array I_nextFree894 integer I_firstFree462 integer I_maxIndex694 array I_typeId378 integer I_firstFree462 = 0 integer I_maxIndex694 = 0 function initGlobals211() { I_firstFree_462 = 0; I_maxIndex_694 = 0; } function main191() { initGlobals211(); init_test140(); } function config141() { } function init_test140() { local integer i1464 local integer i2151 local integer temp155 i1_464 = new_B521(); i2_151 = new_C648(); temp_155 = i2_151; i2_151 = i1_464; i1_464 = temp_155; if ((dispatch_I_test_I_foo572(i1_464) == 3) and (dispatch_I_test_I_foo572(i2_151) == 2)) { testSuccess115(); } else { }; } IS_NATIVE function testSuccess115() { } function B_foo186(integer this843) returns integer { return 2; } function B_init147(integer this199) { } function new_B521() returns integer { local integer this122 this_122 = alloc_B165(); construct_B360(this_122); return this_122; } function construct_B360(integer this996) { B_init147(this_996); } function C_foo200(integer this168) returns integer { return 3; } function C_init137(integer this136) { } function new_C648() returns integer { local integer this178 this_178 = alloc_C106(); construct_C201(this_178); return this_178; } function construct_C201(integer this722) { C_init137(this_722); } function alloc_B165() returns integer { local integer this783 if (I_firstFree_462 == 0) { if (I_maxIndex_694 < 32768) { I_maxIndex_694 = (I_maxIndex_694 + 1); this_783 = I_maxIndex_694; I_typeId_378[this_783] = 2; } else { error175("Out of memory: Could not create B."); this_783 = 0; }; } else { I_firstFree_462 = (I_firstFree_462 - 1); this_783 = I_nextFree_894[I_firstFree_462]; I_typeId_378[this_783] = 2; }; return this_783; } function error175(string msg149) { $debugPrint196((msg_149 + (" " + #getStackTrace()))); } function alloc_C106() returns integer { local integer this137 if (I_firstFree_462 == 0) { if (I_maxIndex_694 < 32768) { I_maxIndex_694 = (I_maxIndex_694 + 1); this_137 = I_maxIndex_694; I_typeId_378[this_137] = 3; } else { error175("Out of memory: Could not create C."); this_137 = 0; }; } else { I_firstFree_462 = (I_firstFree_462 - 1); this_137 = I_nextFree_894[I_firstFree_462]; I_typeId_378[this_137] = 3; }; return this_137; } function dispatch_I_test_I_foo572(integer this105) returns integer { local integer test_I_foo_result160 if (I_typeId_378[this_105] == 0) { if (this_105 == 0) { error175("Nullpointer exception when calling I.foo"); } else { error175("Called I.foo on invalid object."); }; } else { }; if (I_typeId_378[this_105] <= 2) { test_I_foo_result_160 = B_foo186(this_105); } else { test_I_foo_result_160 = C_foo200(this_105); }; return test_I_foo_result_160; }