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

	TITLE	d:\Source Code\NC lib\regex\pcre_try_flipped.c
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB LIBCMTD
INCLUDELIB OLDNAMES

; Function compile flags: /Ogtpy
; File d:\source code\nc lib\regex\pcre_try_flipped.c
;	COMDAT _byteflip
_TEXT	SEGMENT
_n$ = 8							; size = 4
_byteflip PROC						; COMDAT
; _value$ = ecx

; 69   : if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8);

	cmp	DWORD PTR _n$[esp-4], 2
	jne	SHORT $LN1@byteflip
	movzx	eax, ch
	mov	ah, cl

; 74   : }

	ret	0
$LN1@byteflip:

; 70   : return ((value & 0x000000ff) << 24) |
; 71   :        ((value & 0x0000ff00) <<  8) |
; 72   :        ((value & 0x00ff0000) >>  8) |
; 73   :        ((value & 0xff000000) >> 24);

	mov	eax, ecx
	mov	edx, ecx
	shr	edx, 16					; 00000010H
	and	eax, 16711680				; 00ff0000H
	or	eax, edx
	mov	edx, ecx
	and	edx, 65280				; 0000ff00H
	shl	ecx, 16					; 00000010H
	or	edx, ecx
	shr	eax, 8
	shl	edx, 8
	or	eax, edx

; 74   : }

	ret	0
_byteflip ENDP
_TEXT	ENDS
PUBLIC	__pcre_try_flipped
; Function compile flags: /Ogtpy
;	COMDAT __pcre_try_flipped
_TEXT	SEGMENT
_re$ = 8						; size = 4
_internal_re$ = 12					; size = 4
_study$ = 16						; size = 4
_internal_study$ = 20					; size = 4
__pcre_try_flipped PROC					; COMDAT

; 102  : if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER)

	mov	edx, DWORD PTR _re$[esp-4]
	mov	eax, DWORD PTR [edx]
	push	esi
	mov	ecx, eax
	and	ecx, 16711680				; 00ff0000H
	mov	esi, eax
	shr	esi, 16					; 00000010H
	or	ecx, esi
	mov	esi, eax
	and	esi, 65280				; 0000ff00H
	shl	eax, 16					; 00000010H
	or	esi, eax
	shr	ecx, 8
	shl	esi, 8
	or	ecx, esi
	cmp	ecx, 1346589253				; 50435245H
	je	SHORT $LN2@pcre_try_f

; 103  :   return NULL;

	xor	eax, eax
	pop	esi

; 132  : }

	ret	0
$LN2@pcre_try_f:
	push	ebp

; 104  : 
; 105  : *internal_re = *re;           /* To copy other fields */

	mov	ebp, DWORD PTR _internal_re$[esp+4]
	mov	esi, edx
	push	edi
	mov	ecx, 10					; 0000000aH
	mov	edi, ebp
	rep movsd

; 106  : internal_re->size = byteflip(re->size, sizeof(re->size));

	mov	eax, DWORD PTR [edx+4]
	mov	ecx, eax
	and	ecx, 16711680				; 00ff0000H
	mov	esi, eax
	shr	esi, 16					; 00000010H
	or	ecx, esi
	shr	ecx, 8
	mov	esi, eax
	shl	eax, 16					; 00000010H
	and	esi, 65280				; 0000ff00H
	or	esi, eax
	shl	esi, 8
	or	ecx, esi
	mov	DWORD PTR [ebp+4], ecx

; 107  : internal_re->options = byteflip(re->options, sizeof(re->options));

	mov	eax, DWORD PTR [edx+8]
	mov	ecx, eax
	and	ecx, 16711680				; 00ff0000H
	mov	esi, eax
	shr	esi, 16					; 00000010H
	or	ecx, esi
	shr	ecx, 8
	mov	esi, eax
	shl	eax, 16					; 00000010H
	and	esi, 65280				; 0000ff00H
	or	esi, eax
	shl	esi, 8
	or	ecx, esi
	mov	DWORD PTR [ebp+8], ecx

