integer test_x190 array B_nextFree177 integer B_firstFree193 integer B_maxIndex140 array B_typeId137 integer test_x190 = 2 integer B_firstFree193 = 0 integer B_maxIndex140 = 0 function initGlobals610() { } function main169() { initGlobals610(); test_x_190 = 2; dispatch_B_destroyB292(new_X740()); if (test_x_190 == 6) { testSuccess115(); } else { }; } function config202() { } IS_NATIVE function testSuccess115() { } function destroyA141(integer this161) { test_x_190 = ((test_x_190 + 1) * 2); if (B_typeId_137[this_161] == 0) { error202("Double free: object of type A"); } else { B_nextFree_177[B_firstFree_193] = this_161; B_firstFree_193 = (B_firstFree_193 + 1); B_typeId_137[this_161] = 0; }; } function destroyX773(integer this202) { test_x_190 = ((test_x_190 + 1) * 2); if (B_typeId_137[this_202] == 0) { error202("Double free: object of type X"); } else { B_nextFree_177[B_firstFree_193] = this_202; B_firstFree_193 = (B_firstFree_193 + 1); B_typeId_137[this_202] = 0; }; } function new_X740() returns integer { local integer this133 if (B_firstFree_193 == 0) { if (B_maxIndex_140 < 32768) { B_maxIndex_140 = (B_maxIndex_140 + 1); this_133 = B_maxIndex_140; B_typeId_137[this_133] = 3; } else { error202("Out of memory: Could not create X."); this_133 = 0; }; } else { B_firstFree_193 = (B_firstFree_193 - 1); this_133 = B_nextFree_177[B_firstFree_193]; B_typeId_137[this_133] = 3; }; return this_133; } function error202(string msg208) { $debugPrint201((msg_208 + (" " + #getStackTrace()))); } function dispatch_B_destroyB292(integer this189) { if (B_typeId_137[this_189] == 0) { if (this_189 == 0) { error202("Nullpointer exception when calling B.B"); } else { error202("Called B.B on invalid object."); }; } else { }; if (B_typeId_137[this_189] <= 2) { if (B_typeId_137[this_189] <= 1) { test_x_190 = (test_x_190 * 2); if (B_typeId_137[this_189] == 0) { error202("Double free: object of type B"); } else { B_nextFree_177[B_firstFree_193] = this_189; B_firstFree_193 = (B_firstFree_193 + 1); B_typeId_137[this_189] = 0; }; } else { destroyA141(this_189); }; } else { destroyX773(this_189); }; }