integer test_x991 array B_nextFree214 integer B_firstFree182 integer B_maxIndex193 array B_typeId168 integer test_x991 = 2 integer B_firstFree182 = 0 integer B_maxIndex193 = 0 function initGlobals105() { } function main953() { initGlobals105(); test_x_991 = 2; dispatch_B_destroyB164(new_X174()); if (test_x_991 == 6) { testSuccess449(); } else { }; } function config491() { } IS_NATIVE function testSuccess449() { } function destroyX125(integer this119) { test_x_991 = ((test_x_991 + 1) * 2); if (B_typeId_168[this_119] == 0) { error143("Double free: object of type X"); } else { B_nextFree_214[B_firstFree_182] = this_119; B_firstFree_182 = (B_firstFree_182 + 1); B_typeId_168[this_119] = 0; }; } function new_X174() returns integer { local integer this102 if (B_firstFree_182 == 0) { if (B_maxIndex_193 < 32768) { B_maxIndex_193 = (B_maxIndex_193 + 1); this_102 = B_maxIndex_193; B_typeId_168[this_102] = 3; } else { error143("Out of memory: Could not create X."); this_102 = 0; }; } else { B_firstFree_182 = (B_firstFree_182 - 1); this_102 = B_nextFree_214[B_firstFree_182]; B_typeId_168[this_102] = 3; }; return this_102; } function error143(string msg185) { $debugPrint348((msg_185 + (" " + #getStackTrace()))); } function dispatch_B_destroyB164(integer this108) { if (B_typeId_168[this_108] == 0) { if (this_108 == 0) { error143("Nullpointer exception when calling B.B"); } else { error143("Called B.B on invalid object."); }; } else { }; if (B_typeId_168[this_108] <= 2) { test_x_991 = (test_x_991 * 2); if (B_typeId_168[this_108] == 0) { error143("Double free: object of type B"); } else { B_nextFree_214[B_firstFree_182] = this_108; B_firstFree_182 = (B_firstFree_182 + 1); B_typeId_168[this_108] = 0; }; } else { destroyX125(this_108); }; }