array C_nextFree440 integer C_firstFree844 integer C_maxIndex319 array C_typeId101 integer C_firstFree844 = 0 integer C_maxIndex319 = 0 function initGlobals185() { C_firstFree_844 = 0; C_maxIndex_319 = 0; } function main997() { initGlobals185(); init_test172(); } function config827() { } function init_test172() { local integer c459 local integer d384 c_459 = new_C158(); d_384 = new_D144(); if (((dispatch_C_test_C_foo_2443(c_459, 1, 2) == 3) and (dispatch_C_test_C_foo_2443(d_384, 1, 2) == 2)) and (dispatch_C_test_C_foo_4161(d_384, 1, 2, 3, 4) == 24)) { testSuccess187(); } else { }; } IS_NATIVE function testSuccess187() { } function C_init761(integer this882) { } function new_C158() returns integer { local integer this151 this_151 = alloc_C129(); construct_C154(this_151); return this_151; } function construct_C154(integer this954) { C_init761(this_954); } function D_init189(integer this160) { } function new_D144() returns integer { local integer this204 this_204 = alloc_D962(); construct_D832(this_204); return this_204; } function construct_D832(integer this128) { construct_C154(this_128); D_init189(this_128); } function alloc_C129() returns integer { local integer this129 if (C_firstFree_844 == 0) { if (C_maxIndex_319 < 32768) { C_maxIndex_319 = (C_maxIndex_319 + 1); this_129 = C_maxIndex_319; C_typeId_101[this_129] = 1; } else { error374("Out of memory: Could not create C."); this_129 = 0; }; } else { C_firstFree_844 = (C_firstFree_844 - 1); this_129 = C_nextFree_440[C_firstFree_844]; C_typeId_101[this_129] = 1; }; return this_129; } function error374(string msg139) { $debugPrint267((msg_139 + (" " + #getStackTrace()))); } function alloc_D962() returns integer { local integer this875 if (C_firstFree_844 == 0) { if (C_maxIndex_319 < 32768) { C_maxIndex_319 = (C_maxIndex_319 + 1); this_875 = C_maxIndex_319; C_typeId_101[this_875] = 2; } else { error374("Out of memory: Could not create D."); this_875 = 0; }; } else { C_firstFree_844 = (C_firstFree_844 - 1); this_875 = C_nextFree_440[C_firstFree_844]; C_typeId_101[this_875] = 2; }; return this_875; } function C_foo_2110(integer this161, integer xs_0117, integer xs_1291) returns integer { local integer sum337 sum_337 = 0; sum_337 = (sum_337 + xs_0_117); sum_337 = (sum_337 + xs_1_291); return sum_337; } function D_foo_2637(integer this198, integer xs_0121, integer xs_1126) returns integer { local integer prod614 prod_614 = 1; prod_614 = (prod_614 * xs_0_121); prod_614 = (prod_614 * xs_1_126); return prod_614; } function dispatch_C_test_C_foo_2443(integer this338, integer xs_0181, integer xs_1119) returns integer { local integer test_C_foo_result115 if (C_typeId_101[this_338] == 0) { if (this_338 == 0) { error374("Nullpointer exception when calling C.foo"); } else { error374("Called C.foo on invalid object."); }; } else { }; if (C_typeId_101[this_338] <= 1) { test_C_foo_result_115 = C_foo_2110(this_338, xs_0_181, xs_1_119); } else { test_C_foo_result_115 = D_foo_2637(this_338, xs_0_181, xs_1_119); }; return test_C_foo_result_115; } function C_foo_4187(integer this121, integer xs_0168, integer xs_1213, integer xs_2123, integer xs_3143) returns integer { local integer sum144 sum_144 = 0; sum_144 = (sum_144 + xs_0_168); sum_144 = (sum_144 + xs_1_213); sum_144 = (sum_144 + xs_2_123); sum_144 = (sum_144 + xs_3_143); return sum_144; } function D_foo_4187(integer this790, integer xs_0215, integer xs_1147, integer xs_2121, integer xs_3189) returns integer { local integer prod504 prod_504 = 1; prod_504 = (prod_504 * xs_0_215); prod_504 = (prod_504 * xs_1_147); prod_504 = (prod_504 * xs_2_121); prod_504 = (prod_504 * xs_3_189); return prod_504; } function dispatch_C_test_C_foo_4161(integer this175, integer xs_0923, integer xs_1130, integer xs_2893, integer xs_3187) returns integer { local integer test_C_foo_result111 if (C_typeId_101[this_175] == 0) { if (this_175 == 0) { error374("Nullpointer exception when calling C.foo"); } else { error374("Called C.foo on invalid object."); }; } else { }; if (C_typeId_101[this_175] <= 1) { test_C_foo_result_111 = C_foo_4187(this_175, xs_0_923, xs_1_130, xs_2_893, xs_3_187); } else { test_C_foo_result_111 = D_foo_4187(this_175, xs_0_923, xs_1_130, xs_2_893, xs_3_187); }; return test_C_foo_result_111; }