array I_nextFree155 integer I_firstFree395 integer I_maxIndex944 array I_typeId590 integer I_firstFree395 = 0 integer I_maxIndex944 = 0 function initGlobals332() { } function main249() { initGlobals332(); init_test696(); } function config168() { } function init_test696() { local integer i1101 local integer i2736 i1_101 = new_B313(); i2_736 = new_C141(); if ((dispatch_I_test_I_foo134(i1_101) == 2) and (dispatch_I_test_I_foo134(i2_736) == 3)) { testSuccess261(); } else { }; } IS_NATIVE function testSuccess261() { } function new_B313() returns integer { local integer this836 if (I_firstFree_395 == 0) { if (I_maxIndex_944 < 32768) { I_maxIndex_944 = (I_maxIndex_944 + 1); this_836 = I_maxIndex_944; I_typeId_590[this_836] = 2; } else { error136("Out of memory: Could not create B."); this_836 = 0; }; } else { I_firstFree_395 = (I_firstFree_395 - 1); this_836 = I_nextFree_155[I_firstFree_395]; I_typeId_590[this_836] = 2; }; return this_836; } function new_C141() returns integer { local integer this150 if (I_firstFree_395 == 0) { if (I_maxIndex_944 < 32768) { I_maxIndex_944 = (I_maxIndex_944 + 1); this_150 = I_maxIndex_944; I_typeId_590[this_150] = 3; } else { error136("Out of memory: Could not create C."); this_150 = 0; }; } else { I_firstFree_395 = (I_firstFree_395 - 1); this_150 = I_nextFree_155[I_firstFree_395]; I_typeId_590[this_150] = 3; }; return this_150; } function error136(string msg146) { $debugPrint529((msg_146 + (" " + #getStackTrace()))); } function dispatch_I_test_I_foo134(integer this616) returns integer { if (I_typeId_590[this_616] == 0) { if (this_616 == 0) { error136("Nullpointer exception when calling I.foo"); } else { error136("Called I.foo on invalid object."); }; } else { }; if (I_typeId_590[this_616] <= 2) { this_616 = 2; } else { this_616 = 3; }; return this_616; }