integer test_x313 array B_nextFree374 integer B_firstFree125 integer B_maxIndex513 array B_typeId149 integer test_x313 = 2 integer B_firstFree125 = 0 integer B_maxIndex513 = 0 function initGlobals793() { } function main803() { initGlobals793(); init_test255(); } function config196() { } function init_test255() { test_x_313 = 2; dispatch_X_destroyX170(new_X102()); if (test_x_313 == 6) { testSuccess169(); } else { }; } IS_NATIVE function testSuccess169() { } function A_init167(integer this128) { } function construct_A205(integer this116) { construct_B121(this_116); A_init167(this_116); } function A_onDestroy492(integer this169) { test_x_313 = (test_x_313 + 1); B_onDestroy191(this_169); } function B_init163(integer this537) { } function construct_B121(integer this106) { B_init163(this_106); } function B_onDestroy191(integer this942) { test_x_313 = (test_x_313 * 2); } function destroyX150(integer this146) { X_onDestroy382(this_146); dealloc_X641(this_146); } function X_init203(integer this456) { } function new_X102() returns integer { local integer this480 this_480 = alloc_X129(); construct_X249(this_480); return this_480; } function construct_X249(integer this555) { construct_A205(this_555); X_init203(this_555); } function X_onDestroy382(integer this389) { A_onDestroy492(this_389); } function error101(string msg681) { $debugPrint107((msg_681 + (" " + #getStackTrace()))); } function alloc_X129() returns integer { local integer this207 if (B_firstFree_125 == 0) { if (B_maxIndex_513 < 32768) { B_maxIndex_513 = (B_maxIndex_513 + 1); this_207 = B_maxIndex_513; B_typeId_149[this_207] = 3; } else { error101("Out of memory: Could not create X."); this_207 = 0; }; } else { B_firstFree_125 = (B_firstFree_125 - 1); this_207 = B_nextFree_374[B_firstFree_125]; B_typeId_149[this_207] = 3; }; return this_207; } function dealloc_X641(integer obj759) { if (B_typeId_149[obj_759] == 0) { error101("Double free: object of type X"); } else { B_nextFree_374[B_firstFree_125] = obj_759; B_firstFree_125 = (B_firstFree_125 + 1); B_typeId_149[obj_759] = 0; }; } function dispatch_X_destroyX170(integer this896) { if (B_typeId_149[this_896] == 0) { if (this_896 == 0) { error101("Nullpointer exception when calling X.X"); } else { error101("Called X.X on invalid object."); }; } else { }; destroyX150(this_896); }