
;  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:

	.lcomm	gym_sn76489.66 76
	.code
	.align	2
__LC0:
	.ascii	"rb\000"
	.align	2
__LC1:
	.ascii	"GYMX\000"
	.code
	.align	1
	.global	gym_init
gym_init:
;	.frame	%sp,440,$31		# vars= 428, regs= 3/0, args= 0, extra= 0
;	.mask	0x80030000,-4
;	.fmask	0x00000000,0
	pushn	%r1
	sub	%sp,0x6b	; 	xsub	%sp,%sp,428
	ld.w	%r1,%r12
	ld.w	%r0,%r13
	ld.w	%r13,0x0
	ext	0x77		; 	xld.w	%r14,0x00001de8		; 7656
	ld.w	%r14,0x28
	ext	memset@rm	; 	xcall	memset
	call	memset@rl
	ext	gym_ym2612+0x0@h	; 	xld.w	%r12,gym_ym2612
	ext	gym_ym2612+0x0@m
	ld.w	%r12,gym_ym2612+0x0@l
	ld.w	[%r1],%r12	; 	xld.w	[%r1],%r12
	ext	0xe		; 	xld.w	%r13,0x00750aaa		; 7670442
	ext	0x142a
	ld.w	%r13,0x2a
	ext	ym2612_init@rm	; 	xcall	ym2612_init
	call	ym2612_init@rl
	ext	gym_sn76489.66+0x0@h	; 	xld.w	%r12,gym_sn76489.66
	ext	gym_sn76489.66+0x0@m
	ld.w	%r12,gym_sn76489.66+0x0@l
	ext	0x4		; 	xld.w	[%r1+4],%r12
	ld.w	[%r1],%r12
	ext	0x6		; 	xld.w	%r13,0x00369e94		; 3579540
	ext	0x1a7a
	ld.w	%r13,0x14
	ext	sn76489_reset@rm	; 	xcall	sn76489_reset
	call	sn76489_reset@rl
	ld.w	%r12,%r0
	ext	__LC0+0x0@h	; 	xld.w	%r13,__LC0
	ext	__LC0+0x0@m
	ld.w	%r13,__LC0+0x0@l
	ext	fopen@rm	; 	xcall	fopen
	call	fopen@rl
	ext	0x10		; 	xld.w	[%r1+16],%r10
	ld.w	[%r1],%r10
	cmp	%r10,0x0
	jreq	__LX72		; 	xjreq	__L72
	ld.w	%r12,%sp
	ext	0x6		; 	xld.w	%r13,0x000001ac		; 428
	ld.w	%r13,0x2c
	ld.w	%r14,0x1	; 	xld.w	%r14,0x00000001		; 1
	ld.w	%r15,%r10
	ext	fread@rm	; 	xcall	fread
	call	fread@rl
	cmp	%r10,0x1	; 	xcmp	%r10,1
	jrne	__LX72		; 	xjrne	__L72
	ld.w	%r12,%sp
	ext	__LC1+0x0@h	; 	xld.w	%r13,__LC1
	ext	__LC1+0x0@m
	ld.w	%r13,__LC1+0x0@l
	ld.w	%r14,0x4	; 	xld.w	%r14,0x00000004		; 4
	ext	memcmp@rm	; 	xcall	memcmp
	call	memcmp@rl
	cmp	%r10,0x0
	jrne	__LX72		; 	xjrne	__L72
	ext	0x6		; 	xld.w	%r11,[%sp+424]
	ld.w	%r11,[%sp+0x28]
	cmp	%r11,0x0
	jrne	__LX72		; 	xjrne	__L72
	ext	0x6		; 	xld.w	%r10,[%sp+420]
	ld.w	%r10,[%sp+0x24]
	ext	0x8		; 	xld.w	[%r1+8],%r10
	ld.w	[%r1],%r10
	ld.w	%r10,%r11
	jp	__LX76		; 	xjp	__L76
__LX72:				; __L72:
	ld.w	%r12,%r1
	call	gym_free	; 	xcall	gym_free
	ld.w	%r10,0x3f	; 	xld.w	%r10,-1			; 0xffffffff
