string test_s153 array T_nextFree310 integer T_firstFree169 integer T_maxIndex140 array T_typeId340 string test_s153 = "" integer T_firstFree169 = 0 integer T_maxIndex140 = 0 function initGlobals170() { } function main128() { initGlobals170(); init_test111(); } function config547() { } function init_test111() { test_s_153 = ""; dispatch_T_destroyT931(new_A852()); if (test_s_153 == "") { testSuccess457(); } else { }; } IS_NATIVE function testSuccess457() { } function A_init541(integer this338) { } function new_A852() returns integer { local integer this211 this_211 = alloc_A196(); construct_A122(this_211); return this_211; } function construct_A122(integer this139) { construct_T279(this_139); A_init541(this_139); } function destroyB213(integer this717) { B_onDestroy192(this_717); dealloc_B103(this_717); } function B_onDestroy192(integer this193) { test_s_153 = (test_s_153 + "B"); T_onDestroy575(this_193); } function T_init549(integer this163) { } function construct_T279(integer this298) { T_init549(this_298); } function T_onDestroy575(integer this157) { } function destroyT154(integer this186) { T_onDestroy575(this_186); dealloc_T117(this_186); } function alloc_A196() returns integer { local integer this562 if (T_firstFree_169 == 0) { if (T_maxIndex_140 < 32768) { T_maxIndex_140 = (T_maxIndex_140 + 1); this_562 = T_maxIndex_140; T_typeId_340[this_562] = 2; } else { error931("Out of memory: Could not create A."); this_562 = 0; }; } else { T_firstFree_169 = (T_firstFree_169 - 1); this_562 = T_nextFree_310[T_firstFree_169]; T_typeId_340[this_562] = 2; }; return this_562; } function error931(string msg125) { $debugPrint127((msg_125 + (" " + #getStackTrace()))); } function dealloc_B103(integer obj244) { if (T_typeId_340[obj_244] == 0) { error931("Double free: object of type B"); } else { T_nextFree_310[T_firstFree_169] = obj_244; T_firstFree_169 = (T_firstFree_169 + 1); T_typeId_340[obj_244] = 0; }; } function dealloc_T117(integer obj108) { if (T_typeId_340[obj_108] == 0) { error931("Double free: object of type T"); } else { T_nextFree_310[T_firstFree_169] = obj_108; T_firstFree_169 = (T_firstFree_169 + 1); T_typeId_340[obj_108] = 0; }; } function dispatch_T_destroyT931(integer this563) { if (T_typeId_340[this_563] == 0) { if (this_563 == 0) { error931("Nullpointer exception when calling T.T"); } else { error931("Called T.T on invalid object."); }; } else { }; if (T_typeId_340[this_563] <= 2) { destroyT154(this_563); } else { destroyB213(this_563); }; }