array I_nextFree194 integer I_firstFree186 integer I_maxIndex571 array I_typeId164 integer I_firstFree186 = 0 integer I_maxIndex571 = 0 function initGlobals134() { I_firstFree_186 = 0; I_maxIndex_571 = 0; } function main200() { initGlobals134(); init_test554(); } function config138() { } function init_test554() { local integer i1120 local integer i2755 i1_120 = new_B110(); i2_755 = new_C712(); test199(i1_120, i2_755); } function test199(integer i1971, integer i2137) { if ((dispatch_I_test_I_foo197(i1_971) == 2) and (dispatch_I_test_I_foo197(i2_137) == 3)) { testSuccess156(); } else { }; } IS_NATIVE function testSuccess156() { } function B_foo189(integer this176) returns integer { return 2; } function B_init377(integer this188) { } function new_B110() returns integer { local integer this102 this_102 = alloc_B186(); construct_B106(this_102); return this_102; } function construct_B106(integer this741) { B_init377(this_741); } function C_foo169(integer this318) returns integer { return 3; } function C_init134(integer this565) { } function new_C712() returns integer { local integer this178 this_178 = alloc_C139(); construct_C160(this_178); return this_178; } function construct_C160(integer this148) { C_init134(this_148); } function alloc_B186() returns integer { local integer this430 if (I_firstFree_186 == 0) { if (I_maxIndex_571 < 32768) { I_maxIndex_571 = (I_maxIndex_571 + 1); this_430 = I_maxIndex_571; I_typeId_164[this_430] = 2; } else { error195("Out of memory: Could not create B."); this_430 = 0; }; } else { I_firstFree_186 = (I_firstFree_186 - 1); this_430 = I_nextFree_194[I_firstFree_186]; I_typeId_164[this_430] = 2; }; return this_430; } function error195(string msg211) { $debugPrint143((msg_211 + (" " + #getStackTrace()))); } function alloc_C139() returns integer { local integer this484 if (I_firstFree_186 == 0) { if (I_maxIndex_571 < 32768) { I_maxIndex_571 = (I_maxIndex_571 + 1); this_484 = I_maxIndex_571; I_typeId_164[this_484] = 3; } else { error195("Out of memory: Could not create C."); this_484 = 0; }; } else { I_firstFree_186 = (I_firstFree_186 - 1); this_484 = I_nextFree_194[I_firstFree_186]; I_typeId_164[this_484] = 3; }; return this_484; } function dispatch_I_test_I_foo197(integer this135) returns integer { local integer test_I_foo_result126 if (I_typeId_164[this_135] == 0) { if (this_135 == 0) { error195("Nullpointer exception when calling I.foo"); } else { error195("Called I.foo on invalid object."); }; } else { }; if (I_typeId_164[this_135] <= 2) { test_I_foo_result_126 = B_foo189(this_135); } else { test_I_foo_result_126 = C_foo169(this_135); }; return test_I_foo_result_126; }