array F_nextFree307 integer F_firstFree457 integer F_maxIndex229 array F_typeId141 array Cell_nextFree107 integer Cell_firstFree686 integer Cell_maxIndex142 array Cell_typeId243 array Cell_elem190 integer F_firstFree457 = 0 integer F_maxIndex229 = 0 integer Cell_firstFree686 = 0 integer Cell_maxIndex142 = 0 function initGlobals835() { F_firstFree_457 = 0; F_maxIndex_229 = 0; Cell_firstFree_686 = 0; Cell_maxIndex_142 = 0; } function main496() { initGlobals835(); init_test156(); } function config167() { } function init_test156() { local integer a107 local integer b175 local integer clVar206 local integer temp129 a_107 = new_Cell146(5); temp_129 = a_107; clVar_206 = alloc_F_map_test820(); b_175 = dispatch_Cell_test_Cell_map134(temp_129, clVar_206); real_assertEquals153(realFromIndex165(dispatch_Cell_test_Cell_get187(b_175)), 50.); } function realToIndex221(real r116) returns integer { return R2I761((r_116 * 1000.)); } IS_NATIVE IS_EXTERN @extern function R2I761(real r166) returns integer { } function realFromIndex165(integer i212) returns real { return (i_212 / 1000.); } function real_assertEquals153(real this534, real expected844) { if (this_534 == expected_844) { testSuccess834(); } else { println131(R2S819(this_534)); }; } IS_NATIVE function testSuccess834() { } IS_NATIVE IS_EXTERN @extern function R2S819(real r137) returns string { } IS_NATIVE function println131(string s880) { } function apply_wrapper941(integer this928, any a684) returns any { return realToIndex221(apply_map_test116(this_928, a_684)); } function apply_map_test116(integer this172, integer i188) returns real { return (i_188 * 10.); } function Cell_get991(integer this551) returns any { return Cell_elem_190[this_551]; } function Cell_map881(integer this197, integer f106) returns integer { return new_Cell146(dispatch_F_test_F_apply803(f_106, Cell_elem_190[this_197])); } function new_Cell146(any t148) returns integer { local integer this197 this_197 = alloc_Cell300(); construct_Cell775(this_197, t_148); return this_197; } function Cell_init476(integer this217) { } function construct_Cell775(integer this102, any t155) { Cell_init476(this_102); Cell_elem_190[this_102] = t_155; } function alloc_F_map_test820() returns integer { local integer this359 if (F_firstFree_457 == 0) { if (F_maxIndex_229 < 32768) { F_maxIndex_229 = (F_maxIndex_229 + 1); this_359 = F_maxIndex_229; F_typeId_141[this_359] = 3; } else { error169("Out of memory: Could not create F_map_test."); this_359 = 0; }; } else { F_firstFree_457 = (F_firstFree_457 - 1); this_359 = F_nextFree_307[F_firstFree_457]; F_typeId_141[this_359] = 3; }; return this_359; } function error169(string msg180) { $debugPrint206((msg_180 + (" " + #getStackTrace()))); } function alloc_Cell300() returns integer { local integer this182 if (Cell_firstFree_686 == 0) { if (Cell_maxIndex_142 < 32768) { Cell_maxIndex_142 = (Cell_maxIndex_142 + 1); this_182 = Cell_maxIndex_142; Cell_typeId_243[this_182] = 1; } else { error169("Out of memory: Could not create Cell."); this_182 = 0; }; } else { Cell_firstFree_686 = (Cell_firstFree_686 - 1); this_182 = Cell_nextFree_107[Cell_firstFree_686]; Cell_typeId_243[this_182] = 1; }; return this_182; } function dispatch_Cell_test_Cell_get187(integer this154) returns any { local any test_Cell_get_result105 if (Cell_typeId_243[this_154] == 0) { if (this_154 == 0) { error169("Nullpointer exception when calling Cell.get"); } else { error169("Called Cell.get on invalid object."); }; } else { }; test_Cell_get_result_105 = Cell_get991(this_154); return test_Cell_get_result_105; } function dispatch_Cell_test_Cell_map134(integer this227, integer f125) returns integer { local integer test_Cell_map_result174 if (Cell_typeId_243[this_227] == 0) { if (this_227 == 0) { error169("Nullpointer exception when calling Cell.map"); } else { error169("Called Cell.map on invalid object."); }; } else { }; test_Cell_map_result_174 = Cell_map881(this_227, f_125); return test_Cell_map_result_174; } function dispatch_F_test_F_apply803(integer this625, any a108) returns any { local any test_F_apply_result190 if (F_typeId_141[this_625] == 0) { if (this_625 == 0) { error169("Nullpointer exception when calling F.apply"); } else { error169("Called F.apply on invalid object."); }; } else { }; test_F_apply_result_190 = apply_wrapper941(this_625, a_108); return test_F_apply_result_190; }