array I_nextFree384 integer I_firstFree125 integer I_maxIndex114 array I_typeId283 integer I_firstFree125 = 0 integer I_maxIndex114 = 0 function initGlobals157() { I_firstFree_125 = 0; I_maxIndex_114 = 0; } function main119() { initGlobals157(); init_test626(); } function config999() { } function init_test626() { local integer i1113 local integer i2826 local integer temp875 i1_113 = new_B187(); i2_826 = new_C384(); temp_875 = i2_826; i2_826 = i1_113; i1_113 = temp_875; if ((dispatch_I_test_I_foo359(i1_113) == 3) and (dispatch_I_test_I_foo359(i2_826) == 2)) { testSuccess207(); } else { }; } IS_NATIVE function testSuccess207() { } function B_foo194(integer this172) returns integer { return 2; } function B_init147(integer this192) { } function new_B187() returns integer { local integer this167 this_167 = alloc_B196(); construct_B776(this_167); return this_167; } function construct_B776(integer this144) { B_init147(this_144); } function C_foo205(integer this241) returns integer { return 3; } function C_init103(integer this152) { } function new_C384() returns integer { local integer this397 this_397 = alloc_C142(); construct_C132(this_397); return this_397; } function construct_C132(integer this919) { C_init103(this_919); } function alloc_B196() returns integer { local integer this111 if (I_firstFree_125 == 0) { if (I_maxIndex_114 < 32768) { I_maxIndex_114 = (I_maxIndex_114 + 1); this_111 = I_maxIndex_114; I_typeId_283[this_111] = 2; } else { error159("Out of memory: Could not create B."); this_111 = 0; }; } else { I_firstFree_125 = (I_firstFree_125 - 1); this_111 = I_nextFree_384[I_firstFree_125]; I_typeId_283[this_111] = 2; }; return this_111; } function error159(string msg159) { $debugPrint868((msg_159 + (" " + #getStackTrace()))); } function alloc_C142() returns integer { local integer this122 if (I_firstFree_125 == 0) { if (I_maxIndex_114 < 32768) { I_maxIndex_114 = (I_maxIndex_114 + 1); this_122 = I_maxIndex_114; I_typeId_283[this_122] = 3; } else { error159("Out of memory: Could not create C."); this_122 = 0; }; } else { I_firstFree_125 = (I_firstFree_125 - 1); this_122 = I_nextFree_384[I_firstFree_125]; I_typeId_283[this_122] = 3; }; return this_122; } function dispatch_I_test_I_foo359(integer this174) returns integer { local integer test_I_foo_result766 if (I_typeId_283[this_174] == 0) { if (this_174 == 0) { error159("Nullpointer exception when calling I.foo"); } else { error159("Called I.foo on invalid object."); }; } else { }; if (I_typeId_283[this_174] <= 2) { test_I_foo_result_766 = B_foo194(this_174); } else { test_I_foo_result_766 = C_foo205(this_174); }; return test_I_foo_result_766; }