array C_nextFree182 integer C_firstFree182 integer C_maxIndex512 array C_typeId893 array Iterator_nextFree128 integer Iterator_firstFree198 integer Iterator_maxIndex529 array Iterator_i196 integer C_firstFree182 = 0 integer C_maxIndex512 = 0 integer Iterator_firstFree198 = 0 integer Iterator_maxIndex529 = 0 function initGlobals208() { C_firstFree_182 = 0; C_maxIndex_512 = 0; Iterator_firstFree_198 = 0; Iterator_maxIndex_529 = 0; } function main168() { initGlobals208(); init_test469(); } function config539() { } function init_test469() { local integer c145 local integer iter857 local integer i117 local integer from261 c_145 = new_C383(); iter_857 = dispatch_C_test_C_iterator866(c_145); from_261 = iter_857; loop { exitwhen (not Iterator_hasNext205(from_261)); i_117 = Iterator_next211(from_261); if (i_117 == 5) { testSuccess187(); } else { }; }; } IS_NATIVE function testSuccess187() { } function C_iterator594(integer this195) returns integer { return new_Iterator128(); } function C_init751(integer this103) { } function new_C383() returns integer { local integer this204 this_204 = alloc_C102(); construct_C415(this_204); return this_204; } function construct_C415(integer this903) { C_init751(this_903); } function new_Iterator128() returns integer { local integer this100 this_100 = alloc_Iterator213(); construct_Iterator253(this_100); return this_100; } function Iterator_next211(integer this149) returns any { Iterator_i_196[this_149] = (Iterator_i_196[this_149] + 1); return (Iterator_i_196[this_149] castTo any); } function Iterator_hasNext205(integer this151) returns boolean { return (Iterator_i_196[this_151] < 10); } function Iterator_init170(integer this208) { Iterator_i_196[this_208] = 0; } function construct_Iterator253(integer this483) { Iterator_init170(this_483); } function alloc_C102() returns integer { local integer this164 if (C_firstFree_182 == 0) { if (C_maxIndex_512 < 32768) { C_maxIndex_512 = (C_maxIndex_512 + 1); this_164 = C_maxIndex_512; C_typeId_893[this_164] = 1; } else { error212("Out of memory: Could not create C."); this_164 = 0; }; } else { C_firstFree_182 = (C_firstFree_182 - 1); this_164 = C_nextFree_182[C_firstFree_182]; C_typeId_893[this_164] = 1; }; return this_164; } function error212(string msg120) { $debugPrint391((msg_120 + (" " + #getStackTrace()))); } function alloc_Iterator213() returns integer { local integer this191 if (Iterator_firstFree_198 == 0) { if (Iterator_maxIndex_529 < 32768) { Iterator_maxIndex_529 = (Iterator_maxIndex_529 + 1); this_191 = Iterator_maxIndex_529; } else { error212("Out of memory: Could not create Iterator."); this_191 = 0; }; } else { Iterator_firstFree_198 = (Iterator_firstFree_198 - 1); this_191 = Iterator_nextFree_128[Iterator_firstFree_198]; }; return this_191; } function dispatch_C_test_C_iterator866(integer this220) returns integer { local integer test_C_iterator_result155 if (C_typeId_893[this_220] == 0) { if (this_220 == 0) { error212("Nullpointer exception when calling C.iterator"); } else { error212("Called C.iterator on invalid object."); }; } else { }; test_C_iterator_result_155 = C_iterator594(this_220); return test_C_iterator_result_155; }