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

;--------------------------------------------------------
	.module malloc
	
	.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 _init_dynamic_memory_PARM_2
	.globl _init_dynamic_memory
	.globl _malloc
	.globl _free
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area	OSEG    (OVR)
_init_dynamic_memory_sloc0_1_0::
	.ds 2
	.area	OSEG    (OVR)
_malloc_sloc0_1_0::
	.ds 2
_malloc_sloc1_1_0::
	.ds 2
	.area	OSEG    (OVR)
_free_sloc0_1_0::
	.ds 2
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
_FIRST_MEMORY_HEADER_PTR:
	.ds 2
_init_dynamic_memory_PARM_2::
	.ds 2
_init_dynamic_memory_array_1_1::
	.ds 2
_malloc_size_1_1::
	.ds 2
_malloc_current_header_1_1::
	.ds 2
_malloc_new_header_1_1::
	.ds 2
_free_p_1_1::
	.ds 2
_free_prev_header_1_1::
	.ds 2
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area GSINIT
	.area GSFINAL
	.area GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area HOME
	.area CSEG
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG
;------------------------------------------------------------
;Allocation info for local variables in function 'init_dynamic_memory'
;------------------------------------------------------------
;size                      Allocated with name '_init_dynamic_memory_PARM_2'
;array                     Allocated with name '_init_dynamic_memory_array_1_1'
;sloc0                     Allocated with name '_init_dynamic_memory_sloc0_1_0'
;------------------------------------------------------------
;malloc.c:145: void init_dynamic_memory(MEMHEADER xdata * array, unsigned int size) 
;	-----------------------------------------
;	 function init_dynamic_memory
;	-----------------------------------------
_init_dynamic_memory:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_init_dynamic_memory_array_1_1), 0), stacked=0, isaddr=0
	sta	(_init_dynamic_memory_array_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_init_dynamic_memory_array_1_1), 1), stacked=0, isaddr=0
	stx	_init_dynamic_memory_array_1_1
;malloc.c:167: if ( !array ) /*Reserved memory starts on 0x0000 but it's NULL...*/
;     genIfx
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 0)
	lda	(_init_dynamic_memory_array_1_1 + 1)
	ora	_init_dynamic_memory_array_1_1
;     genIfxJump
; Peephole 2c	- eliminated jmp
	bne	00102$
00106$:
;malloc.c:169: array = (MEMHEADER xdata * )((char xdata * ) array + 1) ;
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
; icount = 1, sameRegs=1
;     genPlusIncr
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 0)
	lda	(_init_dynamic_memory_array_1_1 + 1)
	inca
;     storeRegToAop (a, EXT(_init_dynamic_memory_array_1_1), 0), stacked=0, isaddr=0
	sta	(_init_dynamic_memory_array_1_1 + 1)
	bne	00107$
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 1)
	lda	_init_dynamic_memory_array_1_1
	inca
;     storeRegToAop (a, EXT(_init_dynamic_memory_array_1_1), 1), stacked=0, isaddr=0
	sta	_init_dynamic_memory_array_1_1
00107$:
;malloc.c:170: size --;
;     genMinus
;     loadRegFromAop (a, EXT(_init_dynamic_memory_PARM_2), 0)
	lda	(_init_dynamic_memory_PARM_2 + 1)
	sub	#0x01
;     storeRegToAop (a, EXT(_init_dynamic_memory_PARM_2), 0), stacked=0, isaddr=1
	sta	(_init_dynamic_memory_PARM_2 + 1)
;     loadRegFromAop (a, EXT(_init_dynamic_memory_PARM_2), 1)
	lda	_init_dynamic_memory_PARM_2
	sbc	#0x00
;     storeRegToAop (a, EXT(_init_dynamic_memory_PARM_2), 1), stacked=0, isaddr=1
	sta	_init_dynamic_memory_PARM_2
00102$:
;malloc.c:172: FIRST_MEMORY_HEADER_PTR = array;
;     genAssign
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 0)
	lda	(_init_dynamic_memory_array_1_1 + 1)
;     storeRegToAop (a, EXT(_FIRST_MEMORY_HEADER_PTR), 0), stacked=0, isaddr=1
	sta	(_FIRST_MEMORY_HEADER_PTR + 1)
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 1)
	lda	_init_dynamic_memory_array_1_1
