integer test_x690 array B_nextFree422 integer B_firstFree735 integer B_maxIndex188 array B_typeId318 integer test_x690 = 2 integer B_firstFree735 = 0 integer B_maxIndex188 = 0 function initGlobals150() { } function main210() { initGlobals150(); init_test113(); } function config749() { } function init_test113() { test_x_690 = 2; dispatch_B_destroyB191(new_A362()); if (test_x_690 == 6) { testSuccess177(); } else { }; } IS_NATIVE function testSuccess177() { } function destroyA372(integer this132) { A_onDestroy845(this_132); dealloc_A105(this_132); } function A_init169(integer this188) { } function new_A362() returns integer { local integer this474 this_474 = alloc_A110(); construct_A189(this_474); return this_474; } function construct_A189(integer this471) { construct_B144(this_471); A_init169(this_471); } function A_onDestroy845(integer this142) { test_x_690 = (test_x_690 + 1); B_onDestroy704(this_142); } function B_init177(integer this161) { } function construct_B144(integer this778) { B_init177(this_778); } function B_onDestroy704(integer this551) { test_x_690 = (test_x_690 * 2); } function destroyB713(integer this575) { B_onDestroy704(this_575); dealloc_B217(this_575); } function alloc_A110() returns integer { local integer this196 if (B_firstFree_735 == 0) { if (B_maxIndex_188 < 32768) { B_maxIndex_188 = (B_maxIndex_188 + 1); this_196 = B_maxIndex_188; B_typeId_318[this_196] = 2; } else { error431("Out of memory: Could not create A."); this_196 = 0; }; } else { B_firstFree_735 = (B_firstFree_735 - 1); this_196 = B_nextFree_422[B_firstFree_735]; B_typeId_318[this_196] = 2; }; return this_196; } function error431(string msg731) { $debugPrint150((msg_731 + (" " + #getStackTrace()))); } function dealloc_A105(integer obj203) { if (B_typeId_318[obj_203] == 0) { error431("Double free: object of type A"); } else { B_nextFree_422[B_firstFree_735] = obj_203; B_firstFree_735 = (B_firstFree_735 + 1); B_typeId_318[obj_203] = 0; }; } function dealloc_B217(integer obj102) { if (B_typeId_318[obj_102] == 0) { error431("Double free: object of type B"); } else { B_nextFree_422[B_firstFree_735] = obj_102; B_firstFree_735 = (B_firstFree_735 + 1); B_typeId_318[obj_102] = 0; }; } function dispatch_B_destroyB191(integer this896) { if (B_typeId_318[this_896] == 0) { if (this_896 == 0) { error431("Nullpointer exception when calling B.B"); } else { error431("Called B.B on invalid object."); }; } else { }; if (B_typeId_318[this_896] <= 1) { destroyB713(this_896); } else { destroyA372(this_896); }; }