integer test_x518 array B_nextFree168 integer B_firstFree475 integer B_maxIndex480 array B_typeId142 integer test_x518 = 2 integer B_firstFree475 = 0 integer B_maxIndex480 = 0 function initGlobals131() { } function main263() { initGlobals131(); init_test944(); } function config226() { } function init_test944() { test_x_518 = 2; dispatch_X_destroyX434(new_X374()); if (test_x_518 == 6) { testSuccess132(); } else { }; } IS_NATIVE function testSuccess132() { } function A_init134(integer this234) { } function construct_A167(integer this100) { construct_B299(this_100); A_init134(this_100); } function A_onDestroy150(integer this505) { test_x_518 = (test_x_518 + 1); B_onDestroy539(this_505); } function B_init344(integer this498) { } function construct_B299(integer this868) { B_init344(this_868); } function B_onDestroy539(integer this714) { test_x_518 = (test_x_518 * 2); } function destroyX211(integer this387) { X_onDestroy170(this_387); dealloc_X183(this_387); } function X_init195(integer this263) { } function new_X374() returns integer { local integer this799 this_799 = alloc_X303(); construct_X206(this_799); return this_799; } function construct_X206(integer this110) { construct_A167(this_110); X_init195(this_110); } function X_onDestroy170(integer this151) { A_onDestroy150(this_151); } function error106(string msg111) { $debugPrint573((msg_111 + (" " + #getStackTrace()))); } function alloc_X303() returns integer { local integer this873 if (B_firstFree_475 == 0) { if (B_maxIndex_480 < 32768) { B_maxIndex_480 = (B_maxIndex_480 + 1); this_873 = B_maxIndex_480; B_typeId_142[this_873] = 3; } else { error106("Out of memory: Could not create X."); this_873 = 0; }; } else { B_firstFree_475 = (B_firstFree_475 - 1); this_873 = B_nextFree_168[B_firstFree_475]; B_typeId_142[this_873] = 3; }; return this_873; } function dealloc_X183(integer obj884) { if (B_typeId_142[obj_884] == 0) { error106("Double free: object of type X"); } else { B_nextFree_168[B_firstFree_475] = obj_884; B_firstFree_475 = (B_firstFree_475 + 1); B_typeId_142[obj_884] = 0; }; } function dispatch_X_destroyX434(integer this149) { if (B_typeId_142[this_149] == 0) { if (this_149 == 0) { error106("Nullpointer exception when calling X.X"); } else { error106("Called X.X on invalid object."); }; } else { }; destroyX211(this_149); }