array F_nextFree174 integer F_firstFree154 integer F_maxIndex105 array F_typeId461 array Cell_nextFree198 integer Cell_firstFree227 integer Cell_maxIndex125 array Cell_typeId625 array Cell_elem108 integer F_firstFree154 = 0 integer F_maxIndex105 = 0 integer Cell_firstFree227 = 0 integer Cell_maxIndex125 = 0 function initGlobals102() { } function main164() { initGlobals102(); init_test155(); } function config134() { } function init_test155() { real_assertEquals180(realFromIndex197(dispatch_Cell_test_Cell_get558(dispatch_Cell_test_Cell_map190(new_Cell656(5), alloc_F_map_test129()))), 50.); } function realToIndex217(real r141) returns integer { return R2I197((r_141 * 1000.)); } IS_NATIVE IS_EXTERN @extern function R2I197(real r107) returns integer { } function realFromIndex197(integer i243) returns real { return (i_243 / 1000.); } function real_assertEquals180(real this190, real expected134) { if (this_190 == expected_134) { testSuccess106(); } else { println148(R2S210(this_190)); }; } IS_NATIVE function testSuccess106() { } IS_NATIVE IS_EXTERN @extern function R2S210(real r820) returns string { } IS_NATIVE function println148(string s187) { } function apply_wrapper803(integer this300, any a315) returns any { return realToIndex217(apply_map_test197(this_300, a_315)); } function apply_map_test197(integer this324, integer i109) returns real { return (i_109 * 10.); } function Cell_get169(integer this206) returns any { return Cell_elem_108[this_206]; } function Cell_map180(integer this176, integer f110) returns integer { return new_Cell656(dispatch_F_test_F_apply742(f_110, Cell_elem_108[this_176])); } function new_Cell656(any t688) returns integer { local integer this156 this_156 = alloc_Cell129(); construct_Cell720(this_156, t_688); return this_156; } function Cell_init277(integer this106) { } function construct_Cell720(integer this212, any t761) { Cell_init277(this_212); Cell_elem_108[this_212] = t_761; } function alloc_F_map_test129() returns integer { local integer this204 if (F_firstFree_154 == 0) { if (F_maxIndex_105 < 32768) { F_maxIndex_105 = (F_maxIndex_105 + 1); this_204 = F_maxIndex_105; F_typeId_461[this_204] = 3; } else { error455("Out of memory: Could not create F_map_test."); this_204 = 0; }; } else { F_firstFree_154 = (F_firstFree_154 - 1); this_204 = F_nextFree_174[F_firstFree_154]; F_typeId_461[this_204] = 3; }; return this_204; } function error455(string msg124) { $debugPrint103((msg_124 + (" " + #getStackTrace()))); } function alloc_Cell129() returns integer { local integer this228 if (Cell_firstFree_227 == 0) { if (Cell_maxIndex_125 < 32768) { Cell_maxIndex_125 = (Cell_maxIndex_125 + 1); this_228 = Cell_maxIndex_125; Cell_typeId_625[this_228] = 1; } else { error455("Out of memory: Could not create Cell."); this_228 = 0; }; } else { Cell_firstFree_227 = (Cell_firstFree_227 - 1); this_228 = Cell_nextFree_198[Cell_firstFree_227]; Cell_typeId_625[this_228] = 1; }; return this_228; } function dispatch_Cell_test_Cell_get558(integer this212) returns any { if (Cell_typeId_625[this_212] == 0) { if (this_212 == 0) { error455("Nullpointer exception when calling Cell.get"); } else { error455("Called Cell.get on invalid object."); }; } else { }; return Cell_get169(this_212); } function dispatch_Cell_test_Cell_map190(integer this167, integer f160) returns integer { if (Cell_typeId_625[this_167] == 0) { if (this_167 == 0) { error455("Nullpointer exception when calling Cell.map"); } else { error455("Called Cell.map on invalid object."); }; } else { }; return Cell_map180(this_167, f_160); } function dispatch_F_test_F_apply742(integer this354, any a649) returns any { if (F_typeId_461[this_354] == 0) { if (this_354 == 0) { error455("Nullpointer exception when calling F.apply"); } else { error455("Called F.apply on invalid object."); }; } else { }; return apply_wrapper803(this_354, a_649); }