array I_nextFree202 integer I_firstFree209 integer I_maxIndex601 array I_typeId101 integer I_firstFree209 = 0 integer I_maxIndex601 = 0 function initGlobals196() { I_firstFree_209 = 0; I_maxIndex_601 = 0; } function main979() { initGlobals196(); init_test438(); } function config529() { } function init_test438() { local integer i1113 local integer i2404 local integer temp111 i1_113 = new_B192(); i2_404 = new_C538(); temp_111 = i2_404; i2_404 = i1_113; i1_113 = temp_111; if ((dispatch_I_test_I_foo922(i1_113) == 3) and (dispatch_I_test_I_foo922(i2_404) == 2)) { testSuccess635(); } else { }; } IS_NATIVE function testSuccess635() { } function B_foo901(integer this189) returns integer { return 2; } function B_init569(integer this995) { } function new_B192() returns integer { local integer this142 this_142 = alloc_B130(); construct_B203(this_142); return this_142; } function construct_B203(integer this175) { B_init569(this_175); } function C_foo173(integer this552) returns integer { return 3; } function C_init341(integer this119) { } function new_C538() returns integer { local integer this165 this_165 = alloc_C638(); construct_C763(this_165); return this_165; } function construct_C763(integer this836) { C_init341(this_836); } function alloc_B130() returns integer { local integer this167 if (I_firstFree_209 == 0) { if (I_maxIndex_601 < 32768) { I_maxIndex_601 = (I_maxIndex_601 + 1); this_167 = I_maxIndex_601; I_typeId_101[this_167] = 2; } else { error146("Out of memory: Could not create B."); this_167 = 0; }; } else { I_firstFree_209 = (I_firstFree_209 - 1); this_167 = I_nextFree_202[I_firstFree_209]; I_typeId_101[this_167] = 2; }; return this_167; } function error146(string msg765) { $debugPrint201((msg_765 + (" " + #getStackTrace()))); } function alloc_C638() returns integer { local integer this156 if (I_firstFree_209 == 0) { if (I_maxIndex_601 < 32768) { I_maxIndex_601 = (I_maxIndex_601 + 1); this_156 = I_maxIndex_601; I_typeId_101[this_156] = 3; } else { error146("Out of memory: Could not create C."); this_156 = 0; }; } else { I_firstFree_209 = (I_firstFree_209 - 1); this_156 = I_nextFree_202[I_firstFree_209]; I_typeId_101[this_156] = 3; }; return this_156; } function dispatch_I_test_I_foo922(integer this194) returns integer { local integer test_I_foo_result421 if (I_typeId_101[this_194] == 0) { if (this_194 == 0) { error146("Nullpointer exception when calling I.foo"); } else { error146("Called I.foo on invalid object."); }; } else { }; if (I_typeId_101[this_194] <= 2) { test_I_foo_result_421 = B_foo901(this_194); } else { test_I_foo_result_421 = C_foo173(this_194); }; return test_I_foo_result_421; }