string test_s839 array T_nextFree156 integer T_firstFree189 integer T_maxIndex111 array T_typeId115 string test_s839 = "" integer T_firstFree189 = 0 integer T_maxIndex111 = 0 function initGlobals836() { } function main127() { initGlobals836(); test_s_839 = ""; dispatch_T_destroyT224(new_A274()); if (test_s_839 == "C") { testSuccess223(); } else { }; } function config283() { } IS_NATIVE function testSuccess223() { } function destroyA188(integer this851) { test_s_839 = (test_s_839 + "C"); if (T_typeId_115[this_851] == 0) { error126("Double free: object of type A"); } else { T_nextFree_156[T_firstFree_189] = this_851; T_firstFree_189 = (T_firstFree_189 + 1); T_typeId_115[this_851] = 0; }; } function new_A274() returns integer { local integer this171 if (T_firstFree_189 == 0) { if (T_maxIndex_111 < 32768) { T_maxIndex_111 = (T_maxIndex_111 + 1); this_171 = T_maxIndex_111; T_typeId_115[this_171] = 2; } else { error126("Out of memory: Could not create A."); this_171 = 0; }; } else { T_firstFree_189 = (T_firstFree_189 - 1); this_171 = T_nextFree_156[T_firstFree_189]; T_typeId_115[this_171] = 2; }; return this_171; } function destroyB155(integer this158) { test_s_839 = ((test_s_839 + "B") + "C"); if (T_typeId_115[this_158] == 0) { error126("Double free: object of type B"); } else { T_nextFree_156[T_firstFree_189] = this_158; T_firstFree_189 = (T_firstFree_189 + 1); T_typeId_115[this_158] = 0; }; } function error126(string msg731) { $debugPrint207((msg_731 + (" " + #getStackTrace()))); } function dispatch_T_destroyT224(integer this214) { if (T_typeId_115[this_214] == 0) { if (this_214 == 0) { error126("Nullpointer exception when calling T.T"); } else { error126("Called T.T on invalid object."); }; } else { }; if (T_typeId_115[this_214] <= 3) { if (T_typeId_115[this_214] <= 2) { destroyA188(this_214); } else { destroyB155(this_214); }; } else { if (T_typeId_115[this_214] == 0) { error126("Double free: object of type T"); } else { T_nextFree_156[T_firstFree_189] = this_214; T_firstFree_189 = (T_firstFree_189 + 1); T_typeId_115[this_214] = 0; }; }; }