integer test_x139 array B_nextFree752 integer B_firstFree101 integer B_maxIndex103 array B_typeId104 integer test_x139 = 2 integer B_firstFree101 = 0 integer B_maxIndex103 = 0 function initGlobals840() { } function main791() { initGlobals840(); init_test148(); } function config526() { } function init_test148() { test_x_139 = 2; dispatch_X_destroyX106(new_X283()); if (test_x_139 == 6) { testSuccess163(); } else { }; } IS_NATIVE function testSuccess163() { } function A_init201(integer this179) { } function construct_A884(integer this507) { construct_B169(this_507); A_init201(this_507); } function A_onDestroy179(integer this830) { test_x_139 = (test_x_139 + 1); B_onDestroy194(this_830); } function B_init656(integer this136) { } function construct_B169(integer this124) { B_init656(this_124); } function B_onDestroy194(integer this587) { test_x_139 = (test_x_139 * 2); } function destroyX314(integer this285) { X_onDestroy143(this_285); dealloc_X105(this_285); } function X_init353(integer this226) { } function new_X283() returns integer { local integer this856 this_856 = alloc_X143(); construct_X218(this_856); return this_856; } function construct_X218(integer this237) { construct_A884(this_237); X_init353(this_237); } function X_onDestroy143(integer this152) { A_onDestroy179(this_152); } function error162(string msg157) { $debugPrint759((msg_157 + (" " + #getStackTrace()))); } function alloc_X143() returns integer { local integer this125 if (B_firstFree_101 == 0) { if (B_maxIndex_103 < 32768) { B_maxIndex_103 = (B_maxIndex_103 + 1); this_125 = B_maxIndex_103; B_typeId_104[this_125] = 3; } else { error162("Out of memory: Could not create X."); this_125 = 0; }; } else { B_firstFree_101 = (B_firstFree_101 - 1); this_125 = B_nextFree_752[B_firstFree_101]; B_typeId_104[this_125] = 3; }; return this_125; } function dealloc_X105(integer obj182) { if (B_typeId_104[obj_182] == 0) { error162("Double free: object of type X"); } else { B_nextFree_752[B_firstFree_101] = obj_182; B_firstFree_101 = (B_firstFree_101 + 1); B_typeId_104[obj_182] = 0; }; } function dispatch_X_destroyX106(integer this621) { if (B_typeId_104[this_621] == 0) { if (this_621 == 0) { error162("Nullpointer exception when calling X.X"); } else { error162("Called X.X on invalid object."); }; } else { }; destroyX314(this_621); }