integer test_x916 array B_nextFree100 integer B_firstFree191 integer B_maxIndex880 array B_typeId135 integer test_x916 = 2 integer B_firstFree191 = 0 integer B_maxIndex880 = 0 function initGlobals302() { } function main212() { initGlobals302(); init_test240(); } function config210() { } function init_test240() { test_x_916 = 2; dispatch_B_destroyB757(new_A115()); if (test_x_916 == 6) { testSuccess238(); } else { }; } IS_NATIVE function testSuccess238() { } function destroyA119(integer this172) { A_onDestroy174(this_172); dealloc_A178(this_172); } function A_init422(integer this797) { } function new_A115() returns integer { local integer this544 this_544 = alloc_A271(); construct_A145(this_544); return this_544; } function construct_A145(integer this117) { construct_B966(this_117); A_init422(this_117); } function A_onDestroy174(integer this182) { test_x_916 = (test_x_916 + 1); B_onDestroy594(this_182); } function B_init145(integer this136) { } function construct_B966(integer this111) { B_init145(this_111); } function B_onDestroy594(integer this165) { test_x_916 = (test_x_916 * 2); } function destroyB201(integer this138) { B_onDestroy594(this_138); dealloc_B494(this_138); } function alloc_A271() returns integer { local integer this722 if (B_firstFree_191 == 0) { if (B_maxIndex_880 < 32768) { B_maxIndex_880 = (B_maxIndex_880 + 1); this_722 = B_maxIndex_880; B_typeId_135[this_722] = 2; } else { error907("Out of memory: Could not create A."); this_722 = 0; }; } else { B_firstFree_191 = (B_firstFree_191 - 1); this_722 = B_nextFree_100[B_firstFree_191]; B_typeId_135[this_722] = 2; }; return this_722; } function error907(string msg147) { $debugPrint152((msg_147 + (" " + #getStackTrace()))); } function dealloc_A178(integer obj592) { if (B_typeId_135[obj_592] == 0) { error907("Double free: object of type A"); } else { B_nextFree_100[B_firstFree_191] = obj_592; B_firstFree_191 = (B_firstFree_191 + 1); B_typeId_135[obj_592] = 0; }; } function dealloc_B494(integer obj147) { if (B_typeId_135[obj_147] == 0) { error907("Double free: object of type B"); } else { B_nextFree_100[B_firstFree_191] = obj_147; B_firstFree_191 = (B_firstFree_191 + 1); B_typeId_135[obj_147] = 0; }; } function dispatch_B_destroyB757(integer this199) { if (B_typeId_135[this_199] == 0) { if (this_199 == 0) { error907("Nullpointer exception when calling B.B"); } else { error907("Called B.B on invalid object."); }; } else { }; if (B_typeId_135[this_199] <= 1) { destroyB201(this_199); } else { destroyA119(this_199); }; }