;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.4.0 Mon Oct 11 14:12:05 2004

;--------------------------------------------------------
	.module cosf
	
	.area CSEG
	.area GSINIT
	.area GSFINAL
	.area XINIT
	.area DSEG
	.area OSEG    (OVR)
	.area BSEG
	.area XSEG
	.area XISEG
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl _cosf
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area OSEG    (OVR)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area GSINIT
	.area GSFINAL
	.area GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area HOME
	.area CSEG
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG
;------------------------------------------------------------
;Allocation info for local variables in function 'cosf'
;------------------------------------------------------------
;x                         Allocated to stack - offset 2
;sloc0                     Allocated to stack - offset -4
;------------------------------------------------------------
;cosf.c:25: float cosf(const float x) reentrant
;	-----------------------------------------
;	 function cosf
;	-----------------------------------------
_cosf:
	ais	#-4
;cosf.c:27: if (x==0.0) return 1.0;
;     genAssign
;     loadRegFromAop (a, SOF(x), 0)
	lda	10,s
;     storeRegToAop (a, EXT(___fseq_PARM_1), 0), stacked=0, isaddr=1
	sta	(___fseq_PARM_1 + 3)
;     loadRegFromAop (a, SOF(x), 1)
	lda	9,s
;     storeRegToAop (a, EXT(___fseq_PARM_1), 1), stacked=0, isaddr=1
	sta	(___fseq_PARM_1 + 2)
;     loadRegFromAop (a, SOF(x), 2)
	lda	8,s
;     storeRegToAop (a, EXT(___fseq_PARM_1), 2), stacked=0, isaddr=1
	sta	(___fseq_PARM_1 + 1)
;     loadRegFromAop (a, SOF(x), 3)
	lda	7,s
;     storeRegToAop (a, EXT(___fseq_PARM_1), 3), stacked=0, isaddr=1
	sta	___fseq_PARM_1
;     genAssign
;     loadRegFromAop (a, LIT(#0x00), 0)
	lda	#0x00
;     storeRegToAop (a, EXT(___fseq_PARM_2), 0), stacked=0, isaddr=1
	sta	(___fseq_PARM_2 + 3)
;     loadRegFromAop (a, LIT(#0x00), 1)
	lda	#0x00
;     storeRegToAop (a, EXT(___fseq_PARM_2), 1), stacked=0, isaddr=1
	sta	(___fseq_PARM_2 + 2)
;     loadRegFromAop (a, LIT(#0x00), 2)
	lda	#0x00
;     storeRegToAop (a, EXT(___fseq_PARM_2), 2), stacked=0, isaddr=1
	sta	(___fseq_PARM_2 + 1)
;     loadRegFromAop (a, LIT(#0x00), 3)
	lda	#0x00
;     storeRegToAop (a, EXT(___fseq_PARM_2), 3), stacked=0, isaddr=1
	sta	___fseq_PARM_2
;     genCall
	jsr	___fseq
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
;     genIfx
	tsta
;     genIfxJump
; Peephole 2d	- eliminated jmp
	beq	00102$
00106$:
; forgot to free a
;     genRet
	mov	#0x3F,*__ret3
	mov	#0x80,*__ret2
;     loadRegFromAop (x, LIT(#0x00), 1)
	ldx	#0x00
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, LIT(#0x00), 0)
	lda	#0x00
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
; Peephole 3	- shortened jmp to bra
	bra	00103$
00102$:
;cosf.c:28: return sincosf(x, 1);
;     genAssign
;     loadRegFromAop (a, SOF(x), 0)
	lda	10,s
;     storeRegToAop (a, EXT(_sincosf_PARM_1), 0), stacked=0, isaddr=1
	sta	(_sincosf_PARM_1 + 3)
;     loadRegFromAop (a, SOF(x), 1)
	lda	9,s
;     storeRegToAop (a, EXT(_sincosf_PARM_1), 1), stacked=0, isaddr=1
	sta	(_sincosf_PARM_1 + 2)
;     loadRegFromAop (a, SOF(x), 2)
	lda	8,s
;     storeRegToAop (a, EXT(_sincosf_PARM_1), 2), stacked=0, isaddr=1
	sta	(_sincosf_PARM_1 + 1)
;     loadRegFromAop (a, SOF(x), 3)
	lda	7,s
;     storeRegToAop (a, EXT(_sincosf_PARM_1), 3), stacked=0, isaddr=1
	sta	_sincosf_PARM_1
;     genAssign
;     loadRegFromAop (a, LIT(#0x01), 0)
	lda	#0x01
;     storeRegToAop (a, EXT(_sincosf_PARM_2), 0), stacked=0, isaddr=1
	sta	(_sincosf_PARM_2 + 1)
;     loadRegFromAop (a, LIT(#0x01), 1)
	lda	#0x00
;     storeRegToAop (a, EXT(_sincosf_PARM_2), 1), stacked=0, isaddr=1
	sta	_sincosf_PARM_2
;     genCall
	jsr	_sincosf
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, SOF(iTemp1), 0), stacked=0, isaddr=0
	sta	4,s
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, SOF(iTemp1), 1), stacked=0, isaddr=0
	stx	3,s
;     loadRegFromAop (a, DIR(__ret2), 0)
	lda	*__ret2
;     storeRegToAop (a, SOF(iTemp1), 2), stacked=0, isaddr=0
	sta	2,s
;     loadRegFromAop (a, DIR(__ret3), 0)
	lda	*__ret3
;     storeRegToAop (a, SOF(iTemp1), 3), stacked=0, isaddr=0
	sta	1,s
;     genRet
;     loadRegFromAop (a, SOF(iTemp1), 3)
	lda	1,s
;     storeRegToAop (a, DIR(__ret3), 0), stacked=0, isaddr=0
	sta	*__ret3
;     loadRegFromAop (a, SOF(iTemp1), 2)
	lda	2,s
;     storeRegToAop (a, DIR(__ret2), 0), stacked=0, isaddr=0
	sta	*__ret2
;     loadRegFromAop (x, SOF(iTemp1), 1)
	ldx	3,s
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, SOF(iTemp1), 0)
	lda	4,s
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00103$:
	ais	#4
	rts
	.area CSEG
	.area XINIT
