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

	TITLE	c:\Develop\DScaler423a\DScaler\xml_hash.cpp
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB OLDNAMES

EXTRN	__wcsdup:PROC
_szStringVal DD	FLAT:??_C@_13HADIAKP@?$AAS?$AA?$AA@
_szDwordVal DD	FLAT:??_C@_13MKMNOPIJ@?$AAD?$AA?$AA@
_szBinaryVal DD	FLAT:??_C@_13OPKGLAFF@?$AAB?$AA?$AA@
_szValToken DD	FLAT:??_C@_17LLMMEOJD@?$AAV?$AAa?$AAl?$AA?$AA@
_szForceRemove DD FLAT:??_C@_1BI@JFAIJMHL@?$AAF?$AAo?$AAr?$AAc?$AAe?$AAR?$AAe?$AAm?$AAo?$AAv?$AAe?$AA?$AA@
_szNoRemove DD	FLAT:??_C@_1BC@GCKHIPE@?$AAN?$AAo?$AAR?$AAe?$AAm?$AAo?$AAv?$AAe?$AA?$AA@
_szDelete DD	FLAT:??_C@_1O@JDLOHAN@?$AAD?$AAe?$AAl?$AAe?$AAt?$AAe?$AA?$AA@
__bad_alloc_Message DD FLAT:??_C@_0P@GHFPNOJB@bad?5allocation?$AA@
PUBLIC	?XmlHash_Init@@YAPAXXZ				; XmlHash_Init
; Function compile flags: /Odtp
; File c:\develop\dscaler423a\dscaler\xml_hash.cpp
;	COMDAT ?XmlHash_Init@@YAPAXXZ
_TEXT	SEGMENT
_pHash$ = -4						; size = 4
?XmlHash_Init@@YAPAXXZ PROC				; XmlHash_Init, COMDAT

; 294  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx

; 295  :    XML_HASH_STATE * pHash;
; 296  : 
; 297  :    pHash = (XML_HASH_STATE*)xmalloc(sizeof(*pHash));

  00004	68 0c 08 00 00	 push	 2060			; 0000080cH
  00009	e8 00 00 00 00	 call	 _malloc
  0000e	83 c4 04	 add	 esp, 4
  00011	89 45 fc	 mov	 DWORD PTR _pHash$[ebp], eax

; 298  :    memset(pHash, 0, sizeof(*pHash));

  00014	68 0c 08 00 00	 push	 2060			; 0000080cH
  00019	6a 00		 push	 0
  0001b	8b 45 fc	 mov	 eax, DWORD PTR _pHash$[ebp]
  0001e	50		 push	 eax
  0001f	e8 00 00 00 00	 call	 _memset
  00024	83 c4 0c	 add	 esp, 12			; 0000000cH

; 299  : 
; 300  :    pHash->bucketCount = 128;

  00027	8b 4d fc	 mov	 ecx, DWORD PTR _pHash$[ebp]
  0002a	c7 41 08 80 00
	00 00		 mov	 DWORD PTR [ecx+8], 128	; 00000080H

; 301  :    pHash->pBuckets = (HASH_BUCKET*)xmalloc(pHash->bucketCount * sizeof(HASH_BUCKET));

  00031	8b 55 fc	 mov	 edx, DWORD PTR _pHash$[ebp]
  00034	8b 42 08	 mov	 eax, DWORD PTR [edx+8]
  00037	6b c0 18	 imul	 eax, 24			; 00000018H
  0003a	50		 push	 eax
  0003b	e8 00 00 00 00	 call	 _malloc
  00040	83 c4 04	 add	 esp, 4
  00043	8b 4d fc	 mov	 ecx, DWORD PTR _pHash$[ebp]
  00046	89 01		 mov	 DWORD PTR [ecx], eax

; 302  : 
; 303  :    memset(pHash->map, HASH_MAP_FREE, sizeof(pHash->map));

  00048	68 00 08 00 00	 push	 2048			; 00000800H
  0004d	6a ff		 push	 -1
  0004f	8b 55 fc	 mov	 edx, DWORD PTR _pHash$[ebp]
  00052	83 c2 0c	 add	 edx, 12			; 0000000cH
  00055	52		 push	 edx
  00056	e8 00 00 00 00	 call	 _memset
  0005b	83 c4 0c	 add	 esp, 12			; 0000000cH

; 304  : 
; 305  :    return (XML_HASH_PTR) pHash;

  0005e	8b 45 fc	 mov	 eax, DWORD PTR _pHash$[ebp]

