;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.6.1 #4330 (Oct 18 2006)
; This file generated Wed Oct 18 23:31:20 2006
;--------------------------------------------------------
	.module realloc
	.optsdcc -mhc08
	
	.area HOME (CODE)
	.area GSINIT0 (CODE)
	.area GSINIT (CODE)
	.area GSFINAL (CODE)
	.area CSEG (CODE)
	.area XINIT
	.area CONST   (CODE)
	.area DSEG
	.area OSEG    (OVR)
	.area BSEG
	.area XSEG
	.area XISEG
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl _realloc_PARM_2
	.globl _realloc
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
_realloc_sloc0_1_0:
	.ds 2
_realloc_sloc1_1_0:
	.ds 2
_realloc_sloc2_1_0:
	.ds 2
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area OSEG    (OVR)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
_realloc_PARM_2:
	.ds 2
_realloc_p_1_1:
	.ds 2
_realloc_pthis_1_1:
	.ds 2
_realloc_pnew_1_1:
	.ds 2
_realloc_ret_1_1:
	.ds 2
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area HOME (CODE)
	.area GSINIT (CODE)
	.area GSFINAL (CODE)
	.area GSINIT (CODE)
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area HOME (CODE)
	.area CSEG (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG (CODE)
;------------------------------------------------------------
;Allocation info for local variables in function 'realloc'
;------------------------------------------------------------
;sloc0                     Allocated with name '_realloc_sloc0_1_0'
;sloc1                     Allocated with name '_realloc_sloc1_1_0'
;sloc2                     Allocated with name '_realloc_sloc2_1_0'
;size                      Allocated with name '_realloc_PARM_2'
;p                         Allocated with name '_realloc_p_1_1'
;pthis                     Allocated with name '_realloc_pthis_1_1'
;pnew                      Allocated with name '_realloc_pnew_1_1'
;ret                       Allocated with name '_realloc_ret_1_1'
;------------------------------------------------------------
;realloc.c:67: void xdata * realloc (void * p, size_t size)
;	-----------------------------------------
;	 function realloc
;	-----------------------------------------
_realloc:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_realloc_p_1_1), 0), stacked=0, isaddr=0
	sta	(_realloc_p_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_realloc_p_1_1), 1), stacked=0, isaddr=0
	stx	_realloc_p_1_1
;realloc.c:75: pthis = _sdcc_find_memheader(p);
;     genCall
;     loadRegFromAop (x, EXT(_realloc_p_1_1), 1)
	ldx	_realloc_p_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(_realloc_p_1_1), 0)
	lda	(_realloc_p_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	__sdcc_find_memheader
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_realloc_pthis_1_1), 0), stacked=0, isaddr=0
	sta	(_realloc_pthis_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_realloc_pthis_1_1), 1), stacked=0, isaddr=0
	stx	_realloc_pthis_1_1
;realloc.c:76: if (pthis)
;     genIfx
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 0)
	lda	(_realloc_pthis_1_1 + 1)
	ora	_realloc_pthis_1_1
;     genIfxJump
	bne	00124$
	jmp	00114$
