integer test_x808 array B_nextFree117 integer B_firstFree277 integer B_maxIndex501 array B_typeId251 integer test_x808 = 2 integer B_firstFree277 = 0 integer B_maxIndex501 = 0 function initGlobals893() { } function main188() { local integer a129 initGlobals893(); test_x_808 = 2; a_129 = new_A143(); dispatch_B_destroyB127(a_129); if (test_x_808 == 6) { testSuccess173(); } else { }; } function config183() { } IS_NATIVE function testSuccess173() { } function destroyA207(integer this152) { local integer obj177 test_x_808 = (test_x_808 + 1); test_x_808 = (test_x_808 * 2); obj_177 = this_152; if (B_typeId_251[obj_177] == 0) { error143("Double free: object of type A"); } else { B_nextFree_117[B_firstFree_277] = obj_177; B_firstFree_277 = (B_firstFree_277 + 1); B_typeId_251[obj_177] = 0; }; } function new_A143() returns integer { local integer this191 local integer this159 if (B_firstFree_277 == 0) { if (B_maxIndex_501 < 32768) { B_maxIndex_501 = (B_maxIndex_501 + 1); this_159 = B_maxIndex_501; B_typeId_251[this_159] = 2; } else { error143("Out of memory: Could not create A."); this_159 = 0; }; } else { B_firstFree_277 = (B_firstFree_277 - 1); this_159 = B_nextFree_117[B_firstFree_277]; B_typeId_251[this_159] = 2; }; this_191 = this_159; return this_191; } function error143(string msg161) { $debugPrint127((msg_161 + (" " + #getStackTrace()))); } function dispatch_B_destroyB127(integer this175) { local integer this647 local integer obj211 if (B_typeId_251[this_175] == 0) { if (this_175 == 0) { error143("Nullpointer exception when calling B.B"); } else { error143("Called B.B on invalid object."); }; } else { }; if (B_typeId_251[this_175] <= 1) { this_647 = this_175; test_x_808 = (test_x_808 * 2); obj_211 = this_647; if (B_typeId_251[obj_211] == 0) { error143("Double free: object of type B"); } else { B_nextFree_117[B_firstFree_277] = obj_211; B_firstFree_277 = (B_firstFree_277 + 1); B_typeId_251[obj_211] = 0; }; } else { destroyA207(this_175); }; }