array A_nextFree210 integer A_firstFree876 integer A_maxIndex197 array A_typeId475 integer A_firstFree876 = 0 integer A_maxIndex197 = 0 function initGlobals694() { A_firstFree_876 = 0; A_maxIndex_197 = 0; } function main103() { initGlobals694(); init_test543(); } function config479() { } function init_test543() { local integer b203 b_203 = new_A114(); if (dispatch_A_test_A_foo407(b_203) == 7) { testSuccess797(); } else { }; } IS_NATIVE function testSuccess797() { } function A_foo176(integer this214) returns integer { return 7; } function A_init413(integer this849) { } function new_A114() returns integer { local integer this135 this_135 = alloc_A179(); construct_A274(this_135); return this_135; } function construct_A274(integer this209) { A_init413(this_209); } function B_foo134(integer this158) returns integer { return 8; } function alloc_A179() returns integer { local integer this120 if (A_firstFree_876 == 0) { if (A_maxIndex_197 < 32768) { A_maxIndex_197 = (A_maxIndex_197 + 1); this_120 = A_maxIndex_197; A_typeId_475[this_120] = 1; } else { error193("Out of memory: Could not create A."); this_120 = 0; }; } else { A_firstFree_876 = (A_firstFree_876 - 1); this_120 = A_nextFree_210[A_firstFree_876]; A_typeId_475[this_120] = 1; }; return this_120; } function error193(string msg115) { $debugPrint189((msg_115 + (" " + #getStackTrace()))); } function dispatch_A_test_A_foo407(integer this278) returns integer { local integer test_A_foo_result113 if (A_typeId_475[this_278] == 0) { if (this_278 == 0) { error193("Nullpointer exception when calling A.foo"); } else { error193("Called A.foo on invalid object."); }; } else { }; if (A_typeId_475[this_278] <= 1) { test_A_foo_result_113 = A_foo176(this_278); } else { test_A_foo_result_113 = B_foo134(this_278); }; return test_A_foo_result_113; }