integer test_x121 array B_nextFree866 integer B_firstFree139 integer B_maxIndex116 array B_typeId124 array B_y214 integer test_x121 = 2 integer B_firstFree139 = 0 integer B_maxIndex116 = 0 function initGlobals109() { } function main190() { initGlobals109(); init_test189(); } function config151() { } function init_test189() { test_x_121 = 2; dispatch_A_destroyA169(new_A834()); if (test_x_121 == 8) { testSuccess195(); } else { }; } IS_NATIVE function testSuccess195() { } function destroyA163(integer this313) { A_onDestroy212(this_313); dealloc_A112(this_313); } function A_init213(integer this848) { } function new_A834() returns integer { local integer this951 this_951 = alloc_A638(); construct_A118(this_951); return this_951; } function construct_A118(integer this327) { construct_B107(this_327); A_init213(this_327); } function A_onDestroy212(integer this198) { test_x_121 = (test_x_121 + B_y_214[this_198]); B_onDestroy563(this_198); } function B_init115(integer this193) { B_y_214[this_193] = 2; } function construct_B107(integer this411) { B_init115(this_411); } function B_onDestroy563(integer this171) { test_x_121 = (test_x_121 * B_y_214[this_171]); } function alloc_A638() returns integer { local integer this338 if (B_firstFree_139 == 0) { if (B_maxIndex_116 < 32768) { B_maxIndex_116 = (B_maxIndex_116 + 1); this_338 = B_maxIndex_116; B_typeId_124[this_338] = 2; } else { error179("Out of memory: Could not create A."); this_338 = 0; }; } else { B_firstFree_139 = (B_firstFree_139 - 1); this_338 = B_nextFree_866[B_firstFree_139]; B_typeId_124[this_338] = 2; }; return this_338; } function error179(string msg169) { $debugPrint283((msg_169 + (" " + #getStackTrace()))); } function dealloc_A112(integer obj127) { if (B_typeId_124[obj_127] == 0) { error179("Double free: object of type A"); } else { B_nextFree_866[B_firstFree_139] = obj_127; B_firstFree_139 = (B_firstFree_139 + 1); B_typeId_124[obj_127] = 0; }; } function dispatch_A_destroyA169(integer this890) { if (B_typeId_124[this_890] == 0) { if (this_890 == 0) { error179("Nullpointer exception when calling A.A"); } else { error179("Called A.A on invalid object."); }; } else { }; destroyA163(this_890); }