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

	TITLE	d:\# METIN2\work in progress\source client\Client\EterLocale\Japanese.cpp
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES

PUBLIC	?ShiftJIS_IsLeadByte@@YAHD@Z			; ShiftJIS_IsLeadByte
; Function compile flags: /Ogtpy
; File d:\# metin2\work in progress\source client\client\eterlocale\japanese.cpp
;	COMDAT ?ShiftJIS_IsLeadByte@@YAHD@Z
_TEXT	SEGMENT
_chByte$ = 8						; size = 1
?ShiftJIS_IsLeadByte@@YAHD@Z PROC			; ShiftJIS_IsLeadByte, COMDAT

; 13   : 	const unsigned char byByte = (const unsigned char) chByte;
; 14   : 
; 15   : 	return MACRO_IsLeadByte( byByte );

  00000	8a 44 24 04	 mov	 al, BYTE PTR _chByte$[esp-4]
  00004	3c 81		 cmp	 al, 129			; 00000081H
  00006	72 04		 jb	 SHORT $LN3@ShiftJIS_I
  00008	3c 9f		 cmp	 al, 159			; 0000009fH
  0000a	76 08		 jbe	 SHORT $LN5@ShiftJIS_I
$LN3@ShiftJIS_I:
  0000c	3c e0		 cmp	 al, 224			; 000000e0H
  0000e	72 0a		 jb	 SHORT $LN4@ShiftJIS_I
  00010	3c fc		 cmp	 al, 252			; 000000fcH
  00012	77 06		 ja	 SHORT $LN4@ShiftJIS_I
$LN5@ShiftJIS_I:
  00014	b8 01 00 00 00	 mov	 eax, 1

; 16   : }

  00019	c3		 ret	 0
$LN4@ShiftJIS_I:

; 13   : 	const unsigned char byByte = (const unsigned char) chByte;
; 14   : 
; 15   : 	return MACRO_IsLeadByte( byByte );

  0001a	33 c0		 xor	 eax, eax

; 16   : }

  0001c	c3		 ret	 0
?ShiftJIS_IsLeadByte@@YAHD@Z ENDP			; ShiftJIS_IsLeadByte
_TEXT	ENDS
PUBLIC	?ShiftJIS_IsTrailByte@@YAHD@Z			; ShiftJIS_IsTrailByte
; Function compile flags: /Ogtpy
;	COMDAT ?ShiftJIS_IsTrailByte@@YAHD@Z
_TEXT	SEGMENT
_chByte$ = 8						; size = 1
?ShiftJIS_IsTrailByte@@YAHD@Z PROC			; ShiftJIS_IsTrailByte, COMDAT

; 20   : 	const unsigned char byByte = (const unsigned char) chByte;
; 21   : 
; 22   : 	return MACRO_IsTailByte( byByte );

  00000	8a 44 24 04	 mov	 al, BYTE PTR _chByte$[esp-4]
  00004	3c 40		 cmp	 al, 64			; 00000040H
  00006	72 04		 jb	 SHORT $LN3@ShiftJIS_I@2
  00008	3c 7e		 cmp	 al, 126			; 0000007eH
  0000a	76 08		 jbe	 SHORT $LN5@ShiftJIS_I@2
$LN3@ShiftJIS_I@2:
  0000c	3c 80		 cmp	 al, 128			; 00000080H
  0000e	72 0a		 jb	 SHORT $LN4@ShiftJIS_I@2
  00010	3c fc		 cmp	 al, 252			; 000000fcH
  00012	77 06		 ja	 SHORT $LN4@ShiftJIS_I@2
$LN5@ShiftJIS_I@2:
  00014	b8 01 00 00 00	 mov	 eax, 1

; 23   : }

  00019	c3		 ret	 0
$LN4@ShiftJIS_I@2:

; 20   : 	const unsigned char byByte = (const unsigned char) chByte;
; 21   : 
; 22   : 	return MACRO_IsTailByte( byByte );

  0001a	33 c0		 xor	 eax, eax

; 23   : }

  0001c	c3		 ret	 0
?ShiftJIS_IsTrailByte@@YAHD@Z ENDP			; ShiftJIS_IsTrailByte
_TEXT	ENDS
PUBLIC	?ShiftJIS_StringCompareCI@@YAHPBD0I@Z		; ShiftJIS_StringCompareCI
EXTRN	_tolower:PROC
; Function compile flags: /Ogtpy
;	COMDAT ?ShiftJIS_StringCompareCI@@YAHPBD0I@Z
_TEXT	SEGMENT
_szStringLeft$ = 8					; size = 4
_szStringRight$ = 12					; size = 4
_sizeLength$ = 16					; size = 4
?ShiftJIS_StringCompareCI@@YAHPBD0I@Z PROC		; ShiftJIS_StringCompareCI, COMDAT