;     storeRegToAop (a, EXT(_FIRST_MEMORY_HEADER_PTR), 1), stacked=0, isaddr=1
	sta	_FIRST_MEMORY_HEADER_PTR
;malloc.c:174: array->next = (MEMHEADER xdata * )(((char xdata * ) array) + size - HEADER_SIZE);
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
;  left size = 2
;  right size = 2
;  result size = 2
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 0)
	lda	(_init_dynamic_memory_array_1_1 + 1)
	add	(_init_dynamic_memory_PARM_2 + 1)
;     storeRegToAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_init_dynamic_memory_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 1)
	lda	_init_dynamic_memory_array_1_1
	adc	_init_dynamic_memory_PARM_2
;     storeRegToAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_init_dynamic_memory_sloc0_1_0
;     genMinus
;     loadRegFromAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 0)
	lda	*(_init_dynamic_memory_sloc0_1_0 + 1)
	sub	#0x06
;     storeRegToAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_init_dynamic_memory_sloc0_1_0 + 1)
;     loadRegFromAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 1)
	lda	*_init_dynamic_memory_sloc0_1_0
	sbc	#0x00
;     storeRegToAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_init_dynamic_memory_sloc0_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, EXT(_init_dynamic_memory_array_1_1), 0)
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 1)
	lda	_init_dynamic_memory_array_1_1
;     loadRegFromAop (x, EXT(_init_dynamic_memory_array_1_1), 0)
	ldx	(_init_dynamic_memory_array_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
;     loadRegFromAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 1)
	lda	*_init_dynamic_memory_sloc0_1_0
	sta	,x
	aix	#1
;     loadRegFromAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 0)
	lda	*(_init_dynamic_memory_sloc0_1_0 + 1)
	sta	,x
;malloc.c:175: array->next->next = (void xdata * ) NULL; //And mark it as last
;     genCast
	mov	*(_init_dynamic_memory_sloc0_1_0 + 1),*(_init_dynamic_memory_sloc0_1_0 + 1)
	mov	*_init_dynamic_memory_sloc0_1_0,*_init_dynamic_memory_sloc0_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_init_dynamic_memory_sloc0_1_0), 0)
	ldhx	*_init_dynamic_memory_sloc0_1_0
;     loadRegFromAop (a, LIT(#0x00), 1)
	lda	#0x00
	sta	,x
	aix	#1
;     loadRegFromAop (a, LIT(#0x00), 0)
	lda	#0x00
	sta	,x
;malloc.c:176: array->prev       = (void xdata * ) NULL; //and mark first as first
; 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(_init_dynamic_memory_array_1_1), 0)
	lda	(_init_dynamic_memory_array_1_1 + 1)
	add	#0x02
;     storeRegToAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 0), stacked=0, isaddr=1
	sta	*(_init_dynamic_memory_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 1)
	lda	_init_dynamic_memory_array_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 1), stacked=0, isaddr=1
	sta	*_init_dynamic_memory_sloc0_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_init_dynamic_memory_sloc0_1_0), 0)
	ldhx	*_init_dynamic_memory_sloc0_1_0
;     loadRegFromAop (a, LIT(#0x00), 1)
	lda	#0x00
	sta	,x
	aix	#1
;     loadRegFromAop (a, LIT(#0x00), 0)
	lda	#0x00
	sta	,x
;malloc.c:177: array->len        = 0;    //Empty and ready.
; 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 = 4, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 0)
	lda	(_init_dynamic_memory_array_1_1 + 1)
	add	#0x04
;     storeRegToAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 0), stacked=0, isaddr=1
	sta	*(_init_dynamic_memory_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_init_dynamic_memory_array_1_1), 1)
	lda	_init_dynamic_memory_array_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_init_dynamic_memory_sloc0_1_0), 1), stacked=0, isaddr=1
	sta	*_init_dynamic_memory_sloc0_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_init_dynamic_memory_sloc0_1_0), 0)
	ldhx	*_init_dynamic_memory_sloc0_1_0