; 306  : }

  00061	8b e5		 mov	 esp, ebp
  00063	5d		 pop	 ebp
  00064	c3		 ret	 0
?XmlHash_Init@@YAPAXXZ ENDP				; XmlHash_Init
_TEXT	ENDS
PUBLIC	?XmlHash_Destroy@@YAXPAXP6AX0PA_W@Z@Z		; XmlHash_Destroy
; Function compile flags: /Odtp
;	COMDAT ?XmlHash_Destroy@@YAXPAXP6AX0PA_W@Z@Z
_TEXT	SEGMENT
_pWalk$ = -12						; size = 4
_pHash$ = -8						; size = 4
_idx$ = -4						; size = 4
_pHashRef$ = 8						; size = 4
_pCb$ = 12						; size = 4
?XmlHash_Destroy@@YAXPAXP6AX0PA_W@Z@Z PROC		; XmlHash_Destroy, COMDAT

; 259  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 0c	 sub	 esp, 12			; 0000000cH

; 260  :    XML_HASH_STATE * pHash = (XML_HASH_STATE*)pHashRef;

  00006	8b 45 08	 mov	 eax, DWORD PTR _pHashRef$[ebp]
  00009	89 45 f8	 mov	 DWORD PTR _pHash$[ebp], eax

; 261  :    HASH_BUCKET * pWalk;
; 262  :    uint  idx;
; 263  : 
; 264  :    if (pHash != NULL)

  0000c	83 7d f8 00	 cmp	 DWORD PTR _pHash$[ebp], 0
  00010	74 70		 je	 SHORT $LN7@XmlHash_De

; 265  :    {
; 266  : #ifndef DPRINTF_OFF
; 267  :       XmlHash_Statistics(pHash);
; 268  : #endif
; 269  :       // free all strings referenced by buckets
; 270  :       pWalk = pHash->pBuckets;

  00012	8b 4d f8	 mov	 ecx, DWORD PTR _pHash$[ebp]
  00015	8b 11		 mov	 edx, DWORD PTR [ecx]
  00017	89 55 f4	 mov	 DWORD PTR _pWalk$[ebp], edx

; 271  :       for (idx = 0; idx < pHash->bucketUsed; idx++, pWalk++)

  0001a	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _idx$[ebp], 0
  00021	eb 12		 jmp	 SHORT $LN5@XmlHash_De
$LN4@XmlHash_De:
  00023	8b 45 fc	 mov	 eax, DWORD PTR _idx$[ebp]
  00026	83 c0 01	 add	 eax, 1
  00029	89 45 fc	 mov	 DWORD PTR _idx$[ebp], eax
  0002c	8b 4d f4	 mov	 ecx, DWORD PTR _pWalk$[ebp]
  0002f	83 c1 18	 add	 ecx, 24			; 00000018H
  00032	89 4d f4	 mov	 DWORD PTR _pWalk$[ebp], ecx
$LN5@XmlHash_De:
  00035	8b 55 f8	 mov	 edx, DWORD PTR _pHash$[ebp]
  00038	8b 45 fc	 mov	 eax, DWORD PTR _idx$[ebp]
  0003b	3b 42 04	 cmp	 eax, DWORD PTR [edx+4]
  0003e	73 28		 jae	 SHORT $LN3@XmlHash_De

; 272  :       {
; 273  :          if (pCb != NULL)

  00040	83 7d 0c 00	 cmp	 DWORD PTR _pCb$[ebp], 0
  00044	74 11		 je	 SHORT $LN2@XmlHash_De

; 274  :          {
; 275  :             pCb(pHash, pWalk->payload);

  00046	8b 4d f4	 mov	 ecx, DWORD PTR _pWalk$[ebp]
  00049	83 c1 08	 add	 ecx, 8
  0004c	51		 push	 ecx
  0004d	8b 55 f8	 mov	 edx, DWORD PTR _pHash$[ebp]
  00050	52		 push	 edx
  00051	ff 55 0c	 call	 DWORD PTR _pCb$[ebp]
  00054	83 c4 08	 add	 esp, 8
$LN2@XmlHash_De:

; 276  :          }
; 277  :          xfree(pWalk->pStr);

  00057	8b 45 f4	 mov	 eax, DWORD PTR _pWalk$[ebp]
  0005a	8b 48 04	 mov	 ecx, DWORD PTR [eax+4]
  0005d	51		 push	 ecx
  0005e	e8 00 00 00 00	 call	 _free
  00063	83 c4 04	 add	 esp, 4

; 278  :       }

  00066	eb bb		 jmp	 SHORT $LN4@XmlHash_De
$LN3@XmlHash_De:

; 279  : 
; 280  :       // free bucket array
; 281  :       xfree(pHash->pBuckets);

  00068	8b 55 f8	 mov	 edx, DWORD PTR _pHash$[ebp]
  0006b	8b 02		 mov	 eax, DWORD PTR [edx]
  0006d	50		 push	 eax
  0006e	e8 00 00 00 00	 call	 _free
  00073	83 c4 04	 add	 esp, 4

; 282  : 
; 283  :       // free main struct
; 284  :       xfree(pHash);

  00076	8b 4d f8	 mov	 ecx, DWORD PTR _pHash$[ebp]
  00079	51		 push	 ecx
  0007a	e8 00 00 00 00	 call	 _free
  0007f	83 c4 04	 add	 esp, 4
$LN7@XmlHash_De:

; 285  :    }
; 286  :    else
; 287  :       fatal0(_T("XmlHash-Destroy: invalid NULL ptr param"));
; 288  : }

  00082	8b e5		 mov	 esp, ebp
  00084	5d		 pop	 ebp
  00085	c3		 ret	 0
