integer test_x124 array B_nextFree905 integer B_firstFree210 integer B_maxIndex782 array B_typeId108 integer test_x124 = 2 integer B_firstFree210 = 0 integer B_maxIndex782 = 0 function initGlobals193() { B_firstFree_210 = 0; B_maxIndex_782 = 0; } function main126() { initGlobals193(); init_test103(); } function config950() { } function init_test103() { local integer a112 test_x_124 = 2; a_112 = new_X140(); dispatch_X_destroyX409(a_112); if (test_x_124 == 6) { testSuccess202(); } else { }; } IS_NATIVE function testSuccess202() { } function A_init138(integer this191) { } function construct_A177(integer this328) { construct_B790(this_328); A_init138(this_328); } function A_onDestroy128(integer this177) { test_x_124 = (test_x_124 + 1); B_onDestroy774(this_177); } function B_init870(integer this126) { } function construct_B790(integer this128) { B_init870(this_128); } function B_onDestroy774(integer this941) { test_x_124 = (test_x_124 * 2); } function destroyX668(integer this162) { X_onDestroy972(this_162); dealloc_X751(this_162); } function X_init607(integer this100) { } function new_X140() returns integer { local integer this676 this_676 = alloc_X218(); construct_X109(this_676); return this_676; } function construct_X109(integer this177) { construct_A177(this_177); X_init607(this_177); } function X_onDestroy972(integer this100) { A_onDestroy128(this_100); } function error129(string msg995) { $debugPrint843((msg_995 + (" " + #getStackTrace()))); } function alloc_X218() returns integer { local integer this145 if (B_firstFree_210 == 0) { if (B_maxIndex_782 < 32768) { B_maxIndex_782 = (B_maxIndex_782 + 1); this_145 = B_maxIndex_782; B_typeId_108[this_145] = 3; } else { error129("Out of memory: Could not create X."); this_145 = 0; }; } else { B_firstFree_210 = (B_firstFree_210 - 1); this_145 = B_nextFree_905[B_firstFree_210]; B_typeId_108[this_145] = 3; }; return this_145; } function dealloc_X751(integer obj302) { if (B_typeId_108[obj_302] == 0) { error129("Double free: object of type X"); } else { B_nextFree_905[B_firstFree_210] = obj_302; B_firstFree_210 = (B_firstFree_210 + 1); B_typeId_108[obj_302] = 0; }; } function dispatch_X_destroyX409(integer this124) { if (B_typeId_108[this_124] == 0) { if (this_124 == 0) { error129("Nullpointer exception when calling X.X"); } else { error129("Called X.X on invalid object."); }; } else { }; destroyX668(this_124); }