
;  GNU C 2.7.2 [AL 1.1, MM 40] RISC NEWS-OS compiled by CC

;  Cc1 defaults:
;  -mmemcpy

;  Cc1 arguments (-G value = 0, Cpu = 3000, ISA = 1):
;  -quiet -dumpbase -O2 -Wall -o

gcc2_compiled.:
__gnu_compiled_c:
	.code
	.align	1
	.global	mouse_open
mouse_open:
;	.frame	%sp,24,$31		# vars= 0, regs= 2/0, args= 16, extra= 0
;	.mask	0x80010000,-4
;	.fmask	0x00000000,0
	pushn	%r0
	sub	%sp,0x4		; 	xsub	%sp,%sp,16
	call	mouse_close	; 	xcall	mouse_close
	ext	mouse+0x0@h	; 	xld.w	%r12,mouse
	ext	mouse+0x0@m
	ld.w	%r12,mouse+0x0@l
	ld.w	%r13,0x0
	ld.w	%r14,0x1c	; 	xld.w	%r14,0x0000001c		; 28
	ext	memset@rm	; 	xcall	memset
	call	memset@rl
	ld.w	%r11,0x0
	ld.w	[%sp+0x0],%r11	; 	xld.w	[%sp],%r11
	ld.w	[%sp+0x1],%r11	; 	xld.w	[%sp+4],%r11
	ext	mouse_recv_callback+0x0@h	; 	xld.w	%r10,mouse_recv_callback
	ext	mouse_recv_callback+0x0@m
	ld.w	%r10,mouse_recv_callback+0x0@l
	ld.w	[%sp+0x2],%r10	; 	xld.w	[%sp+8],%r10
	ld.w	[%sp+0x3],%r11	; 	xld.w	[%sp+12],%r11
	ext	0x12		; 	xld.w	%r12,0x000004b0		; 1200
	ld.w	%r12,0x30
	ld.w	%r13,0x0
	ld.w	%r14,0x7	; 	xld.w	%r14,0x00000007		; 7
	ld.w	%r15,0x1	; 	xld.w	%r15,0x00000001		; 1
	ext	com_open@rm	; 	xcall	com_open
	call	com_open@rl
	ld.w	%r12,0x0
	ext	com_rts@rm	; 	xcall	com_rts
	call	com_rts@rl
	ext	pceTimerGetCount@rm	; 	xcall	pceTimerGetCount
	call	pceTimerGetCount@rl
	ld.w	%r0,%r10
__LX71:				; __L71:
	ext	pceTimerGetCount@rm	; 	xcall	pceTimerGetCount
	call	pceTimerGetCount@rl
	sub	%r10,%r0
	ext	0x1		; 	xcmp	%r10,99
	cmp	%r10,0x23
	jrule	__LX71		; 	xjrule	__L71
	ext	com_reset@rm	; 	xcall	com_reset
	call	com_reset@rl
	ld.w	%r12,0x1	; 	xld.w	%r12,0x00000001		; 1
	ext	com_rts@rm	; 	xcall	com_rts
	call	com_rts@rl
	ext	pceTimerGetCount@rm	; 	xcall	pceTimerGetCount
	call	pceTimerGetCount@rl
	ld.w	%r0,%r10
__LX74:				; __L74:
	ext	pceTimerGetCount@rm	; 	xcall	pceTimerGetCount
	call	pceTimerGetCount@rl
	sub	%r10,%r0
	ext	0x7		; 	xcmp	%r10,499
	cmp	%r10,0x33
	jrugt	__LX75		; 	xjrugt	__L75
	ext	mouse+0x0@ah	; 	xld.w	%r10,[mouse]
	ext	mouse+0x0@al
	ld.w	%r10,[%r8]
	cmp	%r10,0x0
	jreq	__LX74		; 	xjreq	__L74
