; Listing generated by Microsoft (R) Optimizing Compiler Version 14.00.50727.762 

	TITLE	d:\Source Code\NC lib\pcre-7.8\pcre_refcount.c
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB LIBCMTD
INCLUDELIB OLDNAMES

PUBLIC	_pcre_refcount
; Function compile flags: /Ogtpy
; File d:\source code\nc lib\pcre-7.8\pcre_refcount.c
;	COMDAT _pcre_refcount
_TEXT	SEGMENT
_argument_re$ = 8					; size = 4
_adjust$ = 12						; size = 4
_pcre_refcount PROC					; COMDAT

; 74   : real_pcre *re = (real_pcre *)argument_re;
; 75   : if (re == NULL) return PCRE_ERROR_NULL;

	mov	edx, DWORD PTR _argument_re$[esp-4]
	test	edx, edx
	jne	SHORT $LN1@pcre_refco
	lea	eax, DWORD PTR [edx-2]

; 80   : }

	ret	0
$LN1@pcre_refco:

; 76   : re->ref_count = (-adjust > re->ref_count)? 0 :
; 77   :                 (adjust + re->ref_count > 65535)? 65535 :
; 78   :                 re->ref_count + adjust;

	mov	ecx, DWORD PTR _adjust$[esp-4]
	movzx	eax, WORD PTR [edx+30]
	push	esi
	mov	esi, ecx
	neg	esi
	cmp	esi, eax
	pop	esi
	jle	SHORT $LN6@pcre_refco
	xor	eax, eax
	mov	WORD PTR [edx+30], ax

; 79   : return re->ref_count;

	movzx	eax, ax

; 80   : }

	ret	0
$LN6@pcre_refco:

; 76   : re->ref_count = (-adjust > re->ref_count)? 0 :
; 77   :                 (adjust + re->ref_count > 65535)? 65535 :
; 78   :                 re->ref_count + adjust;

	add	eax, ecx
	cmp	eax, 65535				; 0000ffffH
	jle	SHORT $LN4@pcre_refco
	mov	eax, 65535				; 0000ffffH
$LN4@pcre_refco:
	mov	WORD PTR [edx+30], ax

; 79   : return re->ref_count;

	movzx	eax, ax

; 80   : }

	ret	0
_pcre_refcount ENDP
_TEXT	ENDS
END
