integer test_x160 array B_nextFree175 integer B_firstFree102 integer B_maxIndex128 array B_typeId106 integer test_x160 = 2 integer B_firstFree102 = 0 integer B_maxIndex128 = 0 function initGlobals804() { } function main707() { initGlobals804(); test_x_160 = 2; dispatch_B_destroyB385(new_A750()); if (test_x_160 == 6) { testSuccess126(); } else { }; } function config107() { } IS_NATIVE function testSuccess126() { } function destroyA842(integer this178) { test_x_160 = ((test_x_160 + 1) * 2); if (B_typeId_106[this_178] == 0) { error699("Double free: object of type A"); } else { B_nextFree_175[B_firstFree_102] = this_178; B_firstFree_102 = (B_firstFree_102 + 1); B_typeId_106[this_178] = 0; }; } function new_A750() returns integer { local integer this379 if (B_firstFree_102 == 0) { if (B_maxIndex_128 < 32768) { B_maxIndex_128 = (B_maxIndex_128 + 1); this_379 = B_maxIndex_128; B_typeId_106[this_379] = 2; } else { error699("Out of memory: Could not create A."); this_379 = 0; }; } else { B_firstFree_102 = (B_firstFree_102 - 1); this_379 = B_nextFree_175[B_firstFree_102]; B_typeId_106[this_379] = 2; }; return this_379; } function error699(string msg449) { $debugPrint184((msg_449 + (" " + #getStackTrace()))); } function dispatch_B_destroyB385(integer this450) { if (B_typeId_106[this_450] == 0) { if (this_450 == 0) { error699("Nullpointer exception when calling B.B"); } else { error699("Called B.B on invalid object."); }; } else { }; if (B_typeId_106[this_450] <= 1) { test_x_160 = (test_x_160 * 2); if (B_typeId_106[this_450] == 0) { error699("Double free: object of type B"); } else { B_nextFree_175[B_firstFree_102] = this_450; B_firstFree_102 = (B_firstFree_102 + 1); B_typeId_106[this_450] = 0; }; } else { destroyA842(this_450); }; }