;     loadRegFromAop (a, LIT(#0x00), 1)
	lda	#0x00
	sta	,x
	aix	#1
;     loadRegFromAop (a, LIT(#0x00), 0)
	lda	#0x00
	sta	,x
00103$:
	rts
;------------------------------------------------------------
;Allocation info for local variables in function 'malloc'
;------------------------------------------------------------
;size                      Allocated with name '_malloc_size_1_1'
;current_header            Allocated with name '_malloc_current_header_1_1'
;new_header                Allocated with name '_malloc_new_header_1_1'
;sloc0                     Allocated with name '_malloc_sloc0_1_0'
;sloc1                     Allocated with name '_malloc_sloc1_1_0'
;------------------------------------------------------------
;malloc.c:180: void  xdata * malloc (unsigned int size)
;	-----------------------------------------
;	 function malloc
;	-----------------------------------------
_malloc:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_malloc_size_1_1), 0), stacked=0, isaddr=0
	sta	(_malloc_size_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_malloc_size_1_1), 1), stacked=0, isaddr=0
	stx	_malloc_size_1_1
;malloc.c:185: if (size>(0xFFFF-HEADER_SIZE)) return (void xdata *) NULL; //To prevent overflow in next line
;     genCmpGt
;     genCmp
;     loadRegFromAop (a, LIT(#0xF9), 0)
	lda	#0xF9
	sub	(_malloc_size_1_1 + 1)
;     loadRegFromAop (a, LIT(#0xF9), 1)
	lda	#0xFF
	sbc	_malloc_size_1_1
;     genIfxJump
; Peephole 2a	- eliminated jmp
	bcc	00102$
00122$:
;     genRet
;     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)
	jmp	00114$
00102$:
;malloc.c:186: size += HEADER_SIZE; //We need a memory for header too
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
; icount = 6, sameRegs=1
;     genPlusIncr
;     loadRegFromAop (a, EXT(_malloc_size_1_1), 0)
	lda	(_malloc_size_1_1 + 1)
	add	#0x06
;     storeRegToAop (a, EXT(_malloc_size_1_1), 0), stacked=0, isaddr=0
	sta	(_malloc_size_1_1 + 1)
	bcc	00123$
;     loadRegFromAop (a, EXT(_malloc_size_1_1), 1)
	lda	_malloc_size_1_1
	inca
;     storeRegToAop (a, EXT(_malloc_size_1_1), 1), stacked=0, isaddr=0
	sta	_malloc_size_1_1
00123$:
;malloc.c:187: current_header = FIRST_MEMORY_HEADER_PTR;
;     genAssign
;     loadRegFromAop (a, EXT(_FIRST_MEMORY_HEADER_PTR), 0)
	lda	(_FIRST_MEMORY_HEADER_PTR + 1)
;     storeRegToAop (a, EXT(_malloc_current_header_1_1), 0), stacked=0, isaddr=0
	sta	(_malloc_current_header_1_1 + 1)
;     loadRegFromAop (a, EXT(_FIRST_MEMORY_HEADER_PTR), 1)
	lda	_FIRST_MEMORY_HEADER_PTR
;     storeRegToAop (a, EXT(_malloc_current_header_1_1), 1), stacked=0, isaddr=0
	sta	_malloc_current_header_1_1
;malloc.c:188: while (1)
00108$:
;malloc.c:198: if ((((unsigned int)current_header->next) -
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, EXT(_malloc_current_header_1_1), 0)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
;     loadRegFromAop (x, EXT(_malloc_current_header_1_1), 0)
	ldx	(_malloc_current_header_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_malloc_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_malloc_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc0_1_0 + 1)
;     genCast
	mov	*(_malloc_sloc0_1_0 + 1),*(_malloc_sloc0_1_0 + 1)
	mov	*_malloc_sloc0_1_0,*_malloc_sloc0_1_0
;malloc.c:199: ((unsigned int)current_header) -
;     genCast
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 0)
	lda	(_malloc_current_header_1_1 + 1)
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
;     genMinus
;     loadRegFromAop (a, DIR(_malloc_sloc0_1_0), 0)
	lda	*(_malloc_sloc0_1_0 + 1)
	sub	*(_malloc_sloc1_1_0 + 1)
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, DIR(_malloc_sloc0_1_0), 1)
	lda	*_malloc_sloc0_1_0
	sbc	*_malloc_sloc1_1_0
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
;malloc.c:200: current_header->len) >= size) break; //if spare is more than need
; 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 = 4, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 0)
	lda	(_malloc_current_header_1_1 + 1)
	add	#0x04
