integer test_x183 array B_nextFree130 integer B_firstFree181 integer B_maxIndex854 array B_typeId113 integer test_x183 = 2 integer B_firstFree181 = 0 integer B_maxIndex854 = 0 function initGlobals168() { B_firstFree_181 = 0; B_maxIndex_854 = 0; } function main206() { initGlobals168(); init_test115(); } function config104() { } function init_test115() { local integer a796 test_x_183 = 2; a_796 = new_X262(); dispatch_A_destroyA144(a_796); if (test_x_183 == 6) { testSuccess754(); } else { }; } IS_NATIVE function testSuccess754() { } function destroyA197(integer this101) { A_onDestroy152(this_101); dealloc_A202(this_101); } function A_init802(integer this551) { } function construct_A271(integer this205) { construct_B145(this_205); A_init802(this_205); } function A_onDestroy152(integer this109) { test_x_183 = (test_x_183 + 1); B_onDestroy118(this_109); } function B_init184(integer this754) { } function construct_B145(integer this167) { B_init184(this_167); } function B_onDestroy118(integer this199) { test_x_183 = (test_x_183 * 2); } function X_init209(integer this158) { } function new_X262() returns integer { local integer this163 this_163 = alloc_X351(); construct_X136(this_163); return this_163; } function construct_X136(integer this189) { construct_A271(this_189); X_init209(this_189); } function error151(string msg511) { $debugPrint180((msg_511 + (" " + #getStackTrace()))); } function dealloc_A202(integer obj604) { if (B_typeId_113[obj_604] == 0) { error151("Double free: object of type A"); } else { B_nextFree_130[B_firstFree_181] = obj_604; B_firstFree_181 = (B_firstFree_181 + 1); B_typeId_113[obj_604] = 0; }; } function alloc_X351() returns integer { local integer this133 if (B_firstFree_181 == 0) { if (B_maxIndex_854 < 32768) { B_maxIndex_854 = (B_maxIndex_854 + 1); this_133 = B_maxIndex_854; B_typeId_113[this_133] = 3; } else { error151("Out of memory: Could not create X."); this_133 = 0; }; } else { B_firstFree_181 = (B_firstFree_181 - 1); this_133 = B_nextFree_130[B_firstFree_181]; B_typeId_113[this_133] = 3; }; return this_133; } function dispatch_A_destroyA144(integer this100) { if (B_typeId_113[this_100] == 0) { if (this_100 == 0) { error151("Nullpointer exception when calling A.A"); } else { error151("Called A.A on invalid object."); }; } else { }; destroyA197(this_100); }