integer test_x200 array B_nextFree129 integer B_firstFree198 integer B_maxIndex241 array B_typeId277 array B_y862 integer test_x200 = 2 integer B_firstFree198 = 0 integer B_maxIndex241 = 0 function initGlobals134() { B_firstFree_198 = 0; B_maxIndex_241 = 0; } function main243() { initGlobals134(); init_test199(); } function config178() { } function init_test199() { local integer a671 test_x_200 = 2; a_671 = new_A212(); dispatch_A_destroyA196(a_671); if (test_x_200 == 8) { testSuccess111(); } else { }; } IS_NATIVE function testSuccess111() { } function destroyA282(integer this881) { A_onDestroy557(this_881); dealloc_A204(this_881); } function A_init938(integer this195) { } function new_A212() returns integer { local integer this101 this_101 = alloc_A420(); construct_A201(this_101); return this_101; } function construct_A201(integer this564) { construct_B174(this_564); A_init938(this_564); } function A_onDestroy557(integer this664) { test_x_200 = (test_x_200 + B_y_862[this_664]); B_onDestroy200(this_664); } function B_init471(integer this101) { B_y_862[this_101] = 2; } function construct_B174(integer this139) { B_init471(this_139); } function B_onDestroy200(integer this472) { test_x_200 = (test_x_200 * B_y_862[this_472]); } function alloc_A420() returns integer { local integer this138 if (B_firstFree_198 == 0) { if (B_maxIndex_241 < 32768) { B_maxIndex_241 = (B_maxIndex_241 + 1); this_138 = B_maxIndex_241; B_typeId_277[this_138] = 2; } else { error217("Out of memory: Could not create A."); this_138 = 0; }; } else { B_firstFree_198 = (B_firstFree_198 - 1); this_138 = B_nextFree_129[B_firstFree_198]; B_typeId_277[this_138] = 2; }; return this_138; } function error217(string msg265) { $debugPrint154((msg_265 + (" " + #getStackTrace()))); } function dealloc_A204(integer obj356) { if (B_typeId_277[obj_356] == 0) { error217("Double free: object of type A"); } else { B_nextFree_129[B_firstFree_198] = obj_356; B_firstFree_198 = (B_firstFree_198 + 1); B_typeId_277[obj_356] = 0; }; } function dispatch_A_destroyA196(integer this148) { if (B_typeId_277[this_148] == 0) { if (this_148 == 0) { error217("Nullpointer exception when calling A.A"); } else { error217("Called A.A on invalid object."); }; } else { }; destroyA282(this_148); }