// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals integer BugClass_mws=0 integer array MiddlewareUnary_nextFree integer MiddlewareUnary_firstFree=0 integer MiddlewareUnary_maxIndex=0 integer array MiddlewareUnary_typeId integer array CallbackUnary_nextFree integer CallbackUnary_firstFree=0 integer CallbackUnary_maxIndex=0 integer array CallbackUnary_typeId integer array BugClass_nextFree integer BugClass_firstFree=0 integer BugClass_maxIndex=0 integer array LinkedList_nextFree integer LinkedList_firstFree=0 integer LinkedList_maxIndex=0 integer array LinkedList_typeId integer array cb integer array LinkedList_elem endglobals native println takes string msg returns nothing native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function LinkedList_add_1 takes integer this, integer cbs_0 returns nothing local integer this_1 = this local integer cb_1 = cbs_0 local integer t local integer this_2 local integer t_1 local integer clVar local integer this_3 if MiddlewareUnary_firstFree == 0 then if MiddlewareUnary_maxIndex < 32768 then set MiddlewareUnary_maxIndex = MiddlewareUnary_maxIndex + 1 set this_3 = MiddlewareUnary_maxIndex set MiddlewareUnary_typeId[this_3] = 9 else call error("Out of memory: Could not create MiddlewareUnary_Bug.") set this_3 = 0 endif else set MiddlewareUnary_firstFree = MiddlewareUnary_firstFree - 1 set this_3 = MiddlewareUnary_nextFree[MiddlewareUnary_firstFree] set MiddlewareUnary_typeId[this_3] = 9 endif set clVar = this_3 set cb[clVar] = cb_1 set t = clVar if LinkedList_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling LinkedList.add") else call error("Called LinkedList.add on invalid object.") endif endif set this_2 = this_1 set t_1 = t set LinkedList_elem[this_2] = t_1 endfunction function dispatch_CallbackUnary_Bug_CallbackUnary_call takes integer this, integer t returns nothing if CallbackUnary_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling CallbackUnary.call") else call error("Called CallbackUnary.call on invalid object.") endif endif if CallbackUnary_typeId[this] <= 4 then call testSuccess() else call println("called") endif endfunction function dispatch_CallbackUnary_destroyCallbackUnary takes integer this returns nothing local integer this_1 local integer obj if CallbackUnary_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling CallbackUnary.CallbackUnary") else call error("Called CallbackUnary.CallbackUnary on invalid object.") endif endif set this_1 = this set obj = this_1 if CallbackUnary_typeId[obj] == 0 then call error("Double free: object of type CallbackUnary") else set CallbackUnary_nextFree[CallbackUnary_firstFree] = obj set CallbackUnary_firstFree = CallbackUnary_firstFree + 1 set CallbackUnary_typeId[obj] = 0 endif endfunction function call_Bug takes integer this, integer t, integer mwCb returns nothing local integer this_1 = mwCb local integer t_1 = t local integer this_2 local integer t_2 if CallbackUnary_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling CallbackUnary.callAndDestroy") else call error("Called CallbackUnary.callAndDestroy on invalid object.") endif endif set this_2 = this_1 set t_2 = t_1 call dispatch_CallbackUnary_Bug_CallbackUnary_call(this_2, t_2) call dispatch_CallbackUnary_destroyCallbackUnary(this_2) endfunction function call_Bug_3 takes integer this, integer t, integer mwCb returns nothing local integer this_1 local integer t_1 local integer this_2 local integer t_2 call dispatch_CallbackUnary_Bug_CallbackUnary_call(cb[this], t) set this_1 = mwCb set t_1 = t if CallbackUnary_typeId[this_1] == 0 then if this_1 == 0 then call error("Nullpointer exception when calling CallbackUnary.callAndDestroy") else call error("Called CallbackUnary.callAndDestroy on invalid object.") endif endif set this_2 = this_1 set t_2 = t_1 call dispatch_CallbackUnary_Bug_CallbackUnary_call(this_2, t_2) call dispatch_CallbackUnary_destroyCallbackUnary(this_2) endfunction function dispatch_MiddlewareUnary_Bug_MiddlewareUnary_call takes integer this, integer t, integer cb_1 returns nothing if MiddlewareUnary_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling MiddlewareUnary.call") else call error("Called MiddlewareUnary.call on invalid object.") endif endif if MiddlewareUnary_typeId[this] <= 8 then call call_Bug(this, t, cb_1) else call call_Bug_3(this, t, cb_1) endif endfunction function LinkedList_call takes integer this, integer t0 returns nothing local integer temp = LinkedList_elem[this] local integer temp_1 = t0 local integer clVar local integer this_1 if CallbackUnary_firstFree == 0 then if CallbackUnary_maxIndex < 32768 then set CallbackUnary_maxIndex = CallbackUnary_maxIndex + 1 set this_1 = CallbackUnary_maxIndex set CallbackUnary_typeId[this_1] = 5 else call error("Out of memory: Could not create CallbackUnary_call_Bug.") set this_1 = 0 endif else set CallbackUnary_firstFree = CallbackUnary_firstFree - 1 set this_1 = CallbackUnary_nextFree[CallbackUnary_firstFree] set CallbackUnary_typeId[this_1] = 5 endif set clVar = this_1 call dispatch_MiddlewareUnary_Bug_MiddlewareUnary_call(temp, temp_1, clVar) endfunction function new_BugClass takes nothing returns integer local integer this local integer this_1 if BugClass_firstFree == 0 then if BugClass_maxIndex < 32768 then set BugClass_maxIndex = BugClass_maxIndex + 1 set this_1 = BugClass_maxIndex else call error("Out of memory: Could not create BugClass.") set this_1 = 0 endif else set BugClass_firstFree = BugClass_firstFree - 1 set this_1 = BugClass_nextFree[BugClass_firstFree] endif set this = this_1 return this endfunction function new_LinkedList takes nothing returns integer local integer this local integer this_1 if LinkedList_firstFree == 0 then if LinkedList_maxIndex < 32768 then set LinkedList_maxIndex = LinkedList_maxIndex + 1 set this_1 = LinkedList_maxIndex set LinkedList_typeId[this_1] = 6 else call error("Out of memory: Could not create LinkedList.") set this_1 = 0 endif else set LinkedList_firstFree = LinkedList_firstFree - 1 set this_1 = LinkedList_nextFree[LinkedList_firstFree] set LinkedList_typeId[this_1] = 6 endif set this = this_1 return this endfunction function init_Bug takes nothing returns nothing local integer clVar local integer temp local integer this set BugClass_mws = new_LinkedList() set temp = BugClass_mws if CallbackUnary_firstFree == 0 then if CallbackUnary_maxIndex < 32768 then set CallbackUnary_maxIndex = CallbackUnary_maxIndex + 1 set this = CallbackUnary_maxIndex set CallbackUnary_typeId[this] = 4 else call error("Out of memory: Could not create CallbackUnary_add_Bug.") set this = 0 endif else set CallbackUnary_firstFree = CallbackUnary_firstFree - 1 set this = CallbackUnary_nextFree[CallbackUnary_firstFree] set CallbackUnary_typeId[this] = 4 endif set clVar = this call LinkedList_add_1(temp, clVar) call LinkedList_call(BugClass_mws, new_BugClass()) endfunction function main takes nothing returns nothing call initGlobals() call init_Bug() endfunction function config takes nothing returns nothing endfunction