integer test_x205 array B_nextFree209 integer B_firstFree342 integer B_maxIndex404 array B_typeId284 integer test_x205 = 2 integer B_firstFree342 = 0 integer B_maxIndex404 = 0 function initGlobals966() { } function main319() { initGlobals966(); init_test139(); } function config151() { } function init_test139() { local integer a190 local integer this148 test_x_205 = 2; a_190 = new_X128(); this_148 = a_190; if (B_typeId_284[this_148] == 0) { if (this_148 == 0) { error898("Nullpointer exception when calling X.X"); } else { error898("Called X.X on invalid object."); }; } else { }; destroyX163(this_148); if (test_x_205 == 6) { testSuccess144(); } else { }; } IS_NATIVE function testSuccess144() { } function destroyX163(integer this505) { local integer obj116 test_x_205 = (test_x_205 + 1); test_x_205 = (test_x_205 * 2); obj_116 = this_505; if (B_typeId_284[obj_116] == 0) { error898("Double free: object of type X"); } else { B_nextFree_209[B_firstFree_342] = obj_116; B_firstFree_342 = (B_firstFree_342 + 1); B_typeId_284[obj_116] = 0; }; } function new_X128() returns integer { local integer this414 local integer this125 local integer this156 if (B_firstFree_342 == 0) { if (B_maxIndex_404 < 32768) { B_maxIndex_404 = (B_maxIndex_404 + 1); this_125 = B_maxIndex_404; B_typeId_284[this_125] = 3; } else { error898("Out of memory: Could not create X."); this_125 = 0; }; } else { B_firstFree_342 = (B_firstFree_342 - 1); this_125 = B_nextFree_209[B_firstFree_342]; B_typeId_284[this_125] = 3; }; this_414 = this_125; this_156 = this_414; return this_414; } function error898(string msg210) { $debugPrint107((msg_210 + (" " + #getStackTrace()))); }