__LX75:				; __L75:
	ext	mouse+0x0@ah	; 	xld.w	%r10,[mouse]
	ext	mouse+0x0@al
	ld.w	%r10,[%r8]
	cmp	%r10,0x0
	jreq	__LX78		; 	xjreq	__L78
	ld.w	%r10,0x0
	jp	__LX79		; 	xjp	__L79
__LX78:				; __L78:
	call	mouse_close	; 	xcall	mouse_close
	ld.w	%r10,0x3f	; 	xld.w	%r10,-1			; 0xffffffff
__LX79:				; __L79:
	add	%sp,0x4		; 	xadd	%sp,%sp,16
	popn	%r0
	ret
	.align	1
	.global	mouse_close
mouse_close:
;	.frame	%sp,4,$31		# vars= 0, regs= 1/0, args= 0, extra= 0
;	.mask	0x80000000,-4
;	.fmask	0x00000000,0
	ext	com_close@rm	; 	xcall	com_close
	call	com_close@rl
	ext	mouse+0x0@h	; 	xld.w	%r12,mouse
	ext	mouse+0x0@m
	ld.w	%r12,mouse+0x0@l
	ld.w	%r13,0x0
	ld.w	%r14,0x1c	; 	xld.w	%r14,0x0000001c		; 28
	ext	memset@rm	; 	xcall	memset
	call	memset@rl
	ret
	.align	1
mouse_recv_callback:
;	.frame	%sp,24,$31		# vars= 4, regs= 5/0, args= 0, extra= 0
;	.mask	0x800f0000,-4
;	.fmask	0x00000000,0
	pushn	%r3
	sub	%sp,0x1		; 	xsub	%sp,%sp,4
	ext	mouse+0x0@h	; 	xld.w	%r1,mouse
	ext	mouse+0x0@m
	ld.w	%r1,mouse+0x0@l
	ext	0x14		; 	xadd	%r2,%r1,20
	add	%r2,%r1
	ext	0x18		; 	xadd	%r0,%r1,24
	add	%r0,%r1
	ext	0xc		; 	xadd	%r3,%r1,12
	add	%r3,%r1
__LX82:				; __L82:
	ld.w	%r12,%sp
	ld.w	%r13,0x1	; 	xld.w	%r13,0x00000001		; 1
	ext	com_recv@rm	; 	xcall	com_recv
	call	com_recv@rl
	cmp	%r10,0x0
	ext	__LX83@rm	; 	xjreq	__L83
	jreq	__LX83@rl
	jrge	__LX86		; 	xjrge	__L86
	ext	com_reset@rm	; 	xcall	com_reset
	call	com_reset@rl
	ext	__LX83@rm	; 	xjp	__L83
	jp	__LX83@rl
__LX86:				; __L86:
	ld.w	%r10,[%r1]	; 	xld.w	%r10,[%r1]
	cmp	%r10,0x0
	jrne	__LX87		; 	xjrne	__L87
	ld.b	%r10,[%sp+0x0]	; 	xld.b	%r10,[%sp]
	ext	0x1		; 	xcmp	%r10,77
	cmp	%r10,0xd
	jrne	__LX82		; 	xjrne	__L82
	ld.w	%r10,0x1	; 	xld.w	%r10,0x00000001		; 1
	ld.w	[%r1],%r10	; 	xld.w	[%r1],%r10
	jp	__LX82		; 	xjp	__L82
__LX87:				; __L87:
	ld.ub	%r12,[%sp+0x0]	; 	xld.ub	%r12,[%sp]
	ld.w	%r10,%r12
	ext	0x1		; 	xand	%r10,%r10,0x00000040
	and	%r10,0x0
	jreq	__LX90		; 	xjreq	__L90
	ext	0x4		; 	xld.b	[%r1+4],%r12
	ld.b	[%r1],%r12
	ld.w	%r10,0x1	; 	xld.w	%r10,0x00000001		; 1
	ext	0x8		; 	xld.w	[%r1+8],%r10
	ld.w	[%r1],%r10
	jp	__LX82		; 	xjp	__L82