00124$:
;realloc.c:78: if (size > (0xFFFF-HEADER_SIZE))
;     genCmp	(>)
;     loadRegFromAop (a, LIT(#0xFB), 0)
	lda	#0xFB
	sub	(_realloc_PARM_2 + 1)
;     loadRegFromAop (a, LIT(#0xFB), 1)
	lda	#0xFF
	sbc	_realloc_PARM_2
; Peephole 2a	- eliminated jmp
	bcc	00111$
00125$:
;realloc.c:80: ret = (void xdata *) NULL; //To prevent overflow in next line
;     genAssign
;     loadRegFromAop (a, LIT(#0x00), 1)
;     storeRegToAop (a, EXT(_realloc_ret_1_1), 1), stacked=0, isaddr=0
;     loadRegFromAop (a, LIT(#0x00), 0)
;     storeRegToAop (a, EXT(_realloc_ret_1_1), 0), stacked=0, isaddr=0
; Peephole 5c   - eliminated redundant clra
	clra
	sta	_realloc_ret_1_1
	sta	(_realloc_ret_1_1 + 1)
	jmp	00115$
00111$:
;realloc.c:84: size += HEADER_SIZE; //We need a memory for header too
; checking lic
; checking IS_ITEMP
;     genPlus
; IS_AOP_HX = 0
; icount = 4, sameRegs=1
;     genPlusIncr
;     loadRegFromAop (a, EXT(_realloc_PARM_2), 0)
	lda	(_realloc_PARM_2 + 1)
	add	#0x04
;     storeRegToAop (a, EXT(_realloc_PARM_2), 0), stacked=0, isaddr=1
	sta	(_realloc_PARM_2 + 1)
	bcc	00126$
;     loadRegFromAop (a, EXT(_realloc_PARM_2), 1)
	lda	_realloc_PARM_2
	inca
;     storeRegToAop (a, EXT(_realloc_PARM_2), 1), stacked=0, isaddr=1
	sta	_realloc_PARM_2
00126$:
;realloc.c:86: if ((((unsigned int)pthis->next) - ((unsigned int)pthis)) >= size)
;     genPointerGet
;     loadRegFromAop (hx, EXT(_realloc_pthis_1_1), 0)
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 1)
	lda	_realloc_pthis_1_1
;     loadRegFromAop (x, EXT(_realloc_pthis_1_1), 0)
	ldx	(_realloc_pthis_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_realloc_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_realloc_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc0_1_0 + 1)
;     genCast
;     genCast
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 0)
	lda	(_realloc_pthis_1_1 + 1)
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 1)
	lda	_realloc_pthis_1_1
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc1_1_0
;     genMinus
;     loadRegFromAop (a, DIR(_realloc_sloc0_1_0), 0)
	lda	*(_realloc_sloc0_1_0 + 1)
	sub	*(_realloc_sloc1_1_0 + 1)
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, DIR(_realloc_sloc0_1_0), 1)
	lda	*_realloc_sloc0_1_0
	sbc	*_realloc_sloc1_1_0
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc1_1_0
;     genCmp	(<)
;     loadRegFromAop (a, DIR(_realloc_sloc1_1_0), 0)
	lda	*(_realloc_sloc1_1_0 + 1)
	sub	(_realloc_PARM_2 + 1)
;     loadRegFromAop (a, DIR(_realloc_sloc1_1_0), 1)
	lda	*_realloc_sloc1_1_0
	sbc	_realloc_PARM_2
; Peephole 2b	- eliminated jmp
	bcs	00108$
00127$:
;realloc.c:88: pthis->len = size;
; checking lic
; checking IS_ITEMP
; pset=1, pget=0
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
; checking remat
;     genPlus
; IS_AOP_HX = 0
; icount = 2, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 0)
	lda	(_realloc_pthis_1_1 + 1)
	add	#0x02
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 0), stacked=0, isaddr=1
	sta	*(_realloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 1)
	lda	_realloc_pthis_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 1), stacked=0, isaddr=1
	sta	*_realloc_sloc1_1_0
;     genPointerSet
;     loadRegFromAop (hx, DIR(_realloc_sloc1_1_0), 0)
	ldhx	*_realloc_sloc1_1_0
;     loadRegFromAop (a, EXT(_realloc_PARM_2), 1)
	lda	_realloc_PARM_2
	sta	,x
	aix	#1
;     loadRegFromAop (a, EXT(_realloc_PARM_2), 0)
	lda	(_realloc_PARM_2 + 1)
	sta	,x
;realloc.c:89: ret = p;
;     genAssign
;     loadRegFromAop (a, EXT(_realloc_p_1_1), 1)
	lda	_realloc_p_1_1
;     storeRegToAop (a, EXT(_realloc_ret_1_1), 1), stacked=0, isaddr=0
	sta	_realloc_ret_1_1
;     loadRegFromAop (a, EXT(_realloc_p_1_1), 0)
	lda	(_realloc_p_1_1 + 1)
;     storeRegToAop (a, EXT(_realloc_ret_1_1), 0), stacked=0, isaddr=0
	sta	(_realloc_ret_1_1 + 1)
	jmp	00115$
00108$:
;realloc.c:93: if ((_sdcc_prev_memheader) &&
;     genIfx
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 0)
	lda	(__sdcc_prev_memheader + 1)
	ora	__sdcc_prev_memheader
;     genIfxJump
	bne	00128$
	jmp	00104$
00128$:
;realloc.c:94: ((((unsigned int)pthis->next) -
;     genPointerGet
;     loadRegFromAop (hx, EXT(_realloc_pthis_1_1), 0)
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 1)
	lda	_realloc_pthis_1_1
;     loadRegFromAop (x, EXT(_realloc_pthis_1_1), 0)
	ldx	(_realloc_pthis_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc1_1_0
	lda	,x
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc1_1_0 + 1)
;     genCast
;realloc.c:95: ((unsigned int)_sdcc_prev_memheader) -
;     genCast
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 0)
	lda	(__sdcc_prev_memheader + 1)
;     storeRegToAop (a, DIR(_realloc_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 1)
	lda	__sdcc_prev_memheader
;     storeRegToAop (a, DIR(_realloc_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc0_1_0
;     genMinus
;     loadRegFromAop (a, DIR(_realloc_sloc1_1_0), 0)
	lda	*(_realloc_sloc1_1_0 + 1)
	sub	*(_realloc_sloc0_1_0 + 1)
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, DIR(_realloc_sloc1_1_0), 1)
	lda	*_realloc_sloc1_1_0
	sbc	*_realloc_sloc0_1_0
;     storeRegToAop (a, DIR(_realloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc1_1_0
;realloc.c:96: _sdcc_prev_memheader->len) >= size))
;     genAssign
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 1)
	lda	__sdcc_prev_memheader
;     storeRegToAop (a, DIR(_realloc_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc0_1_0
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 0)
	lda	(__sdcc_prev_memheader + 1)
;     storeRegToAop (a, DIR(_realloc_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc0_1_0 + 1)
; checking lic
; checking IS_ITEMP
; pset=0, pget=1
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
; checking remat
;     genPlus
; IS_AOP_HX = 0
;     loadRegFromAop (hx, DIR(_realloc_sloc0_1_0), 0)
	ldhx	*_realloc_sloc0_1_0
	aix	#2
;     storeRegToAop (hx, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=1
	sthx	*_realloc_sloc2_1_0
;     genPointerGet
;     loadRegFromAop (hx, DIR(_realloc_sloc2_1_0), 0)
	ldhx	*_realloc_sloc2_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc2_1_0
	lda	,x
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc2_1_0 + 1)
;     genMinus
;     loadRegFromAop (a, DIR(_realloc_sloc1_1_0), 0)
	lda	*(_realloc_sloc1_1_0 + 1)
	sub	*(_realloc_sloc2_1_0 + 1)
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc2_1_0 + 1)
;     loadRegFromAop (a, DIR(_realloc_sloc1_1_0), 1)
	lda	*_realloc_sloc1_1_0
	sbc	*_realloc_sloc2_1_0
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc2_1_0
;     genCmp	(<)
;     loadRegFromAop (a, DIR(_realloc_sloc2_1_0), 0)
	lda	*(_realloc_sloc2_1_0 + 1)
	sub	(_realloc_PARM_2 + 1)
;     loadRegFromAop (a, DIR(_realloc_sloc2_1_0), 1)
	lda	*_realloc_sloc2_1_0
	sbc	_realloc_PARM_2
	bcc	00129$
	jmp	00104$
00129$:
;realloc.c:98: pnew = (MEMHEADER xdata * )((char xdata *)_sdcc_prev_memheader + _sdcc_prev_memheader->len);
;     genAssign
;     loadRegFromAop (a, DIR(_realloc_sloc0_1_0), 1)
	lda	*_realloc_sloc0_1_0
;     storeRegToAop (a, EXT(__sdcc_prev_memheader), 1), stacked=0, isaddr=0
	sta	__sdcc_prev_memheader
;     loadRegFromAop (a, DIR(_realloc_sloc0_1_0), 0)
	lda	*(_realloc_sloc0_1_0 + 1)
;     storeRegToAop (a, EXT(__sdcc_prev_memheader), 0), stacked=0, isaddr=0
	sta	(__sdcc_prev_memheader + 1)
; checking lic
; checking IS_ITEMP
; pset=0, pget=1
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
; checking remat
;     genPlus
; IS_AOP_HX = 0
; icount = 2, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 0)
	lda	(__sdcc_prev_memheader + 1)
	add	#0x02
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=1
	sta	*(_realloc_sloc2_1_0 + 1)
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 1)
	lda	__sdcc_prev_memheader
	adc	#0x00
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 1), stacked=0, isaddr=1
	sta	*_realloc_sloc2_1_0