;     storeRegToAop (a, DIR(_malloc_sloc0_1_0), 0), stacked=0, isaddr=1
	sta	*(_malloc_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_malloc_sloc0_1_0), 1), stacked=0, isaddr=1
	sta	*_malloc_sloc0_1_0
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_malloc_sloc0_1_0), 0)
	ldhx	*_malloc_sloc0_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_malloc_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_malloc_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc0_1_0 + 1)
;     genMinus
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 0)
	lda	*(_malloc_sloc1_1_0 + 1)
	sub	*(_malloc_sloc0_1_0 + 1)
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 1)
	lda	*_malloc_sloc1_1_0
	sbc	*_malloc_sloc0_1_0
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
;     genCmpLt
;     genCmp
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 0)
	lda	*(_malloc_sloc1_1_0 + 1)
	sub	(_malloc_size_1_1 + 1)
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 1)
	lda	*_malloc_sloc1_1_0
	sbc	_malloc_size_1_1
;     genIfxJump
; Peephole 2a	- eliminated jmp
	bcc	00109$
00124$:
;malloc.c:201: current_header = current_header->next;    //else try next             
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, EXT(_malloc_current_header_1_1), 0)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
;     loadRegFromAop (x, EXT(_malloc_current_header_1_1), 0)
	ldx	(_malloc_current_header_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, EXT(_malloc_current_header_1_1), 1), stacked=0, isaddr=0
	sta	_malloc_current_header_1_1
	lda	,x
;     storeRegToAop (a, EXT(_malloc_current_header_1_1), 0), stacked=0, isaddr=0
	sta	(_malloc_current_header_1_1 + 1)
;malloc.c:202: if (!current_header->next)  return (void xdata *) NULL;  //if end_of_list reached
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, EXT(_malloc_current_header_1_1), 0)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
;     loadRegFromAop (x, EXT(_malloc_current_header_1_1), 0)
	ldx	(_malloc_current_header_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
	lda	,x
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
;     genIfx
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 0)
	lda	*(_malloc_sloc1_1_0 + 1)
	ora	*_malloc_sloc1_1_0
;     genIfxJump
	beq	00125$
	jmp	00108$
00125$:
;     genRet
;     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)
	jmp	00114$
00109$:
;malloc.c:204: if (!current_header->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 = 4, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 0)
	lda	(_malloc_current_header_1_1 + 1)
	add	#0x04
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=1
	sta	*(_malloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=1
	sta	*_malloc_sloc1_1_0
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_malloc_sloc1_1_0), 0)
	ldhx	*_malloc_sloc1_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
	lda	,x
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
;     genIfx
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 0)
	lda	*(_malloc_sloc1_1_0 + 1)
	ora	*_malloc_sloc1_1_0
;     genIfxJump
; Peephole 2c	- eliminated jmp
	bne	00111$
00126$:
;malloc.c:206: current_header->len = size; //for first allocation
; 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 = 4, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 0)
	lda	(_malloc_current_header_1_1 + 1)
	add	#0x04
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=1
	sta	*(_malloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=1
	sta	*_malloc_sloc1_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_malloc_sloc1_1_0), 0)
	ldhx	*_malloc_sloc1_1_0
;     loadRegFromAop (a, EXT(_malloc_size_1_1), 1)
	lda	_malloc_size_1_1
	sta	,x
	aix	#1
;     loadRegFromAop (a, EXT(_malloc_size_1_1), 0)
	lda	(_malloc_size_1_1 + 1)
	sta	,x
