integer test_x439 array I_nextFree133 integer I_firstFree631 integer I_maxIndex167 array I_typeId141 integer test_x439 = 0 integer I_firstFree631 = 0 integer I_maxIndex167 = 0 function initGlobals708() { } function main209() { local integer i144 initGlobals708(); i_144 = new_C188(); dispatch_I_destroyI108(i_144); if (test_x_439 == 2) { testSuccess858(); } else { }; } function config206() { } IS_NATIVE function testSuccess858() { } function new_C188() returns integer { local integer this961 local integer this150 if (I_firstFree_631 == 0) { if (I_maxIndex_167 < 32768) { I_maxIndex_167 = (I_maxIndex_167 + 1); this_150 = I_maxIndex_167; I_typeId_141[this_150] = 3; } else { error886("Out of memory: Could not create C."); this_150 = 0; }; } else { I_firstFree_631 = (I_firstFree_631 - 1); this_150 = I_nextFree_133[I_firstFree_631]; I_typeId_141[this_150] = 3; }; this_961 = this_150; return this_961; } function error886(string msg115) { $debugPrint189((msg_115 + (" " + #getStackTrace()))); } function dispatch_I_destroyI108(integer this100) { local integer this313 local integer obj131 local integer this840 local integer obj168 local integer this101 local integer obj145 if (I_typeId_141[this_100] == 0) { if (this_100 == 0) { error886("Nullpointer exception when calling I.I"); } else { error886("Called I.I on invalid object."); }; } else { }; if (I_typeId_141[this_100] <= 2) { if (I_typeId_141[this_100] <= 1) { this_313 = this_100; obj_131 = this_313; if (I_typeId_141[obj_131] == 0) { error886("Double free: object of type I"); } else { I_nextFree_133[I_firstFree_631] = obj_131; I_firstFree_631 = (I_firstFree_631 + 1); I_typeId_141[obj_131] = 0; }; } else { this_840 = this_100; test_x_439 = 1; obj_168 = this_840; if (I_typeId_141[obj_168] == 0) { error886("Double free: object of type B"); } else { I_nextFree_133[I_firstFree_631] = obj_168; I_firstFree_631 = (I_firstFree_631 + 1); I_typeId_141[obj_168] = 0; }; }; } else { this_101 = this_100; test_x_439 = 2; obj_145 = this_101; if (I_typeId_141[obj_145] == 0) { error886("Double free: object of type C"); } else { I_nextFree_133[I_firstFree_631] = obj_145; I_firstFree_631 = (I_firstFree_631 + 1); I_typeId_141[obj_145] = 0; }; }; }