;     genPointerGet
;     loadRegFromAop (hx, DIR(_realloc_sloc2_1_0), 0)
	ldhx	*_realloc_sloc2_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc2_1_0
	lda	,x
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc2_1_0 + 1)
; checking lic
; checking IS_ITEMP
; pset=1, pget=0
;     genPlus
;  left size = 2
;  right size = 2
;  result size = 2
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 0)
	lda	(__sdcc_prev_memheader + 1)
	add	*(_realloc_sloc2_1_0 + 1)
;     storeRegToAop (a, EXT(_realloc_pnew_1_1), 0), stacked=0, isaddr=0
	sta	(_realloc_pnew_1_1 + 1)
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 1)
	lda	__sdcc_prev_memheader
	adc	*_realloc_sloc2_1_0
;     storeRegToAop (a, EXT(_realloc_pnew_1_1), 1), stacked=0, isaddr=0
	sta	_realloc_pnew_1_1
;realloc.c:99: _sdcc_prev_memheader->next = pnew;
;     genPointerSet
;     loadRegFromAop (hx, EXT(__sdcc_prev_memheader), 0)
;     loadRegFromAop (a, EXT(__sdcc_prev_memheader), 1)
	lda	__sdcc_prev_memheader
;     loadRegFromAop (x, EXT(__sdcc_prev_memheader), 0)
	ldx	(__sdcc_prev_memheader + 1)
