integer test_x352 array B_nextFree180 integer B_firstFree151 integer B_maxIndex344 array B_typeId213 array B_y637 integer test_x352 = 2 integer B_firstFree151 = 0 integer B_maxIndex344 = 0 function initGlobals814() { } function main695() { initGlobals814(); init_test696(); } function config298() { } function init_test696() { test_x_352 = 2; dispatch_A_destroyA127(new_A146()); if (test_x_352 == 8) { testSuccess483(); } else { }; } IS_NATIVE function testSuccess483() { } function destroyA484(integer this596) { A_onDestroy139(this_596); dealloc_A845(this_596); } function A_init806(integer this188) { } function new_A146() returns integer { local integer this175 this_175 = alloc_A393(); construct_A904(this_175); return this_175; } function construct_A904(integer this735) { construct_B108(this_735); A_init806(this_735); } function A_onDestroy139(integer this158) { test_x_352 = (test_x_352 + B_y_637[this_158]); B_onDestroy138(this_158); } function B_init101(integer this200) { B_y_637[this_200] = 2; } function construct_B108(integer this116) { B_init101(this_116); } function B_onDestroy138(integer this147) { test_x_352 = (test_x_352 * B_y_637[this_147]); } function alloc_A393() returns integer { local integer this130 if (B_firstFree_151 == 0) { if (B_maxIndex_344 < 32768) { B_maxIndex_344 = (B_maxIndex_344 + 1); this_130 = B_maxIndex_344; B_typeId_213[this_130] = 2; } else { error157("Out of memory: Could not create A."); this_130 = 0; }; } else { B_firstFree_151 = (B_firstFree_151 - 1); this_130 = B_nextFree_180[B_firstFree_151]; B_typeId_213[this_130] = 2; }; return this_130; } function error157(string msg123) { $debugPrint798((msg_123 + (" " + #getStackTrace()))); } function dealloc_A845(integer obj380) { if (B_typeId_213[obj_380] == 0) { error157("Double free: object of type A"); } else { B_nextFree_180[B_firstFree_151] = obj_380; B_firstFree_151 = (B_firstFree_151 + 1); B_typeId_213[obj_380] = 0; }; } function dispatch_A_destroyA127(integer this147) { if (B_typeId_213[this_147] == 0) { if (this_147 == 0) { error157("Nullpointer exception when calling A.A"); } else { error157("Called A.A on invalid object."); }; } else { }; destroyA484(this_147); }