
;  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	2
__LC0:
	.ascii	"rb\000"
	.align	2
__LC1:
	.ascii	"Vgm \000"
	.code
	.align	1
	.global	vgm_init
vgm_init:
;	.frame	%sp,20,$31		# vars= 0, regs= 5/0, args= 0, extra= 0
;	.mask	0x800f0000,-4
;	.fmask	0x00000000,0
	pushn	%r3
	ld.w	%r1,%r12
	ld.w	%r0,%r13
	ext	0x4		; 	xadd	%r2,%r1,4
	add	%r2,%r1
	ext	0x44		; 	xadd	%r3,%r1,68
	add	%r3,%r1
	ld.w	%r13,0x0
	ext	0x2		; 	xld.w	%r14,0x00000098		; 152
	ld.w	%r14,0x18
	ext	memset@rm	; 	xcall	memset
	call	memset@rl
	ld.w	%r12,%r0
	ext	__LC0+0x0@h	; 	xld.w	%r13,__LC0
	ext	__LC0+0x0@m
	ld.w	%r13,__LC0+0x0@l
	ext	gzopen@rm	; 	xcall	gzopen
	call	gzopen@rl
	ld.w	[%r1],%r10	; 	xld.w	[%r1],%r10
	cmp	%r10,0x0
	jreq	__LX72		; 	xjreq	__L72
	ext	0x1		; 	xld.w	%r0,0x00000040		; 64
	ld.w	%r0,0x0
	ld.w	%r12,%r10
	ld.w	%r13,%r2
	ld.w	%r14,%r0
	ext	gzread@rm	; 	xcall	gzread
	call	gzread@rl
	cmp	%r10,%r0
	jrne	__LX72		; 	xjrne	__L72
	ld.w	%r12,%r2
	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
	ld.w	%r0,%r10
	cmp	%r0,0x0
	jrne	__LX72		; 	xjrne	__L72
	ext	0x10		; 	xld.w	%r13,[%r1+16]
	ld.w	%r13,[%r1]
	cmp	%r13,0x0
	jreq	__LX72		; 	xjreq	__L72
	ld.w	%r12,%r3
	ext	sn76489_reset@rm	; 	xcall	sn76489_reset
	call	sn76489_reset@rl
	ext	0x1d4e		; 	xld.w	%r10,-44100			; 0xffff53bc
	ld.w	%r10,0x3c
	ext	0x90		; 	xld.w	[%r1+144],%r10
	ld.w	[%r1],%r10
	ld.w	%r10,%r0
	jp	__LX76		; 	xjp	__L76
__LX72:				; __L72:
	ld.w	%r12,%r1
	call	vgm_free	; 	xcall	vgm_free
	ld.w	%r10,0x3f	; 	xld.w	%r10,-1			; 0xffffffff
__LX76:				; __L76:
	popn	%r3
	ret
	.align	1
	.global	vgm_free
vgm_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
	ld.w	%r12,[%r0]	; 	xld.w	%r12,[%r0]
	cmp	%r12,0x0
	jreq	__LX78		; 	xjreq	__L78
	ext	gzclose@rm	; 	xcall	gzclose
	call	gzclose@rl
	ld.w	%r11,0x0
	ld.w	[%r0],%r11	; 	xld.w	[%r0],%r11
__LX78:				; __L78:
	popn	%r0
	ret
	.align	1
	.global	vgm_stream_callback
vgm_stream_callback:
;	.frame	%sp,4,$31		# vars= 0, regs= 1/0, args= 0, extra= 0
;	.mask	0x80000000,-4
;	.fmask	0x00000000,0
	ld.w	%r10,%r12
	ld.w	%r12,%r13
	ld.w	%r13,%r10
	ext	vgm_mix@rm	; 	xcall	vgm_mix
	call	vgm_mix@rl
	ret
	.align	1
	.global	vgm_play
vgm_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	vgm_stop	; 	xcall	vgm_stop
	ext	g_vgm+0x0@h	; 	xld.w	%r1,g_vgm
	ext	g_vgm+0x0@m
	ld.w	%r1,g_vgm+0x0@l
	ld.w	%r12,%r1
	ld.w	%r13,%r0
	call	vgm_init	; 	xcall	vgm_init
	ld.w	%r0,%r10
	cmp	%r0,0x0
	jrne	__LX81		; 	xjrne	__L81
	ext	0x5		; 	xld.w	%r12,0x00000140		; 320
	ld.w	%r12,0x0
	ext	vgm_stream_callback+0x0@h	; 	xld.w	%r13,vgm_stream_callback
	ext	vgm_stream_callback+0x0@m
	ld.w	%r13,vgm_stream_callback+0x0@l
	ld.w	%r14,%r1
	ld.w	%r15,%r0
	ext	stream_play@rm	; 	xcall	stream_play
	call	stream_play@rl
	ld.w	%r10,%r0
	jp	__LX82		; 	xjp	__L82
__LX81:				; __L81:
	ld.w	%r10,0x3f	; 	xld.w	%r10,-1			; 0xffffffff
__LX82:				; __L82:
	popn	%r1
	ret
	.align	1
	.global	vgm_stop
vgm_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	g_vgm+0x0@h	; 	xld.w	%r12,g_vgm
	ext	g_vgm+0x0@m
	ld.w	%r12,g_vgm+0x0@l
	call	vgm_free	; 	xcall	vgm_free
	ret

	.lcomm	g_vgm 152
