;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.4.0 Tue Oct 12 01:21:39 2004

;--------------------------------------------------------
	.module floorf
	
	.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 _floorf
;--------------------------------------------------------
;  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 'floorf'
;------------------------------------------------------------
;x                         Allocated to stack - offset 2
;r                         Allocated to stack - offset -4
;sloc0                     Allocated to stack - offset -5
;sloc1                     Allocated to stack - offset -7
;sloc2                     Allocated to stack - offset -11
;------------------------------------------------------------
;floorf.c:23: float floorf (float x) reentrant
;	-----------------------------------------
;	 function floorf
;	-----------------------------------------
_floorf:
	ais	#-11
;floorf.c:26: r=x;
;     genAssign
;     loadRegFromAop (a, SOF(x), 0)
	lda	17,s
;     storeRegToAop (a, EXT(___fs2slong_PARM_1), 0), stacked=0, isaddr=1
	sta	(___fs2slong_PARM_1 + 3)
;     loadRegFromAop (a, SOF(x), 1)
	lda	16,s
;     storeRegToAop (a, EXT(___fs2slong_PARM_1), 1), stacked=0, isaddr=1
	sta	(___fs2slong_PARM_1 + 2)
;     loadRegFromAop (a, SOF(x), 2)
	lda	15,s
;     storeRegToAop (a, EXT(___fs2slong_PARM_1), 2), stacked=0, isaddr=1
	sta	(___fs2slong_PARM_1 + 1)
;     loadRegFromAop (a, SOF(x), 3)
	lda	14,s
;     storeRegToAop (a, EXT(___fs2slong_PARM_1), 3), stacked=0, isaddr=1
	sta	___fs2slong_PARM_1
;     genCall
	jsr	___fs2slong
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, SOF(iTemp1), 0), stacked=0, isaddr=0
	sta	11,s
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, SOF(iTemp1), 1), stacked=0, isaddr=0
	stx	10,s
;     loadRegFromAop (a, DIR(__ret2), 0)
	lda	*__ret2
;     storeRegToAop (a, SOF(iTemp1), 2), stacked=0, isaddr=0
	sta	9,s
;     loadRegFromAop (a, DIR(__ret3), 0)
	lda	*__ret3
;     storeRegToAop (a, SOF(iTemp1), 3), stacked=0, isaddr=0
	sta	8,s