; transferRegReg(a,h)
	psha
	pulh
;     loadRegFromAop (a, EXT(_realloc_pnew_1_1), 1)
	lda	_realloc_pnew_1_1
	sta	,x
	aix	#1
;     loadRegFromAop (a, EXT(_realloc_pnew_1_1), 0)
	lda	(_realloc_pnew_1_1 + 1)
	sta	,x
;realloc.c:105: memmove(pnew, pthis, pthis->len);
; checking lic
; checking IS_ITEMP
; pset=0, pget=1
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
; checking remat
;     genPlus
; IS_AOP_HX = 0
; icount = 2, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 0)
	lda	(_realloc_pthis_1_1 + 1)
	add	#0x02
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=1
	sta	*(_realloc_sloc2_1_0 + 1)
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 1)
	lda	_realloc_pthis_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 1), stacked=0, isaddr=1
	sta	*_realloc_sloc2_1_0
;     genPointerGet
;     loadRegFromAop (hx, DIR(_realloc_sloc2_1_0), 0)
	ldhx	*_realloc_sloc2_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, EXT(_memmove_PARM_3), 1), stacked=0, isaddr=1
	sta	_memmove_PARM_3
	lda	,x
;     storeRegToAop (a, EXT(_memmove_PARM_3), 0), stacked=0, isaddr=1
	sta	(_memmove_PARM_3 + 1)
;     genAssign
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 1)
	lda	_realloc_pthis_1_1
;     storeRegToAop (a, EXT(_memmove_PARM_2), 1), stacked=0, isaddr=1
	sta	_memmove_PARM_2
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 0)
	lda	(_realloc_pthis_1_1 + 1)
;     storeRegToAop (a, EXT(_memmove_PARM_2), 0), stacked=0, isaddr=1
	sta	(_memmove_PARM_2 + 1)
;     genCall
;     loadRegFromAop (x, EXT(_realloc_pnew_1_1), 1)
	ldx	_realloc_pnew_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(_realloc_pnew_1_1), 0)
	lda	(_realloc_pnew_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	_memmove
;realloc.c:106: pnew->len = size;
; checking lic
; checking IS_ITEMP
; pset=1, pget=0
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
; checking remat
;     genPlus
; IS_AOP_HX = 0
; icount = 2, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_realloc_pnew_1_1), 0)
	lda	(_realloc_pnew_1_1 + 1)
	add	#0x02
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=1
	sta	*(_realloc_sloc2_1_0 + 1)
;     loadRegFromAop (a, EXT(_realloc_pnew_1_1), 1)
	lda	_realloc_pnew_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 1), stacked=0, isaddr=1
	sta	*_realloc_sloc2_1_0
;     genPointerSet
;     loadRegFromAop (hx, DIR(_realloc_sloc2_1_0), 0)
	ldhx	*_realloc_sloc2_1_0
;     loadRegFromAop (a, EXT(_realloc_PARM_2), 1)
	lda	_realloc_PARM_2
	sta	,x
	aix	#1
;     loadRegFromAop (a, EXT(_realloc_PARM_2), 0)
	lda	(_realloc_PARM_2 + 1)
	sta	,x
;realloc.c:107: ret = MEM(pnew);
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
; icount = 4, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_realloc_pnew_1_1), 0)
	lda	(_realloc_pnew_1_1 + 1)
	add	#0x04
;     storeRegToAop (a, EXT(_realloc_ret_1_1), 0), stacked=0, isaddr=0
	sta	(_realloc_ret_1_1 + 1)
;     loadRegFromAop (a, EXT(_realloc_pnew_1_1), 1)
	lda	_realloc_pnew_1_1
	adc	#0x00
;     storeRegToAop (a, EXT(_realloc_ret_1_1), 1), stacked=0, isaddr=0
	sta	_realloc_ret_1_1
	jmp	00115$