__LX90:				; __L90:
	ext	0x8		; 	xadd	%r13,%r1,8
	add	%r13,%r1
	ld.w	%r11,[%r13]	; 	xld.w	%r11,[%r13]
	cmp	%r11,0x0
	jreq	__LX82		; 	xjreq	__L82
	ext	0x1		; 	xadd	%r10,%r11,1
	add	%r10,%r11
	ld.w	[%r13],%r10	; 	xld.w	[%r13],%r10
	ext	mouse+0x4@h	; 	xld.b	[%r11+mouse+4],%r12
	ext	mouse+0x4@m
	ld.w	%r9,mouse+0x4@l
	add	%r9,%r11
	ld.b	[%r9],%r12
	ld.w	%r10,[%r13]	; 	xld.w	%r10,[%r13]
	cmp	%r10,0x3	; 	xcmp	%r10,3
	jrne	__LX82		; 	xjrne	__L82
	ext	0x4		; 	xld.ub	%r13,[%r1+4]
	ld.ub	%r13,[%r1]
	ld.w	%r11,%r13
	and	%r11,0x3	; 	xand	%r11,%r11,0x00000003
	sll	%r11,0x6	; 	xsll	%r11,6
	ext	0x0		; 	xld.w	%r12,0x0000003f		; 63
	ld.w	%r12,0x3f
	ld.w	%r10,%r12
	ext	0x5		; 	xld.ub	%r15,[%r1+5]
	ld.ub	%r15,[%r1]
	and	%r10,%r15
	or	%r11,%r10
	ld.b	%r11,%r11
	ld.w	%r10,%r13
	and	%r10,0xc	; 	xand	%r10,%r10,0x0000000c
	sll	%r10,0x4	; 	xsll	%r10,4
	ext	0x6		; 	xld.ub	%r15,[%r1+6]
	ld.ub	%r15,[%r1]
	and	%r12,%r15
	or	%r10,%r12
	ld.b	%r14,%r10
	ld.w	%r12,%r13
	ext	0x0		; 	xand	%r12,%r12,0x00000020
	and	%r12,0x20
	and	%r13,0x10	; 	xand	%r13,%r13,0x00000010
	cmp	%r11,0x0
	jrne	__LX94		; 	xjrne	__L94
	cmp	%r14,0x0
	jrne	__LX94		; 	xjrne	__L94
	cmp	%r12,0x0
	jreq	__LX110		; 	xjreq	__L110
	ext	0x14		; 	xld.w	%r10,[%r1+20]
	ld.w	%r10,[%r1]
	and	%r10,0x1	; 	xand	%r10,%r10,0x00000001
	jrne	__LX95		; 	xjrne	__L95
	jp	__LX94		; 	xjp	__L94
__LX110:				; __L110:
	ext	0x14		; 	xld.w	%r10,[%r1+20]
	ld.w	%r10,[%r1]
	and	%r10,0x1	; 	xand	%r10,%r10,0x00000001
	jrne	__LX94		; 	xjrne	__L94
__LX95:				; __L95:
	cmp	%r13,0x0
	jreq	__LX111		; 	xjreq	__L111
	ext	mouse+0x14@ah	; 	xld.w	%r10,[mouse+20]
	ext	mouse+0x14@al
	ld.w	%r10,[%r8]
	and	%r10,0x2	; 	xand	%r10,%r10,0x00000002
	jrne	__LX97		; 	xjrne	__L97
	jp	__LX94		; 	xjp	__L94
__LX111:				; __L111:
	ext	mouse+0x14@ah	; 	xld.w	%r10,[mouse+20]
	ext	mouse+0x14@al
	ld.w	%r10,[%r8]
	and	%r10,0x2	; 	xand	%r10,%r10,0x00000002
	jrne	__LX94		; 	xjrne	__L94
