currentEvent::new:
		link	$1
		ldi	$0
		aTop	plane
		aTop	claimed
		push2
		lap	param[$0]
		bnt	code_0061
		lap	param[$1]
		jmp	code_0064

code_0061:	ldi	$3ff		; 1023, pQuickness
code_0064:	push
		pushSelf
		callk	kernel_80, $4
		bnot
		selfID
		ret

User::init:
		lofsa	currentEvent
		aTop	curEvent
		ldi	$0
		sag	global[$6]
		ret

User::doit:
		pushi	$f3		; 243, nextEvent
		push1
		pushi	$7fff		; 32767
		self	$6
		bnot
		pToa	controls
		bt	code_0086
		pToa	input
code_0086:	bnt	code_00a2
		pushi	$2b		; 43, '+', type
		push0
		lofsa	currentEvent
		send	$4
		bnot
		push
		ldi	$0
		ne?
		bnt	code_00a2
		pushi	$c8		; 200, handleEvent
		push1
		lofsa	currentEvent
		push
		self	$6
		bnot
code_00a2:	ret

User::nextEvent:
		pushi	$8d		; 141, new
		push1
		lsp	param[$1]
		lofsa	currentEvent
		send	$6
		bnot
		lofsa	currentEvent
		ret

User::handleEvent:
		link	$1
		pushi	$50		; 80, 'P', claimed
		push0
		lap	param[$1]
		send	$4
		bnot
		bnt	code_00c2
		ldi	$1
		ret

code_00c2:	pushi	$b9		; 185, localize
		push1
		push0
		push0
		lag	global[$3]
		send	$4
		bnot
		push
		lap	param[$1]
		send	$6
		bnot
		pushi	$2b		; 43, '+', type
		push0
		lap	param[$1]
		send	$4
		bnot
		push
		ldi	$1
		eq?
		bnt	code_0101
		pushi	$48		; 72, 'H', modifiers
		push0
		lap	param[$1]
		send	$4
		bnot
		push
		ldi	$3		; z
		and
		bnt	code_0101
		lag	global[$1]
		bnt	code_0101
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		lag	global[$1]
		send	$6
		bnot
		jmp	code_0291

code_0101:	lag	global[$13]
		bnt	code_0126
		pushi	$2b		; 43, '+', type
		push0
		lap	param[$1]
		send	$4
		bnot
		push
		ldi	$100		; 256, strMax
		eq?
		bnt	code_0126
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		lag	global[$13]
		send	$6
		bnot
		bnt	code_0126
		ldi	$0
		jmp	code_0291

code_0126:	pToa	controls
		not
		bnt	code_0141
		pToa	input
		bnt	code_0141
		pushi	$4		; scaleX
		pushi	$2b		; 43, '+', type
		push0
		lap	param[$1]
		send	$4
		bnot
		ne?
		bnt	code_0141
		ldi	$0
		jmp	code_0291

code_0141:	lag	global[$13]
		bnt	code_0155
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		send	$6
		bnot
		bnt	code_0155
		ldi	$0
		jmp	code_0291

code_0155:	pToa	input
		not
		bnt	code_015f
		ldi	$0
		jmp	code_0291

code_015f:	lag	global[$27]
		bnt	code_0173
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		send	$6
		bnot
		bnt	code_0173
		ldi	$0
		jmp	code_0291

code_0173:	lag	global[$6]
		bnt	code_0187
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		send	$6
		bnot
		bnt	code_0187
		ldi	$0
		jmp	code_0291

code_0187:	pushi	$2b		; 43, '+', type
		push0
		lap	param[$1]
		send	$4
		bnot
		push
		ldi	$4		; scaleX
		eq?
		bt	code_01a1
		pushi	$2b		; 43, '+', type
		push0
		lap	param[$1]
		send	$4
		bnot
		push
		ldi	$1
		eq?
code_01a1:	bnt	code_01c2
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		lag	global[$30]
		send	$6
		bnot
		bt	code_01bb
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		lag	global[$2]
		send	$6
		bnot
code_01bb:	bnt	code_01c2
		ldi	$0
		jmp	code_0291

code_01c2:	pushi	$2b		; 43, '+', type
		push0
		lap	param[$1]
		send	$4
		bnot
		push
		ldi	$4000		; 16384
		and
		not
		bnt	code_01d7
		ldi	$0
		jmp	code_0291

