array A_nextFree249 integer A_firstFree141 integer A_maxIndex600 array A_typeId141 integer A_firstFree141 = 0 integer A_maxIndex600 = 0 function initGlobals204() { A_firstFree_141 = 0; A_maxIndex_600 = 0; } function main131() { initGlobals204(); init_test531(); } function config673() { } function init_test531() { local integer a106 local integer b404 a_106 = new_A160(); b_404 = a_106; dispatch_A_destroyA235(b_404); if (dispatch_A_test_A_foo174(a_106) == 7) { testSuccess203(); } else { }; } IS_NATIVE function testSuccess203() { } function A_foo551(integer this101) returns integer { return 7; } function A_init864(integer this138) { } function new_A160() returns integer { local integer this791 this_791 = alloc_A333(); construct_A186(this_791); return this_791; } function construct_A186(integer this194) { A_init864(this_194); } function A_onDestroy434(integer this193) { } function destroyA191(integer this168) { A_onDestroy434(this_168); dealloc_A855(this_168); } function alloc_A333() returns integer { local integer this145 if (A_firstFree_141 == 0) { if (A_maxIndex_600 < 32768) { A_maxIndex_600 = (A_maxIndex_600 + 1); this_145 = A_maxIndex_600; A_typeId_141[this_145] = 1; } else { error108("Out of memory: Could not create A."); this_145 = 0; }; } else { A_firstFree_141 = (A_firstFree_141 - 1); this_145 = A_nextFree_249[A_firstFree_141]; A_typeId_141[this_145] = 1; }; return this_145; } function error108(string msg765) { $debugPrint160((msg_765 + (" " + #getStackTrace()))); } function dealloc_A855(integer obj168) { if (A_typeId_141[obj_168] == 0) { error108("Double free: object of type A"); } else { A_nextFree_249[A_firstFree_141] = obj_168; A_firstFree_141 = (A_firstFree_141 + 1); A_typeId_141[obj_168] = 0; }; } function dispatch_A_destroyA235(integer this674) { if (A_typeId_141[this_674] == 0) { if (this_674 == 0) { error108("Nullpointer exception when calling A.A"); } else { error108("Called A.A on invalid object."); }; } else { }; destroyA191(this_674); } function dispatch_A_test_A_foo174(integer this177) returns integer { local integer test_A_foo_result176 if (A_typeId_141[this_177] == 0) { if (this_177 == 0) { error108("Nullpointer exception when calling A.foo"); } else { error108("Called A.foo on invalid object."); }; } else { }; test_A_foo_result_176 = A_foo551(this_177); return test_A_foo_result_176; }