array I_nextFree126 integer I_firstFree111 integer I_maxIndex477 array I_typeId209 integer I_firstFree111 = 0 integer I_maxIndex477 = 0 function initGlobals574() { } function main116() { initGlobals574(); init_test134(); } function config939() { } function init_test134() { local integer b152 local integer c157 local integer d999 b_152 = new_B870(); c_157 = new_C482(); d_999 = new_D106(); if (dispatch_I_test_I_foo159(b_152) != 2) { testFail718("b"); } else { }; if (dispatch_I_test_I_foo159(c_157) != 3) { testFail718("c"); } else { }; if (dispatch_I_test_I_foo159(d_999) != 5) { testFail718("d"); } else { }; testSuccess507(); } IS_NATIVE function testFail718(string s119) { } IS_NATIVE function testSuccess507() { } function new_B870() returns integer { local integer this124 if (I_firstFree_111 == 0) { if (I_maxIndex_477 < 32768) { I_maxIndex_477 = (I_maxIndex_477 + 1); this_124 = I_maxIndex_477; I_typeId_209[this_124] = 2; } else { error190("Out of memory: Could not create B."); this_124 = 0; }; } else { I_firstFree_111 = (I_firstFree_111 - 1); this_124 = I_nextFree_126[I_firstFree_111]; I_typeId_209[this_124] = 2; }; return this_124; } function new_C482() returns integer { local integer this178 if (I_firstFree_111 == 0) { if (I_maxIndex_477 < 32768) { I_maxIndex_477 = (I_maxIndex_477 + 1); this_178 = I_maxIndex_477; I_typeId_209[this_178] = 3; } else { error190("Out of memory: Could not create C."); this_178 = 0; }; } else { I_firstFree_111 = (I_firstFree_111 - 1); this_178 = I_nextFree_126[I_firstFree_111]; I_typeId_209[this_178] = 3; }; return this_178; } function new_D106() returns integer { local integer this196 if (I_firstFree_111 == 0) { if (I_maxIndex_477 < 32768) { I_maxIndex_477 = (I_maxIndex_477 + 1); this_196 = I_maxIndex_477; I_typeId_209[this_196] = 4; } else { error190("Out of memory: Could not create D."); this_196 = 0; }; } else { I_firstFree_111 = (I_firstFree_111 - 1); this_196 = I_nextFree_126[I_firstFree_111]; I_typeId_209[this_196] = 4; }; return this_196; } function error190(string msg213) { $debugPrint156((msg_213 + (" " + #getStackTrace()))); } function dispatch_I_test_I_foo159(integer this188) returns integer { if (I_typeId_209[this_188] == 0) { if (this_188 == 0) { error190("Nullpointer exception when calling I.foo"); } else { error190("Called I.foo on invalid object."); }; } else { }; if (I_typeId_209[this_188] <= 2) { if (I_typeId_209[this_188] <= 1) { this_188 = 5; } else { this_188 = 2; }; } else { if (I_typeId_209[this_188] <= 3) { this_188 = 3; } else { this_188 = 5; }; }; return this_188; }