integer test_x185 array B_nextFree103 integer B_firstFree812 integer B_maxIndex750 array B_typeId539 integer test_x185 = 2 integer B_firstFree812 = 0 integer B_maxIndex750 = 0 function initGlobals776() { } function main139() { initGlobals776(); init_test583(); } function config960() { } function init_test583() { test_x_185 = 2; dispatch_A_destroyA168(new_A122()); if (test_x_185 == 6) { testSuccess925(); } else { }; } IS_NATIVE function testSuccess925() { } function destroyA143(integer this967) { A_onDestroy169(this_967); dealloc_A404(this_967); } function A_init801(integer this930) { } function new_A122() returns integer { local integer this587 this_587 = alloc_A191(); construct_A207(this_587); return this_587; } function construct_A207(integer this736) { construct_B620(this_736); A_init801(this_736); } function A_onDestroy169(integer this553) { test_x_185 = (test_x_185 + 1); B_onDestroy680(this_553); } function B_init172(integer this201) { } function construct_B620(integer this130) { B_init172(this_130); } function B_onDestroy680(integer this347) { test_x_185 = (test_x_185 * 2); } function alloc_A191() returns integer { local integer this927 if (B_firstFree_812 == 0) { if (B_maxIndex_750 < 32768) { B_maxIndex_750 = (B_maxIndex_750 + 1); this_927 = B_maxIndex_750; B_typeId_539[this_927] = 2; } else { error159("Out of memory: Could not create A."); this_927 = 0; }; } else { B_firstFree_812 = (B_firstFree_812 - 1); this_927 = B_nextFree_103[B_firstFree_812]; B_typeId_539[this_927] = 2; }; return this_927; } function error159(string msg129) { $debugPrint835((msg_129 + (" " + #getStackTrace()))); } function dealloc_A404(integer obj184) { if (B_typeId_539[obj_184] == 0) { error159("Double free: object of type A"); } else { B_nextFree_103[B_firstFree_812] = obj_184; B_firstFree_812 = (B_firstFree_812 + 1); B_typeId_539[obj_184] = 0; }; } function dispatch_A_destroyA168(integer this209) { if (B_typeId_539[this_209] == 0) { if (this_209 == 0) { error159("Nullpointer exception when calling A.A"); } else { error159("Called A.A on invalid object."); }; } else { }; destroyA143(this_209); }