array F_nextFree191 integer F_firstFree881 integer F_maxIndex398 array F_typeId123 array Cell_nextFree262 integer Cell_firstFree192 integer Cell_maxIndex203 array Cell_typeId107 array Cell_elem435 integer F_firstFree881 = 0 integer F_maxIndex398 = 0 integer Cell_firstFree192 = 0 integer Cell_maxIndex203 = 0 function initGlobals110() { F_firstFree_881 = 0; F_maxIndex_398 = 0; Cell_firstFree_192 = 0; Cell_maxIndex_203 = 0; } function main177() { initGlobals110(); init_test195(); } function config595() { } function init_test195() { local integer a548 local integer b144 local integer clVar183 local integer temp116 a_548 = new_Cell330(5); temp_116 = a_548; clVar_183 = alloc_F_map_test920(); b_144 = dispatch_Cell_test_Cell_map874(temp_116, clVar_183); real_assertEquals129(realFromIndex136(dispatch_Cell_test_Cell_get193(b_144)), 50.); } function realToIndex127(real r213) returns integer { return R2I133((r_213 * 1000.)); } IS_NATIVE IS_EXTERN @extern function R2I133(real r616) returns integer { } function realFromIndex136(integer i148) returns real { return (i_148 / 1000.); } function real_assertEquals129(real this659, real expected373) { if (this_659 == expected_373) { testSuccess987(); } else { println176(R2S576(this_659)); }; } IS_NATIVE function testSuccess987() { } IS_NATIVE IS_EXTERN @extern function R2S576(real r136) returns string { } IS_NATIVE function println176(string s531) { } function apply_wrapper831(integer this138, any a241) returns any { return realToIndex127(apply_map_test696(this_138, a_241)); } function apply_map_test696(integer this930, integer i418) returns real { return (i_418 * 10.); } function Cell_get161(integer this858) returns any { return Cell_elem_435[this_858]; } function Cell_map194(integer this319, integer f205) returns integer { return new_Cell330(dispatch_F_test_F_apply169(f_205, Cell_elem_435[this_319])); } function new_Cell330(any t110) returns integer { local integer this196 this_196 = alloc_Cell245(); construct_Cell593(this_196, t_110); return this_196; } function Cell_init129(integer this112) { } function construct_Cell593(integer this161, any t188) { Cell_init129(this_161); Cell_elem_435[this_161] = t_188; } function alloc_F_map_test920() returns integer { local integer this684 if (F_firstFree_881 == 0) { if (F_maxIndex_398 < 32768) { F_maxIndex_398 = (F_maxIndex_398 + 1); this_684 = F_maxIndex_398; F_typeId_123[this_684] = 3; } else { error179("Out of memory: Could not create F_map_test."); this_684 = 0; }; } else { F_firstFree_881 = (F_firstFree_881 - 1); this_684 = F_nextFree_191[F_firstFree_881]; F_typeId_123[this_684] = 3; }; return this_684; } function error179(string msg179) { $debugPrint977((msg_179 + (" " + #getStackTrace()))); } function alloc_Cell245() returns integer { local integer this114 if (Cell_firstFree_192 == 0) { if (Cell_maxIndex_203 < 32768) { Cell_maxIndex_203 = (Cell_maxIndex_203 + 1); this_114 = Cell_maxIndex_203; Cell_typeId_107[this_114] = 1; } else { error179("Out of memory: Could not create Cell."); this_114 = 0; }; } else { Cell_firstFree_192 = (Cell_firstFree_192 - 1); this_114 = Cell_nextFree_262[Cell_firstFree_192]; Cell_typeId_107[this_114] = 1; }; return this_114; } function dispatch_Cell_test_Cell_get193(integer this101) returns any { local any test_Cell_get_result111 if (Cell_typeId_107[this_101] == 0) { if (this_101 == 0) { error179("Nullpointer exception when calling Cell.get"); } else { error179("Called Cell.get on invalid object."); }; } else { }; test_Cell_get_result_111 = Cell_get161(this_101); return test_Cell_get_result_111; } function dispatch_Cell_test_Cell_map874(integer this133, integer f195) returns integer { local integer test_Cell_map_result193 if (Cell_typeId_107[this_133] == 0) { if (this_133 == 0) { error179("Nullpointer exception when calling Cell.map"); } else { error179("Called Cell.map on invalid object."); }; } else { }; test_Cell_map_result_193 = Cell_map194(this_133, f_195); return test_Cell_map_result_193; } function dispatch_F_test_F_apply169(integer this834, any a819) returns any { local any test_F_apply_result131 if (F_typeId_123[this_834] == 0) { if (this_834 == 0) { error179("Nullpointer exception when calling F.apply"); } else { error179("Called F.apply on invalid object."); }; } else { }; test_F_apply_result_131 = apply_wrapper831(this_834, a_819); return test_F_apply_result_131; }