array I_nextFree200 integer I_firstFree613 integer I_maxIndex160 array I_typeId697 integer I_firstFree613 = 0 integer I_maxIndex160 = 0 function initGlobals615() { } function main156() { initGlobals615(); init_test112(); } function config549() { } function init_test112() { local integer b577 local integer c851 local integer d116 b_577 = new_B103(); c_851 = new_C867(); d_116 = new_D100(); if (dispatch_I_test_I_foo480(b_577) != 2) { testFail387("b"); } else { }; if (dispatch_I_test_I_foo480(c_851) != 3) { testFail387("c"); } else { }; if (dispatch_I_test_I_foo480(d_116) != 5) { testFail387("d"); } else { }; testSuccess122(); } IS_NATIVE function testFail387(string s213) { } IS_NATIVE function testSuccess122() { } function B_foo165(integer this156) returns integer { return 2; } function B_init549(integer this201) { } function new_B103() returns integer { local integer this143 this_143 = alloc_B188(); construct_B608(this_143); return this_143; } function construct_B608(integer this501) { B_init549(this_501); } function C_foo902(integer this151) returns integer { return 3; } function C_init464(integer this171) { } function new_C867() returns integer { local integer this129 this_129 = alloc_C790(); construct_C127(this_129); return this_129; } function construct_C127(integer this437) { C_init464(this_437); } function D_init764(integer this142) { } function new_D100() returns integer { local integer this188 this_188 = alloc_D733(); construct_D101(this_188); return this_188; } function construct_D101(integer this482) { D_init764(this_482); } function I_foo261(integer this921) returns integer { return 5; } function alloc_B188() returns integer { local integer this651 if (I_firstFree_613 == 0) { if (I_maxIndex_160 < 32768) { I_maxIndex_160 = (I_maxIndex_160 + 1); this_651 = I_maxIndex_160; I_typeId_697[this_651] = 2; } else { error849("Out of memory: Could not create B."); this_651 = 0; }; } else { I_firstFree_613 = (I_firstFree_613 - 1); this_651 = I_nextFree_200[I_firstFree_613]; I_typeId_697[this_651] = 2; }; return this_651; } function error849(string msg307) { $debugPrint657((msg_307 + (" " + #getStackTrace()))); } function alloc_C790() returns integer { local integer this816 if (I_firstFree_613 == 0) { if (I_maxIndex_160 < 32768) { I_maxIndex_160 = (I_maxIndex_160 + 1); this_816 = I_maxIndex_160; I_typeId_697[this_816] = 3; } else { error849("Out of memory: Could not create C."); this_816 = 0; }; } else { I_firstFree_613 = (I_firstFree_613 - 1); this_816 = I_nextFree_200[I_firstFree_613]; I_typeId_697[this_816] = 3; }; return this_816; } function alloc_D733() returns integer { local integer this765 if (I_firstFree_613 == 0) { if (I_maxIndex_160 < 32768) { I_maxIndex_160 = (I_maxIndex_160 + 1); this_765 = I_maxIndex_160; I_typeId_697[this_765] = 4; } else { error849("Out of memory: Could not create D."); this_765 = 0; }; } else { I_firstFree_613 = (I_firstFree_613 - 1); this_765 = I_nextFree_200[I_firstFree_613]; I_typeId_697[this_765] = 4; }; return this_765; } function dispatch_I_test_I_foo480(integer this218) returns integer { if (I_typeId_697[this_218] == 0) { if (this_218 == 0) { error849("Nullpointer exception when calling I.foo"); } else { error849("Called I.foo on invalid object."); }; } else { }; if (I_typeId_697[this_218] <= 2) { if (I_typeId_697[this_218] <= 1) { this_218 = I_foo261(this_218); } else { this_218 = B_foo165(this_218); }; } else { if (I_typeId_697[this_218] <= 3) { this_218 = C_foo902(this_218); } else { this_218 = I_foo261(this_218); }; }; return this_218; }