integer test_x193 array B_nextFree158 integer B_firstFree546 integer B_maxIndex155 array B_typeId207 integer test_x193 = 2 integer B_firstFree546 = 0 integer B_maxIndex155 = 0 function initGlobals580() { } function main863() { local integer a115 initGlobals580(); test_x_193 = 2; a_115 = new_X284(); dispatch_B_destroyB120(a_115); if (test_x_193 == 6) { testSuccess207(); } else { }; } function config122() { } IS_NATIVE function testSuccess207() { } function destroyA153(integer this197) { local integer obj184 test_x_193 = (test_x_193 + 1); test_x_193 = (test_x_193 * 2); obj_184 = this_197; if (B_typeId_207[obj_184] == 0) { error672("Double free: object of type A"); } else { B_nextFree_158[B_firstFree_546] = obj_184; B_firstFree_546 = (B_firstFree_546 + 1); B_typeId_207[obj_184] = 0; }; } function destroyX187(integer this122) { local integer obj165 test_x_193 = (test_x_193 + 1); test_x_193 = (test_x_193 * 2); obj_165 = this_122; if (B_typeId_207[obj_165] == 0) { error672("Double free: object of type X"); } else { B_nextFree_158[B_firstFree_546] = obj_165; B_firstFree_546 = (B_firstFree_546 + 1); B_typeId_207[obj_165] = 0; }; } function new_X284() returns integer { local integer this177 local integer this787 local integer this151 if (B_firstFree_546 == 0) { if (B_maxIndex_155 < 32768) { B_maxIndex_155 = (B_maxIndex_155 + 1); this_787 = B_maxIndex_155; B_typeId_207[this_787] = 3; } else { error672("Out of memory: Could not create X."); this_787 = 0; }; } else { B_firstFree_546 = (B_firstFree_546 - 1); this_787 = B_nextFree_158[B_firstFree_546]; B_typeId_207[this_787] = 3; }; this_177 = this_787; this_151 = this_177; return this_177; } function error672(string msg143) { $debugPrint168((msg_143 + (" " + #getStackTrace()))); } function dispatch_B_destroyB120(integer this207) { local integer this193 local integer obj214 if (B_typeId_207[this_207] == 0) { if (this_207 == 0) { error672("Nullpointer exception when calling B.B"); } else { error672("Called B.B on invalid object."); }; } else { }; if (B_typeId_207[this_207] <= 2) { if (B_typeId_207[this_207] <= 1) { this_193 = this_207; test_x_193 = (test_x_193 * 2); obj_214 = this_193; if (B_typeId_207[obj_214] == 0) { error672("Double free: object of type B"); } else { B_nextFree_158[B_firstFree_546] = obj_214; B_firstFree_546 = (B_firstFree_546 + 1); B_typeId_207[obj_214] = 0; }; } else { destroyA153(this_207); }; } else { destroyX187(this_207); }; }