integer test_x157 array B_nextFree125 integer B_firstFree172 integer B_maxIndex196 array B_typeId129 integer test_x157 = 2 integer B_firstFree172 = 0 integer B_maxIndex196 = 0 function initGlobals715() { } function main214() { initGlobals715(); init_test502(); } function config140() { } function init_test502() { test_x_157 = 2; dispatch_A_destroyA983(new_X716()); if (test_x_157 == 6) { testSuccess131(); } else { }; } IS_NATIVE function testSuccess131() { } function destroyA684(integer this857) { A_onDestroy929(this_857); dealloc_A432(this_857); } function A_init130(integer this386) { } function construct_A161(integer this129) { construct_B875(this_129); A_init130(this_129); } function A_onDestroy929(integer this185) { test_x_157 = (test_x_157 + 1); B_onDestroy176(this_185); } function B_init211(integer this156) { } function construct_B875(integer this182) { B_init211(this_182); } function B_onDestroy176(integer this181) { test_x_157 = (test_x_157 * 2); } function X_init109(integer this660) { } function new_X716() returns integer { local integer this167 this_167 = alloc_X200(); construct_X116(this_167); return this_167; } function construct_X116(integer this880) { construct_A161(this_880); X_init109(this_880); } function error807(string msg190) { $debugPrint910((msg_190 + (" " + #getStackTrace()))); } function dealloc_A432(integer obj241) { if (B_typeId_129[obj_241] == 0) { error807("Double free: object of type A"); } else { B_nextFree_125[B_firstFree_172] = obj_241; B_firstFree_172 = (B_firstFree_172 + 1); B_typeId_129[obj_241] = 0; }; } function alloc_X200() returns integer { local integer this972 if (B_firstFree_172 == 0) { if (B_maxIndex_196 < 32768) { B_maxIndex_196 = (B_maxIndex_196 + 1); this_972 = B_maxIndex_196; B_typeId_129[this_972] = 3; } else { error807("Out of memory: Could not create X."); this_972 = 0; }; } else { B_firstFree_172 = (B_firstFree_172 - 1); this_972 = B_nextFree_125[B_firstFree_172]; B_typeId_129[this_972] = 3; }; return this_972; } function dispatch_A_destroyA983(integer this797) { if (B_typeId_129[this_797] == 0) { if (this_797 == 0) { error807("Nullpointer exception when calling A.A"); } else { error807("Called A.A on invalid object."); }; } else { }; destroyA684(this_797); }