__LX76:				; __L76:
	add	%sp,0x6b	; 	xadd	%sp,%sp,428
	popn	%r1
	ret
	.align	1
	.global	gym_free
gym_free:
;	.frame	%sp,8,$31		# vars= 0, regs= 2/0, args= 0, extra= 0
;	.mask	0x80010000,-4
;	.fmask	0x00000000,0
	pushn	%r0
	ld.w	%r0,%r12
	ext	0x10		; 	xld.w	%r12,[%r0+16]
	ld.w	%r12,[%r0]
	cmp	%r12,0x0
	jreq	__LX78		; 	xjreq	__L78
	ext	fclose@rm	; 	xcall	fclose
	call	fclose@rl
	ld.w	%r11,0x0
	ext	0x10		; 	xld.w	[%r0+16],%r11
	ld.w	[%r0],%r11
__LX78:				; __L78:
	popn	%r0
	ret
	.align	1
	.global	gym_stream_callback
gym_stream_callback:
;	.frame	%sp,16,$31		# vars= 0, regs= 4/0, args= 0, extra= 0
;	.mask	0x80070000,-4
;	.fmask	0x00000000,0
	pushn	%r2
	ld.w	%r1,%r12
	ld.w	%r2,%r13
	ld.w	%r0,0x3		; 	xld.w	%r0,0x00000003		; 3
__LX80:				; __L80:
	ld.w	%r12,%r2
	ld.w	%r13,%r1
	ext	gym_mix@rm	; 	xcall	gym_mix
	call	gym_mix@rl
	cmp	%r10,0x0
	jrne	__LX81		; 	xjrne	__L81
	ext	0xa		; 	xadd	%r1,%r1,640
	add	%r1,0x0
	sub	%r0,0x1		; 	xsub	%r0,%r0,1
	jrne	__LX80		; 	xjrne	__L80
__LX81:				; __L81:
	popn	%r2
	ret
	.align	1
	.global	gym_play
gym_play:
;	.frame	%sp,12,$31		# vars= 0, regs= 3/0, args= 0, extra= 0
;	.mask	0x80030000,-4
;	.fmask	0x00000000,0
	pushn	%r1
	ld.w	%r0,%r12
	call	gym_stop	; 	xcall	gym_stop
	ext	driver+0x0@h	; 	xld.w	%r1,driver
	ext	driver+0x0@m
	ld.w	%r1,driver+0x0@l
	ld.w	%r12,%r1
	ld.w	%r13,%r0
	call	gym_init	; 	xcall	gym_init
	ld.w	%r0,%r10
	cmp	%r0,0x0
	jrne	__LX86		; 	xjrne	__L86
	ext	0xf		; 	xld.w	%r12,0x000003c0		; 960
	ld.w	%r12,0x0
	ext	gym_stream_callback+0x0@h	; 	xld.w	%r13,gym_stream_callback
	ext	gym_stream_callback+0x0@m
	ld.w	%r13,gym_stream_callback+0x0@l
	ld.w	%r14,%r1
	ld.w	%r15,0x1	; 	xld.w	%r15,0x00000001		; 1
	ext	stream_play@rm	; 	xcall	stream_play
	call	stream_play@rl
	ld.w	%r10,%r0
	jp	__LX87		; 	xjp	__L87
__LX86:				; __L86:
	ld.w	%r10,0x3f	; 	xld.w	%r10,-1			; 0xffffffff
__LX87:				; __L87:
	popn	%r1
	ret
	.align	1
	.global	gym_stop
gym_stop:
;	.frame	%sp,4,$31		# vars= 0, regs= 1/0, args= 0, extra= 0
;	.mask	0x80000000,-4
;	.fmask	0x00000000,0
	ext	stream_stop@rm	; 	xcall	stream_stop
	call	stream_stop@rl
	ext	driver+0x0@h	; 	xld.w	%r12,driver
	ext	driver+0x0@m
	ld.w	%r12,driver+0x0@l
	call	gym_free	; 	xcall	gym_free
	ret

	.lcomm	driver 7656

