integer test_x123 array B_nextFree322 integer B_firstFree542 integer B_maxIndex270 array B_typeId132 integer test_x123 = 2 integer B_firstFree542 = 0 integer B_maxIndex270 = 0 function initGlobals317() { } function main204() { initGlobals317(); test_x_123 = 2; dispatch_B_destroyB634(new_X228()); if (test_x_123 == 6) { testSuccess611(); } else { }; } function config104() { } IS_NATIVE function testSuccess611() { } function destroyX198(integer this549) { test_x_123 = ((test_x_123 + 1) * 2); if (B_typeId_132[this_549] == 0) { error199("Double free: object of type X"); } else { B_nextFree_322[B_firstFree_542] = this_549; B_firstFree_542 = (B_firstFree_542 + 1); B_typeId_132[this_549] = 0; }; } function new_X228() returns integer { local integer this197 if (B_firstFree_542 == 0) { if (B_maxIndex_270 < 32768) { B_maxIndex_270 = (B_maxIndex_270 + 1); this_197 = B_maxIndex_270; B_typeId_132[this_197] = 3; } else { error199("Out of memory: Could not create X."); this_197 = 0; }; } else { B_firstFree_542 = (B_firstFree_542 - 1); this_197 = B_nextFree_322[B_firstFree_542]; B_typeId_132[this_197] = 3; }; return this_197; } function error199(string msg126) { $debugPrint758((msg_126 + (" " + #getStackTrace()))); } function dispatch_B_destroyB634(integer this179) { if (B_typeId_132[this_179] == 0) { if (this_179 == 0) { error199("Nullpointer exception when calling B.B"); } else { error199("Called B.B on invalid object."); }; } else { }; if (B_typeId_132[this_179] <= 2) { test_x_123 = (test_x_123 * 2); if (B_typeId_132[this_179] == 0) { error199("Double free: object of type B"); } else { B_nextFree_322[B_firstFree_542] = this_179; B_firstFree_542 = (B_firstFree_542 + 1); B_typeId_132[this_179] = 0; }; } else { destroyX198(this_179); }; }