integer test_x148 array B_nextFree439 integer B_firstFree175 integer B_maxIndex194 array B_typeId854 integer test_x148 = 2 integer B_firstFree175 = 0 integer B_maxIndex194 = 0 function initGlobals615() { } function main387() { local integer a138 initGlobals615(); test_x_148 = 2; a_138 = new_A117(); dispatch_B_destroyB179(a_138); if (test_x_148 == 6) { testSuccess277(); } else { }; } function config172() { } IS_NATIVE function testSuccess277() { } function destroyA796(integer this132) { local integer obj786 test_x_148 = (test_x_148 + 1); test_x_148 = (test_x_148 * 2); obj_786 = this_132; if (B_typeId_854[obj_786] == 0) { error141("Double free: object of type A"); } else { B_nextFree_439[B_firstFree_175] = obj_786; B_firstFree_175 = (B_firstFree_175 + 1); B_typeId_854[obj_786] = 0; }; } function new_A117() returns integer { local integer this652 local integer this159 if (B_firstFree_175 == 0) { if (B_maxIndex_194 < 32768) { B_maxIndex_194 = (B_maxIndex_194 + 1); this_159 = B_maxIndex_194; B_typeId_854[this_159] = 2; } else { error141("Out of memory: Could not create A."); this_159 = 0; }; } else { B_firstFree_175 = (B_firstFree_175 - 1); this_159 = B_nextFree_439[B_firstFree_175]; B_typeId_854[this_159] = 2; }; this_652 = this_159; return this_652; } function error141(string msg196) { $debugPrint162((msg_196 + (" " + #getStackTrace()))); } function dispatch_B_destroyB179(integer this247) { local integer this151 local integer obj744 if (B_typeId_854[this_247] == 0) { if (this_247 == 0) { error141("Nullpointer exception when calling B.B"); } else { error141("Called B.B on invalid object."); }; } else { }; if (B_typeId_854[this_247] <= 1) { this_151 = this_247; test_x_148 = (test_x_148 * 2); obj_744 = this_151; if (B_typeId_854[obj_744] == 0) { error141("Double free: object of type B"); } else { B_nextFree_439[B_firstFree_175] = obj_744; B_firstFree_175 = (B_firstFree_175 + 1); B_typeId_854[obj_744] = 0; }; } else { destroyA796(this_247); }; }