string test_s137 array T_nextFree138 integer T_firstFree783 integer T_maxIndex492 array T_typeId115 string test_s137 = "" integer T_firstFree783 = 0 integer T_maxIndex492 = 0 function initGlobals862() { T_firstFree_783 = 0; T_maxIndex_492 = 0; } function main718() { initGlobals862(); init_test143(); } function config203() { } function init_test143() { local integer t130 test_s_137 = ""; t_130 = new_A121(); dispatch_T_destroyT504(t_130); if (test_s_137 == "") { testSuccess587(); } else { }; } IS_NATIVE function testSuccess587() { } function A_init357(integer this555) { } function new_A121() returns integer { local integer this598 this_598 = alloc_A538(); construct_A992(this_598); return this_598; } function construct_A992(integer this434) { A_init357(this_434); } function A_onDestroy898(integer this468) { } function destroyA285(integer this153) { A_onDestroy898(this_153); dealloc_A207(this_153); } function B_onDestroy200(integer this765) { test_s_137 = (test_s_137 + "B"); } function destroyB113(integer this293) { B_onDestroy200(this_293); dealloc_B577(this_293); } function destroyT168(integer this581) { dealloc_T158(this_581); } function alloc_A538() returns integer { local integer this210 if (T_firstFree_783 == 0) { if (T_maxIndex_492 < 32768) { T_maxIndex_492 = (T_maxIndex_492 + 1); this_210 = T_maxIndex_492; T_typeId_115[this_210] = 2; } else { error202("Out of memory: Could not create A."); this_210 = 0; }; } else { T_firstFree_783 = (T_firstFree_783 - 1); this_210 = T_nextFree_138[T_firstFree_783]; T_typeId_115[this_210] = 2; }; return this_210; } function error202(string msg178) { $debugPrint157((msg_178 + (" " + #getStackTrace()))); } function dealloc_A207(integer obj794) { if (T_typeId_115[obj_794] == 0) { error202("Double free: object of type A"); } else { T_nextFree_138[T_firstFree_783] = obj_794; T_firstFree_783 = (T_firstFree_783 + 1); T_typeId_115[obj_794] = 0; }; } function dealloc_B577(integer obj107) { if (T_typeId_115[obj_107] == 0) { error202("Double free: object of type B"); } else { T_nextFree_138[T_firstFree_783] = obj_107; T_firstFree_783 = (T_firstFree_783 + 1); T_typeId_115[obj_107] = 0; }; } function dealloc_T158(integer obj159) { if (T_typeId_115[obj_159] == 0) { error202("Double free: object of type T"); } else { T_nextFree_138[T_firstFree_783] = obj_159; T_firstFree_783 = (T_firstFree_783 + 1); T_typeId_115[obj_159] = 0; }; } function dispatch_T_destroyT504(integer this180) { if (T_typeId_115[this_180] == 0) { if (this_180 == 0) { error202("Nullpointer exception when calling T.T"); } else { error202("Called T.T on invalid object."); }; } else { }; if (T_typeId_115[this_180] <= 2) { if (T_typeId_115[this_180] <= 1) { destroyT168(this_180); } else { destroyA285(this_180); }; } else { destroyB113(this_180); }; }