array A_nextFree561 integer A_firstFree440 integer A_maxIndex463 array A_typeId142 array B_nextFree884 integer B_firstFree467 integer B_maxIndex121 array B_typeId716 integer A_firstFree440 = 0 integer A_maxIndex463 = 0 integer B_firstFree467 = 0 integer B_maxIndex121 = 0 function initGlobals129() { A_firstFree_440 = 0; A_maxIndex_463 = 0; B_firstFree_467 = 0; B_maxIndex_121 = 0; } function main891() { initGlobals129(); init_test201(); } function config159() { } function init_test201() { local integer b109 b_109 = dispatch_A_test_A_getB173(new_A704()); if (dispatch_B_test_A_B_foo111(b_109) == 4) { testSuccess337(); } else { }; } IS_NATIVE function testSuccess337() { } function A_getB148(integer this348) returns integer { return new_B186(); } function A_init572(integer this274) { } function new_A704() returns integer { local integer this119 this_119 = alloc_A106(); construct_A996(this_119); return this_119; } function construct_A996(integer this170) { A_init572(this_170); } function new_B186() returns integer { local integer this125 this_125 = alloc_B167(); construct_B155(this_125); return this_125; } function B_foo135(integer this323) returns integer { return 4; } function B_init197(integer this105) { } function construct_B155(integer this213) { B_init197(this_213); } function alloc_A106() returns integer { local integer this144 if (A_firstFree_440 == 0) { if (A_maxIndex_463 < 32768) { A_maxIndex_463 = (A_maxIndex_463 + 1); this_144 = A_maxIndex_463; A_typeId_142[this_144] = 1; } else { error172("Out of memory: Could not create A."); this_144 = 0; }; } else { A_firstFree_440 = (A_firstFree_440 - 1); this_144 = A_nextFree_561[A_firstFree_440]; A_typeId_142[this_144] = 1; }; return this_144; } function error172(string msg148) { $debugPrint474((msg_148 + (" " + #getStackTrace()))); } function alloc_B167() returns integer { local integer this271 if (B_firstFree_467 == 0) { if (B_maxIndex_121 < 32768) { B_maxIndex_121 = (B_maxIndex_121 + 1); this_271 = B_maxIndex_121; B_typeId_716[this_271] = 2; } else { error172("Out of memory: Could not create B."); this_271 = 0; }; } else { B_firstFree_467 = (B_firstFree_467 - 1); this_271 = B_nextFree_884[B_firstFree_467]; B_typeId_716[this_271] = 2; }; return this_271; } function dispatch_A_test_A_getB173(integer this204) returns integer { local integer test_A_getB_result146 if (A_typeId_142[this_204] == 0) { if (this_204 == 0) { error172("Nullpointer exception when calling A.getB"); } else { error172("Called A.getB on invalid object."); }; } else { }; test_A_getB_result_146 = A_getB148(this_204); return test_A_getB_result_146; } function dispatch_B_test_A_B_foo111(integer this106) returns integer { local integer test_A_B_foo_result468 if (B_typeId_716[this_106] == 0) { if (this_106 == 0) { error172("Nullpointer exception when calling B.foo"); } else { error172("Called B.foo on invalid object."); }; } else { }; test_A_B_foo_result_468 = B_foo135(this_106); return test_A_B_foo_result_468; }