array C_nextFree163 integer C_firstFree198 integer C_maxIndex151 array Iterator_nextFree198 integer Iterator_firstFree161 integer Iterator_maxIndex599 array Iterator_typeId210 array Iterator_i102 integer C_firstFree198 = 0 integer C_maxIndex151 = 0 integer Iterator_firstFree161 = 0 integer Iterator_maxIndex599 = 0 function initGlobals714() { } function main697() { initGlobals714(); init_test212(); } function config173() { } function init_test212() { local integer iterator127 iterator_127 = C_iterator165(new_C201()); loop { exitwhen (not Iterator_hasNext225(iterator_127)); if (Iterator_next501(iterator_127) == 5) { testSuccess115(); } else { }; }; Iterator_close115(iterator_127); } IS_NATIVE function testSuccess115() { } function C_iterator165(integer this184) returns integer { return new_Iterator879(); } function C_init155(integer this146) { } function new_C201() returns integer { local integer this113 this_113 = alloc_C238(); construct_C391(this_113); return this_113; } function construct_C391(integer this714) { C_init155(this_714); } function new_Iterator879() returns integer { local integer this339 this_339 = alloc_Iterator166(); construct_Iterator461(this_339); return this_339; } function Iterator_next501(integer this377) returns any { Iterator_i_102[this_377] = (Iterator_i_102[this_377] + 1); return (Iterator_i_102[this_377] castTo any); } function Iterator_hasNext225(integer this174) returns boolean { return (Iterator_i_102[this_174] < 10); } function Iterator_close115(integer this131) { dispatch_Iterator_destroyIterator730(this_131); } function destroyIterator539(integer this689) { Iterator_onDestroy630(this_689); dealloc_Iterator199(this_689); } function Iterator_init180(integer this125) { Iterator_i_102[this_125] = 0; } function construct_Iterator461(integer this476) { Iterator_init180(this_476); } function Iterator_onDestroy630(integer this109) { } function alloc_C238() returns integer { local integer this149 if (C_firstFree_198 == 0) { if (C_maxIndex_151 < 32768) { C_maxIndex_151 = (C_maxIndex_151 + 1); this_149 = C_maxIndex_151; } else { error167("Out of memory: Could not create C."); this_149 = 0; }; } else { C_firstFree_198 = (C_firstFree_198 - 1); this_149 = C_nextFree_163[C_firstFree_198]; }; return this_149; } function error167(string msg102) { $debugPrint810((msg_102 + (" " + #getStackTrace()))); } function alloc_Iterator166() returns integer { local integer this136 if (Iterator_firstFree_161 == 0) { if (Iterator_maxIndex_599 < 32768) { Iterator_maxIndex_599 = (Iterator_maxIndex_599 + 1); this_136 = Iterator_maxIndex_599; Iterator_typeId_210[this_136] = 2; } else { error167("Out of memory: Could not create Iterator."); this_136 = 0; }; } else { Iterator_firstFree_161 = (Iterator_firstFree_161 - 1); this_136 = Iterator_nextFree_198[Iterator_firstFree_161]; Iterator_typeId_210[this_136] = 2; }; return this_136; } function dealloc_Iterator199(integer obj202) { if (Iterator_typeId_210[obj_202] == 0) { error167("Double free: object of type Iterator"); } else { Iterator_nextFree_198[Iterator_firstFree_161] = obj_202; Iterator_firstFree_161 = (Iterator_firstFree_161 + 1); Iterator_typeId_210[obj_202] = 0; }; } function dispatch_Iterator_destroyIterator730(integer this809) { if (Iterator_typeId_210[this_809] == 0) { if (this_809 == 0) { error167("Nullpointer exception when calling Iterator.Iterator"); } else { error167("Called Iterator.Iterator on invalid object."); }; } else { }; destroyIterator539(this_809); }