array A_nextFree103 integer A_firstFree488 integer A_maxIndex189 array A_typeId727 integer A_firstFree488 = 0 integer A_maxIndex189 = 0 function initGlobals734() { A_firstFree_488 = 0; A_maxIndex_189 = 0; } function main199() { initGlobals734(); init_test192(); } function config428() { } function init_test192() { local integer a119 local integer b197 a_119 = new_A188(); b_197 = a_119; dispatch_A_destroyA137(b_197); if (dispatch_A_test_A_foo498(a_119) == 7) { testSuccess187(); } else { }; } IS_NATIVE function testSuccess187() { } function A_foo132(integer this248) returns integer { return 7; } function A_init152(integer this164) { } function new_A188() returns integer { local integer this831 this_831 = alloc_A170(); construct_A806(this_831); return this_831; } function construct_A806(integer this338) { A_init152(this_338); } function A_onDestroy116(integer this875) { } function destroyA252(integer this195) { A_onDestroy116(this_195); dealloc_A112(this_195); } function alloc_A170() returns integer { local integer this117 if (A_firstFree_488 == 0) { if (A_maxIndex_189 < 32768) { A_maxIndex_189 = (A_maxIndex_189 + 1); this_117 = A_maxIndex_189; A_typeId_727[this_117] = 1; } else { error162("Out of memory: Could not create A."); this_117 = 0; }; } else { A_firstFree_488 = (A_firstFree_488 - 1); this_117 = A_nextFree_103[A_firstFree_488]; A_typeId_727[this_117] = 1; }; return this_117; } function error162(string msg171) { $debugPrint676((msg_171 + (" " + #getStackTrace()))); } function dealloc_A112(integer obj777) { if (A_typeId_727[obj_777] == 0) { error162("Double free: object of type A"); } else { A_nextFree_103[A_firstFree_488] = obj_777; A_firstFree_488 = (A_firstFree_488 + 1); A_typeId_727[obj_777] = 0; }; } function dispatch_A_destroyA137(integer this103) { if (A_typeId_727[this_103] == 0) { if (this_103 == 0) { error162("Nullpointer exception when calling A.A"); } else { error162("Called A.A on invalid object."); }; } else { }; destroyA252(this_103); } function dispatch_A_test_A_foo498(integer this252) returns integer { local integer test_A_foo_result209 if (A_typeId_727[this_252] == 0) { if (this_252 == 0) { error162("Nullpointer exception when calling A.foo"); } else { error162("Called A.foo on invalid object."); }; } else { }; test_A_foo_result_209 = A_foo132(this_252); return test_A_foo_result_209; }