string test_s165 array T_nextFree323 integer T_firstFree112 integer T_maxIndex170 array T_typeId135 string test_s165 = "" integer T_firstFree112 = 0 integer T_maxIndex170 = 0 function initGlobals113() { T_firstFree_112 = 0; T_maxIndex_170 = 0; } function main263() { initGlobals113(); init_test175(); } function config208() { } function init_test175() { local integer t116 test_s_165 = ""; t_116 = new_A174(); dispatch_T_destroyT848(t_116); if (test_s_165 == "") { testSuccess166(); } else { }; } IS_NATIVE function testSuccess166() { } function A_init148(integer this534) { } function new_A174() returns integer { local integer this169 this_169 = alloc_A168(); construct_A153(this_169); return this_169; } function construct_A153(integer this135) { construct_T155(this_135); A_init148(this_135); } function destroyB991(integer this200) { B_onDestroy107(this_200); dealloc_B206(this_200); } function B_onDestroy107(integer this302) { test_s_165 = (test_s_165 + "B"); T_onDestroy200(this_302); } function T_init787(integer this983) { } function construct_T155(integer this182) { T_init787(this_182); } function T_onDestroy200(integer this826) { } function destroyT627(integer this605) { T_onDestroy200(this_605); dealloc_T162(this_605); } function alloc_A168() returns integer { local integer this102 if (T_firstFree_112 == 0) { if (T_maxIndex_170 < 32768) { T_maxIndex_170 = (T_maxIndex_170 + 1); this_102 = T_maxIndex_170; T_typeId_135[this_102] = 2; } else { error189("Out of memory: Could not create A."); this_102 = 0; }; } else { T_firstFree_112 = (T_firstFree_112 - 1); this_102 = T_nextFree_323[T_firstFree_112]; T_typeId_135[this_102] = 2; }; return this_102; } function error189(string msg144) { $debugPrint170((msg_144 + (" " + #getStackTrace()))); } function dealloc_B206(integer obj191) { if (T_typeId_135[obj_191] == 0) { error189("Double free: object of type B"); } else { T_nextFree_323[T_firstFree_112] = obj_191; T_firstFree_112 = (T_firstFree_112 + 1); T_typeId_135[obj_191] = 0; }; } function dealloc_T162(integer obj151) { if (T_typeId_135[obj_151] == 0) { error189("Double free: object of type T"); } else { T_nextFree_323[T_firstFree_112] = obj_151; T_firstFree_112 = (T_firstFree_112 + 1); T_typeId_135[obj_151] = 0; }; } function dispatch_T_destroyT848(integer this120) { if (T_typeId_135[this_120] == 0) { if (this_120 == 0) { error189("Nullpointer exception when calling T.T"); } else { error189("Called T.T on invalid object."); }; } else { }; if (T_typeId_135[this_120] <= 2) { destroyT627(this_120); } else { destroyB991(this_120); }; }