// 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 if MiddlewareUnary_firstFree == 0 then if MiddlewareUnary_maxIndex < 32768 then set MiddlewareUnary_maxIndex = MiddlewareUnary_maxIndex + 1 set this_1 = MiddlewareUnary_maxIndex set MiddlewareUnary_typeId[this_1] = 9 else call error("Out of memory: Could not create MiddlewareUnary_Bug.") set this_1 = 0 endif else set MiddlewareUnary_firstFree = MiddlewareUnary_firstFree - 1 set this_1 = MiddlewareUnary_nextFree[MiddlewareUnary_firstFree] set MiddlewareUnary_typeId[this_1] = 9 endif set cb[this_1] = cbs_0 if LinkedList_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling LinkedList.add") else call error("Called LinkedList.add on invalid object.") endif endif set LinkedList_elem[this] = this_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 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 if CallbackUnary_typeId[this] == 0 then call error("Double free: object of type CallbackUnary") else set CallbackUnary_nextFree[CallbackUnary_firstFree] = this set CallbackUnary_firstFree = CallbackUnary_firstFree + 1 set CallbackUnary_typeId[this] = 0 endif endfunction function call_Bug takes integer this, integer t, integer mwCb returns nothing if CallbackUnary_typeId[mwCb] == 0 then if mwCb == 0 then call error("Nullpointer exception when calling CallbackUnary.callAndDestroy") else call error("Called CallbackUnary.callAndDestroy on invalid object.") endif endif call dispatch_CallbackUnary_Bug_CallbackUnary_call(mwCb, t) call dispatch_CallbackUnary_destroyCallbackUnary(mwCb) endfunction function call_Bug_3 takes integer this, integer t, integer mwCb returns nothing call dispatch_CallbackUnary_Bug_CallbackUnary_call(cb[this], t) if CallbackUnary_typeId[mwCb] == 0 then if mwCb == 0 then call error("Nullpointer exception when calling CallbackUnary.callAndDestroy") else call error("Called CallbackUnary.callAndDestroy on invalid object.") endif endif call dispatch_CallbackUnary_Bug_CallbackUnary_call(mwCb, t) call dispatch_CallbackUnary_destroyCallbackUnary(mwCb) 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] if CallbackUnary_firstFree == 0 then if CallbackUnary_maxIndex < 32768 then set CallbackUnary_maxIndex = CallbackUnary_maxIndex + 1 set this = CallbackUnary_maxIndex set CallbackUnary_typeId[this] = 5 else call error("Out of memory: Could not create CallbackUnary_call_Bug.") set this = 0 endif else set CallbackUnary_firstFree = CallbackUnary_firstFree - 1 set this = CallbackUnary_nextFree[CallbackUnary_firstFree] set CallbackUnary_typeId[this] = 5 endif call dispatch_MiddlewareUnary_Bug_MiddlewareUnary_call(temp, t0, this) endfunction function new_BugClass takes nothing returns integer local integer this if BugClass_firstFree == 0 then if BugClass_maxIndex < 32768 then set BugClass_maxIndex = BugClass_maxIndex + 1 set this = BugClass_maxIndex else call error("Out of memory: Could not create BugClass.") set this = 0 endif else set BugClass_firstFree = BugClass_firstFree - 1 set this = BugClass_nextFree[BugClass_firstFree] endif return this endfunction function new_LinkedList takes nothing returns integer local integer this if LinkedList_firstFree == 0 then if LinkedList_maxIndex < 32768 then set LinkedList_maxIndex = LinkedList_maxIndex + 1 set this = LinkedList_maxIndex set LinkedList_typeId[this] = 6 else call error("Out of memory: Could not create LinkedList.") set this = 0 endif else set LinkedList_firstFree = LinkedList_firstFree - 1 set this = LinkedList_nextFree[LinkedList_firstFree] set LinkedList_typeId[this] = 6 endif return this endfunction function init_Bug takes nothing returns nothing 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 call LinkedList_add_1(temp, this) 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