;malloc.c:207: return ((xdata *)&(current_header->mem));
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
; icount = 6, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 0)
	lda	(_malloc_current_header_1_1 + 1)
	add	#0x06
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
;     genRet
;     loadRegFromAop (x, DIR(_malloc_sloc1_1_0), 1)
	ldx	*_malloc_sloc1_1_0
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 0)
	lda	*(_malloc_sloc1_1_0 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jmp	00114$
00111$:
;malloc.c:209: new_header = (MEMHEADER xdata * )((char xdata *)current_header + current_header->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 = 4, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 0)
	lda	(_malloc_current_header_1_1 + 1)
	add	#0x04
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=1
	sta	*(_malloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=1
	sta	*_malloc_sloc1_1_0
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_malloc_sloc1_1_0), 0)
	ldhx	*_malloc_sloc1_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
	lda	,x
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
; checking lic
; checking IS_ITEMP
; pset=0, pget=1
; checking pset operandsEqu
; checking pget operandsEqu
;     genPlus
;  left size = 2
;  right size = 2
;  result size = 2
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 0)
	lda	(_malloc_current_header_1_1 + 1)
	add	*(_malloc_sloc1_1_0 + 1)
;     storeRegToAop (a, EXT(_malloc_new_header_1_1), 0), stacked=0, isaddr=0
	sta	(_malloc_new_header_1_1 + 1)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
	adc	*_malloc_sloc1_1_0
;     storeRegToAop (a, EXT(_malloc_new_header_1_1), 1), stacked=0, isaddr=0
	sta	_malloc_new_header_1_1
;malloc.c:210: new_header->next = current_header->next; //and plug it into the chain
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, EXT(_malloc_current_header_1_1), 0)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
;     loadRegFromAop (x, EXT(_malloc_current_header_1_1), 0)
	ldx	(_malloc_current_header_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
	lda	,x
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, EXT(_malloc_new_header_1_1), 0)
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 1)
	lda	_malloc_new_header_1_1
;     loadRegFromAop (x, EXT(_malloc_new_header_1_1), 0)
	ldx	(_malloc_new_header_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 1)
	lda	*_malloc_sloc1_1_0
	sta	,x
	aix	#1
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 0)
	lda	*(_malloc_sloc1_1_0 + 1)
	sta	,x
;malloc.c:211: new_header->prev = current_header;
; 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(_malloc_new_header_1_1), 0)
	lda	(_malloc_new_header_1_1 + 1)
	add	#0x02
;     storeRegToAop (a, DIR(_malloc_sloc0_1_0), 0), stacked=0, isaddr=1
	sta	*(_malloc_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 1)
	lda	_malloc_new_header_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_malloc_sloc0_1_0), 1), stacked=0, isaddr=1
	sta	*_malloc_sloc0_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_malloc_sloc0_1_0), 0)
	ldhx	*_malloc_sloc0_1_0
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
	sta	,x
	aix	#1
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 0)
	lda	(_malloc_current_header_1_1 + 1)
	sta	,x
;malloc.c:212: current_header->next  = new_header;
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, EXT(_malloc_current_header_1_1), 0)
;     loadRegFromAop (a, EXT(_malloc_current_header_1_1), 1)
	lda	_malloc_current_header_1_1
;     loadRegFromAop (x, EXT(_malloc_current_header_1_1), 0)
	ldx	(_malloc_current_header_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 1)
	lda	_malloc_new_header_1_1
	sta	,x
	aix	#1
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 0)
	lda	(_malloc_new_header_1_1 + 1)
	sta	,x
;malloc.c:213: if (new_header->next)  new_header->next->prev = new_header;
;     genIfx
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 0)
	lda	*(_malloc_sloc1_1_0 + 1)
	ora	*_malloc_sloc1_1_0
;     genIfxJump
; Peephole 2d	- eliminated jmp
	beq	00113$
00127$:
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, EXT(_malloc_new_header_1_1), 0)
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 1)
	lda	_malloc_new_header_1_1
;     loadRegFromAop (x, EXT(_malloc_new_header_1_1), 0)
	ldx	(_malloc_new_header_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
	lda	,x
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
; 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
;     loadRegFromAop (hx, DIR(_malloc_sloc1_1_0), 0)
	ldhx	*_malloc_sloc1_1_0
	aix	#2
;     storeRegToAop (hx, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=1
	sthx	*_malloc_sloc1_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_malloc_sloc1_1_0), 0)
	ldhx	*_malloc_sloc1_1_0
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 1)
	lda	_malloc_new_header_1_1
	sta	,x
	aix	#1
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 0)
	lda	(_malloc_new_header_1_1 + 1)
	sta	,x