__LX97:				; __L97:
	ld.w	%r11,[%r2]	; 	xld.w	%r11,[%r2]
	ld.w	%r10,%r11
	and	%r10,0x4	; 	xand	%r10,%r10,0x00000004
	jreq	__LX99		; 	xjreq	__L99
	ld.w	%r10,%r11
	and	%r10,0x3b	; 	xand	%r10,%r10,0xfffffffb
	ld.w	[%r2],%r10	; 	xld.w	[%r2],%r10
	ld.w	%r10,[%r0]	; 	xld.w	%r10,[%r0]
	ext	0x0		; 	xoor	%r10,%r10,0x00040000
	ext	0x1000
	or	%r10,0x0
	jp	__LX112		; 	xjp	__L112
__LX99:				; __L99:
	ld.w	%r10,%r11
	or	%r10,0x4	; 	xoor	%r10,%r10,0x00000004
	ld.w	[%r2],%r10	; 	xld.w	[%r2],%r10
	ld.w	%r10,[%r0]	; 	xld.w	%r10,[%r0]
	ext	0x10		; 	xoor	%r10,%r10,0x00000400
	or	%r10,0x0
	jp	__LX112		; 	xjp	__L112
__LX94:				; __L94:
	ld.w	%r10,[%r3]	; 	xld.w	%r10,[%r3]
	add	%r10,%r11
	ld.w	[%r3],%r10	; 	xld.w	[%r3],%r10
	ext	0x4		; 	xadd	%r11,%r3,4
	add	%r11,%r3
	ld.w	%r10,[%r11]	; 	xld.w	%r10,[%r11]
	add	%r10,%r14
	ld.w	[%r11],%r10	; 	xld.w	[%r11],%r10
	cmp	%r12,0x0
	jreq	__LX102		; 	xjreq	__L102
	ld.w	%r11,[%r2]	; 	xld.w	%r11,[%r2]
	ld.w	%r10,%r11
	and	%r10,0x1	; 	xand	%r10,%r10,0x00000001
	jrne	__LX104		; 	xjrne	__L104
	ld.w	%r10,%r11
	or	%r10,0x1	; 	xoor	%r10,%r10,0x00000001
	ld.w	[%r2],%r10	; 	xld.w	[%r2],%r10
	ld.w	%r10,[%r0]	; 	xld.w	%r10,[%r0]
	ext	0x4		; 	xoor	%r10,%r10,0x00000100
	or	%r10,0x0
	jp	__LX113		; 	xjp	__L113
__LX102:				; __L102:
	ld.w	%r11,[%r2]	; 	xld.w	%r11,[%r2]
	ld.w	%r10,%r11
	and	%r10,0x1	; 	xand	%r10,%r10,0x00000001
	jreq	__LX104		; 	xjreq	__L104
	ld.w	%r10,%r11
	and	%r10,0x3e	; 	xand	%r10,%r10,0xfffffffe
	ld.w	[%r2],%r10	; 	xld.w	[%r2],%r10
	ld.w	%r10,[%r0]	; 	xld.w	%r10,[%r0]
	ext	0x400		; 	xoor	%r10,%r10,0x00010000
	or	%r10,0x0
__LX113:				; __L113:
	ld.w	[%r0],%r10	; 	xld.w	[%r0],%r10
__LX104:				; __L104:
	cmp	%r13,0x0
	jreq	__LX106		; 	xjreq	__L106
	ld.w	%r11,[%r2]	; 	xld.w	%r11,[%r2]
	ld.w	%r10,%r11
	and	%r10,0x2	; 	xand	%r10,%r10,0x00000002
	jrne	__LX101		; 	xjrne	__L101
	ld.w	%r10,%r11
	or	%r10,0x2	; 	xoor	%r10,%r10,0x00000002
	ld.w	[%r2],%r10	; 	xld.w	[%r2],%r10
	ld.w	%r10,[%r0]	; 	xld.w	%r10,[%r0]
	ext	0x8		; 	xoor	%r10,%r10,0x00000200
	or	%r10,0x0
	jp	__LX112		; 	xjp	__L112