;     genAssign
;floorf.c:27: if (r<=0)
;     genCmpGt
;     genCmp
;     loadRegFromAop (a, LIT(#0x00), 0)
	lda	#0x00
	sub	11,s
;     loadRegFromAop (a, LIT(#0x00), 1)
	lda	#0x00
	sbc	10,s
;     loadRegFromAop (a, LIT(#0x00), 2)
	lda	#0x00
	sbc	9,s
;     loadRegFromAop (a, LIT(#0x00), 3)
	lda	#0x00
	sbc	8,s
;     genIfxJump
	bge	00110$
	jmp	00102$
00110$:
;floorf.c:28: return (r+((r>x)?-1:0));
;     genAssign
;     loadRegFromAop (a, SOF(iTemp0), 0)
	lda	11,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 0), stacked=0, isaddr=1
	sta	(___slong2fs_PARM_1 + 3)
;     loadRegFromAop (a, SOF(iTemp0), 1)
	lda	10,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 1), stacked=0, isaddr=1
	sta	(___slong2fs_PARM_1 + 2)
;     loadRegFromAop (a, SOF(iTemp0), 2)
	lda	9,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 2), stacked=0, isaddr=1
	sta	(___slong2fs_PARM_1 + 1)
;     loadRegFromAop (a, SOF(iTemp0), 3)
	lda	8,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 3), stacked=0, isaddr=1
	sta	___slong2fs_PARM_1
;     genCall
	jsr	___slong2fs
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(___fsgt_PARM_1), 0), stacked=0, isaddr=1
	sta	(___fsgt_PARM_1 + 3)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(___fsgt_PARM_1), 1), stacked=0, isaddr=1
	stx	(___fsgt_PARM_1 + 2)
;     loadRegFromAop (a, DIR(__ret2), 0)
	lda	*__ret2
;     storeRegToAop (a, EXT(___fsgt_PARM_1), 2), stacked=0, isaddr=1
	sta	(___fsgt_PARM_1 + 1)
;     loadRegFromAop (a, DIR(__ret3), 0)
	lda	*__ret3
;     storeRegToAop (a, EXT(___fsgt_PARM_1), 3), stacked=0, isaddr=1
	sta	___fsgt_PARM_1
;     genAssign
;     loadRegFromAop (a, SOF(x), 0)
	lda	17,s
;     storeRegToAop (a, EXT(___fsgt_PARM_2), 0), stacked=0, isaddr=1
	sta	(___fsgt_PARM_2 + 3)
;     loadRegFromAop (a, SOF(x), 1)
	lda	16,s
;     storeRegToAop (a, EXT(___fsgt_PARM_2), 1), stacked=0, isaddr=1
	sta	(___fsgt_PARM_2 + 2)
;     loadRegFromAop (a, SOF(x), 2)
	lda	15,s
;     storeRegToAop (a, EXT(___fsgt_PARM_2), 2), stacked=0, isaddr=1
	sta	(___fsgt_PARM_2 + 1)
;     loadRegFromAop (a, SOF(x), 3)
	lda	14,s
;     storeRegToAop (a, EXT(___fsgt_PARM_2), 3), stacked=0, isaddr=1
	sta	___fsgt_PARM_2
;     genCall
	jsr	___fsgt
;     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	00106$
00111$:
; forgot to free a
;     genAssign
;     loadRegFromAop (a, LIT(#0xFF), 0)
	lda	#0xFF
;     storeRegToAop (a, SOF(iTemp5), 0), stacked=0, isaddr=0
	sta	7,s
; Peephole 3	- shortened jmp to bra
	bra	00107$
00106$:
;     genAssign
;     loadRegFromAop (a, LIT(#0x00), 0)
	lda	#0x00
;     storeRegToAop (a, SOF(iTemp5), 0), stacked=0, isaddr=0
	sta	7,s
00107$:
;     genCast
;     loadRegFromAop (a, SOF(iTemp5), 0)
	lda	7,s
;     storeRegToAop (a, SOF(iTemp6), 0), stacked=0, isaddr=0
	sta	6,s
;     loadRegFromAop (a, SOF(iTemp5), 0)
	lda	7,s
	rola	
	clra	
	sbc	#0x00
;     storeRegToAop (a, SOF(iTemp6), 1), stacked=0, isaddr=0
	sta	5,s
;     genCast
;     loadRegFromAop (a, SOF(iTemp6), 0)
	lda	6,s
;     storeRegToAop (a, SOF(iTemp7), 0), stacked=0, isaddr=0
	sta	4,s
;     loadRegFromAop (a, SOF(iTemp6), 1)
	lda	5,s
;     storeRegToAop (a, SOF(iTemp7), 1), stacked=0, isaddr=0
	sta	3,s
;     loadRegFromAop (a, SOF(iTemp6), 1)
	lda	5,s
	rola	
	clra	
	sbc	#0x00
;     storeRegToAop (a, SOF(iTemp7), 2), stacked=0, isaddr=0
	sta	2,s
;     storeRegToAop (a, SOF(iTemp7), 3), stacked=0, isaddr=0
	sta	1,s
; checking lic
; checking IS_ITEMP
;     genPlus
;  left size = 4
;  right size = 4
;  result size = 4
;     loadRegFromAop (a, SOF(iTemp0), 0)
	lda	11,s
	add	4,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 0), stacked=0, isaddr=1
	sta	(___slong2fs_PARM_1 + 3)
;     loadRegFromAop (a, SOF(iTemp0), 1)
	lda	10,s
	adc	3,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 1), stacked=0, isaddr=1
	sta	(___slong2fs_PARM_1 + 2)
;     loadRegFromAop (a, SOF(iTemp0), 2)
	lda	9,s
	adc	2,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 2), stacked=0, isaddr=1
	sta	(___slong2fs_PARM_1 + 1)
;     loadRegFromAop (a, SOF(iTemp0), 3)
	lda	8,s
	adc	1,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 3), stacked=0, isaddr=1
	sta	___slong2fs_PARM_1
;     genCall
	jsr	___slong2fs
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, SOF(iTemp9), 0), stacked=0, isaddr=0
	sta	4,s
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, SOF(iTemp9), 1), stacked=0, isaddr=0
	stx	3,s
