string test_s309 array T_nextFree995 integer T_firstFree121 integer T_maxIndex173 array T_typeId210 string test_s309 = "" integer T_firstFree121 = 0 integer T_maxIndex173 = 0 function initGlobals696() { } function main847() { initGlobals696(); test_s_309 = ""; dispatch_T_destroyT967(new_A239()); if (test_s_309 == "C") { testSuccess108(); } else { }; } function config657() { } IS_NATIVE function testSuccess108() { } function destroyA874(integer this166) { test_s_309 = (test_s_309 + "C"); if (T_typeId_210[this_166] == 0) { error208("Double free: object of type A"); } else { T_nextFree_995[T_firstFree_121] = this_166; T_firstFree_121 = (T_firstFree_121 + 1); T_typeId_210[this_166] = 0; }; } function new_A239() returns integer { local integer this186 if (T_firstFree_121 == 0) { if (T_maxIndex_173 < 32768) { T_maxIndex_173 = (T_maxIndex_173 + 1); this_186 = T_maxIndex_173; T_typeId_210[this_186] = 2; } else { error208("Out of memory: Could not create A."); this_186 = 0; }; } else { T_firstFree_121 = (T_firstFree_121 - 1); this_186 = T_nextFree_995[T_firstFree_121]; T_typeId_210[this_186] = 2; }; return this_186; } function destroyB799(integer this121) { test_s_309 = ((test_s_309 + "B") + "C"); if (T_typeId_210[this_121] == 0) { error208("Double free: object of type B"); } else { T_nextFree_995[T_firstFree_121] = this_121; T_firstFree_121 = (T_firstFree_121 + 1); T_typeId_210[this_121] = 0; }; } function error208(string msg485) { $debugPrint201((msg_485 + (" " + #getStackTrace()))); } function dispatch_T_destroyT967(integer this303) { if (T_typeId_210[this_303] == 0) { if (this_303 == 0) { error208("Nullpointer exception when calling T.T"); } else { error208("Called T.T on invalid object."); }; } else { }; if (T_typeId_210[this_303] <= 3) { if (T_typeId_210[this_303] <= 2) { destroyA874(this_303); } else { destroyB799(this_303); }; } else { if (T_typeId_210[this_303] == 0) { error208("Double free: object of type T"); } else { T_nextFree_995[T_firstFree_121] = this_303; T_firstFree_121 = (T_firstFree_121 + 1); T_typeId_210[this_303] = 0; }; }; }