?XmlHash_Destroy@@YAXPAXP6AX0PA_W@Z@Z ENDP		; XmlHash_Destroy
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?XmlHash_GetFreeBucket@@YAHPAX@Z
_TEXT	SEGMENT
_pHash$ = -8						; size = 4
_pTmp$ = -4						; size = 4
_pHashRef$ = 8						; size = 4
?XmlHash_GetFreeBucket@@YAHPAX@Z PROC			; XmlHash_GetFreeBucket, COMDAT

; 143  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 08	 sub	 esp, 8

; 144  :    XML_HASH_STATE * pHash = (XML_HASH_STATE*) pHashRef;

  00006	8b 45 08	 mov	 eax, DWORD PTR _pHashRef$[ebp]
  00009	89 45 f8	 mov	 DWORD PTR _pHash$[ebp], eax

; 145  :    HASH_BUCKET * pTmp;
; 146  : 
; 147  :    if (pHash->bucketUsed >= pHash->bucketCount)

  0000c	8b 4d f8	 mov	 ecx, DWORD PTR _pHash$[ebp]
  0000f	8b 55 f8	 mov	 edx, DWORD PTR _pHash$[ebp]
  00012	8b 41 04	 mov	 eax, DWORD PTR [ecx+4]
  00015	3b 42 08	 cmp	 eax, DWORD PTR [edx+8]
  00018	72 57		 jb	 SHORT $LN1@XmlHash_Ge

; 148  :    {
; 149  :       dprintf1(_T("XmlHash-GetFreeBucket: grow bucket list to %d entries\n"), pHash->bucketCount * 2);
; 150  :       assert(pHash->bucketUsed == pHash->bucketCount);
; 151  : 
; 152  :       // all buckets are used -> allocate larger list
; 153  :       pTmp = (HASH_BUCKET*)xmalloc(pHash->bucketCount * 2 * sizeof(HASH_BUCKET));

  0001a	8b 4d f8	 mov	 ecx, DWORD PTR _pHash$[ebp]
  0001d	8b 51 08	 mov	 edx, DWORD PTR [ecx+8]
  00020	d1 e2		 shl	 edx, 1
  00022	6b d2 18	 imul	 edx, 24			; 00000018H
  00025	52		 push	 edx
  00026	e8 00 00 00 00	 call	 _malloc
  0002b	83 c4 04	 add	 esp, 4
  0002e	89 45 fc	 mov	 DWORD PTR _pTmp$[ebp], eax

; 154  :       memcpy(pTmp, pHash->pBuckets, pHash->bucketCount * sizeof(HASH_BUCKET));

  00031	8b 45 f8	 mov	 eax, DWORD PTR _pHash$[ebp]
  00034	8b 48 08	 mov	 ecx, DWORD PTR [eax+8]
  00037	6b c9 18	 imul	 ecx, 24			; 00000018H
  0003a	51		 push	 ecx
  0003b	8b 55 f8	 mov	 edx, DWORD PTR _pHash$[ebp]
  0003e	8b 02		 mov	 eax, DWORD PTR [edx]
  00040	50		 push	 eax
  00041	8b 4d fc	 mov	 ecx, DWORD PTR _pTmp$[ebp]
  00044	51		 push	 ecx
  00045	e8 00 00 00 00	 call	 _memcpy
  0004a	83 c4 0c	 add	 esp, 12			; 0000000cH

; 155  : 
; 156  :       xfree(pHash->pBuckets);

  0004d	8b 55 f8	 mov	 edx, DWORD PTR _pHash$[ebp]
  00050	8b 02		 mov	 eax, DWORD PTR [edx]
  00052	50		 push	 eax
  00053	e8 00 00 00 00	 call	 _free
  00058	83 c4 04	 add	 esp, 4

; 157  :       pHash->pBuckets = pTmp;

  0005b	8b 4d f8	 mov	 ecx, DWORD PTR _pHash$[ebp]
  0005e	8b 55 fc	 mov	 edx, DWORD PTR _pTmp$[ebp]
  00061	89 11		 mov	 DWORD PTR [ecx], edx

; 158  :       pHash->bucketCount *= 2;

  00063	8b 45 f8	 mov	 eax, DWORD PTR _pHash$[ebp]
  00066	8b 48 08	 mov	 ecx, DWORD PTR [eax+8]
  00069	d1 e1		 shl	 ecx, 1
  0006b	8b 55 f8	 mov	 edx, DWORD PTR _pHash$[ebp]
  0006e	89 4a 08	 mov	 DWORD PTR [edx+8], ecx
$LN1@XmlHash_Ge:

; 159  :    }
; 160  :    // allocate the first free bucket
; 161  :    pHash->bucketUsed += 1;

  00071	8b 45 f8	 mov	 eax, DWORD PTR _pHash$[ebp]
  00074	8b 48 04	 mov	 ecx, DWORD PTR [eax+4]
  00077	83 c1 01	 add	 ecx, 1
  0007a	8b 55 f8	 mov	 edx, DWORD PTR _pHash$[ebp]
  0007d	89 4a 04	 mov	 DWORD PTR [edx+4], ecx