; 26   : {

  00000	53		 push	 ebx

; 27   : 	const unsigned char* uszString1 = (const unsigned char*) szStringLeft;

  00001	8b 5c 24 08	 mov	 ebx, DWORD PTR _szStringLeft$[esp]
  00005	55		 push	 ebp

; 28   : 	const unsigned char* uszString2 = (const unsigned char*) szStringRight;
; 29   : 	unsigned short c1, c2;
; 30   : 
; 31   : 	if( sizeLength == 0 )

  00006	8b 6c 24 14	 mov	 ebp, DWORD PTR _sizeLength$[esp+4]
  0000a	57		 push	 edi
  0000b	8b 7c 24 14	 mov	 edi, DWORD PTR _szStringRight$[esp+8]
  0000f	85 ed		 test	 ebp, ebp
  00011	75 06		 jne	 SHORT $LN40@ShiftJIS_S
  00013	5f		 pop	 edi
  00014	5d		 pop	 ebp

; 32   : 		return 0;

  00015	33 c0		 xor	 eax, eax
  00017	5b		 pop	 ebx

; 71   : }

  00018	c3		 ret	 0
$LN40@ShiftJIS_S:
  00019	56		 push	 esi
  0001a	8d 9b 00 00 00
	00		 npad	 6
$LL20@ShiftJIS_S:

; 34   : 		c1 = *uszString1++;

  00020	66 0f b6 03	 movzx	 ax, BYTE PTR [ebx]
  00024	0f b7 c0	 movzx	 eax, ax

; 35   : 		if( MACRO_IsLeadByte(c1) ) {

  00027	b9 81 00 00 00	 mov	 ecx, 129		; 00000081H
  0002c	4d		 dec	 ebp
  0002d	43		 inc	 ebx
  0002e	66 3b c8	 cmp	 cx, ax
  00031	77 0a		 ja	 SHORT $LN38@ShiftJIS_S
  00033	ba 9f 00 00 00	 mov	 edx, 159		; 0000009fH
  00038	66 3b c2	 cmp	 ax, dx
  0003b	76 0c		 jbe	 SHORT $LN39@ShiftJIS_S
$LN38@ShiftJIS_S:
  0003d	8d 88 20 ff ff
	ff		 lea	 ecx, DWORD PTR [eax-224]
  00043	66 83 f9 1c	 cmp	 cx, 28			; 0000001cH
  00047	77 40		 ja	 SHORT $LN18@ShiftJIS_S
$LN39@ShiftJIS_S:

; 36   : 			if( sizeLength == 0 ) {

  00049	85 ed		 test	 ebp, ebp
  0004b	75 25		 jne	 SHORT $LN15@ShiftJIS_S

; 37   : 				c1 = 0;
; 38   : 				c2 = MACRO_IsLeadByte( *uszString2 ) ? 0 : *uszString2;

  0004d	8a 07		 mov	 al, BYTE PTR [edi]
  0004f	33 f6		 xor	 esi, esi
  00051	3c 81		 cmp	 al, 129			; 00000081H
  00053	72 08		 jb	 SHORT $LN24@ShiftJIS_S
  00055	3c 9f		 cmp	 al, 159			; 0000009fH
  00057	0f 86 a4 00 00
	00		 jbe	 $LN31@ShiftJIS_S
$LN24@ShiftJIS_S:
  0005d	3c e0		 cmp	 al, 224			; 000000e0H
  0005f	72 08		 jb	 SHORT $LN25@ShiftJIS_S
  00061	3c fc		 cmp	 al, 252			; 000000fcH
  00063	0f 86 98 00 00
	00		 jbe	 $LN31@ShiftJIS_S
$LN25@ShiftJIS_S:
  00069	66 0f b6 d0	 movzx	 dx, al
  0006d	0f b7 c2	 movzx	 eax, dx
  00070	eb 7d		 jmp	 SHORT $test$26901
$LN15@ShiftJIS_S:

; 39   : 				goto test;
; 40   : 			}
; 41   : 			if( *uszString1 == '\0' )

  00072	8a 0b		 mov	 cl, BYTE PTR [ebx]
  00074	84 c9		 test	 cl, cl
  00076	75 04		 jne	 SHORT $LN13@ShiftJIS_S

; 42   : 				c1 = 0;

  00078	33 f6		 xor	 esi, esi

; 43   : 			else {

  0007a	eb 1c		 jmp	 SHORT $LN11@ShiftJIS_S
$LN13@ShiftJIS_S:

; 44   : 				c1 = ((c1 << 8) | *uszString1++);

  0007c	66 0f b6 c9	 movzx	 cx, cl
  00080	c1 e0 08	 shl	 eax, 8
  00083	66 0b c1	 or	 ax, cx
  00086	43		 inc	 ebx

; 45   : 			}
; 46   : 		} else

  00087	eb 0c		 jmp	 SHORT $LN42@ShiftJIS_S
$LN18@ShiftJIS_S:

