// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals integer Test_x=0 integer array VoidFunction_nextFree integer VoidFunction_firstFree=0 integer VoidFunction_maxIndex=0 integer array VoidFunction_typeId endglobals native testSuccess takes nothing returns nothing function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function cyc_foo takes integer funcChoice, integer i, integer t returns nothing local integer f local integer clVar local integer this local integer j local integer j_1 local integer f_1 local integer clVar_1 local integer this_1 if funcChoice == 0 then set Test_x = Test_x + 1 if VoidFunction_firstFree == 0 then if VoidFunction_maxIndex < 32768 then set VoidFunction_maxIndex = VoidFunction_maxIndex + 1 set this = VoidFunction_maxIndex set VoidFunction_typeId[this] = 2 else call error("Out of memory: Could not create VoidFunction_Test.") set this = 0 endif else set VoidFunction_firstFree = VoidFunction_firstFree - 1 set this = VoidFunction_nextFree[VoidFunction_firstFree] set VoidFunction_typeId[this] = 2 endif set clVar = this set f = clVar call cyc_foo(1, f, i) elseif funcChoice == 1 then if VoidFunction_typeId[i] == 0 then if i == 0 then call error("Nullpointer exception when calling VoidFunction.call") else call error("Called VoidFunction.call on invalid object.") endif endif if VoidFunction_typeId[i] <= 2 then set j = t call cyc_foo(2, j - 1, 0) else set j_1 = t call cyc_foo(0, j_1 - 1, 0) endif elseif funcChoice == 2 then set Test_x = Test_x + 1 if VoidFunction_firstFree == 0 then if VoidFunction_maxIndex < 32768 then set VoidFunction_maxIndex = VoidFunction_maxIndex + 1 set this_1 = VoidFunction_maxIndex set VoidFunction_typeId[this_1] = 3 else call error("Out of memory: Could not create VoidFunction_Test.") set this_1 = 0 endif else set VoidFunction_firstFree = VoidFunction_firstFree - 1 set this_1 = VoidFunction_nextFree[VoidFunction_firstFree] set VoidFunction_typeId[this_1] = 3 endif set clVar_1 = this_1 set f_1 = clVar_1 if i > 0 then call cyc_foo(1, f_1, i) endif endif endfunction function initGlobals takes nothing returns nothing endfunction function main takes nothing returns nothing call initGlobals() call cyc_foo(2, 10, 0) if Test_x == 11 then call testSuccess() endif endfunction function config takes nothing returns nothing endfunction