; 162  : 
; 163  :    return pHash->bucketUsed - 1;

  00080	8b 45 f8	 mov	 eax, DWORD PTR _pHash$[ebp]
  00083	8b 40 04	 mov	 eax, DWORD PTR [eax+4]
  00086	83 e8 01	 sub	 eax, 1

; 164  : }

  00089	8b e5		 mov	 esp, ebp
  0008b	5d		 pop	 ebp
  0008c	c3		 ret	 0
?XmlHash_GetFreeBucket@@YAHPAX@Z ENDP			; XmlHash_GetFreeBucket
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?XmlHash_GetKey@@YAIPB_W@Z
_TEXT	SEGMENT
_c$ = -8						; size = 2
_key$ = -4						; size = 4
_pStr$ = 8						; size = 4
?XmlHash_GetKey@@YAIPB_W@Z PROC				; XmlHash_GetKey, COMDAT

; 126  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 08	 sub	 esp, 8

; 127  :    uint  key;
; 128  :    TCHAR c;
; 129  : 
; 130  :    key = 0;

  00006	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _key$[ebp], 0
$LN2@XmlHash_Ge@2:

; 131  :    while ( (c = *(pStr++)) != 0 )

  0000d	8b 45 08	 mov	 eax, DWORD PTR _pStr$[ebp]
  00010	66 8b 08	 mov	 cx, WORD PTR [eax]
  00013	66 89 4d f8	 mov	 WORD PTR _c$[ebp], cx
  00017	0f b7 55 f8	 movzx	 edx, WORD PTR _c$[ebp]
  0001b	8b 45 08	 mov	 eax, DWORD PTR _pStr$[ebp]
  0001e	83 c0 02	 add	 eax, 2
  00021	89 45 08	 mov	 DWORD PTR _pStr$[ebp], eax
  00024	85 d2		 test	 edx, edx
  00026	74 14		 je	 SHORT $LN1@XmlHash_Ge@2

; 132  :    {
; 133  :       key += (key << 3) ^ c;

  00028	8b 4d fc	 mov	 ecx, DWORD PTR _key$[ebp]
  0002b	c1 e1 03	 shl	 ecx, 3
  0002e	0f b7 55 f8	 movzx	 edx, WORD PTR _c$[ebp]
  00032	33 ca		 xor	 ecx, edx
  00034	03 4d fc	 add	 ecx, DWORD PTR _key$[ebp]
  00037	89 4d fc	 mov	 DWORD PTR _key$[ebp], ecx

; 134  :    }

  0003a	eb d1		 jmp	 SHORT $LN2@XmlHash_Ge@2
$LN1@XmlHash_Ge@2:

; 135  :    return key;

  0003c	8b 45 fc	 mov	 eax, DWORD PTR _key$[ebp]

