array A_nextFree103 integer A_firstFree151 integer A_maxIndex113 array A_typeId360 integer wurst_stack_depth756 array wurst_stack272 integer A_firstFree151 = 0 integer A_maxIndex113 = 0 integer wurst_stack_depth756 = 0 function initGlobals129() { } function main200() { initGlobals129(); init_Test483("when calling init_Test in instanceCount, line 1"); } function config111() { } function init_Test483(string __wurst_stackPos137) { local integer a120 local integer e915 local integer count1101 wurst_stack_272[wurst_stack_depth_756] = __wurst_stackPos_137; wurst_stack_depth_756 = (wurst_stack_depth_756 + 1); a_120 = new_A155("when calling new_A in instanceCount, line 6"); new_A155("when calling new_A in instanceCount, line 7"); new_A155("when calling new_A in instanceCount, line 8"); new_A155("when calling new_A in instanceCount, line 9"); e_915 = new_A155("when calling new_A in instanceCount, line 10"); count1_101 = instanceCount773(1); dispatch_A_destroyA916(a_120, "when calling dispatch_A_destroyA in instanceCount, line 12"); dispatch_A_destroyA916(e_915, "when calling dispatch_A_destroyA in instanceCount, line 13"); e_915 = instanceCount773(1); if ((count1_101 == 5) and (e_915 == 3)) { testSuccess868(); } else { }; wurst_stack_depth_756 = (wurst_stack_depth_756 - 1); } IS_NATIVE function testSuccess868() { } function new_A155(string __wurst_stackPos241) returns integer { local integer this404 wurst_stack_272[wurst_stack_depth_756] = __wurst_stackPos_241; wurst_stack_depth_756 = (wurst_stack_depth_756 + 1); wurst_stack_272[wurst_stack_depth_756] = "when calling alloc_A in instanceCount, line 4"; wurst_stack_depth_756 = (wurst_stack_depth_756 + 1); if (A_firstFree_151 == 0) { if (A_maxIndex_113 < 32768) { A_maxIndex_113 = (A_maxIndex_113 + 1); this_404 = A_maxIndex_113; A_typeId_360[this_404] = 1; } else { error970("Out of memory: Could not create A.", "when calling error in instanceCount, line 4"); this_404 = 0; }; } else { A_firstFree_151 = (A_firstFree_151 - 1); this_404 = A_nextFree_103[A_firstFree_151]; A_typeId_360[this_404] = 1; }; wurst_stack_depth_756 = ((wurst_stack_depth_756 - 1) - 1); return this_404; } function instanceCount773(integer typeId131) returns integer { return (A_maxIndex_113 - A_firstFree_151); } function error970(string msg139, string __wurst_stackPos103) { local integer stacktraceIndex141 local integer stacktraceLimit106 wurst_stack_272[wurst_stack_depth_756] = __wurst_stackPos_103; wurst_stack_depth_756 = (wurst_stack_depth_756 + 1); __wurst_stackPos_103 = ""; stacktraceIndex_141 = wurst_stack_depth_756; stacktraceLimit_106 = 0; loop { stacktraceIndex_141 = (stacktraceIndex_141 - 1); stacktraceLimit_106 = (stacktraceLimit_106 + 1); exitwhen ((stacktraceLimit_106 > 20) or (stacktraceIndex_141 < 0)); __wurst_stackPos_103 = (__wurst_stackPos_103 + (" " + wurst_stack_272[stacktraceIndex_141])); }; $debugPrint680((msg_139 + (" " + __wurst_stackPos_103))); wurst_stack_depth_756 = (wurst_stack_depth_756 - 1); } function dispatch_A_destroyA916(integer this263, string __wurst_stackPos168) { wurst_stack_272[wurst_stack_depth_756] = __wurst_stackPos_168; wurst_stack_depth_756 = (wurst_stack_depth_756 + 1); if (A_typeId_360[this_263] == 0) { if (this_263 == 0) { error970("Nullpointer exception when calling A.A", "when calling error in instanceCount, line 4"); } else { error970("Called A.A on invalid object.", "when calling error in instanceCount, line 4"); }; } else { }; wurst_stack_272[wurst_stack_depth_756] = "when calling destroyA in instanceCount, line 4"; wurst_stack_depth_756 = (wurst_stack_depth_756 + 1); wurst_stack_272[wurst_stack_depth_756] = "when calling dealloc_A in instanceCount, line 4"; wurst_stack_depth_756 = (wurst_stack_depth_756 + 1); if (A_typeId_360[this_263] == 0) { error970("Double free: object of type A", "when calling error in instanceCount, line 4"); } else { A_nextFree_103[A_firstFree_151] = this_263; A_firstFree_151 = (A_firstFree_151 + 1); A_typeId_360[this_263] = 0; }; wurst_stack_depth_756 = (((wurst_stack_depth_756 - 1) - 1) - 1); }