integer test_x469 array I_nextFree260 integer I_firstFree193 integer I_maxIndex183 array I_typeId137 integer test_x469 = 0 integer I_firstFree193 = 0 integer I_maxIndex183 = 0 function initGlobals164() { I_firstFree_193 = 0; I_maxIndex_183 = 0; } function main490() { initGlobals164(); init_test120(); } function config278() { } function init_test120() { local integer i690 test_x_469 = 0; i_690 = new_C986(); dispatch_I_destroyI788(i_690); if (test_x_469 == 2) { testSuccess148(); } else { }; } IS_NATIVE function testSuccess148() { } function destroyB299(integer this426) { B_onDestroy441(this_426); dealloc_B130(this_426); } function B_onDestroy441(integer this113) { test_x_469 = 1; } function destroyC176(integer this178) { C_onDestroy953(this_178); dealloc_C150(this_178); } function C_init168(integer this373) { } function new_C986() returns integer { local integer this998 this_998 = alloc_C433(); construct_C939(this_998); return this_998; } function construct_C939(integer this708) { C_init168(this_708); } function C_onDestroy953(integer this572) { test_x_469 = 2; } function destroyI679(integer this189) { dealloc_I793(this_189); } function error196(string msg848) { $debugPrint299((msg_848 + (" " + #getStackTrace()))); } function dealloc_B130(integer obj866) { if (I_typeId_137[obj_866] == 0) { error196("Double free: object of type B"); } else { I_nextFree_260[I_firstFree_193] = obj_866; I_firstFree_193 = (I_firstFree_193 + 1); I_typeId_137[obj_866] = 0; }; } function alloc_C433() returns integer { local integer this266 if (I_firstFree_193 == 0) { if (I_maxIndex_183 < 32768) { I_maxIndex_183 = (I_maxIndex_183 + 1); this_266 = I_maxIndex_183; I_typeId_137[this_266] = 3; } else { error196("Out of memory: Could not create C."); this_266 = 0; }; } else { I_firstFree_193 = (I_firstFree_193 - 1); this_266 = I_nextFree_260[I_firstFree_193]; I_typeId_137[this_266] = 3; }; return this_266; } function dealloc_C150(integer obj560) { if (I_typeId_137[obj_560] == 0) { error196("Double free: object of type C"); } else { I_nextFree_260[I_firstFree_193] = obj_560; I_firstFree_193 = (I_firstFree_193 + 1); I_typeId_137[obj_560] = 0; }; } function dealloc_I793(integer obj374) { if (I_typeId_137[obj_374] == 0) { error196("Double free: object of type I"); } else { I_nextFree_260[I_firstFree_193] = obj_374; I_firstFree_193 = (I_firstFree_193 + 1); I_typeId_137[obj_374] = 0; }; } function dispatch_I_destroyI788(integer this138) { if (I_typeId_137[this_138] == 0) { if (this_138 == 0) { error196("Nullpointer exception when calling I.I"); } else { error196("Called I.I on invalid object."); }; } else { }; if (I_typeId_137[this_138] <= 2) { if (I_typeId_137[this_138] <= 1) { destroyI679(this_138); } else { destroyB299(this_138); }; } else { destroyC176(this_138); }; }