; 136  : }

  0003f	8b e5		 mov	 esp, ebp
  00041	5d		 pop	 ebp
  00042	c3		 ret	 0
?XmlHash_GetKey@@YAIPB_W@Z ENDP				; XmlHash_GetKey
PUBLIC	?XmlHash_CreateEntry@@YAPAXPAXPB_WPAE@Z		; XmlHash_CreateEntry
; Function compile flags: /Odtp
;	COMDAT ?XmlHash_CreateEntry@@YAPAXPAXPB_WPAE@Z
_TEXT	SEGMENT
_prevIdx$ = -16						; size = 4
_pHash$ = -12						; size = 4
_walkIdx$ = -8						; size = 4
_key$ = -4						; size = 4
_pHashRef$ = 8						; size = 4
_pStr$ = 12						; size = 4
_pIsNew$ = 16						; size = 4
?XmlHash_CreateEntry@@YAPAXPAXPB_WPAE@Z PROC		; XmlHash_CreateEntry, COMDAT

; 204  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 10	 sub	 esp, 16			; 00000010H

; 205  :    XML_HASH_STATE * pHash = (XML_HASH_STATE*)pHashRef;

  00006	8b 45 08	 mov	 eax, DWORD PTR _pHashRef$[ebp]
  00009	89 45 f4	 mov	 DWORD PTR _pHash$[ebp], eax

; 206  :    sint  walkIdx;
; 207  :    sint  prevIdx;
; 208  :    uint  key;
; 209  : 
; 210  :    key = XmlHash_GetKey(pStr) & (HASH_MAP_SIZE - 1);

  0000c	8b 4d 0c	 mov	 ecx, DWORD PTR _pStr$[ebp]
  0000f	51		 push	 ecx
  00010	e8 00 00 00 00	 call	 ?XmlHash_GetKey@@YAIPB_W@Z ; XmlHash_GetKey
  00015	83 c4 04	 add	 esp, 4
  00018	25 ff 01 00 00	 and	 eax, 511		; 000001ffH
  0001d	89 45 fc	 mov	 DWORD PTR _key$[ebp], eax

; 211  :    prevIdx = HASH_MAP_FREE;

  00020	c7 45 f0 ff ff
	ff ff		 mov	 DWORD PTR _prevIdx$[ebp], -1

; 212  :    walkIdx = pHash->map[key];

  00027	8b 55 fc	 mov	 edx, DWORD PTR _key$[ebp]
  0002a	8b 45 f4	 mov	 eax, DWORD PTR _pHash$[ebp]
  0002d	8b 4c 90 0c	 mov	 ecx, DWORD PTR [eax+edx*4+12]
  00031	89 4d f8	 mov	 DWORD PTR _walkIdx$[ebp], ecx

; 213  : 
; 214  :    if (walkIdx != HASH_MAP_FREE)

  00034	83 7d f8 ff	 cmp	 DWORD PTR _walkIdx$[ebp], -1
  00038	74 41		 je	 SHORT $LN8@XmlHash_Cr
$LN7@XmlHash_Cr:

; 215  :    {
; 216  :       while (walkIdx != HASH_MAP_FREE)

  0003a	83 7d f8 ff	 cmp	 DWORD PTR _walkIdx$[ebp], -1
  0003e	74 3b		 je	 SHORT $LN8@XmlHash_Cr

; 217  :       {
; 218  :          if (_tcscmp(pHash->pBuckets[walkIdx].pStr, pStr) == 0)

  00040	8b 55 0c	 mov	 edx, DWORD PTR _pStr$[ebp]
  00043	52		 push	 edx
  00044	8b 45 f8	 mov	 eax, DWORD PTR _walkIdx$[ebp]
  00047	6b c0 18	 imul	 eax, 24			; 00000018H
  0004a	8b 4d f4	 mov	 ecx, DWORD PTR _pHash$[ebp]
  0004d	8b 11		 mov	 edx, DWORD PTR [ecx]
  0004f	8b 44 02 04	 mov	 eax, DWORD PTR [edx+eax+4]
  00053	50		 push	 eax
  00054	e8 00 00 00 00	 call	 _wcscmp
  00059	83 c4 08	 add	 esp, 8
  0005c	85 c0		 test	 eax, eax
  0005e	75 02		 jne	 SHORT $LN5@XmlHash_Cr

; 219  :          {
; 220  :             break;

  00060	eb 19		 jmp	 SHORT $LN8@XmlHash_Cr
$LN5@XmlHash_Cr:

; 221  :          }
; 222  :          prevIdx = walkIdx;

  00062	8b 4d f8	 mov	 ecx, DWORD PTR _walkIdx$[ebp]
  00065	89 4d f0	 mov	 DWORD PTR _prevIdx$[ebp], ecx

; 223  :          walkIdx = pHash->pBuckets[walkIdx].nextIdx;

  00068	8b 55 f8	 mov	 edx, DWORD PTR _walkIdx$[ebp]
  0006b	6b d2 18	 imul	 edx, 24			; 00000018H
  0006e	8b 45 f4	 mov	 eax, DWORD PTR _pHash$[ebp]
  00071	8b 08		 mov	 ecx, DWORD PTR [eax]
  00073	8b 14 0a	 mov	 edx, DWORD PTR [edx+ecx]
  00076	89 55 f8	 mov	 DWORD PTR _walkIdx$[ebp], edx

; 224  :       }

  00079	eb bf		 jmp	 SHORT $LN7@XmlHash_Cr
$LN8@XmlHash_Cr:

; 225  :    }
; 226  : 
; 227  :    if (walkIdx == HASH_MAP_FREE)

  0007b	83 7d f8 ff	 cmp	 DWORD PTR _walkIdx$[ebp], -1
  0007f	75 6a		 jne	 SHORT $LN4@XmlHash_Cr

