array F_nextFree982 integer F_firstFree846 integer F_maxIndex178 array F_typeId179 array Cell_nextFree519 integer Cell_firstFree141 integer Cell_maxIndex661 array Cell_typeId140 array Cell_elem197 integer F_firstFree846 = 0 integer F_maxIndex178 = 0 integer Cell_firstFree141 = 0 integer Cell_maxIndex661 = 0 function initGlobals117() { F_firstFree_846 = 0; F_maxIndex_178 = 0; Cell_firstFree_141 = 0; Cell_maxIndex_661 = 0; } function main940() { initGlobals117(); init_test100(); } function config198() { } function init_test100() { local integer a207 local integer b174 local integer clVar163 local integer temp165 a_207 = new_Cell165(5); temp_165 = a_207; clVar_163 = alloc_F_map_test133(); b_174 = dispatch_Cell_test_Cell_map773(temp_165, clVar_163); real_assertEquals203(realFromIndex128(dispatch_Cell_test_Cell_get507(b_174)), 50.); } function realToIndex245(real r166) returns integer { return R2I468((r_166 * 1000.)); } IS_NATIVE IS_EXTERN @extern function R2I468(real r187) returns integer { } function realFromIndex128(integer i178) returns real { return (i_178 / 1000.); } function real_assertEquals203(real this940, real expected273) { if (this_940 == expected_273) { testSuccess358(); } else { println203(R2S158(this_940)); }; } IS_NATIVE function testSuccess358() { } IS_NATIVE IS_EXTERN @extern function R2S158(real r744) returns string { } IS_NATIVE function println203(string s198) { } function apply_wrapper762(integer this135, any a627) returns any { return realToIndex245(apply_map_test786(this_135, a_627)); } function apply_map_test786(integer this179, integer i573) returns real { return (i_573 * 10.); } function Cell_get135(integer this214) returns any { return Cell_elem_197[this_214]; } function Cell_map117(integer this441, integer f626) returns integer { return new_Cell165(dispatch_F_test_F_apply101(f_626, Cell_elem_197[this_441])); } function new_Cell165(any t136) returns integer { local integer this148 this_148 = alloc_Cell171(); construct_Cell106(this_148, t_136); return this_148; } function Cell_init199(integer this606) { } function construct_Cell106(integer this146, any t105) { Cell_init199(this_146); Cell_elem_197[this_146] = t_105; } function alloc_F_map_test133() returns integer { local integer this210 if (F_firstFree_846 == 0) { if (F_maxIndex_178 < 32768) { F_maxIndex_178 = (F_maxIndex_178 + 1); this_210 = F_maxIndex_178; F_typeId_179[this_210] = 3; } else { error214("Out of memory: Could not create F_map_test."); this_210 = 0; }; } else { F_firstFree_846 = (F_firstFree_846 - 1); this_210 = F_nextFree_982[F_firstFree_846]; F_typeId_179[this_210] = 3; }; return this_210; } function error214(string msg584) { $debugPrint120((msg_584 + (" " + #getStackTrace()))); } function alloc_Cell171() returns integer { local integer this129 if (Cell_firstFree_141 == 0) { if (Cell_maxIndex_661 < 32768) { Cell_maxIndex_661 = (Cell_maxIndex_661 + 1); this_129 = Cell_maxIndex_661; Cell_typeId_140[this_129] = 1; } else { error214("Out of memory: Could not create Cell."); this_129 = 0; }; } else { Cell_firstFree_141 = (Cell_firstFree_141 - 1); this_129 = Cell_nextFree_519[Cell_firstFree_141]; Cell_typeId_140[this_129] = 1; }; return this_129; } function dispatch_Cell_test_Cell_get507(integer this126) returns any { local any test_Cell_get_result181 if (Cell_typeId_140[this_126] == 0) { if (this_126 == 0) { error214("Nullpointer exception when calling Cell.get"); } else { error214("Called Cell.get on invalid object."); }; } else { }; test_Cell_get_result_181 = Cell_get135(this_126); return test_Cell_get_result_181; } function dispatch_Cell_test_Cell_map773(integer this571, integer f882) returns integer { local integer test_Cell_map_result124 if (Cell_typeId_140[this_571] == 0) { if (this_571 == 0) { error214("Nullpointer exception when calling Cell.map"); } else { error214("Called Cell.map on invalid object."); }; } else { }; test_Cell_map_result_124 = Cell_map117(this_571, f_882); return test_Cell_map_result_124; } function dispatch_F_test_F_apply101(integer this711, any a194) returns any { local any test_F_apply_result117 if (F_typeId_179[this_711] == 0) { if (this_711 == 0) { error214("Nullpointer exception when calling F.apply"); } else { error214("Called F.apply on invalid object."); }; } else { }; test_F_apply_result_117 = apply_wrapper762(this_711, a_194); return test_F_apply_result_117; }