integer test_x157 array B_nextFree130 integer B_firstFree214 integer B_maxIndex907 array B_typeId166 integer test_x157 = 2 integer B_firstFree214 = 0 integer B_maxIndex907 = 0 function initGlobals970() { } function main148() { initGlobals970(); init_test157(); } function config186() { } function init_test157() { test_x_157 = 2; dispatch_A_destroyA372(new_A365()); if (test_x_157 == 6) { testSuccess456(); } else { }; } IS_NATIVE function testSuccess456() { } function destroyA125(integer this834) { A_onDestroy196(this_834); dealloc_A185(this_834); } function A_init171(integer this156) { } function new_A365() returns integer { local integer this137 this_137 = alloc_A106(); construct_A143(this_137); return this_137; } function construct_A143(integer this728) { construct_B161(this_728); A_init171(this_728); } function A_onDestroy196(integer this176) { test_x_157 = (test_x_157 + 1); B_onDestroy146(this_176); } function B_init165(integer this105) { } function construct_B161(integer this549) { B_init165(this_549); } function B_onDestroy146(integer this434) { test_x_157 = (test_x_157 * 2); } function alloc_A106() returns integer { local integer this669 if (B_firstFree_214 == 0) { if (B_maxIndex_907 < 32768) { B_maxIndex_907 = (B_maxIndex_907 + 1); this_669 = B_maxIndex_907; B_typeId_166[this_669] = 2; } else { error818("Out of memory: Could not create A."); this_669 = 0; }; } else { B_firstFree_214 = (B_firstFree_214 - 1); this_669 = B_nextFree_130[B_firstFree_214]; B_typeId_166[this_669] = 2; }; return this_669; } function error818(string msg784) { $debugPrint162((msg_784 + (" " + #getStackTrace()))); } function dealloc_A185(integer obj175) { if (B_typeId_166[obj_175] == 0) { error818("Double free: object of type A"); } else { B_nextFree_130[B_firstFree_214] = obj_175; B_firstFree_214 = (B_firstFree_214 + 1); B_typeId_166[obj_175] = 0; }; } function dispatch_A_destroyA372(integer this989) { if (B_typeId_166[this_989] == 0) { if (this_989 == 0) { error818("Nullpointer exception when calling A.A"); } else { error818("Called A.A on invalid object."); }; } else { }; destroyA125(this_989); }