; 228  :    {
; 229  :       // tstring not found in hash
; 230  :       *pIsNew = TRUE;

  00081	8b 45 10	 mov	 eax, DWORD PTR _pIsNew$[ebp]
  00084	c6 00 01	 mov	 BYTE PTR [eax], 1

; 231  : 
; 232  :       walkIdx = XmlHash_GetFreeBucket(pHash);

  00087	8b 4d f4	 mov	 ecx, DWORD PTR _pHash$[ebp]
  0008a	51		 push	 ecx
  0008b	e8 00 00 00 00	 call	 ?XmlHash_GetFreeBucket@@YAHPAX@Z ; XmlHash_GetFreeBucket
  00090	83 c4 04	 add	 esp, 4
  00093	89 45 f8	 mov	 DWORD PTR _walkIdx$[ebp], eax

; 233  :       pHash->pBuckets[walkIdx].pStr = xstrdup(pStr);

  00096	8b 55 0c	 mov	 edx, DWORD PTR _pStr$[ebp]
  00099	52		 push	 edx
  0009a	e8 00 00 00 00	 call	 __wcsdup
  0009f	83 c4 04	 add	 esp, 4
  000a2	8b 4d f8	 mov	 ecx, DWORD PTR _walkIdx$[ebp]
  000a5	6b c9 18	 imul	 ecx, 24			; 00000018H
  000a8	8b 55 f4	 mov	 edx, DWORD PTR _pHash$[ebp]
  000ab	8b 12		 mov	 edx, DWORD PTR [edx]
  000ad	89 44 0a 04	 mov	 DWORD PTR [edx+ecx+4], eax

; 234  :       pHash->pBuckets[walkIdx].nextIdx = HASH_MAP_FREE;

  000b1	8b 45 f8	 mov	 eax, DWORD PTR _walkIdx$[ebp]
  000b4	6b c0 18	 imul	 eax, 24			; 00000018H
  000b7	8b 4d f4	 mov	 ecx, DWORD PTR _pHash$[ebp]
  000ba	8b 11		 mov	 edx, DWORD PTR [ecx]
  000bc	c7 04 10 ff ff
	ff ff		 mov	 DWORD PTR [eax+edx], -1

; 235  : 
; 236  :       if (prevIdx == HASH_MAP_FREE)

  000c3	83 7d f0 ff	 cmp	 DWORD PTR _prevIdx$[ebp], -1
  000c7	75 0f		 jne	 SHORT $LN3@XmlHash_Cr

; 237  :       {  // allocate new key
; 238  :          dprintf3(_T("XmlHash-CreateEntry: allocate map entry #%d: bucket #%d for '%s'\n"), key, walkIdx, pStr);
; 239  :          pHash->map[key] = walkIdx;

  000c9	8b 45 fc	 mov	 eax, DWORD PTR _key$[ebp]
  000cc	8b 4d f4	 mov	 ecx, DWORD PTR _pHash$[ebp]
  000cf	8b 55 f8	 mov	 edx, DWORD PTR _walkIdx$[ebp]
  000d2	89 54 81 0c	 mov	 DWORD PTR [ecx+eax*4+12], edx

; 240  :       }
; 241  :       else

  000d6	eb 11		 jmp	 SHORT $LN2@XmlHash_Cr
$LN3@XmlHash_Cr:

; 242  :       {  // key already known -> append to existing bucket chain
; 243  :          dprintf3(_T("XmlHash-CreateEntry: append tp map entry #%d: bucket #%d for '%s'\n"), key, walkIdx, pStr);
; 244  :          pHash->pBuckets[prevIdx].nextIdx = walkIdx;

  000d8	8b 45 f0	 mov	 eax, DWORD PTR _prevIdx$[ebp]
  000db	6b c0 18	 imul	 eax, 24			; 00000018H
  000de	8b 4d f4	 mov	 ecx, DWORD PTR _pHash$[ebp]
  000e1	8b 11		 mov	 edx, DWORD PTR [ecx]
  000e3	8b 4d f8	 mov	 ecx, DWORD PTR _walkIdx$[ebp]
  000e6	89 0c 10	 mov	 DWORD PTR [eax+edx], ecx
$LN2@XmlHash_Cr:

; 245  :       }
; 246  :    }
; 247  :    else

  000e9	eb 06		 jmp	 SHORT $LN1@XmlHash_Cr
