array I_nextFree187 integer I_firstFree109 integer I_maxIndex144 array I_typeId172 integer I_firstFree109 = 0 integer I_maxIndex144 = 0 function initGlobals206() { } function main210() { initGlobals206(); init_test532(); } function config859() { } function init_test532() { local integer b178 local integer c124 local integer d131 b_178 = new_B147(); c_124 = new_C141(); d_131 = new_D198(); if (dispatch_I_test_I_foo162(b_178) != 2) { testFail197("b"); } else { }; if (dispatch_I_test_I_foo162(c_124) != 3) { testFail197("c"); } else { }; if (dispatch_I_test_I_foo162(d_131) != 5) { testFail197("d"); } else { }; testSuccess261(); } IS_NATIVE function testFail197(string s132) { } IS_NATIVE function testSuccess261() { } function new_B147() returns integer { local integer this952 local integer this825 if (I_firstFree_109 == 0) { if (I_maxIndex_144 < 32768) { I_maxIndex_144 = (I_maxIndex_144 + 1); this_825 = I_maxIndex_144; I_typeId_172[this_825] = 2; } else { error755("Out of memory: Could not create B."); this_825 = 0; }; } else { I_firstFree_109 = (I_firstFree_109 - 1); this_825 = I_nextFree_187[I_firstFree_109]; I_typeId_172[this_825] = 2; }; this_952 = this_825; return this_952; } function new_C141() returns integer { local integer this188 local integer this653 if (I_firstFree_109 == 0) { if (I_maxIndex_144 < 32768) { I_maxIndex_144 = (I_maxIndex_144 + 1); this_653 = I_maxIndex_144; I_typeId_172[this_653] = 3; } else { error755("Out of memory: Could not create C."); this_653 = 0; }; } else { I_firstFree_109 = (I_firstFree_109 - 1); this_653 = I_nextFree_187[I_firstFree_109]; I_typeId_172[this_653] = 3; }; this_188 = this_653; return this_188; } function new_D198() returns integer { local integer this176 local integer this166 if (I_firstFree_109 == 0) { if (I_maxIndex_144 < 32768) { I_maxIndex_144 = (I_maxIndex_144 + 1); this_166 = I_maxIndex_144; I_typeId_172[this_166] = 4; } else { error755("Out of memory: Could not create D."); this_166 = 0; }; } else { I_firstFree_109 = (I_firstFree_109 - 1); this_166 = I_nextFree_187[I_firstFree_109]; I_typeId_172[this_166] = 4; }; this_176 = this_166; return this_176; } function error755(string msg137) { $debugPrint204((msg_137 + (" " + #getStackTrace()))); } function dispatch_I_test_I_foo162(integer this235) returns integer { local integer test_I_foo_result165 if (I_typeId_172[this_235] == 0) { if (this_235 == 0) { error755("Nullpointer exception when calling I.foo"); } else { error755("Called I.foo on invalid object."); }; } else { }; if (I_typeId_172[this_235] <= 2) { if (I_typeId_172[this_235] <= 1) { test_I_foo_result_165 = 5; } else { test_I_foo_result_165 = 2; }; } else { if (I_typeId_172[this_235] <= 3) { test_I_foo_result_165 = 3; } else { test_I_foo_result_165 = 5; }; }; return test_I_foo_result_165; }