
;  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:
; APP
	
		.code
		.align	1
idle_context_switcher:
		;// %r12     := nowsp
		;// %r13     := flag
		;// [%sp+ 0] := retp 劅 usr/PIECE/sysdev/pcekn/timer.c:timer_isr()傊偺栠傝億僀儞僞
		;// [%sp+ 4] := %alr 劍 pceTimerSetContextSwitcher()乽僗僞僢僋僼儗乕儉偺峔惉乿巇條
		;// [%sp+ 8] := %ahr 劆
		;// [%sp+12] := %r0  劆
		;// [%sp+16] := %r1  劆
		;// [%sp+20] := %r2  劆
		;// [%sp+24] := %r3  劆
		;// [%sp+28] := %r4  劆
		;// [%sp+32] := %r5  劆
		;// [%sp+36] := %r6  劆
		;// [%sp+40] := %r7  劆
		;// [%sp+44] := %r8  劆
		;// [%sp+48] := %r9  劆
		;// [%sp+52] := %r10 劆
		;// [%sp+56] := %r11 劆
		;// [%sp+60] := %r12 劆
		;// [%sp+64] := %r13 劆
		;// [%sp+68] := %r14 劆
		;// [%sp+72] := %r15 劆
		;// [%sp+76] := %psr 劆
		;// [%sp+80] := %pc  劏
	ext	idle_count+0x0@ah	; 		xld.w		%r4, [idle_count]		;// idle_count--
	ext	idle_count+0x0@al
	ld.w	%r4,[%r8]
		sub		%r4, 1
	ext	idle_count+0x0@ah	; 		xld.w		[idle_count], %r4
	ext	idle_count+0x0@al
	ld.w	[%r8],%r4
		jrgt		idle_context_switcher_RET	;// if(idle_count <= 0) {
		and		%r13, 1				;//   if(!(flag & PCE_TSCSF_INCRITICAL)) {
		jrne		idle_context_switcher_RET
	ld.w	%r4,[%sp+0x13]	; 		xld.w		%r4, [%sp+76]			;//     %r4  := %psr
	ext	0x3c		; 		xand		%r4, %r4, 0x00000F00		;//     if(%psr[IL] == 0) { /* 懡廳妱傝崬傒拞偱側偄偙偲 */
	and	%r4,0x0
		jrne		idle_context_switcher_RET
	ext	idle_sp+0x0@ah	; 		xld.w		[idle_sp], %r12			;//       idle_sp := nowsp
	ext	idle_sp+0x0@al
	ld.w	[%r8],%r12
	ext	main_sp+0x0@ah	; 		xld.w		%r12, [main_sp]			;//       nowsp   := main_sp
	ext	main_sp+0x0@al
	ld.w	%r12,[%r8]
idle_context_switcher_RET:					;// } } }
		ret.d						;// return  nowsp
		ld.w		%r10, %r12			;// %r10 := nowsp	*delay*

	
		.code
		.align	1
idle_exec:
		;// 儊僀儞僗儗僢僪偺僐儞僥僉僗僩傪戅旔偟傑偡丅
	sub	%sp,0x1		; 		xsub		%sp, %sp, 4
		pushn		%r15
		ld.w		%r0, %alr
		ld.w		%r1, %ahr
		pushn		%r1
		ld.w		%r0, %psr
	ld.w	[%sp+0x12],%r0	; 		xld.w		[%sp+72], %r0
		;// [%sp+ 0] := %alr 劍 pceTimerSetContextSwitcher()乽僗僞僢僋僼儗乕儉偺峔惉乿巇條
		;// [%sp+ 4] := %ahr 劆
		;// [%sp+ 8] := %r0  劆
		;// [%sp+12] := %r1  劆
		;// [%sp+16] := %r2  劆
		;// [%sp+20] := %r3  劆
		;// [%sp+24] := %r4  劆
		;// [%sp+28] := %r5  劆
		;// [%sp+32] := %r6  劆
		;// [%sp+36] := %r7  劆
		;// [%sp+40] := %r8  劆
		;// [%sp+44] := %r9  劆
		;// [%sp+48] := %r10 劆
		;// [%sp+52] := %r11 劆
		;// [%sp+56] := %r12 劆
		;// [%sp+60] := %r13 劆
		;// [%sp+64] := %r14 劆
		;// [%sp+68] := %r15 劆
		;// [%sp+72] := %psr 劆
		;// [%sp+76] := %pc  劏
		ld.w		%r0, %sp
	ext	main_sp+0x0@ah	; 		xld.w		[main_sp], %r0
	ext	main_sp+0x0@al
	ld.w	[%r8],%r0
		;// 傾僀僪儖僗儗僢僪偺僐儞僥僉僗僩傪暅尦偟傑偡丅
	ext	idle_sp+0x0@ah	; 		xld.w		%r0, [idle_sp]
	ext	idle_sp+0x0@al
	ld.w	%r0,[%r8]
		ld.w		%sp, %r0
		;// [%sp+ 0] := %alr 劍 pceTimerSetContextSwitcher()乽僗僞僢僋僼儗乕儉偺峔惉乿巇條
		;// [%sp+ 4] := %ahr 劆
		;// [%sp+ 8] := %r0  劆
		;// [%sp+12] := %r1  劆
		;// [%sp+16] := %r2  劆
		;// [%sp+20] := %r3  劆
		;// [%sp+24] := %r4  劆
		;// [%sp+28] := %r5  劆
		;// [%sp+32] := %r6  劆
		;// [%sp+36] := %r7  劆
		;// [%sp+40] := %r8  劆
		;// [%sp+44] := %r9  劆
		;// [%sp+48] := %r10 劆
		;// [%sp+52] := %r11 劆
		;// [%sp+56] := %r12 劆
		;// [%sp+60] := %r13 劆
		;// [%sp+64] := %r14 劆
		;// [%sp+68] := %r15 劆
		;// [%sp+72] := %psr 劆
		;// [%sp+76] := %pc  劏
		popn		%r1
		ld.w		%ahr, %r1
		ld.w		%alr, %r0
		popn		%r15
		reti				;// 偙傟偱妱傝崬傒嫋壜偵側傞丅

	
		.code
		.align		1
		.global		idle_exit
