integer test_x549 array B_nextFree202 integer B_firstFree549 integer B_maxIndex610 array B_typeId144 integer test_x549 = 2 integer B_firstFree549 = 0 integer B_maxIndex610 = 0 function initGlobals203() { } function main390() { initGlobals203(); init_test639(); } function config139() { } function init_test639() { test_x_549 = 2; dispatch_A_destroyA629(new_X345()); if (test_x_549 == 6) { testSuccess169(); } else { }; } IS_NATIVE function testSuccess169() { } function destroyA199(integer this200) { A_onDestroy105(this_200); dealloc_A620(this_200); } function A_init127(integer this138) { } function construct_A159(integer this123) { construct_B103(this_123); A_init127(this_123); } function A_onDestroy105(integer this789) { test_x_549 = (test_x_549 + 1); B_onDestroy167(this_789); } function B_init162(integer this116) { } function construct_B103(integer this778) { B_init162(this_778); } function B_onDestroy167(integer this522) { test_x_549 = (test_x_549 * 2); } function X_init338(integer this229) { } function new_X345() returns integer { local integer this828 this_828 = alloc_X166(); construct_X206(this_828); return this_828; } function construct_X206(integer this132) { construct_A159(this_132); X_init338(this_132); } function error910(string msg210) { $debugPrint713((msg_210 + (" " + #getStackTrace()))); } function dealloc_A620(integer obj229) { if (B_typeId_144[obj_229] == 0) { error910("Double free: object of type A"); } else { B_nextFree_202[B_firstFree_549] = obj_229; B_firstFree_549 = (B_firstFree_549 + 1); B_typeId_144[obj_229] = 0; }; } function alloc_X166() returns integer { local integer this137 if (B_firstFree_549 == 0) { if (B_maxIndex_610 < 32768) { B_maxIndex_610 = (B_maxIndex_610 + 1); this_137 = B_maxIndex_610; B_typeId_144[this_137] = 3; } else { error910("Out of memory: Could not create X."); this_137 = 0; }; } else { B_firstFree_549 = (B_firstFree_549 - 1); this_137 = B_nextFree_202[B_firstFree_549]; B_typeId_144[this_137] = 3; }; return this_137; } function dispatch_A_destroyA629(integer this923) { if (B_typeId_144[this_923] == 0) { if (this_923 == 0) { error910("Nullpointer exception when calling A.A"); } else { error910("Called A.A on invalid object."); }; } else { }; destroyA199(this_923); }