__LX106:				; __L106:
	ld.w	%r11,[%r2]	; 	xld.w	%r11,[%r2]
	ld.w	%r10,%r11
	and	%r10,0x2	; 	xand	%r10,%r10,0x00000002
	jreq	__LX101		; 	xjreq	__L101
	ld.w	%r10,%r11
	and	%r10,0x3d	; 	xand	%r10,%r10,0xfffffffd
	ld.w	[%r2],%r10	; 	xld.w	[%r2],%r10
	ld.w	%r10,[%r0]	; 	xld.w	%r10,[%r0]
	ext	0x800		; 	xoor	%r10,%r10,0x00020000
	or	%r10,0x0
__LX112:				; __L112:
	ld.w	[%r0],%r10	; 	xld.w	[%r0],%r10
__LX101:				; __L101:
	ld.w	%r15,0x0
	ext	mouse+0x8@ah	; 	xld.w	[mouse+8],%r15
	ext	mouse+0x8@al
	ld.w	[%r8],%r15
	ext	__LX82@rm	; 	xjp	__L82
	jp	__LX82@rl
__LX83:				; __L83:
	add	%sp,0x1		; 	xadd	%sp,%sp,4
	popn	%r3
	ret
	.align	1
	.global	mouse_get
mouse_get:
;	.frame	%sp,20,$31		# vars= 4, regs= 4/0, args= 0, extra= 0
;	.mask	0x80070000,-4
;	.fmask	0x00000000,0
	pushn	%r2
	sub	%sp,0x1		; 	xsub	%sp,%sp,4
	ld.w	%r0,%r12
	ld.w	%r1,%r13
	ld.w	%r2,%r14
	ld.w	%r12,%sp
	ext	pceSyncEnterCriticalSection@rm	; 	xcall	pceSyncEnterCriticalSection
	call	pceSyncEnterCriticalSection@rl
	cmp	%r0,0x0
	jreq	__LX118		; 	xjreq	__L118
	ext	mouse+0xc@ah	; 	xld.w	%r10,[mouse+12]
	ext	mouse+0xc@al
	ld.w	%r10,[%r8]
	ld.w	[%r0],%r10	; 	xld.w	[%r0],%r10
__LX118:				; __L118:
	cmp	%r1,0x0
	jreq	__LX119		; 	xjreq	__L119
	ext	mouse+0x10@ah	; 	xld.w	%r10,[mouse+16]
	ext	mouse+0x10@al
	ld.w	%r10,[%r8]
	ld.w	[%r1],%r10	; 	xld.w	[%r1],%r10
__LX119:				; __L119:
	cmp	%r2,0x0
	jreq	__LX120		; 	xjreq	__L120
	ext	mouse+0x14@h	; 	xld.w	%r10,mouse+20
	ext	mouse+0x14@m
	ld.w	%r10,mouse+0x14@l
	ld.w	%r11,[%r10]	; 	xld.w	%r11,[%r10]
	ext	0x4		; 	xld.w	%r10,[%r10+4]
	ld.w	%r10,[%r10]
	or	%r11,%r10
	ld.w	[%r2],%r11	; 	xld.w	[%r2],%r11
__LX120:				; __L120:
	ext	mouse+0xc@h	; 	xld.w	%r10,mouse+12
	ext	mouse+0xc@m
	ld.w	%r10,mouse+0xc@l
	ld.w	%r15,0x0
	ld.w	[%r10],%r15	; 	xld.w	[%r10],%r15
	ext	0x4		; 	xld.w	[%r10+4],%r15
	ld.w	[%r10],%r15
	ext	0xc		; 	xld.w	[%r10+12],%r15
	ld.w	[%r10],%r15
	ld.w	%r12,%sp
	ext	pceSyncLeaveCriticalSection@rm	; 	xcall	pceSyncLeaveCriticalSection
	call	pceSyncLeaveCriticalSection@rl
	add	%sp,0x1		; 	xadd	%sp,%sp,4
	popn	%r2
	ret

	.lcomm	mouse 28
