integer test_x179 array B_nextFree203 integer B_firstFree188 integer B_maxIndex112 array B_typeId173 integer test_x179 = 2 integer B_firstFree188 = 0 integer B_maxIndex112 = 0 function initGlobals212() { } function main158() { initGlobals212(); init_test195(); } function config476() { } function init_test195() { test_x_179 = 2; dispatch_X_destroyX185(new_X164()); if (test_x_179 == 6) { testSuccess137(); } else { }; } IS_NATIVE function testSuccess137() { } function A_init158(integer this763) { } function construct_A127(integer this181) { construct_B279(this_181); A_init158(this_181); } function A_onDestroy136(integer this169) { test_x_179 = (test_x_179 + 1); B_onDestroy907(this_169); } function B_init467(integer this121) { } function construct_B279(integer this749) { B_init467(this_749); } function B_onDestroy907(integer this101) { test_x_179 = (test_x_179 * 2); } function destroyX858(integer this926) { X_onDestroy159(this_926); dealloc_X209(this_926); } function X_init566(integer this145) { } function new_X164() returns integer { local integer this985 this_985 = alloc_X667(); construct_X717(this_985); return this_985; } function construct_X717(integer this145) { construct_A127(this_145); X_init566(this_145); } function X_onDestroy159(integer this271) { A_onDestroy136(this_271); } function error423(string msg984) { $debugPrint468((msg_984 + (" " + #getStackTrace()))); } function alloc_X667() returns integer { local integer this111 if (B_firstFree_188 == 0) { if (B_maxIndex_112 < 32768) { B_maxIndex_112 = (B_maxIndex_112 + 1); this_111 = B_maxIndex_112; B_typeId_173[this_111] = 3; } else { error423("Out of memory: Could not create X."); this_111 = 0; }; } else { B_firstFree_188 = (B_firstFree_188 - 1); this_111 = B_nextFree_203[B_firstFree_188]; B_typeId_173[this_111] = 3; }; return this_111; } function dealloc_X209(integer obj915) { if (B_typeId_173[obj_915] == 0) { error423("Double free: object of type X"); } else { B_nextFree_203[B_firstFree_188] = obj_915; B_firstFree_188 = (B_firstFree_188 + 1); B_typeId_173[obj_915] = 0; }; } function dispatch_X_destroyX185(integer this149) { if (B_typeId_173[this_149] == 0) { if (this_149 == 0) { error423("Nullpointer exception when calling X.X"); } else { error423("Called X.X on invalid object."); }; } else { }; destroyX858(this_149); }