array I_nextFree965 integer I_firstFree188 integer I_maxIndex158 array I_typeId627 integer I_firstFree188 = 0 integer I_maxIndex158 = 0 function initGlobals786() { I_firstFree_188 = 0; I_maxIndex_158 = 0; } function main126() { initGlobals786(); init_test108(); } function config873() { } function init_test108() { local integer b164 local integer c175 local integer d773 b_164 = new_B512(); c_175 = new_C728(); d_773 = new_D833(); if (((dispatch_B_test_B_foo125(b_164) == 2) and (dispatch_I_test_I_foo380(c_175) == 5)) and (dispatch_I_test_I_foo380(d_773) == 3)) { testSuccess157(); } else { }; } IS_NATIVE function testSuccess157() { } function B_foo160(integer this133) returns integer { return 2; } function B_init159(integer this820) { } function new_B512() returns integer { local integer this102 this_102 = alloc_B127(); construct_B269(this_102); return this_102; } function construct_B269(integer this132) { B_init159(this_132); } function C_init955(integer this192) { } function new_C728() returns integer { local integer this159 this_159 = alloc_C157(); construct_C159(this_159); return this_159; } function construct_C159(integer this166) { C_init955(this_166); } function D_bar498(integer this113) returns integer { return 3; } function D_init125(integer this160) { } function new_D833() returns integer { local integer this179 this_179 = alloc_D482(); construct_D113(this_179); return this_179; } function construct_D113(integer this815) { D_init125(this_815); } function I_foo375(integer this214) returns integer { return dispatch_I_test_I_bar553(this_214); } function I_bar843(integer this774) returns integer { return 5; } function alloc_B127() returns integer { local integer this737 if (I_firstFree_188 == 0) { if (I_maxIndex_158 < 32768) { I_maxIndex_158 = (I_maxIndex_158 + 1); this_737 = I_maxIndex_158; I_typeId_627[this_737] = 2; } else { error182("Out of memory: Could not create B."); this_737 = 0; }; } else { I_firstFree_188 = (I_firstFree_188 - 1); this_737 = I_nextFree_965[I_firstFree_188]; I_typeId_627[this_737] = 2; }; return this_737; } function error182(string msg117) { $debugPrint116((msg_117 + (" " + #getStackTrace()))); } function alloc_C157() returns integer { local integer this124 if (I_firstFree_188 == 0) { if (I_maxIndex_158 < 32768) { I_maxIndex_158 = (I_maxIndex_158 + 1); this_124 = I_maxIndex_158; I_typeId_627[this_124] = 3; } else { error182("Out of memory: Could not create C."); this_124 = 0; }; } else { I_firstFree_188 = (I_firstFree_188 - 1); this_124 = I_nextFree_965[I_firstFree_188]; I_typeId_627[this_124] = 3; }; return this_124; } function alloc_D482() returns integer { local integer this122 if (I_firstFree_188 == 0) { if (I_maxIndex_158 < 32768) { I_maxIndex_158 = (I_maxIndex_158 + 1); this_122 = I_maxIndex_158; I_typeId_627[this_122] = 4; } else { error182("Out of memory: Could not create D."); this_122 = 0; }; } else { I_firstFree_188 = (I_firstFree_188 - 1); this_122 = I_nextFree_965[I_firstFree_188]; I_typeId_627[this_122] = 4; }; return this_122; } function dispatch_B_test_B_foo125(integer this131) returns integer { local integer test_B_foo_result105 if (I_typeId_627[this_131] == 0) { if (this_131 == 0) { error182("Nullpointer exception when calling B.foo"); } else { error182("Called B.foo on invalid object."); }; } else { }; test_B_foo_result_105 = B_foo160(this_131); return test_B_foo_result_105; } function dispatch_I_test_I_foo380(integer this118) returns integer { local integer test_I_foo_result165 if (I_typeId_627[this_118] == 0) { if (this_118 == 0) { error182("Nullpointer exception when calling I.foo"); } else { error182("Called I.foo on invalid object."); }; } else { }; if (I_typeId_627[this_118] <= 2) { if (I_typeId_627[this_118] <= 1) { test_I_foo_result_165 = I_foo375(this_118); } else { test_I_foo_result_165 = B_foo160(this_118); }; } else { test_I_foo_result_165 = I_foo375(this_118); }; return test_I_foo_result_165; } function dispatch_I_test_I_bar553(integer this171) returns integer { local integer test_I_bar_result208 if (I_typeId_627[this_171] == 0) { if (this_171 == 0) { error182("Nullpointer exception when calling I.bar"); } else { error182("Called I.bar on invalid object."); }; } else { }; if (I_typeId_627[this_171] <= 3) { test_I_bar_result_208 = I_bar843(this_171); } else { test_I_bar_result_208 = D_bar498(this_171); }; return test_I_bar_result_208; }