array test_ar699 array I_nextFree109 integer I_firstFree617 integer I_maxIndex242 array I_typeId173 integer I_firstFree617 = 0 integer I_maxIndex242 = 0 function initGlobals789() { } function main193() { initGlobals789(); init_test591(); } function config911() { } function init_test591() { local integer temp148 test_ar_699[5] = new_B133(); test_ar_699[6] = new_C910(); temp_148 = test_ar_699[6]; test_ar_699[6] = test_ar_699[5]; test_ar_699[5] = temp_148; if ((dispatch_I_test_I_foo148(test_ar_699[5]) == 3) and (dispatch_I_test_I_foo148(test_ar_699[6]) == 2)) { testSuccess205(); } else { }; } IS_NATIVE function testSuccess205() { } function B_foo778(integer this952) returns integer { return 2; } function B_init834(integer this284) { } function new_B133() returns integer { local integer this146 this_146 = alloc_B171(); construct_B158(this_146); return this_146; } function construct_B158(integer this189) { B_init834(this_189); } function C_foo783(integer this557) returns integer { return 3; } function C_init185(integer this106) { } function new_C910() returns integer { local integer this136 this_136 = alloc_C261(); construct_C286(this_136); return this_136; } function construct_C286(integer this951) { C_init185(this_951); } function alloc_B171() returns integer { local integer this182 if (I_firstFree_617 == 0) { if (I_maxIndex_242 < 32768) { I_maxIndex_242 = (I_maxIndex_242 + 1); this_182 = I_maxIndex_242; I_typeId_173[this_182] = 2; } else { error164("Out of memory: Could not create B."); this_182 = 0; }; } else { I_firstFree_617 = (I_firstFree_617 - 1); this_182 = I_nextFree_109[I_firstFree_617]; I_typeId_173[this_182] = 2; }; return this_182; } function error164(string msg870) { $debugPrint104((msg_870 + (" " + #getStackTrace()))); } function alloc_C261() returns integer { local integer this116 if (I_firstFree_617 == 0) { if (I_maxIndex_242 < 32768) { I_maxIndex_242 = (I_maxIndex_242 + 1); this_116 = I_maxIndex_242; I_typeId_173[this_116] = 3; } else { error164("Out of memory: Could not create C."); this_116 = 0; }; } else { I_firstFree_617 = (I_firstFree_617 - 1); this_116 = I_nextFree_109[I_firstFree_617]; I_typeId_173[this_116] = 3; }; return this_116; } function dispatch_I_test_I_foo148(integer this152) returns integer { if (I_typeId_173[this_152] == 0) { if (this_152 == 0) { error164("Nullpointer exception when calling I.foo"); } else { error164("Called I.foo on invalid object."); }; } else { }; if (I_typeId_173[this_152] <= 2) { this_152 = B_foo778(this_152); } else { this_152 = C_foo783(this_152); }; return this_152; }