
;  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	sprite_init
sprite_init:
;	.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
	ld.w	%r1,%r12
	ld.w	%r2,%r13
	ld.w	%r3,%r14
	ld.w	[%sp+0x0],%r15	; 	xld.w	[%sp],%r15
	ext	sprite_driver+0x0@h	; 	xld.w	%r0,sprite_driver
	ext	sprite_driver+0x0@m
	ld.w	%r0,sprite_driver+0x0@l
	ld.w	%r12,%r0
	ld.w	%r13,0x0
	ld.w	%r14,0x14	; 	xld.w	%r14,0x00000014		; 20
	ext	memset@rm	; 	xcall	memset
	call	memset@rl
	ld.w	[%r0],%r1	; 	xld.w	[%r0],%r1
	ext	sprite_driver+0x4@ah	; 	xld.w	[sprite_driver+4],%r2
	ext	sprite_driver+0x4@al
	ld.w	[%r8],%r2
	ext	sprite_driver+0x8@ah	; 	xld.w	[sprite_driver+8],%r3
	ext	sprite_driver+0x8@al
	ld.w	[%r8],%r3
	ld.w	%r11,[%sp+0x0]	; 	xld.w	%r11,[%sp]
	ext	sprite_driver+0xc@ah	; 	xld.w	[sprite_driver+12],%r11
	ext	sprite_driver+0xc@al
	ld.w	[%r8],%r11
	ld.w	%r11,[%sp+0x6]	; 	xld.w	%r11,[%sp+24]
	ext	sprite_driver+0x10@ah	; 	xld.w	[sprite_driver+16],%r11
	ext	sprite_driver+0x10@al
	ld.w	[%r8],%r11
	add	%sp,0x1		; 	xadd	%sp,%sp,4
	popn	%r3
	ret
; APP
	
	.code
	.align	1
	.global	sprite_draw
sprite_draw:
	pushn	%r1
	;// %r12 := x
	;// %r13 := y
	;// %r14 := sprno
	;// %r15 := param
	ext	sprite_driver+0x0@h	; 	xld.w	%r9, sprite_driver		; %r9  := driver = &sprite_driver
	ext	sprite_driver+0x0@m
	ld.w	%r9,sprite_driver+0x0@l
	ld.w	%r4, %r15			; %r4  := param
	ld.w	%r5, [%r9]+			; %r5  := render = driver->render
	ld.w	%r6, [%r9]+			; %r6  := sprites = driver->sprites
	ld.w	%r7, [%r9]+			; %r7  := sprite_count = driver->sprite_count
	ld.w	%r10, [%r9]+			; %r10 := textures = driver->textures
	ld.w	%r11, [%r9]			; %r11 := texture_count = driver->texture_count
	ext	0x14		; 	xld.w	%r0, [%r5+20]			; %r0  := context = render->context
	ld.w	%r0,[%r5]
	add	%r0,0x30	; 	xadd	%r0, %r0, 48			; %r0  := &context->texture
	ld.w	%r1, [%r0]			; %r1  := texture_save = context->texture
	;// %r0  := &context->texture
	;// %r1  := texture_save
	;// %r4  := param
	;// %r5  := render
	;// %r6  := sprites
	;// %r7  := sprite_count
	;// %r10 := textures
	;// %r11 := texture_count
	;// %r12 := x
	;// %r13 := y
	;// %r14 := sprno
	cmp	%r14, %r7			; if((unsigned)sprno >= (unsigned)sprite_count) DIE()
	jruge	sprite_draw_DIE	; 	xjruge	sprite_draw_DIE
	sla	%r14,0x3	; 	xsla	%r14, 3				; %r14 := sprno * 8 // 8 = sizeof(SPRITE)
	add	%r14, %r6			; %r14 := sprite = sprites + sprno * 8
	;// %r0  := &context->texture
	;// %r1  := texture_save
	;// %r4  := param
	;// %r5  := render
	;// %r10 := textures
	;// %r11 := texture_count
	;// %r12 := x
	;// %r13 := y
	;// %r14 := sprite
	ld.ub	%r6, [%r14]+			; %r6  := texno = sprite->texno
	cmp	%r6, %r11			; if((unsigned)texno >= (unsigned)texture_count) DIE()
	jruge	sprite_draw_DIE	; 	xjruge	sprite_draw_DIE
	ld.w	%r9,0x1c	; 	xld.w	%r9, 28				; %r9  := 28 // 28 = sizeof(TEXTURE)
	mlt.h	%r6, %r9			; %alr := texno * 28
	ld.w	%r9, %alr			; %r9  := texno * 28
	add	%r9, %r10			; %r9  := texture = textures + texno * 28
	ld.w	[%r0], %r9			; context->texture = texture
	;// %r0  := &context->texture
	;// %r1  := texture_save
	;// %r4  := param
	;// %r5  := render
	;// %r12 := x
	;// %r13 := y
	;// %r14 := sprite + 1
	sub	%sp,0x4		; 	xsub	%sp, %sp, 16
	ld.ub	%r15, [%r14]+			; %r15       := sprite->x
	ld.ub	%r9, [%r14]+			; %r9        := sprite->y
	ld.w	[%sp+0x0],%r9	; 	xld.w	[%sp+0], %r9			; [%sp+0]    := sprite->y
	ld.ub	%r6, [%r14]+			; %r6        := sprite->w
	ld.w	[%sp+0x1],%r6	; 	xld.w	[%sp+4], %r6			; [%sp+4]    := sprite->w
	ld.ub	%r7, [%r14]+			; %r7        := sprite->h
