array I_nextFree665 integer I_firstFree200 integer I_maxIndex192 array I_typeId166 integer I_firstFree200 = 0 integer I_maxIndex192 = 0 function initGlobals981() { } function main828() { initGlobals981(); init_test338(); } function config164() { } function init_test338() { local integer b159 local integer c110 local integer d871 b_159 = new_B465(); c_110 = new_C108(); d_871 = new_D156(); if (dispatch_I_test_I_foo127(b_159) != 2) { testFail371("b"); } else { }; if (dispatch_I_test_I_foo127(c_110) != 3) { testFail371("c"); } else { }; if (dispatch_I_test_I_foo127(d_871) != 5) { testFail371("d"); } else { }; testSuccess810(); } IS_NATIVE function testFail371(string s134) { } IS_NATIVE function testSuccess810() { } function new_B465() returns integer { local integer this595 local integer this111 if (I_firstFree_200 == 0) { if (I_maxIndex_192 < 32768) { I_maxIndex_192 = (I_maxIndex_192 + 1); this_111 = I_maxIndex_192; I_typeId_166[this_111] = 2; } else { error136("Out of memory: Could not create B."); this_111 = 0; }; } else { I_firstFree_200 = (I_firstFree_200 - 1); this_111 = I_nextFree_665[I_firstFree_200]; I_typeId_166[this_111] = 2; }; this_595 = this_111; return this_595; } function new_C108() returns integer { local integer this502 local integer this163 if (I_firstFree_200 == 0) { if (I_maxIndex_192 < 32768) { I_maxIndex_192 = (I_maxIndex_192 + 1); this_163 = I_maxIndex_192; I_typeId_166[this_163] = 3; } else { error136("Out of memory: Could not create C."); this_163 = 0; }; } else { I_firstFree_200 = (I_firstFree_200 - 1); this_163 = I_nextFree_665[I_firstFree_200]; I_typeId_166[this_163] = 3; }; this_502 = this_163; return this_502; } function new_D156() returns integer { local integer this827 local integer this112 if (I_firstFree_200 == 0) { if (I_maxIndex_192 < 32768) { I_maxIndex_192 = (I_maxIndex_192 + 1); this_112 = I_maxIndex_192; I_typeId_166[this_112] = 4; } else { error136("Out of memory: Could not create D."); this_112 = 0; }; } else { I_firstFree_200 = (I_firstFree_200 - 1); this_112 = I_nextFree_665[I_firstFree_200]; I_typeId_166[this_112] = 4; }; this_827 = this_112; return this_827; } function error136(string msg571) { $debugPrint152((msg_571 + (" " + #getStackTrace()))); } function dispatch_I_test_I_foo127(integer this121) returns integer { local integer test_I_foo_result158 if (I_typeId_166[this_121] == 0) { if (this_121 == 0) { error136("Nullpointer exception when calling I.foo"); } else { error136("Called I.foo on invalid object."); }; } else { }; if (I_typeId_166[this_121] <= 2) { if (I_typeId_166[this_121] <= 1) { test_I_foo_result_158 = 5; } else { test_I_foo_result_158 = 2; }; } else { if (I_typeId_166[this_121] <= 3) { test_I_foo_result_158 = 3; } else { test_I_foo_result_158 = 5; }; }; return test_I_foo_result_158; }