integer test_x243 array B_nextFree159 integer B_firstFree139 integer B_maxIndex444 array B_typeId668 integer test_x243 = 2 integer B_firstFree139 = 0 integer B_maxIndex444 = 0 function initGlobals103() { } function main498() { local integer a134 initGlobals103(); test_x_243 = 2; a_134 = new_X133(); dispatch_B_destroyB164(a_134); if (test_x_243 == 6) { testSuccess177(); } else { }; } function config201() { } IS_NATIVE function testSuccess177() { } function destroyA644(integer this549) { local integer obj104 test_x_243 = (test_x_243 + 1); test_x_243 = (test_x_243 * 2); obj_104 = this_549; if (B_typeId_668[obj_104] == 0) { error435("Double free: object of type A"); } else { B_nextFree_159[B_firstFree_139] = obj_104; B_firstFree_139 = (B_firstFree_139 + 1); B_typeId_668[obj_104] = 0; }; } function destroyX170(integer this177) { local integer obj175 test_x_243 = (test_x_243 + 1); test_x_243 = (test_x_243 * 2); obj_175 = this_177; if (B_typeId_668[obj_175] == 0) { error435("Double free: object of type X"); } else { B_nextFree_159[B_firstFree_139] = obj_175; B_firstFree_139 = (B_firstFree_139 + 1); B_typeId_668[obj_175] = 0; }; } function new_X133() returns integer { local integer this628 local integer this313 local integer this818 if (B_firstFree_139 == 0) { if (B_maxIndex_444 < 32768) { B_maxIndex_444 = (B_maxIndex_444 + 1); this_313 = B_maxIndex_444; B_typeId_668[this_313] = 3; } else { error435("Out of memory: Could not create X."); this_313 = 0; }; } else { B_firstFree_139 = (B_firstFree_139 - 1); this_313 = B_nextFree_159[B_firstFree_139]; B_typeId_668[this_313] = 3; }; this_628 = this_313; this_818 = this_628; return this_628; } function error435(string msg154) { $debugPrint156((msg_154 + (" " + #getStackTrace()))); } function dispatch_B_destroyB164(integer this157) { local integer this953 local integer obj143 if (B_typeId_668[this_157] == 0) { if (this_157 == 0) { error435("Nullpointer exception when calling B.B"); } else { error435("Called B.B on invalid object."); }; } else { }; if (B_typeId_668[this_157] <= 2) { if (B_typeId_668[this_157] <= 1) { this_953 = this_157; test_x_243 = (test_x_243 * 2); obj_143 = this_953; if (B_typeId_668[obj_143] == 0) { error435("Double free: object of type B"); } else { B_nextFree_159[B_firstFree_139] = obj_143; B_firstFree_139 = (B_firstFree_139 + 1); B_typeId_668[obj_143] = 0; }; } else { destroyA644(this_157); }; } else { destroyX170(this_157); }; }