;     loadRegFromAop (a, DIR(__ret2), 0)
	lda	*__ret2
;     storeRegToAop (a, SOF(iTemp9), 2), stacked=0, isaddr=0
	sta	2,s
;     loadRegFromAop (a, DIR(__ret3), 0)
	lda	*__ret3
;     storeRegToAop (a, SOF(iTemp9), 3), stacked=0, isaddr=0
	sta	1,s
;     genRet
;     loadRegFromAop (a, SOF(iTemp9), 3)
	lda	1,s
;     storeRegToAop (a, DIR(__ret3), 0), stacked=0, isaddr=0
	sta	*__ret3
;     loadRegFromAop (a, SOF(iTemp9), 2)
	lda	2,s
;     storeRegToAop (a, DIR(__ret2), 0), stacked=0, isaddr=0
	sta	*__ret2
;     loadRegFromAop (x, SOF(iTemp9), 1)
	ldx	3,s
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, SOF(iTemp9), 0)
	lda	4,s
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
; Peephole 3	- shortened jmp to bra
	bra	00104$
00102$:
;floorf.c:30: return r;
;     genAssign
;     loadRegFromAop (a, SOF(iTemp0), 0)
	lda	11,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 0), stacked=0, isaddr=1
	sta	(___slong2fs_PARM_1 + 3)
;     loadRegFromAop (a, SOF(iTemp0), 1)
	lda	10,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 1), stacked=0, isaddr=1
	sta	(___slong2fs_PARM_1 + 2)
;     loadRegFromAop (a, SOF(iTemp0), 2)
	lda	9,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 2), stacked=0, isaddr=1
	sta	(___slong2fs_PARM_1 + 1)
;     loadRegFromAop (a, SOF(iTemp0), 3)
	lda	8,s
;     storeRegToAop (a, EXT(___slong2fs_PARM_1), 3), stacked=0, isaddr=1
	sta	___slong2fs_PARM_1
;     genCall
	jsr	___slong2fs
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, SOF(iTemp10), 0), stacked=0, isaddr=0
	sta	4,s
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, SOF(iTemp10), 1), stacked=0, isaddr=0
	stx	3,s
;     loadRegFromAop (a, DIR(__ret2), 0)
	lda	*__ret2
;     storeRegToAop (a, SOF(iTemp10), 2), stacked=0, isaddr=0
	sta	2,s
;     loadRegFromAop (a, DIR(__ret3), 0)
	lda	*__ret3
;     storeRegToAop (a, SOF(iTemp10), 3), stacked=0, isaddr=0
	sta	1,s
;     genRet
;     loadRegFromAop (a, SOF(iTemp10), 3)
	lda	1,s
;     storeRegToAop (a, DIR(__ret3), 0), stacked=0, isaddr=0
	sta	*__ret3
;     loadRegFromAop (a, SOF(iTemp10), 2)
	lda	2,s
;     storeRegToAop (a, DIR(__ret2), 0), stacked=0, isaddr=0
	sta	*__ret2
;     loadRegFromAop (x, SOF(iTemp10), 1)
	ldx	3,s
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, SOF(iTemp10), 0)
	lda	4,s
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00104$:
	ais	#11
	rts
	.area CSEG
	.area XINIT
