array I_nextFree895 integer I_firstFree263 integer I_maxIndex277 array I_typeId322 integer I_firstFree263 = 0 integer I_maxIndex277 = 0 function initGlobals140() { I_firstFree_263 = 0; I_maxIndex_277 = 0; } function main196() { initGlobals140(); init_test313(); } function config196() { } function init_test313() { local integer b151 local integer c111 local integer d160 b_151 = new_B187(); c_111 = new_C559(); d_160 = new_D208(); if (dispatch_I_test_I_foo417(b_151) != 2) { testFail116("b"); } else { }; if (dispatch_I_test_I_foo417(c_111) != 3) { testFail116("c"); } else { }; if (dispatch_I_test_I_foo417(d_160) != 5) { testFail116("d"); } else { }; testSuccess186(); } IS_NATIVE function testFail116(string s613) { } IS_NATIVE function testSuccess186() { } function B_foo686(integer this693) returns integer { return 2; } function B_init125(integer this313) { } function new_B187() returns integer { local integer this141 this_141 = alloc_B766(); construct_B680(this_141); return this_141; } function construct_B680(integer this481) { B_init125(this_481); } function C_foo138(integer this268) returns integer { return 3; } function C_init944(integer this409) { } function new_C559() returns integer { local integer this185 this_185 = alloc_C139(); construct_C116(this_185); return this_185; } function construct_C116(integer this174) { C_init944(this_174); } function D_init475(integer this613) { } function new_D208() returns integer { local integer this190 this_190 = alloc_D144(); construct_D128(this_190); return this_190; } function construct_D128(integer this464) { D_init475(this_464); } function I_foo540(integer this750) returns integer { return 5; } function alloc_B766() returns integer { local integer this177 if (I_firstFree_263 == 0) { if (I_maxIndex_277 < 32768) { I_maxIndex_277 = (I_maxIndex_277 + 1); this_177 = I_maxIndex_277; I_typeId_322[this_177] = 2; } else { error819("Out of memory: Could not create B."); this_177 = 0; }; } else { I_firstFree_263 = (I_firstFree_263 - 1); this_177 = I_nextFree_895[I_firstFree_263]; I_typeId_322[this_177] = 2; }; return this_177; } function error819(string msg141) { $debugPrint231((msg_141 + (" " + #getStackTrace()))); } function alloc_C139() returns integer { local integer this650 if (I_firstFree_263 == 0) { if (I_maxIndex_277 < 32768) { I_maxIndex_277 = (I_maxIndex_277 + 1); this_650 = I_maxIndex_277; I_typeId_322[this_650] = 3; } else { error819("Out of memory: Could not create C."); this_650 = 0; }; } else { I_firstFree_263 = (I_firstFree_263 - 1); this_650 = I_nextFree_895[I_firstFree_263]; I_typeId_322[this_650] = 3; }; return this_650; } function alloc_D144() returns integer { local integer this897 if (I_firstFree_263 == 0) { if (I_maxIndex_277 < 32768) { I_maxIndex_277 = (I_maxIndex_277 + 1); this_897 = I_maxIndex_277; I_typeId_322[this_897] = 4; } else { error819("Out of memory: Could not create D."); this_897 = 0; }; } else { I_firstFree_263 = (I_firstFree_263 - 1); this_897 = I_nextFree_895[I_firstFree_263]; I_typeId_322[this_897] = 4; }; return this_897; } function dispatch_I_test_I_foo417(integer this985) returns integer { local integer test_I_foo_result789 if (I_typeId_322[this_985] == 0) { if (this_985 == 0) { error819("Nullpointer exception when calling I.foo"); } else { error819("Called I.foo on invalid object."); }; } else { }; if (I_typeId_322[this_985] <= 2) { if (I_typeId_322[this_985] <= 1) { test_I_foo_result_789 = I_foo540(this_985); } else { test_I_foo_result_789 = B_foo686(this_985); }; } else { if (I_typeId_322[this_985] <= 3) { test_I_foo_result_789 = C_foo138(this_985); } else { test_I_foo_result_789 = I_foo540(this_985); }; }; return test_I_foo_result_789; }