$LN4@XmlHash_Cr:

; 248  :    {  // already in hash: just return pointer to the entry
; 249  :       *pIsNew = FALSE;

  000eb	8b 55 10	 mov	 edx, DWORD PTR _pIsNew$[ebp]
  000ee	c6 02 00	 mov	 BYTE PTR [edx], 0
$LN1@XmlHash_Cr:

; 250  :    }
; 251  : 
; 252  :    return (XML_HASH_PAYLOAD) (&pHash->pBuckets[walkIdx].payload);

  000f1	8b 45 f8	 mov	 eax, DWORD PTR _walkIdx$[ebp]
  000f4	6b c0 18	 imul	 eax, 24			; 00000018H
  000f7	8b 4d f4	 mov	 ecx, DWORD PTR _pHash$[ebp]
  000fa	8b 11		 mov	 edx, DWORD PTR [ecx]
  000fc	8d 44 02 08	 lea	 eax, DWORD PTR [edx+eax+8]

; 253  : }

  00100	8b e5		 mov	 esp, ebp
  00102	5d		 pop	 ebp
  00103	c3		 ret	 0
?XmlHash_CreateEntry@@YAPAXPAXPB_WPAE@Z ENDP		; XmlHash_CreateEntry
_TEXT	ENDS
PUBLIC	?XmlHash_SearchEntry@@YAPAXPAXPB_W@Z		; XmlHash_SearchEntry
; Function compile flags: /Odtp
;	COMDAT ?XmlHash_SearchEntry@@YAPAXPAXPB_W@Z
_TEXT	SEGMENT
_prevIdx$ = -16						; size = 4
_pHash$ = -12						; size = 4
_walkIdx$ = -8						; size = 4
_key$ = -4						; size = 4
_pHashRef$ = 8						; size = 4
_pStr$ = 12						; size = 4
?XmlHash_SearchEntry@@YAPAXPAXPB_W@Z PROC		; XmlHash_SearchEntry, COMDAT

; 171  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 10	 sub	 esp, 16			; 00000010H

; 172  :    XML_HASH_STATE * pHash = (XML_HASH_STATE*)pHashRef;

  00006	8b 45 08	 mov	 eax, DWORD PTR _pHashRef$[ebp]
  00009	89 45 f4	 mov	 DWORD PTR _pHash$[ebp], eax

; 173  :    sint  walkIdx;
; 174  :    sint  prevIdx;
; 175  :    uint  key;
; 176  : 
; 177  :    key = XmlHash_GetKey(pStr) & (HASH_MAP_SIZE - 1);

  0000c	8b 4d 0c	 mov	 ecx, DWORD PTR _pStr$[ebp]
  0000f	51		 push	 ecx
  00010	e8 00 00 00 00	 call	 ?XmlHash_GetKey@@YAIPB_W@Z ; XmlHash_GetKey
  00015	83 c4 04	 add	 esp, 4
  00018	25 ff 01 00 00	 and	 eax, 511		; 000001ffH
  0001d	89 45 fc	 mov	 DWORD PTR _key$[ebp], eax

; 178  :    prevIdx = HASH_MAP_FREE;

  00020	c7 45 f0 ff ff
	ff ff		 mov	 DWORD PTR _prevIdx$[ebp], -1

