array I_nextFree678 integer I_firstFree194 integer I_maxIndex155 array I_typeId144 integer I_firstFree194 = 0 integer I_maxIndex155 = 0 function initGlobals182() { I_firstFree_194 = 0; I_maxIndex_155 = 0; } function main156() { initGlobals182(); init_test220(); } function config496() { } function init_test220() { local integer i1110 local integer i2143 i1_110 = new_B188(); i2_143 = new_C132(); if ((dispatch_I_test_I_foo126(i1_110) == 2) and (dispatch_I_test_I_foo126(i2_143) == 3)) { testSuccess173(); } else { }; } IS_NATIVE function testSuccess173() { } function B_foo208(integer this100) returns integer { return 2; } function B_init872(integer this290) { } function new_B188() returns integer { local integer this584 this_584 = alloc_B187(); construct_B442(this_584); return this_584; } function construct_B442(integer this516) { B_init872(this_516); } function C_foo188(integer this175) returns integer { return 3; } function C_init172(integer this310) { } function new_C132() returns integer { local integer this112 this_112 = alloc_C212(); construct_C109(this_112); return this_112; } function construct_C109(integer this134) { C_init172(this_134); } function alloc_B187() returns integer { local integer this215 if (I_firstFree_194 == 0) { if (I_maxIndex_155 < 32768) { I_maxIndex_155 = (I_maxIndex_155 + 1); this_215 = I_maxIndex_155; I_typeId_144[this_215] = 2; } else { error167("Out of memory: Could not create B."); this_215 = 0; }; } else { I_firstFree_194 = (I_firstFree_194 - 1); this_215 = I_nextFree_678[I_firstFree_194]; I_typeId_144[this_215] = 2; }; return this_215; } function error167(string msg106) { $debugPrint867((msg_106 + (" " + #getStackTrace()))); } function alloc_C212() returns integer { local integer this119 if (I_firstFree_194 == 0) { if (I_maxIndex_155 < 32768) { I_maxIndex_155 = (I_maxIndex_155 + 1); this_119 = I_maxIndex_155; I_typeId_144[this_119] = 3; } else { error167("Out of memory: Could not create C."); this_119 = 0; }; } else { I_firstFree_194 = (I_firstFree_194 - 1); this_119 = I_nextFree_678[I_firstFree_194]; I_typeId_144[this_119] = 3; }; return this_119; } function dispatch_I_test_I_foo126(integer this310) returns integer { local integer test_I_foo_result182 if (I_typeId_144[this_310] == 0) { if (this_310 == 0) { error167("Nullpointer exception when calling I.foo"); } else { error167("Called I.foo on invalid object."); }; } else { }; if (I_typeId_144[this_310] <= 2) { test_I_foo_result_182 = B_foo208(this_310); } else { test_I_foo_result_182 = C_foo188(this_310); }; return test_I_foo_result_182; }