_idle_ret:
		ld.w		%r12, %r10		;// %r12 := exit_code
idle_exit:
		;// idle_yield()偐傜屇偽傟偨応崌丄偙傟埲崀僾儕僄儞僾僩偑敪惗偟側偄傛偆丄妱傝崬傒嬛巭丅
		ld.w		%psr, %r8		;// %psr[IE] := 0
		;// 傾僀僪儖僗儗僢僪偺廔椆僐乕僪傪奿擺偟丄傾僀僪儖僗儗僢僪偺僐儞僥僉僗僩傪攋婞偟傑偡丅
	ext	idle_exit_code+0x0@ah	; 		xld.w		[idle_exit_code], %r12	;// idle_exit_code := exit_code
	ext	idle_exit_code+0x0@al
	ld.w	[%r8],%r12
	ext	idle_sp+0x0@ah	; 		xld.w		[idle_sp], %r8		;// idle_sp        := NULL
	ext	idle_sp+0x0@al
	ld.w	[%r8],%r8
		;// 儊僀儞僗儗僢僪偺僐儞僥僉僗僩傪暅尦偟傑偡丅
	ext	main_sp+0x0@ah	; 		xld.w		%r0, [main_sp]		;// %r0 := main_sp
	ext	main_sp+0x0@al
	ld.w	%r0,[%r8]
		ld.w		%sp, %r0		;// %sp := main_sp
		;// [%sp+ 0] := %alr 劍 pceTimerSetContextSwitcher()乽僗僞僢僋僼儗乕儉偺峔惉乿巇條
		;// [%sp+ 4] := %ahr 劆
		;// [%sp+ 8] := %r0  劆
		;// [%sp+12] := %r1  劆
		;// [%sp+16] := %r2  劆
		;// [%sp+20] := %r3  劆
		;// [%sp+24] := %r4  劆
		;// [%sp+28] := %r5  劆
		;// [%sp+32] := %r6  劆
		;// [%sp+36] := %r7  劆
		;// [%sp+40] := %r8  劆
		;// [%sp+44] := %r9  劆
		;// [%sp+48] := %r10 劆
		;// [%sp+52] := %r11 劆
		;// [%sp+56] := %r12 劆
		;// [%sp+60] := %r13 劆
		;// [%sp+64] := %r14 劆
		;// [%sp+68] := %r15 劆
		;// [%sp+72] := %psr 劆
		;// [%sp+76] := %pc  劏
		popn		%r1
		ld.w		%ahr, %r1
		ld.w		%alr, %r0
		popn		%r15
		reti					;// idle_yield()偐傜屇偽傟偨応崌偼丄妱傝崬傒嬛巭偺傑傑婣傞丅
							;// idle_wait() 偐傜屇偽傟偨応崌偼丄尦偺妱傝崬傒忬懺偵栠傞丅

; NO_APP
	.code
	.align	1
	.global	idle_init
idle_init:
;	.frame	%sp,4,$31		# vars= 0, regs= 1/0, args= 0, extra= 0
;	.mask	0x80000000,-4
;	.fmask	0x00000000,0
	cmp	%r12,0x0
	jreq	__LX71		; 	xjreq	__L71
	ext	idle_stack+0x1fa8@h	; 	xld.w	%r10,idle_stack+8104
	ext	idle_stack+0x1fa8@m
	ld.w	%r10,idle_stack+0x1fa8@l
	ext	idle_sp+0x0@ah	; 	xld.w	[idle_sp],%r10
	ext	idle_sp+0x0@al
	ld.w	[%r8],%r10
	ld.w	%r11,0x0
	ext	idle_stack+0x1fd0@ah	; 	xld.w	[idle_stack+8144],%r11
	ext	idle_stack+0x1fd0@al
	ld.w	[%r8],%r11
	ext	idle_stack+0x1fe0@ah	; 	xld.w	[idle_stack+8160],%r13
	ext	idle_stack+0x1fe0@al
	ld.w	[%r8],%r13
	ld.w	%r10,0x10	; 	xld.w	%r10,0x00000010		; 16
	ext	idle_stack+0x1ff0@ah	; 	xld.w	[idle_stack+8176],%r10
	ext	idle_stack+0x1ff0@al
	ld.w	[%r8],%r10
	ext	idle_stack+0x1ff4@ah	; 	xld.w	[idle_stack+8180],%r12
	ext	idle_stack+0x1ff4@al
	ld.w	[%r8],%r12
	ext	_idle_ret+0x0@h	; 	xld.w	%r10,_idle_ret
	ext	_idle_ret+0x0@m
	ld.w	%r10,_idle_ret+0x0@l
	ext	idle_stack+0x1ff8@ah	; 	xld.w	[idle_stack+8184],%r10
	ext	idle_stack+0x1ff8@al
	ld.w	[%r8],%r10
	jp	__LX72		; 	xjp	__L72