;//	xld.w	[%sp+8], %r7			; [%sp+8]    := sprite->h ----+
	ld.b	%r10, [%r14]+			; %r10       := sprite->cx    |
	ld.b	%r11, [%r14]+			; %r11       := sprite->cy    |
	ld.ub	%r14, [%r14]			; %r14       := sprite->param |
	ld.w	[%sp+0x2],%r7	; 	xld.w	[%sp+8], %r7			; <---------------------------+		*anti-interlock*
	xor	%r4, %r14			; %r4        := param ^= sprite->param
	ld.w	[%sp+0x3],%r4	; 	xld.w	[%sp+12], %r4			; [%sp+12]   := param
	rr	%r4,0x8		; 	xrr	%r4, 8				; %r4(31:30) := DRW_REVX,DRW_REVY
	;// %r0        := &context->texture
	;// %r1        := texture_save
	;// %r4(31:30) := DRW_REVX,DRW_REVY
	;// %r5        := render
	;// %r6        := sprite->w
	;// %r7        := sprite->h
	;// %r10       := sprite->cx
	;// %r11       := sprite->cy
	;// %r12       := x
	;// %r13       := y
	;// %r15       := sprite->x
	;// [%sp+0]    := sprite->y
	;// [%sp+4]    := sprite->w
	;// [%sp+8]    := sprite->h
	;// [%sp+12]   := param
	add	%r4, %r4			; if(param & DRW_REVX)
	jruge.d	4
	 ld.w	%r14, %r13			; %r14 := y				*delay*
	 sub	%r10, %r6			;   %r10 :=   sprite->cx - sprite->w
	 not	%r10, %r10			;   %r10 := -(sprite->cx - sprite->w + 1)
	sub	%r12, %r10			; %r12 := (x -= sprite->cx) or (x += sprite->cx - sprite->w + 1)
	;// %r0        := &context->texture
	;// %r1        := texture_save
	;// %r4(31:30) := DRW_REVX,DRW_REVY
	;// %r5        := render
	;// %r7        := sprite->h
	;// %r11       := sprite->cy
	;// %r12       := x
	;// %r14       := y
	;// %r15       := sprite->x
	;// [%sp+0]    := sprite->y
	;// [%sp+4]    := sprite->w
	;// [%sp+8]    := sprite->h
	;// [%sp+12]   := param
	add	%r4, %r4			; if(param & DRW_REVY)
	jruge.d	4
	 ld.w	%r13, %r12			; %r13 := x				*delay*
	 sub	%r11, %r7			;   %r11 :=   sprite->cy - sprite->h
	 not	%r11, %r11			;   %r11 := -(sprite->cy - sprite->h + 1)
	sub	%r14, %r11			; %r14 := (y -= sprite->cy) or (y += sprite->cy - sprite->h + 1)
	;// %r0      := &context->texture
	;// %r1      := texture_save
	;// %r5      := render
	;// %r13     := x
	;// %r14     := y
	;// %r15     := sprite->x
	;// [%sp+0]  := sprite->y
	;// [%sp+4]  := sprite->w
	;// [%sp+8]  := sprite->h
	;// [%sp+12] := param
	ext	render_object@rm	; 	xcall.d	render_object
	call.d	render_object@rl
	ld.w	%r12, %r5			; %r12 := render			*delay*
	add	%sp,0x4		; 	xadd	%sp, %sp, 16
	;// %r0 := &context->texture
	;// %r1 := texture_save
	ld.w	[%r0], %r1			; context->texture = texture_save
	popn	%r1
	ret

	.code
	.align	2
__LC0:
	.ascii	"clipspr.$(%d)\000"
; NO_APP
	.code
	.align	1
sprite_draw_DIE:
;	.frame	%sp,12,$31		# vars= 0, regs= 1/0, args= 8, extra= 0
;	.mask	0x80000000,-4
;	.fmask	0x00000000,0
	sub	%sp,0x2		; 	xsub	%sp,%sp,8
	ext	__LC0+0x0@h	; 	xld.w	%r10,__LC0
	ext	__LC0+0x0@m
	ld.w	%r10,__LC0+0x0@l
	ld.w	[%sp+0x0],%r10	; 	xld.w	[%sp],%r10
	ext	0x3		; 	xld.w	%r10,0x000000e5		; 229
	ld.w	%r10,0x25
	ld.w	[%sp+0x1],%r10	; 	xld.w	[%sp+4],%r10
	ext	die@rm		; 	xcall	die
	call	die@rl
	add	%sp,0x2		; 	xadd	%sp,%sp,8
	ret

	.comm	sprite_driver 20
