integer test_x124 array B_nextFree903 integer B_firstFree113 integer B_maxIndex197 array B_typeId197 integer test_x124 = 2 integer B_firstFree113 = 0 integer B_maxIndex197 = 0 function initGlobals664() { } function main178() { initGlobals664(); init_test268(); } function config180() { } function init_test268() { test_x_124 = 2; dispatch_X_destroyX339(new_X140()); if (test_x_124 == 6) { testSuccess728(); } else { }; } IS_NATIVE function testSuccess728() { } function A_init212(integer this335) { } function construct_A252(integer this196) { construct_B162(this_196); A_init212(this_196); } function A_onDestroy101(integer this150) { test_x_124 = (test_x_124 + 1); B_onDestroy174(this_150); } function B_init334(integer this203) { } function construct_B162(integer this916) { B_init334(this_916); } function B_onDestroy174(integer this211) { test_x_124 = (test_x_124 * 2); } function destroyX115(integer this211) { X_onDestroy210(this_211); dealloc_X189(this_211); } function X_init213(integer this178) { } function new_X140() returns integer { local integer this806 this_806 = alloc_X559(); construct_X632(this_806); return this_806; } function construct_X632(integer this177) { construct_A252(this_177); X_init213(this_177); } function X_onDestroy210(integer this330) { A_onDestroy101(this_330); } function error327(string msg101) { $debugPrint323((msg_101 + (" " + #getStackTrace()))); } function alloc_X559() returns integer { local integer this103 if (B_firstFree_113 == 0) { if (B_maxIndex_197 < 32768) { B_maxIndex_197 = (B_maxIndex_197 + 1); this_103 = B_maxIndex_197; B_typeId_197[this_103] = 3; } else { error327("Out of memory: Could not create X."); this_103 = 0; }; } else { B_firstFree_113 = (B_firstFree_113 - 1); this_103 = B_nextFree_903[B_firstFree_113]; B_typeId_197[this_103] = 3; }; return this_103; } function dealloc_X189(integer obj102) { if (B_typeId_197[obj_102] == 0) { error327("Double free: object of type X"); } else { B_nextFree_903[B_firstFree_113] = obj_102; B_firstFree_113 = (B_firstFree_113 + 1); B_typeId_197[obj_102] = 0; }; } function dispatch_X_destroyX339(integer this506) { if (B_typeId_197[this_506] == 0) { if (this_506 == 0) { error327("Nullpointer exception when calling X.X"); } else { error327("Called X.X on invalid object."); }; } else { }; destroyX115(this_506); }