array I_nextFree109 integer I_firstFree868 integer I_maxIndex128 array I_typeId133 integer I_firstFree868 = 0 integer I_maxIndex128 = 0 function initGlobals840() { I_firstFree_868 = 0; I_maxIndex_128 = 0; } function main113() { initGlobals840(); init_test201(); } function config169() { } function init_test201() { local integer b169 local integer c697 local integer d198 b_169 = new_B107(); c_697 = new_C139(); d_198 = new_D159(); if (dispatch_I_test_I_foo104(b_169) != 2) { testFail745("b"); } else { }; if (dispatch_I_test_I_foo104(c_697) != 3) { testFail745("c"); } else { }; if (dispatch_I_test_I_foo104(d_198) != 5) { testFail745("d"); } else { }; testSuccess823(); } IS_NATIVE function testFail745(string s935) { } IS_NATIVE function testSuccess823() { } function B_foo828(integer this133) returns integer { return 2; } function B_init186(integer this361) { } function new_B107() returns integer { local integer this160 this_160 = alloc_B347(); construct_B132(this_160); return this_160; } function construct_B132(integer this202) { B_init186(this_202); } function C_foo184(integer this136) returns integer { return 3; } function C_init917(integer this145) { } function new_C139() returns integer { local integer this375 this_375 = alloc_C205(); construct_C937(this_375); return this_375; } function construct_C937(integer this120) { C_init917(this_120); } function D_init760(integer this202) { } function new_D159() returns integer { local integer this800 this_800 = alloc_D543(); construct_D165(this_800); return this_800; } function construct_D165(integer this801) { D_init760(this_801); } function I_foo138(integer this907) returns integer { return 5; } function alloc_B347() returns integer { local integer this614 if (I_firstFree_868 == 0) { if (I_maxIndex_128 < 32768) { I_maxIndex_128 = (I_maxIndex_128 + 1); this_614 = I_maxIndex_128; I_typeId_133[this_614] = 2; } else { error101("Out of memory: Could not create B."); this_614 = 0; }; } else { I_firstFree_868 = (I_firstFree_868 - 1); this_614 = I_nextFree_109[I_firstFree_868]; I_typeId_133[this_614] = 2; }; return this_614; } function error101(string msg175) { $debugPrint523((msg_175 + (" " + #getStackTrace()))); } function alloc_C205() returns integer { local integer this117 if (I_firstFree_868 == 0) { if (I_maxIndex_128 < 32768) { I_maxIndex_128 = (I_maxIndex_128 + 1); this_117 = I_maxIndex_128; I_typeId_133[this_117] = 3; } else { error101("Out of memory: Could not create C."); this_117 = 0; }; } else { I_firstFree_868 = (I_firstFree_868 - 1); this_117 = I_nextFree_109[I_firstFree_868]; I_typeId_133[this_117] = 3; }; return this_117; } function alloc_D543() returns integer { local integer this148 if (I_firstFree_868 == 0) { if (I_maxIndex_128 < 32768) { I_maxIndex_128 = (I_maxIndex_128 + 1); this_148 = I_maxIndex_128; I_typeId_133[this_148] = 4; } else { error101("Out of memory: Could not create D."); this_148 = 0; }; } else { I_firstFree_868 = (I_firstFree_868 - 1); this_148 = I_nextFree_109[I_firstFree_868]; I_typeId_133[this_148] = 4; }; return this_148; } function dispatch_I_test_I_foo104(integer this105) returns integer { local integer test_I_foo_result180 if (I_typeId_133[this_105] == 0) { if (this_105 == 0) { error101("Nullpointer exception when calling I.foo"); } else { error101("Called I.foo on invalid object."); }; } else { }; if (I_typeId_133[this_105] <= 2) { if (I_typeId_133[this_105] <= 1) { test_I_foo_result_180 = I_foo138(this_105); } else { test_I_foo_result_180 = B_foo828(this_105); }; } else { if (I_typeId_133[this_105] <= 3) { test_I_foo_result_180 = C_foo184(this_105); } else { test_I_foo_result_180 = I_foo138(this_105); }; }; return test_I_foo_result_180; }