integer test_x184 array B_nextFree148 integer B_firstFree185 integer B_maxIndex938 array B_typeId369 integer test_x184 = 2 integer B_firstFree185 = 0 integer B_maxIndex938 = 0 function initGlobals173() { } function main554() { initGlobals173(); test_x_184 = 2; dispatch_B_destroyB137(new_X212()); if (test_x_184 == 6) { testSuccess144(); } else { }; } function config181() { } IS_NATIVE function testSuccess144() { } function destroyA872(integer this209) { test_x_184 = ((test_x_184 + 1) * 2); if (B_typeId_369[this_209] == 0) { error946("Double free: object of type A"); } else { B_nextFree_148[B_firstFree_185] = this_209; B_firstFree_185 = (B_firstFree_185 + 1); B_typeId_369[this_209] = 0; }; } function destroyX102(integer this173) { test_x_184 = ((test_x_184 + 1) * 2); if (B_typeId_369[this_173] == 0) { error946("Double free: object of type X"); } else { B_nextFree_148[B_firstFree_185] = this_173; B_firstFree_185 = (B_firstFree_185 + 1); B_typeId_369[this_173] = 0; }; } function new_X212() returns integer { local integer this203 if (B_firstFree_185 == 0) { if (B_maxIndex_938 < 32768) { B_maxIndex_938 = (B_maxIndex_938 + 1); this_203 = B_maxIndex_938; B_typeId_369[this_203] = 3; } else { error946("Out of memory: Could not create X."); this_203 = 0; }; } else { B_firstFree_185 = (B_firstFree_185 - 1); this_203 = B_nextFree_148[B_firstFree_185]; B_typeId_369[this_203] = 3; }; return this_203; } function error946(string msg210) { $debugPrint137((msg_210 + (" " + #getStackTrace()))); } function dispatch_B_destroyB137(integer this137) { if (B_typeId_369[this_137] == 0) { if (this_137 == 0) { error946("Nullpointer exception when calling B.B"); } else { error946("Called B.B on invalid object."); }; } else { }; if (B_typeId_369[this_137] <= 2) { if (B_typeId_369[this_137] <= 1) { test_x_184 = (test_x_184 * 2); if (B_typeId_369[this_137] == 0) { error946("Double free: object of type B"); } else { B_nextFree_148[B_firstFree_185] = this_137; B_firstFree_185 = (B_firstFree_185 + 1); B_typeId_369[this_137] = 0; }; } else { destroyA872(this_137); }; } else { destroyX102(this_137); }; }