array I_nextFree147 integer I_firstFree161 integer I_maxIndex181 array I_typeId145 integer I_firstFree161 = 0 integer I_maxIndex181 = 0 function initGlobals135() { } function main879() { initGlobals135(); init_test195(); } function config157() { } function init_test195() { local integer b209 local integer c158 local integer d131 b_209 = new_B130(); c_158 = new_C174(); d_131 = new_D353(); if (dispatch_I_test_I_foo157(b_209) != 2) { testFail114("b"); } else { }; if (dispatch_I_test_I_foo157(c_158) != 3) { testFail114("c"); } else { }; if (dispatch_I_test_I_foo157(d_131) != 5) { testFail114("d"); } else { }; testSuccess605(); } IS_NATIVE function testFail114(string s162) { } IS_NATIVE function testSuccess605() { } function new_B130() returns integer { local integer this982 if (I_firstFree_161 == 0) { if (I_maxIndex_181 < 32768) { I_maxIndex_181 = (I_maxIndex_181 + 1); this_982 = I_maxIndex_181; I_typeId_145[this_982] = 2; } else { error104("Out of memory: Could not create B."); this_982 = 0; }; } else { I_firstFree_161 = (I_firstFree_161 - 1); this_982 = I_nextFree_147[I_firstFree_161]; I_typeId_145[this_982] = 2; }; return this_982; } function new_C174() returns integer { local integer this132 if (I_firstFree_161 == 0) { if (I_maxIndex_181 < 32768) { I_maxIndex_181 = (I_maxIndex_181 + 1); this_132 = I_maxIndex_181; I_typeId_145[this_132] = 3; } else { error104("Out of memory: Could not create C."); this_132 = 0; }; } else { I_firstFree_161 = (I_firstFree_161 - 1); this_132 = I_nextFree_147[I_firstFree_161]; I_typeId_145[this_132] = 3; }; return this_132; } function new_D353() returns integer { local integer this152 if (I_firstFree_161 == 0) { if (I_maxIndex_181 < 32768) { I_maxIndex_181 = (I_maxIndex_181 + 1); this_152 = I_maxIndex_181; I_typeId_145[this_152] = 4; } else { error104("Out of memory: Could not create D."); this_152 = 0; }; } else { I_firstFree_161 = (I_firstFree_161 - 1); this_152 = I_nextFree_147[I_firstFree_161]; I_typeId_145[this_152] = 4; }; return this_152; } function error104(string msg766) { $debugPrint132((msg_766 + (" " + #getStackTrace()))); } function dispatch_I_test_I_foo157(integer this202) returns integer { if (I_typeId_145[this_202] == 0) { if (this_202 == 0) { error104("Nullpointer exception when calling I.foo"); } else { error104("Called I.foo on invalid object."); }; } else { }; if (I_typeId_145[this_202] <= 2) { if (I_typeId_145[this_202] <= 1) { this_202 = 5; } else { this_202 = 2; }; } else { if (I_typeId_145[this_202] <= 3) { this_202 = 3; } else { this_202 = 5; }; }; return this_202; }