string test_s127 array T_nextFree399 integer T_firstFree307 integer T_maxIndex119 array T_typeId167 string test_s127 = "" integer T_firstFree307 = 0 integer T_maxIndex119 = 0 function initGlobals165() { T_firstFree_307 = 0; T_maxIndex_119 = 0; } function main508() { initGlobals165(); init_test441(); } function config182() { } function init_test441() { local integer t213 test_s_127 = ""; t_213 = new_A812(); dispatch_T_destroyT439(t_213); if (test_s_127 == "") { testSuccess323(); } else { }; } IS_NATIVE function testSuccess323() { } function A_init126(integer this901) { } function new_A812() returns integer { local integer this508 this_508 = alloc_A446(); construct_A139(this_508); return this_508; } function construct_A139(integer this509) { construct_T991(this_509); A_init126(this_509); } function destroyB145(integer this172) { B_onDestroy131(this_172); dealloc_B667(this_172); } function B_onDestroy131(integer this193) { test_s_127 = (test_s_127 + "B"); T_onDestroy138(this_193); } function T_init840(integer this166) { } function construct_T991(integer this468) { T_init840(this_468); } function T_onDestroy138(integer this800) { } function destroyT159(integer this741) { T_onDestroy138(this_741); dealloc_T199(this_741); } function alloc_A446() returns integer { local integer this155 if (T_firstFree_307 == 0) { if (T_maxIndex_119 < 32768) { T_maxIndex_119 = (T_maxIndex_119 + 1); this_155 = T_maxIndex_119; T_typeId_167[this_155] = 2; } else { error956("Out of memory: Could not create A."); this_155 = 0; }; } else { T_firstFree_307 = (T_firstFree_307 - 1); this_155 = T_nextFree_399[T_firstFree_307]; T_typeId_167[this_155] = 2; }; return this_155; } function error956(string msg445) { $debugPrint190((msg_445 + (" " + #getStackTrace()))); } function dealloc_B667(integer obj168) { if (T_typeId_167[obj_168] == 0) { error956("Double free: object of type B"); } else { T_nextFree_399[T_firstFree_307] = obj_168; T_firstFree_307 = (T_firstFree_307 + 1); T_typeId_167[obj_168] = 0; }; } function dealloc_T199(integer obj208) { if (T_typeId_167[obj_208] == 0) { error956("Double free: object of type T"); } else { T_nextFree_399[T_firstFree_307] = obj_208; T_firstFree_307 = (T_firstFree_307 + 1); T_typeId_167[obj_208] = 0; }; } function dispatch_T_destroyT439(integer this212) { if (T_typeId_167[this_212] == 0) { if (this_212 == 0) { error956("Nullpointer exception when calling T.T"); } else { error956("Called T.T on invalid object."); }; } else { }; if (T_typeId_167[this_212] <= 2) { destroyT159(this_212); } else { destroyB145(this_212); }; }