array SimpleFunc_nextFree610 integer SimpleFunc_firstFree619 integer SimpleFunc_maxIndex206 array SimpleFunc_typeId150 integer SimpleFunc_firstFree619 = 0 integer SimpleFunc_maxIndex206 = 0 function initGlobals138() { SimpleFunc_firstFree_619 = 0; SimpleFunc_maxIndex_206 = 0; } function main669() { initGlobals138(); init_test226(); } function config154() { } function init_test226() { local integer f142 local integer clVar912 local integer g613 clVar_912 = alloc_SimpleFunc_test185(); f_142 = clVar_912; g_613 = new_Test510(); if ((dispatch_SimpleFunc_test_SimpleFunc_apply420(f_142, 3, 4) == 7) and (dispatch_SimpleFunc_test_SimpleFunc_apply420(g_613, 3, 4) == 12)) { testSuccess402(); } else { }; } IS_NATIVE function testSuccess402() { } function apply_test106(integer this468, integer x169, integer y833) returns integer { return (x_169 + y_833); } function Test_apply193(integer this911, integer x163, integer y109) returns integer { return (x_163 * y_109); } function Test_init801(integer this909) { } function new_Test510() returns integer { local integer this199 this_199 = alloc_Test110(); construct_Test205(this_199); return this_199; } function construct_Test205(integer this943) { Test_init801(this_943); } function alloc_SimpleFunc_test185() returns integer { local integer this148 if (SimpleFunc_firstFree_619 == 0) { if (SimpleFunc_maxIndex_206 < 32768) { SimpleFunc_maxIndex_206 = (SimpleFunc_maxIndex_206 + 1); this_148 = SimpleFunc_maxIndex_206; SimpleFunc_typeId_150[this_148] = 2; } else { error195("Out of memory: Could not create SimpleFunc_test."); this_148 = 0; }; } else { SimpleFunc_firstFree_619 = (SimpleFunc_firstFree_619 - 1); this_148 = SimpleFunc_nextFree_610[SimpleFunc_firstFree_619]; SimpleFunc_typeId_150[this_148] = 2; }; return this_148; } function error195(string msg821) { $debugPrint144((msg_821 + (" " + #getStackTrace()))); } function alloc_Test110() returns integer { local integer this168 if (SimpleFunc_firstFree_619 == 0) { if (SimpleFunc_maxIndex_206 < 32768) { SimpleFunc_maxIndex_206 = (SimpleFunc_maxIndex_206 + 1); this_168 = SimpleFunc_maxIndex_206; SimpleFunc_typeId_150[this_168] = 3; } else { error195("Out of memory: Could not create Test."); this_168 = 0; }; } else { SimpleFunc_firstFree_619 = (SimpleFunc_firstFree_619 - 1); this_168 = SimpleFunc_nextFree_610[SimpleFunc_firstFree_619]; SimpleFunc_typeId_150[this_168] = 3; }; return this_168; } function dispatch_SimpleFunc_test_SimpleFunc_apply420(integer this531, integer x538, integer y793) returns integer { local integer test_SimpleFunc_apply_result149 if (SimpleFunc_typeId_150[this_531] == 0) { if (this_531 == 0) { error195("Nullpointer exception when calling SimpleFunc.apply"); } else { error195("Called SimpleFunc.apply on invalid object."); }; } else { }; if (SimpleFunc_typeId_150[this_531] <= 2) { test_SimpleFunc_apply_result_149 = apply_test106(this_531, x_538, y_793); } else { test_SimpleFunc_apply_result_149 = Test_apply193(this_531, x_538, y_793); }; return test_SimpleFunc_apply_result_149; }