integer test_x959 array I_nextFree124 integer I_firstFree162 integer I_maxIndex210 array I_typeId590 integer test_x959 = 0 integer I_firstFree162 = 0 integer I_maxIndex210 = 0 function initGlobals151() { I_firstFree_162 = 0; I_maxIndex_210 = 0; } function main157() { initGlobals151(); init_test423(); } function config556() { } function init_test423() { local integer i884 test_x_959 = 0; i_884 = new_C120(); dispatch_I_destroyI282(i_884); if (test_x_959 == 2) { testSuccess579(); } else { }; } IS_NATIVE function testSuccess579() { } function destroyB172(integer this151) { B_onDestroy293(this_151); dealloc_B113(this_151); } function B_onDestroy293(integer this197) { test_x_959 = 1; } function destroyC187(integer this130) { C_onDestroy113(this_130); dealloc_C207(this_130); } function C_init294(integer this121) { } function new_C120() returns integer { local integer this199 this_199 = alloc_C156(); construct_C159(this_199); return this_199; } function construct_C159(integer this469) { C_init294(this_469); } function C_onDestroy113(integer this200) { test_x_959 = 2; } function destroyI980(integer this105) { dealloc_I140(this_105); } function error934(string msg757) { $debugPrint120((msg_757 + (" " + #getStackTrace()))); } function dealloc_B113(integer obj627) { if (I_typeId_590[obj_627] == 0) { error934("Double free: object of type B"); } else { I_nextFree_124[I_firstFree_162] = obj_627; I_firstFree_162 = (I_firstFree_162 + 1); I_typeId_590[obj_627] = 0; }; } function alloc_C156() returns integer { local integer this192 if (I_firstFree_162 == 0) { if (I_maxIndex_210 < 32768) { I_maxIndex_210 = (I_maxIndex_210 + 1); this_192 = I_maxIndex_210; I_typeId_590[this_192] = 3; } else { error934("Out of memory: Could not create C."); this_192 = 0; }; } else { I_firstFree_162 = (I_firstFree_162 - 1); this_192 = I_nextFree_124[I_firstFree_162]; I_typeId_590[this_192] = 3; }; return this_192; } function dealloc_C207(integer obj113) { if (I_typeId_590[obj_113] == 0) { error934("Double free: object of type C"); } else { I_nextFree_124[I_firstFree_162] = obj_113; I_firstFree_162 = (I_firstFree_162 + 1); I_typeId_590[obj_113] = 0; }; } function dealloc_I140(integer obj129) { if (I_typeId_590[obj_129] == 0) { error934("Double free: object of type I"); } else { I_nextFree_124[I_firstFree_162] = obj_129; I_firstFree_162 = (I_firstFree_162 + 1); I_typeId_590[obj_129] = 0; }; } function dispatch_I_destroyI282(integer this138) { if (I_typeId_590[this_138] == 0) { if (this_138 == 0) { error934("Nullpointer exception when calling I.I"); } else { error934("Called I.I on invalid object."); }; } else { }; if (I_typeId_590[this_138] <= 2) { if (I_typeId_590[this_138] <= 1) { destroyI980(this_138); } else { destroyB172(this_138); }; } else { destroyC187(this_138); }; }