array C_nextFree651 integer C_firstFree188 integer C_maxIndex117 array C_typeId124 integer C_firstFree188 = 0 integer C_maxIndex117 = 0 function initGlobals201() { } function main112() { initGlobals201(); init_test247(); } function config291() { } function init_test247() { local integer c161 local integer d543 c_161 = new_C144(); d_543 = new_D395(); if (((dispatch_C_test_C_foo_2606(c_161, 1, 2) == 3) and (dispatch_C_test_C_foo_2606(d_543, 1, 2) == 2)) and (dispatch_C_test_C_foo_4527(d_543, 1, 2, 3, 4) == 24)) { testSuccess168(); } else { }; } IS_NATIVE function testSuccess168() { } function new_C144() returns integer { local integer this102 local integer this109 if (C_firstFree_188 == 0) { if (C_maxIndex_117 < 32768) { C_maxIndex_117 = (C_maxIndex_117 + 1); this_109 = C_maxIndex_117; C_typeId_124[this_109] = 1; } else { error155("Out of memory: Could not create C."); this_109 = 0; }; } else { C_firstFree_188 = (C_firstFree_188 - 1); this_109 = C_nextFree_651[C_firstFree_188]; C_typeId_124[this_109] = 1; }; this_102 = this_109; return this_102; } function new_D395() returns integer { local integer this211 local integer this898 if (C_firstFree_188 == 0) { if (C_maxIndex_117 < 32768) { C_maxIndex_117 = (C_maxIndex_117 + 1); this_898 = C_maxIndex_117; C_typeId_124[this_898] = 2; } else { error155("Out of memory: Could not create D."); this_898 = 0; }; } else { C_firstFree_188 = (C_firstFree_188 - 1); this_898 = C_nextFree_651[C_firstFree_188]; C_typeId_124[this_898] = 2; }; this_211 = this_898; return this_211; } function error155(string msg433) { $debugPrint570((msg_433 + (" " + #getStackTrace()))); } function dispatch_C_test_C_foo_2606(integer this208, integer xs_0121, integer xs_1102) returns integer { local integer test_C_foo_result167 local integer xs_0937 local integer xs_1570 local integer sum785 local integer xs_0655 local integer xs_1113 local integer prod165 if (C_typeId_124[this_208] == 0) { if (this_208 == 0) { error155("Nullpointer exception when calling C.foo"); } else { error155("Called C.foo on invalid object."); }; } else { }; if (C_typeId_124[this_208] <= 1) { xs_0_937 = xs_0_121; xs_1_570 = xs_1_102; sum_785 = 0; sum_785 = (sum_785 + xs_0_937); sum_785 = (sum_785 + xs_1_570); test_C_foo_result_167 = sum_785; } else { xs_0_655 = xs_0_121; xs_1_113 = xs_1_102; prod_165 = 1; prod_165 = (prod_165 * xs_0_655); prod_165 = (prod_165 * xs_1_113); test_C_foo_result_167 = prod_165; }; return test_C_foo_result_167; } function dispatch_C_test_C_foo_4527(integer this587, integer xs_0105, integer xs_1152, integer xs_2759, integer xs_3148) returns integer { local integer test_C_foo_result776 local integer xs_0191 local integer xs_1928 local integer xs_2141 local integer xs_3732 local integer sum108 local integer xs_0182 local integer xs_1162 local integer xs_2431 local integer xs_3168 local integer prod125 if (C_typeId_124[this_587] == 0) { if (this_587 == 0) { error155("Nullpointer exception when calling C.foo"); } else { error155("Called C.foo on invalid object."); }; } else { }; if (C_typeId_124[this_587] <= 1) { xs_0_191 = xs_0_105; xs_1_928 = xs_1_152; xs_2_141 = xs_2_759; xs_3_732 = xs_3_148; sum_108 = 0; sum_108 = (sum_108 + xs_0_191); sum_108 = (sum_108 + xs_1_928); sum_108 = (sum_108 + xs_2_141); sum_108 = (sum_108 + xs_3_732); test_C_foo_result_776 = sum_108; } else { xs_0_182 = xs_0_105; xs_1_162 = xs_1_152; xs_2_431 = xs_2_759; xs_3_168 = xs_3_148; prod_125 = 1; prod_125 = (prod_125 * xs_0_182); prod_125 = (prod_125 * xs_1_162); prod_125 = (prod_125 * xs_2_431); prod_125 = (prod_125 * xs_3_168); test_C_foo_result_776 = prod_125; }; return test_C_foo_result_776; }