; 179  :    walkIdx = pHash->map[key];

  00027	8b 55 fc	 mov	 edx, DWORD PTR _key$[ebp]
  0002a	8b 45 f4	 mov	 eax, DWORD PTR _pHash$[ebp]
  0002d	8b 4c 90 0c	 mov	 ecx, DWORD PTR [eax+edx*4+12]
  00031	89 4d f8	 mov	 DWORD PTR _walkIdx$[ebp], ecx

; 180  : 
; 181  :    if (walkIdx != HASH_MAP_FREE)

  00034	83 7d f8 ff	 cmp	 DWORD PTR _walkIdx$[ebp], -1
  00038	74 41		 je	 SHORT $LN6@XmlHash_Se
$LN5@XmlHash_Se:

; 182  :    {
; 183  :       while (walkIdx != HASH_MAP_FREE)

  0003a	83 7d f8 ff	 cmp	 DWORD PTR _walkIdx$[ebp], -1
  0003e	74 3b		 je	 SHORT $LN6@XmlHash_Se

; 184  :       {
; 185  :          if (_tcscmp(pHash->pBuckets[walkIdx].pStr, pStr) == 0)

  00040	8b 55 0c	 mov	 edx, DWORD PTR _pStr$[ebp]
  00043	52		 push	 edx
  00044	8b 45 f8	 mov	 eax, DWORD PTR _walkIdx$[ebp]
  00047	6b c0 18	 imul	 eax, 24			; 00000018H
  0004a	8b 4d f4	 mov	 ecx, DWORD PTR _pHash$[ebp]
  0004d	8b 11		 mov	 edx, DWORD PTR [ecx]
  0004f	8b 44 02 04	 mov	 eax, DWORD PTR [edx+eax+4]
  00053	50		 push	 eax
  00054	e8 00 00 00 00	 call	 _wcscmp
  00059	83 c4 08	 add	 esp, 8
  0005c	85 c0		 test	 eax, eax
  0005e	75 02		 jne	 SHORT $LN3@XmlHash_Se

; 186  :          {
; 187  :             break;

  00060	eb 19		 jmp	 SHORT $LN6@XmlHash_Se
$LN3@XmlHash_Se:

; 188  :          }
; 189  :          prevIdx = walkIdx;

  00062	8b 4d f8	 mov	 ecx, DWORD PTR _walkIdx$[ebp]
  00065	89 4d f0	 mov	 DWORD PTR _prevIdx$[ebp], ecx

; 190  :          walkIdx = pHash->pBuckets[walkIdx].nextIdx;

  00068	8b 55 f8	 mov	 edx, DWORD PTR _walkIdx$[ebp]
  0006b	6b d2 18	 imul	 edx, 24			; 00000018H
  0006e	8b 45 f4	 mov	 eax, DWORD PTR _pHash$[ebp]
  00071	8b 08		 mov	 ecx, DWORD PTR [eax]
  00073	8b 14 0a	 mov	 edx, DWORD PTR [edx+ecx]
  00076	89 55 f8	 mov	 DWORD PTR _walkIdx$[ebp], edx

; 191  :       }

  00079	eb bf		 jmp	 SHORT $LN5@XmlHash_Se
$LN6@XmlHash_Se:

; 192  :    }
; 193  : 
; 194  :    if (walkIdx != HASH_MAP_FREE)

  0007b	83 7d f8 ff	 cmp	 DWORD PTR _walkIdx$[ebp], -1
  0007f	74 13		 je	 SHORT $LN2@XmlHash_Se

; 195  :       return (XML_HASH_PAYLOAD) (&pHash->pBuckets[walkIdx].payload);

  00081	8b 45 f8	 mov	 eax, DWORD PTR _walkIdx$[ebp]
  00084	6b c0 18	 imul	 eax, 24			; 00000018H
  00087	8b 4d f4	 mov	 ecx, DWORD PTR _pHash$[ebp]
  0008a	8b 11		 mov	 edx, DWORD PTR [ecx]
  0008c	8d 44 02 08	 lea	 eax, DWORD PTR [edx+eax+8]
  00090	eb 04		 jmp	 SHORT $LN7@XmlHash_Se

; 196  :    else

  00092	eb 02		 jmp	 SHORT $LN7@XmlHash_Se
$LN2@XmlHash_Se:

; 197  :       return NULL;

  00094	33 c0		 xor	 eax, eax
$LN7@XmlHash_Se:

; 198  : }

  00096	8b e5		 mov	 esp, ebp
  00098	5d		 pop	 ebp
  00099	c3		 ret	 0
?XmlHash_SearchEntry@@YAPAXPAXPB_W@Z ENDP		; XmlHash_SearchEntry
END