00113$:
;malloc.c:214: new_header->len  = size; //mark as used
; 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 = 4, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 0)
	lda	(_malloc_new_header_1_1 + 1)
	add	#0x04
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=1
	sta	*(_malloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 1)
	lda	_malloc_new_header_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=1
	sta	*_malloc_sloc1_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_malloc_sloc1_1_0), 0)
	ldhx	*_malloc_sloc1_1_0
;     loadRegFromAop (a, EXT(_malloc_size_1_1), 1)
	lda	_malloc_size_1_1
	sta	,x
	aix	#1
;     loadRegFromAop (a, EXT(_malloc_size_1_1), 0)
	lda	(_malloc_size_1_1 + 1)
	sta	,x
;malloc.c:215: return ((xdata *)&(new_header->mem));
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
; icount = 6, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 0)
	lda	(_malloc_new_header_1_1 + 1)
	add	#0x06
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_malloc_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_malloc_new_header_1_1), 1)
	lda	_malloc_new_header_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_malloc_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_malloc_sloc1_1_0
;     genRet
;     loadRegFromAop (x, DIR(_malloc_sloc1_1_0), 1)
	ldx	*_malloc_sloc1_1_0
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, DIR(_malloc_sloc1_1_0), 0)
	lda	*(_malloc_sloc1_1_0 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00114$:
	rts
;------------------------------------------------------------
;Allocation info for local variables in function 'free'
;------------------------------------------------------------
;p                         Allocated with name '_free_p_1_1'
;prev_header               Allocated with name '_free_prev_header_1_1'
;sloc0                     Allocated with name '_free_sloc0_1_0'
;------------------------------------------------------------
;malloc.c:218: void free (void xdata * p)
;	-----------------------------------------
;	 function free
;	-----------------------------------------
_free:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_free_p_1_1), 0), stacked=0, isaddr=0
	sta	(_free_p_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_free_p_1_1), 1), stacked=0, isaddr=0
	stx	_free_p_1_1
;malloc.c:221: if ( p ) //For allocated pointers only!
;     genIfx
;     loadRegFromAop (a, EXT(_free_p_1_1), 0)
	lda	(_free_p_1_1 + 1)
	ora	_free_p_1_1
;     genIfxJump
	bne	00113$
	jmp	00108$
00113$:
;malloc.c:223: p = (MEMHEADER xdata * )((char xdata *)  p - HEADER_SIZE); //to start of header
;     genMinus
;     loadRegFromAop (a, EXT(_free_p_1_1), 0)
	lda	(_free_p_1_1 + 1)
	sub	#0x06
;     storeRegToAop (a, EXT(_free_p_1_1), 0), stacked=0, isaddr=0
	sta	(_free_p_1_1 + 1)
;     loadRegFromAop (a, EXT(_free_p_1_1), 1)
	lda	_free_p_1_1
	sbc	#0x00
;     storeRegToAop (a, EXT(_free_p_1_1), 1), stacked=0, isaddr=0
	sta	_free_p_1_1
;malloc.c:224: if ( ((MEMHEADER xdata * ) p)->prev ) // For the regular header
; 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(_free_p_1_1), 0)
	lda	(_free_p_1_1 + 1)
	add	#0x02
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 0), stacked=0, isaddr=1
	sta	*(_free_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_free_p_1_1), 1)
	lda	_free_p_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 1), stacked=0, isaddr=1
	sta	*_free_sloc0_1_0
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_free_sloc0_1_0), 0)
	ldhx	*_free_sloc0_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_free_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_free_sloc0_1_0 + 1)
;     genIfx
;     loadRegFromAop (a, DIR(_free_sloc0_1_0), 0)
	lda	*(_free_sloc0_1_0 + 1)
	ora	*_free_sloc0_1_0
;     genIfxJump
	bne	00114$
	jmp	00104$
00114$:
;malloc.c:226: prev_header = ((MEMHEADER xdata * ) p)->prev;
; 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(_free_p_1_1), 0)
	lda	(_free_p_1_1 + 1)
	add	#0x02
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 0), stacked=0, isaddr=1
	sta	*(_free_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_free_p_1_1), 1)
	lda	_free_p_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 1), stacked=0, isaddr=1
	sta	*_free_sloc0_1_0
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_free_sloc0_1_0), 0)
	ldhx	*_free_sloc0_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, EXT(_free_prev_header_1_1), 1), stacked=0, isaddr=0
	sta	_free_prev_header_1_1
	lda	,x
