integer test_x184 array B_nextFree600 integer B_firstFree884 integer B_maxIndex754 array B_typeId515 integer test_x184 = 2 integer B_firstFree884 = 0 integer B_maxIndex754 = 0 function initGlobals524() { } function main151() { initGlobals524(); init_test860(); } function config342() { } function init_test860() { test_x_184 = 2; dispatch_X_destroyX129(new_X108()); if (test_x_184 == 6) { testSuccess156(); } else { }; } IS_NATIVE function testSuccess156() { } function A_init163(integer this178) { } function construct_A498(integer this453) { construct_B156(this_453); A_init163(this_453); } function A_onDestroy368(integer this343) { test_x_184 = (test_x_184 + 1); B_onDestroy702(this_343); } function B_init144(integer this272) { } function construct_B156(integer this407) { B_init144(this_407); } function B_onDestroy702(integer this898) { test_x_184 = (test_x_184 * 2); } function destroyX967(integer this261) { X_onDestroy505(this_261); dealloc_X229(this_261); } function X_init414(integer this176) { } function new_X108() returns integer { local integer this134 this_134 = alloc_X257(); construct_X299(this_134); return this_134; } function construct_X299(integer this123) { construct_A498(this_123); X_init414(this_123); } function X_onDestroy505(integer this940) { A_onDestroy368(this_940); } function error169(string msg431) { $debugPrint116((msg_431 + (" " + #getStackTrace()))); } function alloc_X257() returns integer { local integer this966 if (B_firstFree_884 == 0) { if (B_maxIndex_754 < 32768) { B_maxIndex_754 = (B_maxIndex_754 + 1); this_966 = B_maxIndex_754; B_typeId_515[this_966] = 3; } else { error169("Out of memory: Could not create X."); this_966 = 0; }; } else { B_firstFree_884 = (B_firstFree_884 - 1); this_966 = B_nextFree_600[B_firstFree_884]; B_typeId_515[this_966] = 3; }; return this_966; } function dealloc_X229(integer obj191) { if (B_typeId_515[obj_191] == 0) { error169("Double free: object of type X"); } else { B_nextFree_600[B_firstFree_884] = obj_191; B_firstFree_884 = (B_firstFree_884 + 1); B_typeId_515[obj_191] = 0; }; } function dispatch_X_destroyX129(integer this490) { if (B_typeId_515[this_490] == 0) { if (this_490 == 0) { error169("Nullpointer exception when calling X.X"); } else { error169("Called X.X on invalid object."); }; } else { }; destroyX967(this_490); }