integer test_x144 array B_nextFree162 integer B_firstFree751 integer B_maxIndex195 array B_typeId107 integer test_x144 = 2 integer B_firstFree751 = 0 integer B_maxIndex195 = 0 function initGlobals153() { B_firstFree_751 = 0; B_maxIndex_195 = 0; } function main104() { initGlobals153(); init_test336(); } function config186() { } function init_test336() { local integer a185 test_x_144 = 2; a_185 = new_X288(); dispatch_X_destroyX136(a_185); if (test_x_144 == 6) { testSuccess256(); } else { }; } IS_NATIVE function testSuccess256() { } function A_init358(integer this105) { } function construct_A901(integer this194) { construct_B196(this_194); A_init358(this_194); } function A_onDestroy180(integer this642) { local integer z109 z_109 = 1; test_x_144 = (test_x_144 + z_109); B_onDestroy430(this_642); } function B_init213(integer this198) { } function construct_B196(integer this268) { B_init213(this_268); } function B_onDestroy430(integer this183) { local integer y708 y_708 = 2; test_x_144 = (test_x_144 * y_708); } function destroyX107(integer this151) { X_onDestroy165(this_151); dealloc_X158(this_151); } function X_init155(integer this382) { } function new_X288() returns integer { local integer this239 this_239 = alloc_X175(); construct_X186(this_239); return this_239; } function construct_X186(integer this586) { construct_A901(this_586); X_init155(this_586); } function X_onDestroy165(integer this161) { A_onDestroy180(this_161); } function error166(string msg147) { $debugPrint723((msg_147 + (" " + #getStackTrace()))); } function alloc_X175() returns integer { local integer this159 if (B_firstFree_751 == 0) { if (B_maxIndex_195 < 32768) { B_maxIndex_195 = (B_maxIndex_195 + 1); this_159 = B_maxIndex_195; B_typeId_107[this_159] = 3; } else { error166("Out of memory: Could not create X."); this_159 = 0; }; } else { B_firstFree_751 = (B_firstFree_751 - 1); this_159 = B_nextFree_162[B_firstFree_751]; B_typeId_107[this_159] = 3; }; return this_159; } function dealloc_X158(integer obj137) { if (B_typeId_107[obj_137] == 0) { error166("Double free: object of type X"); } else { B_nextFree_162[B_firstFree_751] = obj_137; B_firstFree_751 = (B_firstFree_751 + 1); B_typeId_107[obj_137] = 0; }; } function dispatch_X_destroyX136(integer this245) { if (B_typeId_107[this_245] == 0) { if (this_245 == 0) { error166("Nullpointer exception when calling X.X"); } else { error166("Called X.X on invalid object."); }; } else { }; destroyX107(this_245); }