; 47   : 			c1 = tolower(c1);

  00089	0f b7 d0	 movzx	 edx, ax
  0008c	52		 push	 edx
  0008d	e8 00 00 00 00	 call	 _tolower
  00092	83 c4 04	 add	 esp, 4
$LN42@ShiftJIS_S:
  00095	0f b7 f0	 movzx	 esi, ax
$LN11@ShiftJIS_S:

; 48   : 
; 49   : 		c2 = *uszString2++;

  00098	66 0f b6 07	 movzx	 ax, BYTE PTR [edi]
  0009c	0f b7 c0	 movzx	 eax, ax

; 50   : 		if( MACRO_IsLeadByte(c2) ) {

  0009f	b9 81 00 00 00	 mov	 ecx, 129		; 00000081H
  000a4	47		 inc	 edi
  000a5	66 3b c8	 cmp	 cx, ax
  000a8	77 0a		 ja	 SHORT $LN8@ShiftJIS_S
  000aa	ba 9f 00 00 00	 mov	 edx, 159		; 0000009fH
  000af	66 3b c2	 cmp	 ax, dx
  000b2	76 0c		 jbe	 SHORT $LN9@ShiftJIS_S
$LN8@ShiftJIS_S:
  000b4	8d 88 20 ff ff
	ff		 lea	 ecx, DWORD PTR [eax-224]
  000ba	66 83 f9 1c	 cmp	 cx, 28			; 0000001cH
  000be	77 20		 ja	 SHORT $LN10@ShiftJIS_S
$LN9@ShiftJIS_S:

; 51   : 			if( sizeLength == 0 ) {

  000c0	85 ed		 test	 ebp, ebp
  000c2	75 04		 jne	 SHORT $LN7@ShiftJIS_S

; 52   : 				c2 = 0;

  000c4	33 c0		 xor	 eax, eax

; 63   : test:

  000c6	eb 27		 jmp	 SHORT $test$26901
$LN7@ShiftJIS_S:

; 53   : 				goto test;
; 54   : 			}
; 55   : 			sizeLength--;
; 56   : 			if( *uszString2 == '\0' )

  000c8	8a 0f		 mov	 cl, BYTE PTR [edi]
  000ca	4d		 dec	 ebp
  000cb	84 c9		 test	 cl, cl
  000cd	75 04		 jne	 SHORT $LN5@ShiftJIS_S

; 57   : 				c2 = 0;

  000cf	33 c0		 xor	 eax, eax

; 58   : 			else {

  000d1	eb 1c		 jmp	 SHORT $test$26901
$LN5@ShiftJIS_S:

; 59   : 				c2 = ((c2 << 8) | *uszString2++);

  000d3	66 0f b6 d1	 movzx	 dx, cl
  000d7	c1 e0 08	 shl	 eax, 8
  000da	66 0b c2	 or	 ax, dx
  000dd	47		 inc	 edi

; 60   : 			}
; 61   : 		} else

  000de	eb 0c		 jmp	 SHORT $LN43@ShiftJIS_S
$LN10@ShiftJIS_S:

; 62   : 			c2 = tolower(c2);

  000e0	0f b7 c0	 movzx	 eax, ax
  000e3	50		 push	 eax
  000e4	e8 00 00 00 00	 call	 _tolower
  000e9	83 c4 04	 add	 esp, 4
$LN43@ShiftJIS_S:
  000ec	0f b7 c0	 movzx	 eax, ax
$test$26901:

; 64   :         if (c1 != c2)

  000ef	66 3b c6	 cmp	 ax, si
  000f2	75 14		 jne	 SHORT $LN44@ShiftJIS_S

; 66   : 
; 67   :         if (c1 == 0)

  000f4	66 85 f6	 test	 si, si
  000f7	74 08		 je	 SHORT $LN31@ShiftJIS_S

; 33   : 	while( sizeLength-- ) {

  000f9	85 ed		 test	 ebp, ebp
  000fb	0f 85 1f ff ff
	ff		 jne	 $LL20@ShiftJIS_S
$LN31@ShiftJIS_S:
  00101	5e		 pop	 esi
  00102	5f		 pop	 edi
  00103	5d		 pop	 ebp

; 68   :             return(0);
; 69   : 	}
; 70   : 	return 0;

  00104	33 c0		 xor	 eax, eax
  00106	5b		 pop	 ebx

; 71   : }

  00107	c3		 ret	 0
$LN44@ShiftJIS_S:
  00108	5e		 pop	 esi

; 65   :             return( (c1 > c2) ? 1 : -1);

  00109	1b c0		 sbb	 eax, eax
  0010b	5f		 pop	 edi
  0010c	83 e0 02	 and	 eax, 2
  0010f	5d		 pop	 ebp
  00110	48		 dec	 eax
  00111	5b		 pop	 ebx

; 71   : }

  00112	c3		 ret	 0
?ShiftJIS_StringCompareCI@@YAHPBD0I@Z ENDP		; ShiftJIS_StringCompareCI
_TEXT	ENDS
END
