array A_nextFree181 integer A_firstFree161 integer A_maxIndex205 array A_typeId595 integer A_firstFree161 = 0 integer A_maxIndex205 = 0 function initGlobals569() { A_firstFree_161 = 0; A_maxIndex_205 = 0; } function main147() { initGlobals569(); init_test701(); } function config487() { } function init_test701() { local integer a128 local integer b148 a_128 = new_A492(); b_148 = a_128; dispatch_A_destroyA102(b_148); if (dispatch_A_test_A_foo545(a_128) == 7) { testSuccess110(); } else { }; } IS_NATIVE function testSuccess110() { } function A_foo859(integer this135) returns integer { return 7; } function A_init704(integer this323) { } function new_A492() returns integer { local integer this205 this_205 = alloc_A206(); construct_A161(this_205); return this_205; } function construct_A161(integer this137) { A_init704(this_137); } function A_onDestroy189(integer this169) { } function destroyA430(integer this124) { A_onDestroy189(this_124); dealloc_A319(this_124); } function alloc_A206() returns integer { local integer this791 if (A_firstFree_161 == 0) { if (A_maxIndex_205 < 32768) { A_maxIndex_205 = (A_maxIndex_205 + 1); this_791 = A_maxIndex_205; A_typeId_595[this_791] = 1; } else { error377("Out of memory: Could not create A."); this_791 = 0; }; } else { A_firstFree_161 = (A_firstFree_161 - 1); this_791 = A_nextFree_181[A_firstFree_161]; A_typeId_595[this_791] = 1; }; return this_791; } function error377(string msg116) { $debugPrint677((msg_116 + (" " + #getStackTrace()))); } function dealloc_A319(integer obj160) { if (A_typeId_595[obj_160] == 0) { error377("Double free: object of type A"); } else { A_nextFree_181[A_firstFree_161] = obj_160; A_firstFree_161 = (A_firstFree_161 + 1); A_typeId_595[obj_160] = 0; }; } function dispatch_A_destroyA102(integer this643) { if (A_typeId_595[this_643] == 0) { if (this_643 == 0) { error377("Nullpointer exception when calling A.A"); } else { error377("Called A.A on invalid object."); }; } else { }; destroyA430(this_643); } function dispatch_A_test_A_foo545(integer this131) returns integer { local integer test_A_foo_result199 if (A_typeId_595[this_131] == 0) { if (this_131 == 0) { error377("Nullpointer exception when calling A.foo"); } else { error377("Called A.foo on invalid object."); }; } else { }; test_A_foo_result_199 = A_foo859(this_131); return test_A_foo_result_199; }