code_01d7:	pushi	$2b		; 43, '+', type
		push0
		lap	param[$1]
		send	$4
		bnot
		push
		ldi	$4000		; 16384
		and
		bnt	code_0221
		pToa	controls
		bnt	code_0291
		lag	global[$49]
		bnt	code_0213
		pushi	$3		; z
		lsp	param[$1]
		pushi	$f2		; 242, pCast
		push0
		lag	global[$3]
		send	$4
		bnot
		push
		pushi	$264		; 612, pFeatures
		push0
		lag	global[$3]
		send	$4
		bnot
		push
		call	code_02ad, $6
		bnot
		bnt	code_0213
		ldi	$0
		jmp	code_0291

code_0213:	pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		lag	global[$1]
		send	$6
		bnot
		jmp	code_0291

code_0221:	lag	global[$49]
		bnt	code_0242
		pushi	$3		; z
		lsp	param[$1]
		pushi	$f2		; 242, pCast
		push0
		lag	global[$3]
		send	$4
		bnot
		push
		pushi	$264		; 612, pFeatures
		push0
		lag	global[$3]
		send	$4
		bnot
		push
		call	code_02ad, $6
		bnot
code_0242:	bt	code_026f
		lag	global[$49]
		not
		bnt	code_0275
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		pushi	$f2		; 242, pCast
		push0
		lag	global[$3]
		send	$4
		bnot
		send	$6
		bnot
		bt	code_026f
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		pushi	$264		; 612, pFeatures
		push0
		lag	global[$3]
		send	$4
		bnot
		send	$6
		bnot
code_026f:	bnt	code_0275
		ldi	$0
		jmp	code_0291

code_0275:	pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		lag	global[$30]
		send	$6
		bnot
		bnt	code_0286
		ldi	$0
		jmp	code_0291

code_0286:	pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		lag	global[$2]
		send	$6
		bnot
code_0291:	ldi	$1
		ret

User::canControl:
		lap	param[$0]
		bnt	code_02a0
		lap	param[$1]
		aTop	controls
		ldi	$0
		aTop	prevDir
code_02a0:	pToa	controls
		ret

User::canInput:
		lap	param[$0]
		bnt	code_02ab
		lap	param[$1]
		aTop	input
code_02ab:	pToa	input
code_02ad:	ret

		link	$9
		pushi	$b9		; 185, localize
		push1
		push0
		push0
		lag	global[$3]
		send	$4
		bnot
		push
		lap	param[$1]
		send	$6
		bnot
		ldi	$0
		sat	temp[$0]
		ldi	$0
		sat	temp[$1]
		push2
		push0
		lag	global[$1]
		send	$4
		bnot
		sat	temp[$7]
		ldi	$0
		sat	temp[$4]
code_02d6:	lst	temp[$4]
		lsp	param[$0]
		ldi	$1
		sub
		lt?
		bnt	code_0331
		lat	temp[$4]
		lapi	param[$2]
		sat	temp[$2]
		bnt	code_032d
		pushi	$5a		; 90, 'Z', size
		push0
		send	$4
		bnot
		sat	temp[$8]
		ldi	$0
		sat	temp[$5]
code_02f4:	lst	temp[$5]
		lat	temp[$8]
		lt?
		bnt	code_032d
		pushi	$4b		; 75, 'K', at
		push1
		lst	temp[$5]
		lat	temp[$2]
		send	$6
		bnot
		sat	temp[$3]
		pushi	$eb		; 235, onMe
		push1
		lsp	param[$1]
		send	$6
		bnot
		bnt	code_0329
		push2
		push0
		lat	temp[$3]
		send	$4
		bnot
		sat	temp[$6]
		push
		lat	temp[$1]
		gt?
		bnt	code_0329
		lat	temp[$3]
		sat	temp[$0]
		lat	temp[$6]
		sat	temp[$1]
code_0329:	+at	temp[$5]
		jmp	code_02f4

code_032d:	+at	temp[$4]
		jmp	code_02d6

code_0331:	lat	temp[$0]
		bnt	code_033e
		pushi	$c8		; 200, handleEvent
		push1
		lsp	param[$1]
		send	$6
		bnot
code_033e:	pushi	$ba		; 186, globalize
		push0
		lap	param[$1]
		send	$4
		bnot
		lat	temp[$0]
		ret