; 108  : internal_re->flags = (pcre_uint16)byteflip(re->flags, sizeof(re->flags));

	movzx	eax, WORD PTR [edx+12]
	movzx	cx, ah
	mov	ch, al
	mov	WORD PTR [ebp+12], cx

; 109  : internal_re->top_bracket =
; 110  :   (pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket));

	movzx	eax, WORD PTR [edx+16]
	movzx	cx, ah
	mov	ch, al
	mov	WORD PTR [ebp+16], cx

; 111  : internal_re->top_backref =
; 112  :   (pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref));

	movzx	eax, WORD PTR [edx+18]
	movzx	cx, ah
	mov	ch, al
	mov	WORD PTR [ebp+18], cx

; 113  : internal_re->first_byte =
; 114  :   (pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte));

	movzx	eax, WORD PTR [edx+20]
	movzx	cx, ah
	mov	ch, al
	mov	WORD PTR [ebp+20], cx

; 115  : internal_re->req_byte =
; 116  :   (pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte));

	movzx	eax, WORD PTR [edx+22]
	movzx	cx, ah
	mov	ch, al
	mov	WORD PTR [ebp+22], cx

; 117  : internal_re->name_table_offset =
; 118  :   (pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset));

	movzx	eax, WORD PTR [edx+24]
	movzx	cx, ah
	mov	ch, al
	mov	WORD PTR [ebp+24], cx

; 119  : internal_re->name_entry_size =
; 120  :   (pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size));

	movzx	eax, WORD PTR [edx+26]
	movzx	cx, ah
	mov	ch, al
	mov	WORD PTR [ebp+26], cx

; 121  : internal_re->name_count =
; 122  :   (pcre_uint16)byteflip(re->name_count, sizeof(re->name_count));

	movzx	eax, WORD PTR [edx+28]
	movzx	dx, ah
	mov	dh, al
	mov	WORD PTR [ebp+28], dx

; 123  : 
; 124  : if (study != NULL)

	mov	edx, DWORD PTR _study$[esp+8]
	test	edx, edx
	je	SHORT $LN1@pcre_try_f

; 125  :   {
; 126  :   *internal_study = *study;   /* To copy other fields */

	mov	esi, edx
	push	ebx
	mov	ebx, DWORD PTR _internal_study$[esp+12]
	mov	edi, ebx
	mov	ecx, 10					; 0000000aH
	rep movsd

; 127  :   internal_study->size = byteflip(study->size, sizeof(study->size));

	mov	eax, DWORD PTR [edx]
	mov	ecx, eax
	and	ecx, 16711680				; 00ff0000H
	mov	esi, eax
	shr	esi, 16					; 00000010H
	or	ecx, esi
	mov	esi, eax
	shr	ecx, 8
	and	eax, 65280				; 0000ff00H
	shl	esi, 16					; 00000010H
	or	esi, eax
	shl	esi, 8
	or	ecx, esi
	mov	DWORD PTR [ebx], ecx

; 128  :   internal_study->options = byteflip(study->options, sizeof(study->options));

	mov	eax, DWORD PTR [edx+4]
	mov	edx, eax
	mov	ecx, eax
	shr	ecx, 16					; 00000010H
	and	edx, 16711680				; 00ff0000H
	or	edx, ecx
	mov	ecx, eax
	shl	ecx, 16					; 00000010H
	and	eax, 65280				; 0000ff00H
	or	ecx, eax
	shr	edx, 8
	shl	ecx, 8
	or	edx, ecx
	mov	DWORD PTR [ebx+4], edx
	pop	ebx
$LN1@pcre_try_f:
	pop	edi

; 129  :   }
; 130  : 
; 131  : return internal_re;

	mov	eax, ebp
	pop	ebp
	pop	esi

; 132  : }

	ret	0
__pcre_try_flipped ENDP
_TEXT	ENDS
END
