array I_nextFree135 integer I_firstFree148 integer I_maxIndex213 array I_typeId376 integer I_firstFree148 = 0 integer I_maxIndex213 = 0 function initGlobals902() { } function main656() { initGlobals902(); init_test122(); } function config203() { } function init_test122() { local integer i1170 local integer i2150 i1_170 = new_B108(); i2_150 = new_C311(); if ((dispatch_I_test_I_foo108(i1_170) == 2) and (dispatch_I_test_I_foo108(i2_150) == 3)) { testSuccess214(); } else { }; } IS_NATIVE function testSuccess214() { } function B_foo331(integer this720) returns integer { return 2; } function B_init852(integer this684) { } function new_B108() returns integer { local integer this192 this_192 = alloc_B226(); construct_B218(this_192); return this_192; } function construct_B218(integer this215) { B_init852(this_215); } function C_foo244(integer this182) returns integer { return 3; } function C_init570(integer this213) { } function new_C311() returns integer { local integer this214 this_214 = alloc_C209(); construct_C147(this_214); return this_214; } function construct_C147(integer this128) { C_init570(this_128); } function alloc_B226() returns integer { local integer this645 if (I_firstFree_148 == 0) { if (I_maxIndex_213 < 32768) { I_maxIndex_213 = (I_maxIndex_213 + 1); this_645 = I_maxIndex_213; I_typeId_376[this_645] = 2; } else { error231("Out of memory: Could not create B."); this_645 = 0; }; } else { I_firstFree_148 = (I_firstFree_148 - 1); this_645 = I_nextFree_135[I_firstFree_148]; I_typeId_376[this_645] = 2; }; return this_645; } function error231(string msg113) { $debugPrint325((msg_113 + (" " + #getStackTrace()))); } function alloc_C209() returns integer { local integer this646 if (I_firstFree_148 == 0) { if (I_maxIndex_213 < 32768) { I_maxIndex_213 = (I_maxIndex_213 + 1); this_646 = I_maxIndex_213; I_typeId_376[this_646] = 3; } else { error231("Out of memory: Could not create C."); this_646 = 0; }; } else { I_firstFree_148 = (I_firstFree_148 - 1); this_646 = I_nextFree_135[I_firstFree_148]; I_typeId_376[this_646] = 3; }; return this_646; } function dispatch_I_test_I_foo108(integer this650) returns integer { if (I_typeId_376[this_650] == 0) { if (this_650 == 0) { error231("Nullpointer exception when calling I.foo"); } else { error231("Called I.foo on invalid object."); }; } else { }; if (I_typeId_376[this_650] <= 2) { this_650 = B_foo331(this_650); } else { this_650 = C_foo244(this_650); }; return this_650; }