string test_s200 array T_nextFree207 integer T_firstFree128 integer T_maxIndex175 array T_typeId203 string test_s200 = "" integer T_firstFree128 = 0 integer T_maxIndex175 = 0 function initGlobals178() { T_firstFree_128 = 0; T_maxIndex_175 = 0; } function main175() { initGlobals178(); init_test109(); } function config127() { } function init_test109() { local integer t140 test_s_200 = ""; t_140 = new_A114(); dispatch_T_destroyT880(t_140); if (test_s_200 == "C") { testSuccess618(); } else { }; } IS_NATIVE function testSuccess618() { } function destroyA183(integer this207) { A_onDestroy378(this_207); dealloc_A117(this_207); } function A_init126(integer this105) { } function new_A114() returns integer { local integer this308 this_308 = alloc_A180(); construct_A712(this_308); return this_308; } function construct_A712(integer this326) { construct_C403(this_326); A_init126(this_326); } function A_onDestroy378(integer this197) { C_onDestroy562(this_197); } function destroyB173(integer this128) { B_onDestroy179(this_128); dealloc_B408(this_128); } function B_onDestroy179(integer this126) { test_s_200 = (test_s_200 + "B"); C_onDestroy562(this_126); } function C_init149(integer this122) { } function construct_C403(integer this130) { C_init149(this_130); } function C_onDestroy562(integer this696) { test_s_200 = (test_s_200 + "C"); } function destroyT401(integer this160) { dealloc_T310(this_160); } function alloc_A180() returns integer { local integer this588 if (T_firstFree_128 == 0) { if (T_maxIndex_175 < 32768) { T_maxIndex_175 = (T_maxIndex_175 + 1); this_588 = T_maxIndex_175; T_typeId_203[this_588] = 2; } else { error712("Out of memory: Could not create A."); this_588 = 0; }; } else { T_firstFree_128 = (T_firstFree_128 - 1); this_588 = T_nextFree_207[T_firstFree_128]; T_typeId_203[this_588] = 2; }; return this_588; } function error712(string msg166) { $debugPrint879((msg_166 + (" " + #getStackTrace()))); } function dealloc_A117(integer obj526) { if (T_typeId_203[obj_526] == 0) { error712("Double free: object of type A"); } else { T_nextFree_207[T_firstFree_128] = obj_526; T_firstFree_128 = (T_firstFree_128 + 1); T_typeId_203[obj_526] = 0; }; } function dealloc_B408(integer obj627) { if (T_typeId_203[obj_627] == 0) { error712("Double free: object of type B"); } else { T_nextFree_207[T_firstFree_128] = obj_627; T_firstFree_128 = (T_firstFree_128 + 1); T_typeId_203[obj_627] = 0; }; } function dealloc_T310(integer obj798) { if (T_typeId_203[obj_798] == 0) { error712("Double free: object of type T"); } else { T_nextFree_207[T_firstFree_128] = obj_798; T_firstFree_128 = (T_firstFree_128 + 1); T_typeId_203[obj_798] = 0; }; } function dispatch_T_destroyT880(integer this633) { if (T_typeId_203[this_633] == 0) { if (this_633 == 0) { error712("Nullpointer exception when calling T.T"); } else { error712("Called T.T on invalid object."); }; } else { }; if (T_typeId_203[this_633] <= 3) { if (T_typeId_203[this_633] <= 2) { destroyA183(this_633); } else { destroyB173(this_633); }; } else { destroyT401(this_633); }; }