string test_s920 array T_nextFree954 integer T_firstFree628 integer T_maxIndex998 array T_typeId182 string test_s920 = "" integer T_firstFree628 = 0 integer T_maxIndex998 = 0 function initGlobals159() { T_firstFree_628 = 0; T_maxIndex_998 = 0; } function main669() { initGlobals159(); init_test626(); } function config410() { } function init_test626() { local integer t153 test_s_920 = ""; t_153 = new_A105(); dispatch_T_destroyT169(t_153); if (test_s_920 == "C") { testSuccess583(); } else { }; } IS_NATIVE function testSuccess583() { } function destroyA141(integer this208) { A_onDestroy793(this_208); dealloc_A100(this_208); } function A_init156(integer this135) { } function new_A105() returns integer { local integer this174 this_174 = alloc_A213(); construct_A521(this_174); return this_174; } function construct_A521(integer this147) { construct_C174(this_147); A_init156(this_147); } function A_onDestroy793(integer this474) { C_onDestroy487(this_474); } function destroyB741(integer this222) { B_onDestroy496(this_222); dealloc_B132(this_222); } function B_onDestroy496(integer this155) { test_s_920 = (test_s_920 + "B"); C_onDestroy487(this_155); } function C_init204(integer this112) { } function construct_C174(integer this139) { C_init204(this_139); } function C_onDestroy487(integer this132) { test_s_920 = (test_s_920 + "C"); } function destroyT125(integer this193) { dealloc_T220(this_193); } function alloc_A213() returns integer { local integer this897 if (T_firstFree_628 == 0) { if (T_maxIndex_998 < 32768) { T_maxIndex_998 = (T_maxIndex_998 + 1); this_897 = T_maxIndex_998; T_typeId_182[this_897] = 2; } else { error208("Out of memory: Could not create A."); this_897 = 0; }; } else { T_firstFree_628 = (T_firstFree_628 - 1); this_897 = T_nextFree_954[T_firstFree_628]; T_typeId_182[this_897] = 2; }; return this_897; } function error208(string msg338) { $debugPrint159((msg_338 + (" " + #getStackTrace()))); } function dealloc_A100(integer obj212) { if (T_typeId_182[obj_212] == 0) { error208("Double free: object of type A"); } else { T_nextFree_954[T_firstFree_628] = obj_212; T_firstFree_628 = (T_firstFree_628 + 1); T_typeId_182[obj_212] = 0; }; } function dealloc_B132(integer obj353) { if (T_typeId_182[obj_353] == 0) { error208("Double free: object of type B"); } else { T_nextFree_954[T_firstFree_628] = obj_353; T_firstFree_628 = (T_firstFree_628 + 1); T_typeId_182[obj_353] = 0; }; } function dealloc_T220(integer obj130) { if (T_typeId_182[obj_130] == 0) { error208("Double free: object of type T"); } else { T_nextFree_954[T_firstFree_628] = obj_130; T_firstFree_628 = (T_firstFree_628 + 1); T_typeId_182[obj_130] = 0; }; } function dispatch_T_destroyT169(integer this731) { if (T_typeId_182[this_731] == 0) { if (this_731 == 0) { error208("Nullpointer exception when calling T.T"); } else { error208("Called T.T on invalid object."); }; } else { }; if (T_typeId_182[this_731] <= 3) { if (T_typeId_182[this_731] <= 2) { destroyA141(this_731); } else { destroyB741(this_731); }; } else { destroyT125(this_731); }; }