00104$:
;realloc.c:111: ret = malloc(size - HEADER_SIZE);
;     genMinus
;     loadRegFromAop (a, EXT(_realloc_PARM_2), 0)
	lda	(_realloc_PARM_2 + 1)
	sub	#0x04
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc2_1_0 + 1)
;     loadRegFromAop (a, EXT(_realloc_PARM_2), 1)
	lda	_realloc_PARM_2
	sbc	#0x00
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc2_1_0
;     genCall
;     loadRegFromAop (x, DIR(_realloc_sloc2_1_0), 1)
	ldx	*_realloc_sloc2_1_0
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, DIR(_realloc_sloc2_1_0), 0)
	lda	*(_realloc_sloc2_1_0 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	_malloc
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_realloc_ret_1_1), 0), stacked=0, isaddr=0
	sta	(_realloc_ret_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_realloc_ret_1_1), 1), stacked=0, isaddr=0
	stx	_realloc_ret_1_1
;realloc.c:112: if (ret)
;     genIfx
;     loadRegFromAop (a, EXT(_realloc_ret_1_1), 0)
	lda	(_realloc_ret_1_1 + 1)
	ora	_realloc_ret_1_1
;     genIfxJump
; Peephole 2d	- eliminated jmp
	beq	00115$
00130$:
;realloc.c:114: memcpy(ret, MEM(pthis), pthis->len - HEADER_SIZE);
; checking lic
; checking IS_ITEMP
;     genPlus
; IS_AOP_HX = 0
; icount = 4, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 0)
	lda	(_realloc_pthis_1_1 + 1)
	add	#0x04
;     storeRegToAop (a, EXT(_memcpy_PARM_2), 0), stacked=0, isaddr=1
	sta	(_memcpy_PARM_2 + 1)
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 1)
	lda	_realloc_pthis_1_1
	adc	#0x00
;     storeRegToAop (a, EXT(_memcpy_PARM_2), 1), stacked=0, isaddr=1
	sta	_memcpy_PARM_2
; checking lic
; checking IS_ITEMP
; pset=0, pget=1
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
; checking remat
;     genPlus
; IS_AOP_HX = 0
; icount = 2, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 0)
	lda	(_realloc_pthis_1_1 + 1)
	add	#0x02
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=1
	sta	*(_realloc_sloc2_1_0 + 1)
;     loadRegFromAop (a, EXT(_realloc_pthis_1_1), 1)
	lda	_realloc_pthis_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 1), stacked=0, isaddr=1
	sta	*_realloc_sloc2_1_0
;     genPointerGet
;     loadRegFromAop (hx, DIR(_realloc_sloc2_1_0), 0)
	ldhx	*_realloc_sloc2_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 1), stacked=0, isaddr=0
	sta	*_realloc_sloc2_1_0
	lda	,x
;     storeRegToAop (a, DIR(_realloc_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(_realloc_sloc2_1_0 + 1)
;     genMinus
;     loadRegFromAop (a, DIR(_realloc_sloc2_1_0), 0)
	lda	*(_realloc_sloc2_1_0 + 1)
	sub	#0x04
;     storeRegToAop (a, EXT(_memcpy_PARM_3), 0), stacked=0, isaddr=1
	sta	(_memcpy_PARM_3 + 1)
;     loadRegFromAop (a, DIR(_realloc_sloc2_1_0), 1)
	lda	*_realloc_sloc2_1_0
	sbc	#0x00
;     storeRegToAop (a, EXT(_memcpy_PARM_3), 1), stacked=0, isaddr=1
	sta	_memcpy_PARM_3
;     genCall
;     loadRegFromAop (x, EXT(_realloc_ret_1_1), 1)
	ldx	_realloc_ret_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(_realloc_ret_1_1), 0)
	lda	(_realloc_ret_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	_memcpy
;realloc.c:115: free(p);
;     genCall
;     loadRegFromAop (x, EXT(_realloc_p_1_1), 1)
	ldx	_realloc_p_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(_realloc_p_1_1), 0)
	lda	(_realloc_p_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	_free
; Peephole 3	- shortened jmp to bra
	bra	00115$
00114$:
;realloc.c:123: ret = malloc(size);
;     genCall
;     loadRegFromAop (x, EXT(_realloc_PARM_2), 1)
	ldx	_realloc_PARM_2
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(_realloc_PARM_2), 0)
	lda	(_realloc_PARM_2 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	_malloc
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_realloc_ret_1_1), 0), stacked=0, isaddr=0
	sta	(_realloc_ret_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_realloc_ret_1_1), 1), stacked=0, isaddr=0
	stx	_realloc_ret_1_1
00115$:
;realloc.c:126: return ret;
;     genRet
;     loadRegFromAop (x, EXT(_realloc_ret_1_1), 1)
	ldx	_realloc_ret_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(_realloc_ret_1_1), 0)
	lda	(_realloc_ret_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00116$:
	rts
	.area CSEG (CODE)
	.area CONST   (CODE)
	.area XINIT
