integer test_x210 array B_nextFree163 integer B_firstFree357 integer B_maxIndex629 array B_typeId154 integer test_x210 = 2 integer B_firstFree357 = 0 integer B_maxIndex629 = 0 function initGlobals950() { } function main516() { local integer a201 initGlobals950(); test_x_210 = 2; a_201 = new_X108(); dispatch_B_destroyB106(a_201); if (test_x_210 == 6) { testSuccess128(); } else { }; } function config375() { } IS_NATIVE function testSuccess128() { } function destroyX198(integer this103) { local integer obj970 test_x_210 = (test_x_210 + 1); test_x_210 = (test_x_210 * 2); obj_970 = this_103; if (B_typeId_154[obj_970] == 0) { error321("Double free: object of type X"); } else { B_nextFree_163[B_firstFree_357] = obj_970; B_firstFree_357 = (B_firstFree_357 + 1); B_typeId_154[obj_970] = 0; }; } function new_X108() returns integer { local integer this610 local integer this336 local integer this812 if (B_firstFree_357 == 0) { if (B_maxIndex_629 < 32768) { B_maxIndex_629 = (B_maxIndex_629 + 1); this_336 = B_maxIndex_629; B_typeId_154[this_336] = 3; } else { error321("Out of memory: Could not create X."); this_336 = 0; }; } else { B_firstFree_357 = (B_firstFree_357 - 1); this_336 = B_nextFree_163[B_firstFree_357]; B_typeId_154[this_336] = 3; }; this_610 = this_336; this_812 = this_610; return this_610; } function error321(string msg257) { $debugPrint763((msg_257 + (" " + #getStackTrace()))); } function dispatch_B_destroyB106(integer this345) { local integer this522 local integer obj195 if (B_typeId_154[this_345] == 0) { if (this_345 == 0) { error321("Nullpointer exception when calling B.B"); } else { error321("Called B.B on invalid object."); }; } else { }; if (B_typeId_154[this_345] <= 2) { this_522 = this_345; test_x_210 = (test_x_210 * 2); obj_195 = this_522; if (B_typeId_154[obj_195] == 0) { error321("Double free: object of type B"); } else { B_nextFree_163[B_firstFree_357] = obj_195; B_firstFree_357 = (B_firstFree_357 + 1); B_typeId_154[obj_195] = 0; }; } else { destroyX198(this_345); }; }