// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals integer PowerLevel_amount=0 integer array PowerLevel_nextFree integer PowerLevel_firstFree=0 integer PowerLevel_maxIndex=0 endglobals native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing set PowerLevel_firstFree = 0 set PowerLevel_maxIndex = 0 endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function alloc_PowerLevel takes nothing returns integer local integer this if PowerLevel_firstFree == 0 then if PowerLevel_maxIndex < 32768 then set PowerLevel_maxIndex = PowerLevel_maxIndex + 1 set this = PowerLevel_maxIndex else call error("Out of memory: Could not create PowerLevel.") set this = 0 endif else set PowerLevel_firstFree = PowerLevel_firstFree - 1 set this = PowerLevel_nextFree[PowerLevel_firstFree] endif return this endfunction function PowerLevel_init takes integer this returns nothing endfunction function construct_PowerLevel takes integer this returns nothing call PowerLevel_init(this) set PowerLevel_amount = PowerLevel_amount + 1 endfunction function new_PowerLevel takes nothing returns integer local integer this = alloc_PowerLevel() call construct_PowerLevel(this) return this endfunction function init_Vegeta takes nothing returns nothing local integer i set PowerLevel_amount = 0 set i = 0 loop exitwhen i > 20000 call new_PowerLevel() set i = i + 1 endloop if PowerLevel_amount > 9000 and PowerLevel_amount == 20001 then call testSuccess() endif endfunction function main takes nothing returns nothing call initGlobals() call init_Vegeta() endfunction function config takes nothing returns nothing endfunction