string test_s157 array T_nextFree125 integer T_firstFree112 integer T_maxIndex730 array T_typeId161 string test_s157 = "" integer T_firstFree112 = 0 integer T_maxIndex730 = 0 function initGlobals207() { } function main435() { initGlobals207(); init_test206(); } function config531() { } function init_test206() { test_s_157 = ""; dispatch_T_destroyT526(new_A579()); if (test_s_157 == "") { testSuccess708(); } else { }; } IS_NATIVE function testSuccess708() { } function A_init464(integer this921) { } function new_A579() returns integer { local integer this433 this_433 = alloc_A136(); construct_A184(this_433); return this_433; } function construct_A184(integer this954) { construct_T837(this_954); A_init464(this_954); } function destroyB206(integer this610) { B_onDestroy815(this_610); dealloc_B170(this_610); } function B_onDestroy815(integer this967) { test_s_157 = (test_s_157 + "B"); T_onDestroy157(this_967); } function T_init410(integer this153) { } function construct_T837(integer this628) { T_init410(this_628); } function T_onDestroy157(integer this605) { } function destroyT201(integer this121) { T_onDestroy157(this_121); dealloc_T164(this_121); } function alloc_A136() returns integer { local integer this482 if (T_firstFree_112 == 0) { if (T_maxIndex_730 < 32768) { T_maxIndex_730 = (T_maxIndex_730 + 1); this_482 = T_maxIndex_730; T_typeId_161[this_482] = 2; } else { error797("Out of memory: Could not create A."); this_482 = 0; }; } else { T_firstFree_112 = (T_firstFree_112 - 1); this_482 = T_nextFree_125[T_firstFree_112]; T_typeId_161[this_482] = 2; }; return this_482; } function error797(string msg103) { $debugPrint154((msg_103 + (" " + #getStackTrace()))); } function dealloc_B170(integer obj199) { if (T_typeId_161[obj_199] == 0) { error797("Double free: object of type B"); } else { T_nextFree_125[T_firstFree_112] = obj_199; T_firstFree_112 = (T_firstFree_112 + 1); T_typeId_161[obj_199] = 0; }; } function dealloc_T164(integer obj511) { if (T_typeId_161[obj_511] == 0) { error797("Double free: object of type T"); } else { T_nextFree_125[T_firstFree_112] = obj_511; T_firstFree_112 = (T_firstFree_112 + 1); T_typeId_161[obj_511] = 0; }; } function dispatch_T_destroyT526(integer this831) { if (T_typeId_161[this_831] == 0) { if (this_831 == 0) { error797("Nullpointer exception when calling T.T"); } else { error797("Called T.T on invalid object."); }; } else { }; if (T_typeId_161[this_831] <= 2) { destroyT201(this_831); } else { destroyB206(this_831); }; }