__LX71:				; __L71:
	ext	idle_sp+0x0@ah	; 	xld.w	[idle_sp],%r12
	ext	idle_sp+0x0@al
	ld.w	[%r8],%r12
__LX72:				; __L72:
	ret
	.align	1
	.global	idle_yield
idle_yield:
;	.frame	%sp,12,$31		# vars= 4, regs= 2/0, args= 0, extra= 0
;	.mask	0x80010000,-4
;	.fmask	0x00000000,0
	pushn	%r0
	sub	%sp,0x1		; 	xsub	%sp,%sp,4
	ext	pceTimerGetCount@rm	; 	xcall	pceTimerGetCount
	call	pceTimerGetCount@rl
	ext	apptm_wk+0x0@ah	; 	xld.w	%r11,[apptm_wk]
	ext	apptm_wk+0x0@al
	ld.w	%r11,[%r8]
	ld.w	%r0,%r10
	sub	%r0,%r11
	ld.w	%r12,0x3f	; 	xld.w	%r12,-1			; 0xffffffff
	ext	pceAppSetProcPeriod@rm	; 	xcall	pceAppSetProcPeriod
	call	pceAppSetProcPeriod@rl
	sub	%r10,%r0
	ext	idle_count+0x0@ah	; 	xld.w	[idle_count],%r10
	ext	idle_count+0x0@al
	ld.w	[%r8],%r10
	jrle	__LX74		; 	xjrle	__L74
	ext	idle_sp+0x0@ah	; 	xld.w	%r10,[idle_sp]
	ext	idle_sp+0x0@al
	ld.w	%r10,[%r8]
	cmp	%r10,0x0
	jreq	__LX74		; 	xjreq	__L74
	ld.w	%r12,%sp
	ext	pceSyncEnterCriticalSection@rm	; 	xcall	pceSyncEnterCriticalSection
	call	pceSyncEnterCriticalSection@rl
	ext	idle_context_switcher+0x0@h	; 	xld.w	%r12,idle_context_switcher
	ext	idle_context_switcher+0x0@m
	ld.w	%r12,idle_context_switcher+0x0@l
	ext	pceTimerSetContextSwitcher@rm	; 	xcall	pceTimerSetContextSwitcher
	call	pceTimerSetContextSwitcher@rl
	call	idle_exec	; 	xcall	idle_exec
	ld.w	%r12,0x0
	ext	pceTimerSetContextSwitcher@rm	; 	xcall	pceTimerSetContextSwitcher
	call	pceTimerSetContextSwitcher@rl
	ld.w	%r12,%sp
	ext	pceSyncLeaveCriticalSection@rm	; 	xcall	pceSyncLeaveCriticalSection
	call	pceSyncLeaveCriticalSection@rl
__LX74:				; __L74:
	ext	yield@rm	; 	xcall	yield
	call	yield@rl
	add	%sp,0x1		; 	xadd	%sp,%sp,4
	popn	%r0
	ret
	.align	1
	.global	idle_wait
idle_wait:
;	.frame	%sp,4,$31		# vars= 0, regs= 1/0, args= 0, extra= 0
;	.mask	0x80000000,-4
;	.fmask	0x00000000,0
	ext	idle_sp+0x0@ah	; 	xld.w	%r10,[idle_sp]
	ext	idle_sp+0x0@al
	ld.w	%r10,[%r8]
	cmp	%r10,0x0
	jreq	__LX81		; 	xjreq	__L81
	call	idle_exec	; 	xcall	idle_exec
__LX81:				; __L81:
	ext	idle_exit_code+0x0@ah	; 	xld.w	%r10,[idle_exit_code]
	ext	idle_exit_code+0x0@al
	ld.w	%r10,[%r8]
	ret
	.align	1
	.global	idle_stat
idle_stat:
;	.frame	%sp,4,$31		# vars= 0, regs= 1/0, args= 0, extra= 0
;	.mask	0x80000000,-4
;	.fmask	0x00000000,0
	ext	idle_sp+0x0@ah	; 	xld.w	%r10,[idle_sp]
	ext	idle_sp+0x0@al
	ld.w	%r10,[%r8]
	ret

	.lcomm	idle_stack 8192

	.lcomm	idle_exit_code 4

	.lcomm	idle_count 4

	.lcomm	idle_sp 4

	.lcomm	main_sp 4

