array I_nextFree109 integer I_firstFree167 integer I_maxIndex101 array I_typeId138 integer I_firstFree167 = 0 integer I_maxIndex101 = 0 function initGlobals104() { I_firstFree_167 = 0; I_maxIndex_101 = 0; } function main217() { initGlobals104(); init_test996(); } function config503() { } function init_test996() { local integer b784 local integer c809 local integer d867 b_784 = new_B101(); c_809 = new_C153(); d_867 = new_D158(); if (((dispatch_B_test_B_foo786(b_784) == 2) and (dispatch_I_test_I_foo862(c_809) == 5)) and (dispatch_D_test_D_foo130(d_867) == 3)) { testSuccess160(); } else { }; } IS_NATIVE function testSuccess160() { } function B_foo177(integer this593) returns integer { return 2; } function B_init207(integer this130) { } function new_B101() returns integer { local integer this653 this_653 = alloc_B996(); construct_B461(this_653); return this_653; } function construct_B461(integer this840) { B_init207(this_840); } function C_init214(integer this770) { } function new_C153() returns integer { local integer this124 this_124 = alloc_C428(); construct_C228(this_124); return this_124; } function construct_C228(integer this314) { C_init214(this_314); } function D_foo106(integer this161) returns integer { return 3; } function D_init179(integer this420) { } function new_D158() returns integer { local integer this140 this_140 = alloc_D311(); construct_D151(this_140); return this_140; } function construct_D151(integer this152) { D_init179(this_152); } function I_foo149(integer this189) returns integer { return 5; } function alloc_B996() returns integer { local integer this882 if (I_firstFree_167 == 0) { if (I_maxIndex_101 < 32768) { I_maxIndex_101 = (I_maxIndex_101 + 1); this_882 = I_maxIndex_101; I_typeId_138[this_882] = 2; } else { error218("Out of memory: Could not create B."); this_882 = 0; }; } else { I_firstFree_167 = (I_firstFree_167 - 1); this_882 = I_nextFree_109[I_firstFree_167]; I_typeId_138[this_882] = 2; }; return this_882; } function error218(string msg266) { $debugPrint196((msg_266 + (" " + #getStackTrace()))); } function alloc_C428() returns integer { local integer this779 if (I_firstFree_167 == 0) { if (I_maxIndex_101 < 32768) { I_maxIndex_101 = (I_maxIndex_101 + 1); this_779 = I_maxIndex_101; I_typeId_138[this_779] = 3; } else { error218("Out of memory: Could not create C."); this_779 = 0; }; } else { I_firstFree_167 = (I_firstFree_167 - 1); this_779 = I_nextFree_109[I_firstFree_167]; I_typeId_138[this_779] = 3; }; return this_779; } function alloc_D311() returns integer { local integer this155 if (I_firstFree_167 == 0) { if (I_maxIndex_101 < 32768) { I_maxIndex_101 = (I_maxIndex_101 + 1); this_155 = I_maxIndex_101; I_typeId_138[this_155] = 4; } else { error218("Out of memory: Could not create D."); this_155 = 0; }; } else { I_firstFree_167 = (I_firstFree_167 - 1); this_155 = I_nextFree_109[I_firstFree_167]; I_typeId_138[this_155] = 4; }; return this_155; } function dispatch_B_test_B_foo786(integer this182) returns integer { local integer test_B_foo_result151 if (I_typeId_138[this_182] == 0) { if (this_182 == 0) { error218("Nullpointer exception when calling B.foo"); } else { error218("Called B.foo on invalid object."); }; } else { }; test_B_foo_result_151 = B_foo177(this_182); return test_B_foo_result_151; } function dispatch_D_test_D_foo130(integer this171) returns integer { local integer test_D_foo_result129 if (I_typeId_138[this_171] == 0) { if (this_171 == 0) { error218("Nullpointer exception when calling D.foo"); } else { error218("Called D.foo on invalid object."); }; } else { }; test_D_foo_result_129 = D_foo106(this_171); return test_D_foo_result_129; } function dispatch_I_test_I_foo862(integer this144) returns integer { local integer test_I_foo_result859 if (I_typeId_138[this_144] == 0) { if (this_144 == 0) { error218("Nullpointer exception when calling I.foo"); } else { error218("Called I.foo on invalid object."); }; } else { }; if (I_typeId_138[this_144] <= 2) { if (I_typeId_138[this_144] <= 1) { test_I_foo_result_859 = I_foo149(this_144); } else { test_I_foo_result_859 = B_foo177(this_144); }; } else { if (I_typeId_138[this_144] <= 3) { test_I_foo_result_859 = I_foo149(this_144); } else { test_I_foo_result_859 = D_foo106(this_144); }; }; return test_I_foo_result_859; }