// 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 cb_18 integer array LinkedList_elem endglobals native testSuccess takes nothing returns nothing native println takes string msg returns nothing function initGlobals takes nothing returns nothing set MiddlewareUnary_firstFree = 0 set MiddlewareUnary_maxIndex = 0 set CallbackUnary_firstFree = 0 set CallbackUnary_maxIndex = 0 set BugClass_firstFree = 0 set BugClass_maxIndex = 0 set LinkedList_firstFree = 0 set LinkedList_maxIndex = 0 endfunction function LinkedList_add takes integer this, integer t returns nothing set LinkedList_elem[this] = t endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function dispatch_LinkedList_Bug_LinkedList_add takes integer this, integer t returns nothing 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 call LinkedList_add(this, t) endfunction function alloc_MiddlewareUnary_Bug takes nothing returns integer local integer this if MiddlewareUnary_firstFree == 0 then if MiddlewareUnary_maxIndex < 32768 then set MiddlewareUnary_maxIndex = MiddlewareUnary_maxIndex + 1 set this = MiddlewareUnary_maxIndex set MiddlewareUnary_typeId[this] = 9 else call error("Out of memory: Could not create MiddlewareUnary_Bug.") set this = 0 endif else set MiddlewareUnary_firstFree = MiddlewareUnary_firstFree - 1 set this = MiddlewareUnary_nextFree[MiddlewareUnary_firstFree] set MiddlewareUnary_typeId[this] = 9 endif return this endfunction function mwUnary takes integer cb_1 returns integer local integer clVar = alloc_MiddlewareUnary_Bug() set cb_18[clVar] = cb_1 return clVar endfunction function LinkedList_add_1 takes integer this, integer cbs_0 returns nothing call dispatch_LinkedList_Bug_LinkedList_add(this, mwUnary(cbs_0)) endfunction function alloc_CallbackUnary_call_Bug takes nothing returns integer local integer 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 return this endfunction function dispatch_CallbackNullary_Bug_CallbackNullary_call takes integer this returns nothing endfunction function call_add_Bug takes integer this, integer i returns nothing call testSuccess() endfunction function call_call_Bug takes integer this, integer e returns nothing call println("called") 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 call_add_Bug(this, t) else call call_call_Bug(this, t) endif endfunction function dealloc_CallbackUnary takes integer obj returns nothing 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 destroyCallbackUnary takes integer this returns nothing call dealloc_CallbackUnary(this) 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 call destroyCallbackUnary(this) endfunction function CallbackUnary_callAndDestroy takes integer this, integer t returns nothing call dispatch_CallbackUnary_Bug_CallbackUnary_call(this, t) call dispatch_CallbackUnary_destroyCallbackUnary(this) endfunction function dispatch_CallbackUnary_Bug_CallbackUnary_callAndDestroy takes integer this, integer t returns nothing if CallbackUnary_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling CallbackUnary.callAndDestroy") else call error("Called CallbackUnary.callAndDestroy on invalid object.") endif endif call CallbackUnary_callAndDestroy(this, t) endfunction function call_Bug takes integer this, integer t, integer mwCb returns nothing call dispatch_CallbackNullary_Bug_CallbackNullary_call(cb[this]) call dispatch_CallbackUnary_Bug_CallbackUnary_callAndDestroy(mwCb, t) endfunction function call_Bug_12 takes integer this, integer t, integer mwCb returns nothing call dispatch_CallbackUnary_Bug_CallbackUnary_call(cb_18[this], t) call dispatch_CallbackUnary_Bug_CallbackUnary_callAndDestroy(mwCb, t) 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_12(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 = alloc_CallbackUnary_call_Bug() call dispatch_MiddlewareUnary_Bug_MiddlewareUnary_call(temp, temp_1, clVar) endfunction function alloc_CallbackUnary_add_Bug takes nothing returns integer local integer 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] = 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 return this endfunction function alloc_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 BugClass_init takes integer this returns nothing endfunction function construct_BugClass takes integer this returns nothing call BugClass_init(this) endfunction function new_BugClass takes nothing returns integer local integer this = alloc_BugClass() call construct_BugClass(this) return this endfunction function alloc_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 LinkedList_init takes integer this returns nothing endfunction function construct_LinkedList takes integer this returns nothing call LinkedList_init(this) endfunction function new_LinkedList takes nothing returns integer local integer this = alloc_LinkedList() call construct_LinkedList(this) return this endfunction function init_Bug takes nothing returns nothing local integer clVar local integer temp set BugClass_mws = new_LinkedList() set temp = BugClass_mws set clVar = alloc_CallbackUnary_add_Bug() 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