;     storeRegToAop (a, EXT(_free_prev_header_1_1), 0), stacked=0, isaddr=0
	sta	(_free_prev_header_1_1 + 1)
;malloc.c:227: prev_header->next = ((MEMHEADER xdata * ) p)->next;
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, EXT(_free_p_1_1), 0)
;     loadRegFromAop (a, EXT(_free_p_1_1), 1)
	lda	_free_p_1_1
;     loadRegFromAop (x, EXT(_free_p_1_1), 0)
	ldx	(_free_p_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_free_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_free_sloc0_1_0 + 1)
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, EXT(_free_prev_header_1_1), 0)
;     loadRegFromAop (a, EXT(_free_prev_header_1_1), 1)
	lda	_free_prev_header_1_1
;     loadRegFromAop (x, EXT(_free_prev_header_1_1), 0)
	ldx	(_free_prev_header_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
;     loadRegFromAop (a, DIR(_free_sloc0_1_0), 1)
	lda	*_free_sloc0_1_0
	sta	,x
	aix	#1
;     loadRegFromAop (a, DIR(_free_sloc0_1_0), 0)
	lda	*(_free_sloc0_1_0 + 1)
	sta	,x
;malloc.c:228: if (((MEMHEADER xdata * ) p)->next)
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, EXT(_free_p_1_1), 0)
;     loadRegFromAop (a, EXT(_free_p_1_1), 1)
	lda	_free_p_1_1
;     loadRegFromAop (x, EXT(_free_p_1_1), 0)
	ldx	(_free_p_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_free_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_free_sloc0_1_0 + 1)
;     genIfx
;     loadRegFromAop (a, DIR(_free_sloc0_1_0), 0)
	lda	*(_free_sloc0_1_0 + 1)
	ora	*_free_sloc0_1_0
;     genIfxJump
; Peephole 2d	- eliminated jmp
	beq	00108$
00115$:
;malloc.c:229: ((MEMHEADER xdata * ) p)->next->prev = prev_header;
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, EXT(_free_p_1_1), 0)
;     loadRegFromAop (a, EXT(_free_p_1_1), 1)
	lda	_free_p_1_1
;     loadRegFromAop (x, EXT(_free_p_1_1), 0)
	ldx	(_free_p_1_1 + 1)
; transferRegReg(a,h)
	psha
	pulh
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_free_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_free_sloc0_1_0 + 1)
; 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
;     loadRegFromAop (hx, DIR(_free_sloc0_1_0), 0)
	ldhx	*_free_sloc0_1_0
	aix	#2
;     storeRegToAop (hx, DIR(_free_sloc0_1_0), 0), stacked=0, isaddr=1
	sthx	*_free_sloc0_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_free_sloc0_1_0), 0)
	ldhx	*_free_sloc0_1_0
;     loadRegFromAop (a, EXT(_free_prev_header_1_1), 1)
	lda	_free_prev_header_1_1
	sta	,x
	aix	#1
;     loadRegFromAop (a, EXT(_free_prev_header_1_1), 0)
	lda	(_free_prev_header_1_1 + 1)
	sta	,x
; Peephole 3	- shortened jmp to bra
	bra	00108$
00104$:
;malloc.c:231: else ((MEMHEADER xdata * ) p)->len = 0; //For the first header
; 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 = 4, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(_free_p_1_1), 0)
	lda	(_free_p_1_1 + 1)
	add	#0x04
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 0), stacked=0, isaddr=1
	sta	*(_free_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_free_p_1_1), 1)
	lda	_free_p_1_1
	adc	#0x00
;     storeRegToAop (a, DIR(_free_sloc0_1_0), 1), stacked=0, isaddr=1
	sta	*_free_sloc0_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_free_sloc0_1_0), 0)
	ldhx	*_free_sloc0_1_0
;     loadRegFromAop (a, LIT(#0x00), 1)
	lda	#0x00
	sta	,x
	aix	#1
;     loadRegFromAop (a, LIT(#0x00), 0)
	lda	#0x00
	sta	,x
00108$:
	rts
	.area CSEG
	.area XINIT
