array A_nextFree346 integer A_firstFree618 integer A_maxIndex187 array A_typeId278 integer wurst_stack_depth117 array wurst_stack962 integer A_firstFree618 = 0 integer A_maxIndex187 = 0 integer wurst_stack_depth117 = 0 function initGlobals119() { } function main599() { initGlobals119(); init_Test863("when calling init_Test in instanceCount, line 1"); } function config626() { } function init_Test863(string __wurst_stackPos118) { local integer a984 local integer e590 local integer count1141 wurst_stack_962[wurst_stack_depth_117] = __wurst_stackPos_118; wurst_stack_depth_117 = (wurst_stack_depth_117 + 1); a_984 = new_A149("when calling new_A in instanceCount, line 6"); new_A149("when calling new_A in instanceCount, line 7"); new_A149("when calling new_A in instanceCount, line 8"); new_A149("when calling new_A in instanceCount, line 9"); e_590 = new_A149("when calling new_A in instanceCount, line 10"); count1_141 = instanceCount879(1); dispatch_A_destroyA273(a_984, "when calling dispatch_A_destroyA in instanceCount, line 12"); dispatch_A_destroyA273(e_590, "when calling dispatch_A_destroyA in instanceCount, line 13"); e_590 = instanceCount879(1); if ((count1_141 == 5) and (e_590 == 3)) { testSuccess204(); } else { }; wurst_stack_depth_117 = (wurst_stack_depth_117 - 1); } IS_NATIVE function testSuccess204() { } function new_A149(string __wurst_stackPos148) returns integer { local integer this469 wurst_stack_962[wurst_stack_depth_117] = __wurst_stackPos_148; wurst_stack_depth_117 = (wurst_stack_depth_117 + 1); wurst_stack_962[wurst_stack_depth_117] = "when calling alloc_A in instanceCount, line 4"; wurst_stack_depth_117 = (wurst_stack_depth_117 + 1); if (A_firstFree_618 == 0) { if (A_maxIndex_187 < 32768) { A_maxIndex_187 = (A_maxIndex_187 + 1); this_469 = A_maxIndex_187; A_typeId_278[this_469] = 1; } else { error140("Out of memory: Could not create A.", "when calling error in instanceCount, line 4"); this_469 = 0; }; } else { A_firstFree_618 = (A_firstFree_618 - 1); this_469 = A_nextFree_346[A_firstFree_618]; A_typeId_278[this_469] = 1; }; wurst_stack_depth_117 = ((wurst_stack_depth_117 - 1) - 1); return this_469; } function instanceCount879(integer typeId120) returns integer { return (A_maxIndex_187 - A_firstFree_618); } function error140(string msg826, string __wurst_stackPos349) { local integer stacktraceIndex351 local integer stacktraceLimit113 wurst_stack_962[wurst_stack_depth_117] = __wurst_stackPos_349; wurst_stack_depth_117 = (wurst_stack_depth_117 + 1); __wurst_stackPos_349 = ""; stacktraceIndex_351 = wurst_stack_depth_117; stacktraceLimit_113 = 0; loop { stacktraceIndex_351 = (stacktraceIndex_351 - 1); stacktraceLimit_113 = (stacktraceLimit_113 + 1); exitwhen ((stacktraceLimit_113 > 20) or (stacktraceIndex_351 < 0)); __wurst_stackPos_349 = (__wurst_stackPos_349 + (" " + wurst_stack_962[stacktraceIndex_351])); }; $debugPrint114((msg_826 + (" " + __wurst_stackPos_349))); wurst_stack_depth_117 = (wurst_stack_depth_117 - 1); } function dispatch_A_destroyA273(integer this459, string __wurst_stackPos998) { wurst_stack_962[wurst_stack_depth_117] = __wurst_stackPos_998; wurst_stack_depth_117 = (wurst_stack_depth_117 + 1); if (A_typeId_278[this_459] == 0) { if (this_459 == 0) { error140("Nullpointer exception when calling A.A", "when calling error in instanceCount, line 4"); } else { error140("Called A.A on invalid object.", "when calling error in instanceCount, line 4"); }; } else { }; wurst_stack_962[wurst_stack_depth_117] = "when calling destroyA in instanceCount, line 4"; wurst_stack_depth_117 = (wurst_stack_depth_117 + 1); wurst_stack_962[wurst_stack_depth_117] = "when calling dealloc_A in instanceCount, line 4"; wurst_stack_depth_117 = (wurst_stack_depth_117 + 1); if (A_typeId_278[this_459] == 0) { error140("Double free: object of type A", "when calling error in instanceCount, line 4"); } else { A_nextFree_346[A_firstFree_618] = this_459; A_firstFree_618 = (A_firstFree_618 + 1); A_typeId_278[this_459] = 0; }; wurst_stack_depth_117 = (((wurst_stack_depth_117 - 1) - 1) - 1); }