array I_nextFree828 integer I_firstFree136 integer I_maxIndex128 array I_typeId189 integer I_firstFree136 = 0 integer I_maxIndex128 = 0 function initGlobals367() { I_firstFree_136 = 0; I_maxIndex_128 = 0; } function main110() { initGlobals367(); init_test201(); } function config114() { } function init_test201() { local integer i1351 local integer i2786 i1_351 = new_B276(); i2_786 = new_C156(); if ((dispatch_I_test_I_foo194(i1_351) == 2) and (dispatch_I_test_I_foo194(i2_786) == 3)) { testSuccess997(); } else { }; } IS_NATIVE function testSuccess997() { } function B_foo900(integer this113) returns integer { return 2; } function B_init249(integer this721) { } function new_B276() returns integer { local integer this161 this_161 = alloc_B261(); construct_B237(this_161); return this_161; } function construct_B237(integer this180) { B_init249(this_180); } function C_foo150(integer this114) returns integer { return 3; } function C_init211(integer this291) { } function new_C156() returns integer { local integer this145 this_145 = alloc_C113(); construct_C155(this_145); return this_145; } function construct_C155(integer this208) { C_init211(this_208); } function alloc_B261() returns integer { local integer this660 if (I_firstFree_136 == 0) { if (I_maxIndex_128 < 32768) { I_maxIndex_128 = (I_maxIndex_128 + 1); this_660 = I_maxIndex_128; I_typeId_189[this_660] = 2; } else { error211("Out of memory: Could not create B."); this_660 = 0; }; } else { I_firstFree_136 = (I_firstFree_136 - 1); this_660 = I_nextFree_828[I_firstFree_136]; I_typeId_189[this_660] = 2; }; return this_660; } function error211(string msg175) { $debugPrint203((msg_175 + (" " + #getStackTrace()))); } function alloc_C113() returns integer { local integer this275 if (I_firstFree_136 == 0) { if (I_maxIndex_128 < 32768) { I_maxIndex_128 = (I_maxIndex_128 + 1); this_275 = I_maxIndex_128; I_typeId_189[this_275] = 3; } else { error211("Out of memory: Could not create C."); this_275 = 0; }; } else { I_firstFree_136 = (I_firstFree_136 - 1); this_275 = I_nextFree_828[I_firstFree_136]; I_typeId_189[this_275] = 3; }; return this_275; } function dispatch_I_test_I_foo194(integer this180) returns integer { local integer test_I_foo_result196 if (I_typeId_189[this_180] == 0) { if (this_180 == 0) { error211("Nullpointer exception when calling I.foo"); } else { error211("Called I.foo on invalid object."); }; } else { }; if (I_typeId_189[this_180] <= 2) { test_I_foo_result_196 = B_foo900(this_180); } else { test_I_foo_result_196 = C_foo150(this_180); }; return test_I_foo_result_196; }