integer test_x145 array I_nextFree896 integer I_firstFree189 integer I_maxIndex140 array I_typeId932 integer test_x145 = 0 integer I_firstFree189 = 0 integer I_maxIndex140 = 0 function initGlobals796() { } function main832() { initGlobals796(); init_test169(); } function config996() { } function init_test169() { dispatch_I_destroyI207(new_C168()); if (test_x_145 == 2) { testSuccess998(); } else { }; } IS_NATIVE function testSuccess998() { } function destroyB147(integer this295) { B_onDestroy963(this_295); dealloc_B175(this_295); } function B_onDestroy963(integer this132) { test_x_145 = 1; } function destroyC178(integer this186) { C_onDestroy424(this_186); dealloc_C106(this_186); } function C_init818(integer this119) { } function new_C168() returns integer { local integer this118 this_118 = alloc_C184(); construct_C156(this_118); return this_118; } function construct_C156(integer this509) { C_init818(this_509); } function C_onDestroy424(integer this204) { test_x_145 = 2; } function destroyI113(integer this927) { dealloc_I816(this_927); } function error601(string msg104) { $debugPrint147((msg_104 + (" " + #getStackTrace()))); } function dealloc_B175(integer obj182) { if (I_typeId_932[obj_182] == 0) { error601("Double free: object of type B"); } else { I_nextFree_896[I_firstFree_189] = obj_182; I_firstFree_189 = (I_firstFree_189 + 1); I_typeId_932[obj_182] = 0; }; } function alloc_C184() returns integer { local integer this208 if (I_firstFree_189 == 0) { if (I_maxIndex_140 < 32768) { I_maxIndex_140 = (I_maxIndex_140 + 1); this_208 = I_maxIndex_140; I_typeId_932[this_208] = 3; } else { error601("Out of memory: Could not create C."); this_208 = 0; }; } else { I_firstFree_189 = (I_firstFree_189 - 1); this_208 = I_nextFree_896[I_firstFree_189]; I_typeId_932[this_208] = 3; }; return this_208; } function dealloc_C106(integer obj382) { if (I_typeId_932[obj_382] == 0) { error601("Double free: object of type C"); } else { I_nextFree_896[I_firstFree_189] = obj_382; I_firstFree_189 = (I_firstFree_189 + 1); I_typeId_932[obj_382] = 0; }; } function dealloc_I816(integer obj102) { if (I_typeId_932[obj_102] == 0) { error601("Double free: object of type I"); } else { I_nextFree_896[I_firstFree_189] = obj_102; I_firstFree_189 = (I_firstFree_189 + 1); I_typeId_932[obj_102] = 0; }; } function dispatch_I_destroyI207(integer this212) { if (I_typeId_932[this_212] == 0) { if (this_212 == 0) { error601("Nullpointer exception when calling I.I"); } else { error601("Called I.I on invalid object."); }; } else { }; if (I_typeId_932[this_212] <= 2) { if (I_typeId_932[this_212] <= 1) { destroyI113(this_212); } else { destroyB147(this_212); }; } else { destroyC178(this_212); }; }