OSDN Git Service

#xxxxx DTXViewerのプロジェクトを追加。
[dtxmania/dtxmania.git] / DTXViewerプロジェクト / @libpngソリューション / zlib-1.2.8 / contrib / vstudio / vc10 / x86 / ZlibDllRelease / Tmp / inftrees.cod
1 ; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.40219.01 
2
3         TITLE   C:\Documents and Settings\yyagi\My Documents\Visual Studio 2010\Projects\dtxmania\branches\111222(DTXViewer023 with #26977)\@libpng\[V\zlib-1.2.8\inftrees.c
4         .686P
5         .XMM
6         include listing.inc
7         .model  flat
8
9 INCLUDELIB OLDNAMES
10
11 PUBLIC  _inflate_copyright
12 _inflate_copyright DB ' inflate 1.2.8 Copyright 1995-2013 Mark Adler ', 00H
13         ORG $+1
14 ?lbase@?1??inflate_table@@9@9 DW 03H                    ; `inflate_table'::`2'::lbase
15         DW      04H
16         DW      05H
17         DW      06H
18         DW      07H
19         DW      08H
20         DW      09H
21         DW      0aH
22         DW      0bH
23         DW      0dH
24         DW      0fH
25         DW      011H
26         DW      013H
27         DW      017H
28         DW      01bH
29         DW      01fH
30         DW      023H
31         DW      02bH
32         DW      033H
33         DW      03bH
34         DW      043H
35         DW      053H
36         DW      063H
37         DW      073H
38         DW      083H
39         DW      0a3H
40         DW      0c3H
41         DW      0e3H
42         DW      0102H
43         DW      00H
44         DW      00H
45         ORG $+2
46 ?lext@?1??inflate_table@@9@9 DW 010H                    ; `inflate_table'::`2'::lext
47         DW      010H
48         DW      010H
49         DW      010H
50         DW      010H
51         DW      010H
52         DW      010H
53         DW      010H
54         DW      011H
55         DW      011H
56         DW      011H
57         DW      011H
58         DW      012H
59         DW      012H
60         DW      012H
61         DW      012H
62         DW      013H
63         DW      013H
64         DW      013H
65         DW      013H
66         DW      014H
67         DW      014H
68         DW      014H
69         DW      014H
70         DW      015H
71         DW      015H
72         DW      015H
73         DW      015H
74         DW      010H
75         DW      048H
76         DW      04eH
77         ORG $+2
78 ?dbase@?1??inflate_table@@9@9 DW 01H                    ; `inflate_table'::`2'::dbase
79         DW      02H
80         DW      03H
81         DW      04H
82         DW      05H
83         DW      07H
84         DW      09H
85         DW      0dH
86         DW      011H
87         DW      019H
88         DW      021H
89         DW      031H
90         DW      041H
91         DW      061H
92         DW      081H
93         DW      0c1H
94         DW      0101H
95         DW      0181H
96         DW      0201H
97         DW      0301H
98         DW      0401H
99         DW      0601H
100         DW      0801H
101         DW      0c01H
102         DW      01001H
103         DW      01801H
104         DW      02001H
105         DW      03001H
106         DW      04001H
107         DW      06001H
108         DW      00H
109         DW      00H
110 ?dext@?1??inflate_table@@9@9 DW 010H                    ; `inflate_table'::`2'::dext
111         DW      010H
112         DW      010H
113         DW      010H
114         DW      011H
115         DW      011H
116         DW      012H
117         DW      012H
118         DW      013H
119         DW      013H
120         DW      014H
121         DW      014H
122         DW      015H
123         DW      015H
124         DW      016H
125         DW      016H
126         DW      017H
127         DW      017H
128         DW      018H
129         DW      018H
130         DW      019H
131         DW      019H
132         DW      01aH
133         DW      01aH
134         DW      01bH
135         DW      01bH
136         DW      01cH
137         DW      01cH
138         DW      01dH
139         DW      01dH
140         DW      040H
141         DW      040H
142 PUBLIC  _inflate_table
143 ; Function compile flags: /Ogtp
144 ; File c:\documents and settings\yyagi\my documents\visual studio 2010\projects\dtxmania\branches\111222(dtxviewer023 with #26977)\@libpng\83\\83\8a\83\85\81[\83V\83\87\83\93\zlib-1.2.8\inftrees.c
145 ;       COMDAT _inflate_table
146 _TEXT   SEGMENT
147 _offs$ = -124                                           ; size = 32
148 _count$ = -92                                           ; size = 32
149 tv614 = -60                                             ; size = 4
150 _min$ = -56                                             ; size = 4
151 _mask$ = -52                                            ; size = 4
152 _low$ = -48                                             ; size = 4
153 tv585 = -44                                             ; size = 4
154 _used$ = -40                                            ; size = 4
155 _base$ = -36                                            ; size = 4
156 _extra$ = -32                                           ; size = 4
157 _end$ = -28                                             ; size = 4
158 _next$ = -24                                            ; size = 4
159 _max$ = -20                                             ; size = 4
160 tv1134 = -16                                            ; size = 4
161 _drop$ = -12                                            ; size = 4
162 _huff$ = -8                                             ; size = 4
163 _root$ = -4                                             ; size = 4
164 _type$ = 8                                              ; size = 4
165 _lens$ = 12                                             ; size = 4
166 _here$ = 16                                             ; size = 4
167 _codes$ = 16                                            ; size = 4
168 _table$ = 20                                            ; size = 4
169 _bits$ = 24                                             ; size = 4
170 _work$ = 28                                             ; size = 4
171 _inflate_table PROC                                     ; COMDAT
172
173 ; 39   : {
174
175   00000 55               push    ebp
176   00001 8b ec            mov     ebp, esp
177   00003 83 ec 7c         sub     esp, 124               ; 0000007cH
178   00006 8b 55 10         mov     edx, DWORD PTR _codes$[ebp]
179
180 ; 40   :     unsigned len;               /* a code's length in bits */
181 ; 41   :     unsigned sym;               /* index of code symbols */
182 ; 42   :     unsigned min, max;          /* minimum and maximum code lengths */
183 ; 43   :     unsigned root;              /* number of index bits for root table */
184 ; 44   :     unsigned curr;              /* number of index bits for current table */
185 ; 45   :     unsigned drop;              /* code bits to drop for sub-table */
186 ; 46   :     int left;                   /* number of prefix codes available */
187 ; 47   :     unsigned used;              /* code entries in table used */
188 ; 48   :     unsigned huff;              /* Huffman code */
189 ; 49   :     unsigned incr;              /* for incrementing code, index */
190 ; 50   :     unsigned fill;              /* index for replicating entries */
191 ; 51   :     unsigned low;               /* low bits for current root entry */
192 ; 52   :     unsigned mask;              /* mask for low root bits */
193 ; 53   :     code here;                  /* table entry for duplication */
194 ; 54   :     code FAR *next;             /* next available space in table */
195 ; 55   :     const unsigned short FAR *base;     /* base value table to use */
196 ; 56   :     const unsigned short FAR *extra;    /* extra bits table to use */
197 ; 57   :     int end;                    /* use base and extra for symbol > end */
198 ; 58   :     unsigned short count[MAXBITS+1];    /* number of codes of each length */
199 ; 59   :     unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
200 ; 60   :     static const unsigned short lbase[31] = { /* Length codes 257..285 base */
201 ; 61   :         3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
202 ; 62   :         35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
203 ; 63   :     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
204 ; 64   :         16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
205 ; 65   :         19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78};
206 ; 66   :     static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
207 ; 67   :         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
208 ; 68   :         257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
209 ; 69   :         8193, 12289, 16385, 24577, 0, 0};
210 ; 70   :     static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
211 ; 71   :         16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
212 ; 72   :         23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
213 ; 73   :         28, 28, 29, 29, 64, 64};
214 ; 74   : 
215 ; 75   :     /*
216 ; 76   :        Process a set of code lengths to create a canonical Huffman code.  The
217 ; 77   :        code lengths are lens[0..codes-1].  Each length corresponds to the
218 ; 78   :        symbols 0..codes-1.  The Huffman code is generated by first sorting the
219 ; 79   :        symbols by length from short to long, and retaining the symbol order
220 ; 80   :        for codes with equal lengths.  Then the code starts with all zero bits
221 ; 81   :        for the first code of the shortest length, and the codes are integer
222 ; 82   :        increments for the same length, and zeros are appended as the length
223 ; 83   :        increases.  For the deflate format, these bits are stored backwards
224 ; 84   :        from their more natural integer increment ordering, and so when the
225 ; 85   :        decoding tables are built in the large loop below, the integer codes
226 ; 86   :        are incremented backwards.
227 ; 87   : 
228 ; 88   :        This routine assumes, but does not check, that all of the entries in
229 ; 89   :        lens[] are in the range 0..MAXBITS.  The caller must assure this.
230 ; 90   :        1..MAXBITS is interpreted as that code length.  zero means that that
231 ; 91   :        symbol does not occur in this code.
232 ; 92   : 
233 ; 93   :        The codes are sorted by computing a count of codes for each length,
234 ; 94   :        creating from that a table of starting indices for each length in the
235 ; 95   :        sorted table, and then entering the symbols in order in the sorted
236 ; 96   :        table.  The sorted table is work[], with that space being provided by
237 ; 97   :        the caller.
238 ; 98   : 
239 ; 99   :        The length counts are used for other purposes as well, i.e. finding
240 ; 100  :        the minimum and maximum length codes, determining if there are any
241 ; 101  :        codes at all, checking for a valid set of lengths, and looking ahead
242 ; 102  :        at length counts to determine sub-table sizes when building the
243 ; 103  :        decoding tables.
244 ; 104  :      */
245 ; 105  : 
246 ; 106  :     /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
247 ; 107  :     for (len = 0; len <= MAXBITS; len++)
248 ; 108  :         count[len] = 0;
249
250   00009 33 c0            xor     eax, eax
251   0000b 0f b7 c8         movzx   ecx, ax
252   0000e 8b c1            mov     eax, ecx
253   00010 c1 e1 10         shl     ecx, 16                        ; 00000010H
254   00013 0b c1            or      eax, ecx
255   00015 53               push    ebx
256   00016 8b 5d 18         mov     ebx, DWORD PTR _bits$[ebp]
257   00019 56               push    esi
258   0001a 8b 75 14         mov     esi, DWORD PTR _table$[ebp]
259   0001d 89 45 a4         mov     DWORD PTR _count$[ebp], eax
260   00020 89 45 a8         mov     DWORD PTR _count$[ebp+4], eax
261   00023 89 45 ac         mov     DWORD PTR _count$[ebp+8], eax
262   00026 89 45 b0         mov     DWORD PTR _count$[ebp+12], eax
263   00029 89 45 b4         mov     DWORD PTR _count$[ebp+16], eax
264   0002c 89 45 b8         mov     DWORD PTR _count$[ebp+20], eax
265   0002f 89 45 bc         mov     DWORD PTR _count$[ebp+24], eax
266   00032 89 45 c0         mov     DWORD PTR _count$[ebp+28], eax
267
268 ; 109  :     for (sym = 0; sym < codes; sym++)
269
270   00035 33 c0            xor     eax, eax
271   00037 57               push    edi
272   00038 8b 7d 0c         mov     edi, DWORD PTR _lens$[ebp]
273   0003b 85 d2            test    edx, edx
274   0003d 74 13            je      SHORT $LN57@inflate_ta
275   0003f 90               npad    1
276 $LL59@inflate_ta:
277
278 ; 110  :         count[lens[sym]]++;
279
280   00040 0f b7 0c 47      movzx   ecx, WORD PTR [edi+eax*2]
281   00044 66 ff 44 4d a4   inc     WORD PTR _count$[ebp+ecx*2]
282   00049 8d 4c 4d a4      lea     ecx, DWORD PTR _count$[ebp+ecx*2]
283   0004d 40               inc     eax
284   0004e 3b c2            cmp     eax, edx
285   00050 72 ee            jb      SHORT $LL59@inflate_ta
286 $LN57@inflate_ta:
287
288 ; 111  : 
289 ; 112  :     /* bound code lengths, force root to be within code lengths */
290 ; 113  :     root = *bits;
291
292   00052 8b 0b            mov     ecx, DWORD PTR [ebx]
293   00054 89 4d fc         mov     DWORD PTR _root$[ebp], ecx
294
295 ; 114  :     for (max = MAXBITS; max >= 1; max--)
296
297   00057 b8 0f 00 00 00   mov     eax, 15                        ; 0000000fH
298   0005c 8d 64 24 00      npad    4
299 $LL56@inflate_ta:
300
301 ; 115  :         if (count[max] != 0) break;
302
303   00060 66 83 7c 45 a4
304         00               cmp     WORD PTR _count$[ebp+eax*2], 0
305   00066 75 06            jne     SHORT $LN105@inflate_ta
306
307 ; 114  :     for (max = MAXBITS; max >= 1; max--)
308
309   00068 48               dec     eax
310   00069 83 f8 01         cmp     eax, 1
311   0006c 73 f2            jae     SHORT $LL56@inflate_ta
312 $LN105@inflate_ta:
313   0006e 89 45 ec         mov     DWORD PTR _max$[ebp], eax
314
315 ; 116  :     if (root > max) root = max;
316
317   00071 3b c8            cmp     ecx, eax
318   00073 76 05            jbe     SHORT $LN52@inflate_ta
319   00075 89 45 fc         mov     DWORD PTR _root$[ebp], eax
320   00078 8b c8            mov     ecx, eax
321 $LN52@inflate_ta:
322
323 ; 117  :     if (max == 0) {                     /* no symbols to code at all */
324
325   0007a 85 c0            test    eax, eax
326   0007c 75 27            jne     SHORT $LN51@inflate_ta
327
328 ; 118  :         here.op = (unsigned char)64;    /* invalid code marker */
329 ; 119  :         here.bits = (unsigned char)1;
330 ; 120  :         here.val = (unsigned short)0;
331 ; 121  :         *(*table)++ = here;             /* make a table to force an error */
332
333   0007e 8b 0e            mov     ecx, DWORD PTR [esi]
334   00080 c7 45 10 40 01
335         00 00            mov     DWORD PTR _here$[ebp], 320 ; 00000140H
336   00087 8b 45 10         mov     eax, DWORD PTR _here$[ebp]
337   0008a 89 01            mov     DWORD PTR [ecx], eax
338   0008c 83 06 04         add     DWORD PTR [esi], 4
339   0008f 8b 0e            mov     ecx, DWORD PTR [esi]
340
341 ; 122  :         *(*table)++ = here;
342
343   00091 89 01            mov     DWORD PTR [ecx], eax
344   00093 83 06 04         add     DWORD PTR [esi], 4
345   00096 5f               pop     edi
346   00097 5e               pop     esi
347
348 ; 123  :         *bits = 1;
349
350   00098 c7 03 01 00 00
351         00               mov     DWORD PTR [ebx], 1
352
353 ; 124  :         return 0;     /* no symbols, but wait for decoding to report error */
354
355   0009e 33 c0            xor     eax, eax
356   000a0 5b               pop     ebx
357
358 ; 306  : }
359
360   000a1 8b e5            mov     esp, ebp
361   000a3 5d               pop     ebp
362   000a4 c3               ret     0
363 $LN51@inflate_ta:
364
365 ; 125  :     }
366 ; 126  :     for (min = 1; min < max; min++)
367
368   000a5 bb 01 00 00 00   mov     ebx, 1
369   000aa 3b c3            cmp     eax, ebx
370   000ac 76 0f            jbe     SHORT $LN78@inflate_ta
371   000ae 8b ff            npad    2
372 $LL50@inflate_ta:
373
374 ; 127  :         if (count[min] != 0) break;
375
376   000b0 66 83 7c 5d a4
377         00               cmp     WORD PTR _count$[ebp+ebx*2], 0
378   000b6 75 05            jne     SHORT $LN78@inflate_ta
379
380 ; 125  :     }
381 ; 126  :     for (min = 1; min < max; min++)
382
383   000b8 43               inc     ebx
384   000b9 3b d8            cmp     ebx, eax
385   000bb 72 f3            jb      SHORT $LL50@inflate_ta
386 $LN78@inflate_ta:
387
388 ; 128  :     if (root < min) root = min;
389
390   000bd 3b cb            cmp     ecx, ebx
391   000bf 73 03            jae     SHORT $LN46@inflate_ta
392   000c1 89 5d fc         mov     DWORD PTR _root$[ebp], ebx
393 $LN46@inflate_ta:
394
395 ; 129  : 
396 ; 130  :     /* check for an over-subscribed or incomplete set of lengths */
397 ; 131  :     left = 1;
398
399   000c4 ba 01 00 00 00   mov     edx, 1
400
401 ; 132  :     for (len = 1; len <= MAXBITS; len++) {
402
403   000c9 8b ca            mov     ecx, edx
404   000cb eb 03 8d 49 00   npad    5
405 $LL45@inflate_ta:
406
407 ; 133  :         left <<= 1;
408 ; 134  :         left -= count[len];
409
410   000d0 0f b7 74 4d a4   movzx   esi, WORD PTR _count$[ebp+ecx*2]
411   000d5 03 d2            add     edx, edx
412   000d7 2b d6            sub     edx, esi
413
414 ; 135  :         if (left < 0) return -1;        /* over-subscribed */
415
416   000d9 0f 88 90 00 00
417         00               js      $LN79@inflate_ta
418
419 ; 132  :     for (len = 1; len <= MAXBITS; len++) {
420
421   000df 41               inc     ecx
422   000e0 83 f9 0f         cmp     ecx, 15                        ; 0000000fH
423   000e3 76 eb            jbe     SHORT $LL45@inflate_ta
424
425 ; 136  :     }
426 ; 137  :     if (left > 0 && (type == CODES || max != 1))
427
428   000e5 85 d2            test    edx, edx
429   000e7 7e 0f            jle     SHORT $LN102@inflate_ta
430   000e9 83 7d 08 00      cmp     DWORD PTR _type$[ebp], 0
431   000ed 0f 84 7c 00 00
432         00               je      $LN79@inflate_ta
433   000f3 83 f8 01         cmp     eax, 1
434
435 ; 138  :         return -1;                      /* incomplete set */
436
437   000f6 75 77            jne     SHORT $LN79@inflate_ta
438 $LN102@inflate_ta:
439
440 ; 139  : 
441 ; 140  :     /* generate offsets into symbol table for each length for sorting */
442 ; 141  :     offs[1] = 0;
443
444   000f8 33 c0            xor     eax, eax
445   000fa 66 89 45 86      mov     WORD PTR _offs$[ebp+2], ax
446
447 ; 142  :     for (len = 1; len < MAXBITS; len++)
448
449   000fe b8 02 00 00 00   mov     eax, 2
450 $LL39@inflate_ta:
451
452 ; 143  :         offs[len + 1] = offs[len] + count[len];
453
454   00103 66 8b 4c 05 84   mov     cx, WORD PTR _offs$[ebp+eax]
455   00108 66 03 4c 05 a4   add     cx, WORD PTR _count$[ebp+eax]
456   0010d 83 c0 02         add     eax, 2
457   00110 66 89 4c 05 84   mov     WORD PTR _offs$[ebp+eax], cx
458   00115 83 f8 1e         cmp     eax, 30                        ; 0000001eH
459   00118 72 e9            jb      SHORT $LL39@inflate_ta
460
461 ; 144  : 
462 ; 145  :     /* sort symbols by length, by symbol order within each length */
463 ; 146  :     for (sym = 0; sym < codes; sym++)
464
465   0011a 8b 55 10         mov     edx, DWORD PTR _codes$[ebp]
466   0011d 8b 75 1c         mov     esi, DWORD PTR _work$[ebp]
467   00120 33 c0            xor     eax, eax
468   00122 85 d2            test    edx, edx
469   00124 74 26            je      SHORT $LN34@inflate_ta
470 $LL104@inflate_ta:
471
472 ; 147  :         if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
473
474   00126 66 83 3c 47 00   cmp     WORD PTR [edi+eax*2], 0
475   0012b 74 1a            je      SHORT $LN35@inflate_ta
476   0012d 0f b7 0c 47      movzx   ecx, WORD PTR [edi+eax*2]
477   00131 0f b7 4c 4d 84   movzx   ecx, WORD PTR _offs$[ebp+ecx*2]
478   00136 66 89 04 4e      mov     WORD PTR [esi+ecx*2], ax
479   0013a 0f b7 0c 47      movzx   ecx, WORD PTR [edi+eax*2]
480   0013e 66 ff 44 4d 84   inc     WORD PTR _offs$[ebp+ecx*2]
481   00143 8d 4c 4d 84      lea     ecx, DWORD PTR _offs$[ebp+ecx*2]
482 $LN35@inflate_ta:
483
484 ; 144  : 
485 ; 145  :     /* sort symbols by length, by symbol order within each length */
486 ; 146  :     for (sym = 0; sym < codes; sym++)
487
488   00147 40               inc     eax
489   00148 3b c2            cmp     eax, edx
490   0014a 72 da            jb      SHORT $LL104@inflate_ta
491 $LN34@inflate_ta:
492
493 ; 148  : 
494 ; 149  :     /*
495 ; 150  :        Create and fill in decoding tables.  In this loop, the table being
496 ; 151  :        filled is at next and has curr index bits.  The code being used is huff
497 ; 152  :        with length len.  That code is converted to an index by dropping drop
498 ; 153  :        bits off of the bottom.  For codes where len is less than drop + curr,
499 ; 154  :        those top drop + curr - len bits are incremented through all values to
500 ; 155  :        fill the table with replicated entries.
501 ; 156  : 
502 ; 157  :        root is the number of index bits for the root table.  When len exceeds
503 ; 158  :        root, sub-tables are created pointed to by the root entry with an index
504 ; 159  :        of the low root bits of huff.  This is saved in low to check for when a
505 ; 160  :        new sub-table should be started.  drop is zero when the root table is
506 ; 161  :        being filled, and drop is root when sub-tables are being filled.
507 ; 162  : 
508 ; 163  :        When a new sub-table is needed, it is necessary to look ahead in the
509 ; 164  :        code lengths to determine what size sub-table is needed.  The length
510 ; 165  :        counts are used for this, and so count[] is decremented as codes are
511 ; 166  :        entered in the tables.
512 ; 167  : 
513 ; 168  :        used keeps track of how many table entries have been allocated from the
514 ; 169  :        provided *table space.  It is checked for LENS and DIST tables against
515 ; 170  :        the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
516 ; 171  :        the initial root table size constants.  See the comments in inftrees.h
517 ; 172  :        for more information.
518 ; 173  : 
519 ; 174  :        sym increments through all symbols, and the loop terminates when
520 ; 175  :        all codes of length max, i.e. all codes, have been processed.  This
521 ; 176  :        routine permits incomplete codes, so another loop after this one fills
522 ; 177  :        in the rest of the decoding tables with invalid code markers.
523 ; 178  :      */
524 ; 179  : 
525 ; 180  :     /* set up for code type */
526 ; 181  :     switch (type) {
527
528   0014c 8b 45 08         mov     eax, DWORD PTR _type$[ebp]
529   0014f 83 e8 00         sub     eax, 0
530   00152 b9 ff ff ff ff   mov     ecx, -1
531   00157 74 43            je      SHORT $LN30@inflate_ta
532   00159 48               dec     eax
533   0015a 74 1d            je      SHORT $LN29@inflate_ta
534
535 ; 193  :     default:            /* DISTS */
536 ; 194  :         base = dbase;
537
538   0015c c7 45 dc 00 00
539         00 00            mov     DWORD PTR _base$[ebp], OFFSET ?dbase@?1??inflate_table@@9@9
540
541 ; 195  :         extra = dext;
542
543   00163 c7 45 e0 00 00
544         00 00            mov     DWORD PTR _extra$[ebp], OFFSET ?dext@?1??inflate_table@@9@9
545
546 ; 196  :         end = -1;
547
548   0016a 89 4d e4         mov     DWORD PTR _end$[ebp], ecx
549   0016d eb 3a            jmp     SHORT $LN31@inflate_ta
550 $LN79@inflate_ta:
551   0016f 5f               pop     edi
552   00170 5e               pop     esi
553
554 ; 135  :         if (left < 0) return -1;        /* over-subscribed */
555
556   00171 83 c8 ff         or      eax, -1
557   00174 5b               pop     ebx
558
559 ; 306  : }
560
561   00175 8b e5            mov     esp, ebp
562   00177 5d               pop     ebp
563   00178 c3               ret     0
564 $LN29@inflate_ta:
565
566 ; 185  :         break;
567 ; 186  :     case LENS:
568 ; 187  :         base = lbase;
569 ; 188  :         base -= 257;
570
571   00179 b8 00 00 00 00   mov     eax, OFFSET ?lbase@?1??inflate_table@@9@9
572   0017e 2d 02 02 00 00   sub     eax, 514               ; 00000202H
573   00183 89 45 dc         mov     DWORD PTR _base$[ebp], eax
574
575 ; 189  :         extra = lext;
576 ; 190  :         extra -= 257;
577
578   00186 b8 00 00 00 00   mov     eax, OFFSET ?lext@?1??inflate_table@@9@9
579   0018b 2d 02 02 00 00   sub     eax, 514               ; 00000202H
580   00190 89 45 e0         mov     DWORD PTR _extra$[ebp], eax
581
582 ; 191  :         end = 256;
583
584   00193 c7 45 e4 00 01
585         00 00            mov     DWORD PTR _end$[ebp], 256 ; 00000100H
586
587 ; 192  :         break;
588
589   0019a eb 0d            jmp     SHORT $LN31@inflate_ta
590 $LN30@inflate_ta:
591
592 ; 182  :     case CODES:
593 ; 183  :         base = extra = work;    /* dummy value--not used */
594
595   0019c 89 75 e0         mov     DWORD PTR _extra$[ebp], esi
596   0019f 89 75 dc         mov     DWORD PTR _base$[ebp], esi
597
598 ; 184  :         end = 19;
599
600   001a2 c7 45 e4 13 00
601         00 00            mov     DWORD PTR _end$[ebp], 19 ; 00000013H
602 $LN31@inflate_ta:
603
604 ; 197  :     }
605 ; 198  : 
606 ; 199  :     /* initialize state for loop */
607 ; 200  :     huff = 0;                   /* starting code */
608 ; 201  :     sym = 0;                    /* starting code symbol */
609 ; 202  :     len = min;                  /* starting code length */
610 ; 203  :     next = *table;              /* current table to fill in */
611
612   001a9 8b 55 14         mov     edx, DWORD PTR _table$[ebp]
613   001ac 8b 12            mov     edx, DWORD PTR [edx]
614   001ae 33 c0            xor     eax, eax
615
616 ; 204  :     curr = root;                /* current table index bits */
617 ; 205  :     drop = 0;                   /* current bits to drop from code for index */
618 ; 206  :     low = (unsigned)(-1);       /* trigger new sub-table when len > root */
619
620   001b0 89 4d d0         mov     DWORD PTR _low$[ebp], ecx
621
622 ; 207  :     used = 1U << root;          /* use root table entries */
623
624   001b3 8b 4d fc         mov     ecx, DWORD PTR _root$[ebp]
625   001b6 89 45 f8         mov     DWORD PTR _huff$[ebp], eax
626   001b9 89 45 f4         mov     DWORD PTR _drop$[ebp], eax
627   001bc b8 01 00 00 00   mov     eax, 1
628   001c1 d3 e0            shl     eax, cl
629   001c3 89 55 e8         mov     DWORD PTR _next$[ebp], edx
630
631 ; 208  :     mask = used - 1;            /* mask for comparing low */
632
633   001c6 8d 48 ff         lea     ecx, DWORD PTR [eax-1]
634   001c9 89 4d cc         mov     DWORD PTR _mask$[ebp], ecx
635
636 ; 209  : 
637 ; 210  :     /* check available table space */
638 ; 211  :     if ((type == LENS && used > ENOUGH_LENS) ||
639 ; 212  :         (type == DISTS && used > ENOUGH_DISTS))
640
641   001cc 8b 4d 08         mov     ecx, DWORD PTR _type$[ebp]
642   001cf 8b f8            mov     edi, eax
643   001d1 89 7d d4         mov     DWORD PTR tv585[ebp], edi
644   001d4 89 45 d8         mov     DWORD PTR _used$[ebp], eax
645   001d7 83 f9 01         cmp     ecx, 1
646   001da 75 07            jne     SHORT $LN25@inflate_ta
647   001dc 3d 54 03 00 00   cmp     eax, 852               ; 00000354H
648   001e1 eb 0a            jmp     SHORT $LN112@inflate_ta
649 $LN25@inflate_ta:
650   001e3 83 f9 02         cmp     ecx, 2
651   001e6 75 0b            jne     SHORT $LN95@inflate_ta
652   001e8 3d 50 02 00 00   cmp     eax, 592               ; 00000250H
653 $LN112@inflate_ta:
654
655 ; 213  :         return 1;
656
657   001ed 0f 87 ee 01 00
658         00               ja      $LN3@inflate_ta
659 $LN95@inflate_ta:
660
661 ; 214  : 
662 ; 215  :     /* process all codes and make table entries */
663 ; 216  :     for (;;) {
664 ; 217  :         /* create table entry */
665 ; 218  :         here.bits = (unsigned char)(len - drop);
666
667   001f3 89 75 f0         mov     DWORD PTR tv1134[ebp], esi
668
669 ; 289  :         }
670 ; 290  :     }
671
672   001f6 eb 0b            jmp     SHORT $LL24@inflate_ta
673   001f8 eb 06 8d 9b 00
674         00 00 00         npad    8
675 $LL99@inflate_ta:
676   00200 8b 7d d4         mov     edi, DWORD PTR tv585[ebp]
677 $LL24@inflate_ta:
678
679 ; 214  : 
680 ; 215  :     /* process all codes and make table entries */
681 ; 216  :     for (;;) {
682 ; 217  :         /* create table entry */
683 ; 218  :         here.bits = (unsigned char)(len - drop);
684
685   00203 8b 55 f4         mov     edx, DWORD PTR _drop$[ebp]
686
687 ; 219  :         if ((int)(work[sym]) < end) {
688
689   00206 8b 4d f0         mov     ecx, DWORD PTR tv1134[ebp]
690   00209 8b 75 e4         mov     esi, DWORD PTR _end$[ebp]
691   0020c 8a c3            mov     al, bl
692   0020e 2a c2            sub     al, dl
693   00210 88 45 11         mov     BYTE PTR _here$[ebp+1], al
694   00213 0f b7 01         movzx   eax, WORD PTR [ecx]
695   00216 8b c8            mov     ecx, eax
696   00218 3b ce            cmp     ecx, esi
697   0021a 7d 0a            jge     SHORT $LN110@inflate_ta
698
699 ; 220  :             here.op = (unsigned char)0;
700
701   0021c c6 45 10 00      mov     BYTE PTR _here$[ebp], 0
702
703 ; 221  :             here.val = work[sym];
704
705   00220 66 89 45 12      mov     WORD PTR _here$[ebp+2], ax
706   00224 eb 2a            jmp     SHORT $LN19@inflate_ta
707 $LN110@inflate_ta:
708
709 ; 222  :         }
710 ; 223  :         else if ((int)(work[sym]) > end) {
711
712   00226 7e 1e            jle     SHORT $LN20@inflate_ta
713
714 ; 224  :             here.op = (unsigned char)(extra[work[sym]]);
715
716   00228 8b 45 f0         mov     eax, DWORD PTR tv1134[ebp]
717   0022b 0f b7 00         movzx   eax, WORD PTR [eax]
718   0022e 8b 4d e0         mov     ecx, DWORD PTR _extra$[ebp]
719   00231 03 c0            add     eax, eax
720   00233 8a 0c 08         mov     cl, BYTE PTR [eax+ecx]
721   00236 88 4d 10         mov     BYTE PTR _here$[ebp], cl
722
723 ; 225  :             here.val = base[work[sym]];
724
725   00239 8b 4d dc         mov     ecx, DWORD PTR _base$[ebp]
726   0023c 66 8b 04 08      mov     ax, WORD PTR [eax+ecx]
727   00240 66 89 45 12      mov     WORD PTR _here$[ebp+2], ax
728
729 ; 226  :         }
730 ; 227  :         else {
731
732   00244 eb 0a            jmp     SHORT $LN19@inflate_ta
733 $LN20@inflate_ta:
734
735 ; 228  :             here.op = (unsigned char)(32 + 64);         /* end of block */
736 ; 229  :             here.val = 0;
737
738   00246 33 c9            xor     ecx, ecx
739   00248 c6 45 10 60      mov     BYTE PTR _here$[ebp], 96 ; 00000060H
740   0024c 66 89 4d 12      mov     WORD PTR _here$[ebp+2], cx
741 $LN19@inflate_ta:
742
743 ; 230  :         }
744 ; 231  : 
745 ; 232  :         /* replicate for those indices with low len bits equal to huff */
746 ; 233  :         incr = 1U << (len - drop);
747
748   00250 8b cb            mov     ecx, ebx
749   00252 2b ca            sub     ecx, edx
750
751 ; 234  :         fill = 1U << curr;
752
753   00254 8b c7            mov     eax, edi
754   00256 8b 7d f8         mov     edi, DWORD PTR _huff$[ebp]
755   00259 ba 01 00 00 00   mov     edx, 1
756   0025e d3 e2            shl     edx, cl
757   00260 8b 4d f4         mov     ecx, DWORD PTR _drop$[ebp]
758   00263 d3 ef            shr     edi, cl
759   00265 8b 4d e8         mov     ecx, DWORD PTR _next$[ebp]
760
761 ; 235  :         min = fill;                 /* save offset to next table */
762
763   00268 89 45 c8         mov     DWORD PTR _min$[ebp], eax
764   0026b 8d 34 95 00 00
765         00 00            lea     esi, DWORD PTR [edx*4]
766   00272 03 f8            add     edi, eax
767   00274 8d 0c b9         lea     ecx, DWORD PTR [ecx+edi*4]
768   00277 8b 7d 10         mov     edi, DWORD PTR _here$[ebp]
769   0027a 8d 9b 00 00 00
770         00               npad    6
771 $LL18@inflate_ta:
772
773 ; 236  :         do {
774 ; 237  :             fill -= incr;
775
776   00280 2b ce            sub     ecx, esi
777   00282 2b c2            sub     eax, edx
778
779 ; 238  :             next[(huff >> drop) + fill] = here;
780
781   00284 89 39            mov     DWORD PTR [ecx], edi
782
783 ; 239  :         } while (fill != 0);
784
785   00286 75 f8            jne     SHORT $LL18@inflate_ta
786
787 ; 240  : 
788 ; 241  :         /* backwards increment the len-bit code huff */
789 ; 242  :         incr = 1U << (len - 1);
790
791   00288 8d 4b ff         lea     ecx, DWORD PTR [ebx-1]
792   0028b b8 01 00 00 00   mov     eax, 1
793   00290 d3 e0            shl     eax, cl
794
795 ; 243  :         while (huff & incr)
796
797   00292 8b 4d f8         mov     ecx, DWORD PTR _huff$[ebp]
798   00295 85 c1            test    eax, ecx
799   00297 74 0d            je      SHORT $LN14@inflate_ta
800   00299 8d a4 24 00 00
801         00 00            npad    7
802 $LL15@inflate_ta:
803
804 ; 244  :             incr >>= 1;
805
806   002a0 d1 e8            shr     eax, 1
807   002a2 85 c1            test    eax, ecx
808   002a4 75 fa            jne     SHORT $LL15@inflate_ta
809 $LN14@inflate_ta:
810
811 ; 245  :         if (incr != 0) {
812
813   002a6 85 c0            test    eax, eax
814   002a8 74 0c            je      SHORT $LN13@inflate_ta
815
816 ; 246  :             huff &= incr - 1;
817
818   002aa 8d 50 ff         lea     edx, DWORD PTR [eax-1]
819   002ad 23 d1            and     edx, ecx
820
821 ; 247  :             huff += incr;
822
823   002af 03 d0            add     edx, eax
824   002b1 89 55 f8         mov     DWORD PTR _huff$[ebp], edx
825
826 ; 248  :         }
827 ; 249  :         else
828
829   002b4 eb 07            jmp     SHORT $LN12@inflate_ta
830 $LN13@inflate_ta:
831
832 ; 250  :             huff = 0;
833
834   002b6 c7 45 f8 00 00
835         00 00            mov     DWORD PTR _huff$[ebp], 0
836 $LN12@inflate_ta:
837
838 ; 251  : 
839 ; 252  :         /* go to next symbol, update count, len */
840 ; 253  :         sym++;
841
842   002bd 83 45 f0 02      add     DWORD PTR tv1134[ebp], 2
843
844 ; 254  :         if (--(count[len]) == 0) {
845
846   002c1 b8 ff ff 00 00   mov     eax, 65535             ; 0000ffffH
847   002c6 66 01 44 5d a4   add     WORD PTR _count$[ebp+ebx*2], ax
848   002cb 75 16            jne     SHORT $LN100@inflate_ta
849
850 ; 255  :             if (len == max) break;
851
852   002cd 3b 5d ec         cmp     ebx, DWORD PTR _max$[ebp]
853   002d0 0f 84 cb 00 00
854         00               je      $LN81@inflate_ta
855
856 ; 256  :             len = lens[work[sym]];
857
858   002d6 8b 4d f0         mov     ecx, DWORD PTR tv1134[ebp]
859   002d9 0f b7 11         movzx   edx, WORD PTR [ecx]
860   002dc 8b 45 0c         mov     eax, DWORD PTR _lens$[ebp]
861   002df 0f b7 1c 50      movzx   ebx, WORD PTR [eax+edx*2]
862 $LN100@inflate_ta:
863
864 ; 257  :         }
865 ; 258  : 
866 ; 259  :         /* create new sub-table if needed */
867 ; 260  :         if (len > root && (huff & mask) != low) {
868
869   002e3 3b 5d fc         cmp     ebx, DWORD PTR _root$[ebp]
870   002e6 0f 86 14 ff ff
871         ff               jbe     $LL99@inflate_ta
872   002ec 8b 75 cc         mov     esi, DWORD PTR _mask$[ebp]
873   002ef 23 75 f8         and     esi, DWORD PTR _huff$[ebp]
874   002f2 89 75 c4         mov     DWORD PTR tv614[ebp], esi
875   002f5 3b 75 d0         cmp     esi, DWORD PTR _low$[ebp]
876   002f8 0f 84 02 ff ff
877         ff               je      $LL99@inflate_ta
878
879 ; 261  :             /* if first time, transition to sub-tables */
880 ; 262  :             if (drop == 0)
881
882   002fe 8b 55 f4         mov     edx, DWORD PTR _drop$[ebp]
883   00301 85 d2            test    edx, edx
884   00303 75 08            jne     SHORT $LN8@inflate_ta
885
886 ; 263  :                 drop = root;
887
888   00305 8b 4d fc         mov     ecx, DWORD PTR _root$[ebp]
889   00308 89 4d f4         mov     DWORD PTR _drop$[ebp], ecx
890   0030b 8b d1            mov     edx, ecx
891 $LN8@inflate_ta:
892
893 ; 264  : 
894 ; 265  :             /* increment past last table */
895 ; 266  :             next += min;            /* here min is 1 << curr */
896
897   0030d 8b 45 e8         mov     eax, DWORD PTR _next$[ebp]
898   00310 8b 4d c8         mov     ecx, DWORD PTR _min$[ebp]
899   00313 8d 04 88         lea     eax, DWORD PTR [eax+ecx*4]
900
901 ; 267  : 
902 ; 268  :             /* determine length of next table */
903 ; 269  :             curr = len - drop;
904
905   00316 8b cb            mov     ecx, ebx
906   00318 2b ca            sub     ecx, edx
907   0031a 89 45 e8         mov     DWORD PTR _next$[ebp], eax
908
909 ; 270  :             left = (int)(1 << curr);
910
911   0031d b8 01 00 00 00   mov     eax, 1
912
913 ; 271  :             while (curr + drop < max) {
914
915   00322 03 d1            add     edx, ecx
916   00324 d3 e0            shl     eax, cl
917   00326 3b 55 ec         cmp     edx, DWORD PTR _max$[ebp]
918   00329 73 1d            jae     SHORT $LN80@inflate_ta
919
920 ; 264  : 
921 ; 265  :             /* increment past last table */
922 ; 266  :             next += min;            /* here min is 1 << curr */
923
924   0032b 8d 74 55 a4      lea     esi, DWORD PTR _count$[ebp+edx*2]
925   0032f 90               npad    1
926 $LL7@inflate_ta:
927
928 ; 272  :                 left -= count[curr + drop];
929
930   00330 0f b7 3e         movzx   edi, WORD PTR [esi]
931   00333 2b c7            sub     eax, edi
932
933 ; 273  :                 if (left <= 0) break;
934
935   00335 85 c0            test    eax, eax
936   00337 7e 0c            jle     SHORT $LN101@inflate_ta
937
938 ; 274  :                 curr++;
939
940   00339 42               inc     edx
941   0033a 41               inc     ecx
942   0033b 83 c6 02         add     esi, 2
943
944 ; 275  :                 left <<= 1;
945
946   0033e 03 c0            add     eax, eax
947   00340 3b 55 ec         cmp     edx, DWORD PTR _max$[ebp]
948   00343 72 eb            jb      SHORT $LL7@inflate_ta
949 $LN101@inflate_ta:
950
951 ; 271  :             while (curr + drop < max) {
952
953   00345 8b 75 c4         mov     esi, DWORD PTR tv614[ebp]
954 $LN80@inflate_ta:
955
956 ; 276  :             }
957 ; 277  : 
958 ; 278  :             /* check for enough space */
959 ; 279  :             used += 1U << curr;
960
961   00348 8b 55 d8         mov     edx, DWORD PTR _used$[ebp]
962
963 ; 280  :             if ((type == LENS && used > ENOUGH_LENS) ||
964 ; 281  :                 (type == DISTS && used > ENOUGH_DISTS))
965
966   0034b 8b 45 08         mov     eax, DWORD PTR _type$[ebp]
967   0034e bf 01 00 00 00   mov     edi, 1
968   00353 d3 e7            shl     edi, cl
969   00355 03 d7            add     edx, edi
970   00357 89 7d d4         mov     DWORD PTR tv585[ebp], edi
971   0035a 89 55 d8         mov     DWORD PTR _used$[ebp], edx
972   0035d 83 f8 01         cmp     eax, 1
973   00360 75 08            jne     SHORT $LN2@inflate_ta
974   00362 81 fa 54 03 00
975         00               cmp     edx, 852               ; 00000354H
976   00368 eb 0b            jmp     SHORT $LN111@inflate_ta
977 $LN2@inflate_ta:
978   0036a 83 f8 02         cmp     eax, 2
979   0036d 75 08            jne     SHORT $LN4@inflate_ta
980   0036f 81 fa 50 02 00
981         00               cmp     edx, 592               ; 00000250H
982 $LN111@inflate_ta:
983   00375 77 6a            ja      SHORT $LN3@inflate_ta
984 $LN4@inflate_ta:
985
986 ; 283  : 
987 ; 284  :             /* point entry in root table to sub-table */
988 ; 285  :             low = huff & mask;
989
990   00377 8b d6            mov     edx, esi
991
992 ; 286  :             (*table)[low].op = (unsigned char)curr;
993
994   00379 8b 75 14         mov     esi, DWORD PTR _table$[ebp]
995   0037c 8b 06            mov     eax, DWORD PTR [esi]
996   0037e 88 0c 90         mov     BYTE PTR [eax+edx*4], cl
997
998 ; 287  :             (*table)[low].bits = (unsigned char)root;
999
1000   00381 8b 0e            mov     ecx, DWORD PTR [esi]
1001   00383 8a 45 fc         mov     al, BYTE PTR _root$[ebp]
1002   00386 88 44 91 01      mov     BYTE PTR [ecx+edx*4+1], al
1003
1004 ; 288  :             (*table)[low].val = (unsigned short)(next - *table);
1005
1006   0038a 8b 06            mov     eax, DWORD PTR [esi]
1007   0038c 8b 4d e8         mov     ecx, DWORD PTR _next$[ebp]
1008   0038f 2b c8            sub     ecx, eax
1009   00391 c1 f9 02         sar     ecx, 2
1010   00394 89 55 d0         mov     DWORD PTR _low$[ebp], edx
1011   00397 66 89 4c 90 02   mov     WORD PTR [eax+edx*4+2], cx
1012
1013 ; 289  :         }
1014 ; 290  :     }
1015
1016   0039c e9 62 fe ff ff   jmp     $LL24@inflate_ta
1017 $LN81@inflate_ta:
1018
1019 ; 291  : 
1020 ; 292  :     /* fill in remaining table entry if code is incomplete (guaranteed to have
1021 ; 293  :        at most one remaining entry, since if the code is incomplete, the
1022 ; 294  :        maximum code length that was allowed to get this far is one bit) */
1023 ; 295  :     if (huff != 0) {
1024
1025   003a1 8b 45 f8         mov     eax, DWORD PTR _huff$[ebp]
1026   003a4 85 c0            test    eax, eax
1027   003a6 74 19            je      SHORT $LN1@inflate_ta
1028
1029 ; 296  :         here.op = (unsigned char)64;            /* invalid code marker */
1030 ; 297  :         here.bits = (unsigned char)(len - drop);
1031
1032   003a8 2a 5d f4         sub     bl, BYTE PTR _drop$[ebp]
1033
1034 ; 298  :         here.val = (unsigned short)0;
1035
1036   003ab 33 d2            xor     edx, edx
1037   003ad 66 89 55 12      mov     WORD PTR _here$[ebp+2], dx
1038
1039 ; 299  :         next[huff] = here;
1040
1041   003b1 8b 55 e8         mov     edx, DWORD PTR _next$[ebp]
1042   003b4 c6 45 10 40      mov     BYTE PTR _here$[ebp], 64 ; 00000040H
1043   003b8 88 5d 11         mov     BYTE PTR _here$[ebp+1], bl
1044   003bb 8b 4d 10         mov     ecx, DWORD PTR _here$[ebp]
1045   003be 89 0c 82         mov     DWORD PTR [edx+eax*4], ecx
1046 $LN1@inflate_ta:
1047
1048 ; 300  :     }
1049 ; 301  : 
1050 ; 302  :     /* set return parameters */
1051 ; 303  :     *table += used;
1052
1053   003c1 8b 45 d8         mov     eax, DWORD PTR _used$[ebp]
1054
1055 ; 304  :     *bits = root;
1056
1057   003c4 8b 55 fc         mov     edx, DWORD PTR _root$[ebp]
1058   003c7 8d 0c 85 00 00
1059         00 00            lea     ecx, DWORD PTR [eax*4]
1060   003ce 8b 45 14         mov     eax, DWORD PTR _table$[ebp]
1061   003d1 01 08            add     DWORD PTR [eax], ecx
1062   003d3 8b 45 18         mov     eax, DWORD PTR _bits$[ebp]
1063   003d6 5f               pop     edi
1064   003d7 5e               pop     esi
1065   003d8 89 10            mov     DWORD PTR [eax], edx
1066
1067 ; 305  :     return 0;
1068
1069   003da 33 c0            xor     eax, eax
1070   003dc 5b               pop     ebx
1071
1072 ; 306  : }
1073
1074   003dd 8b e5            mov     esp, ebp
1075   003df 5d               pop     ebp
1076   003e0 c3               ret     0
1077 $LN3@inflate_ta:
1078   003e1 5f               pop     edi
1079   003e2 5e               pop     esi
1080
1081 ; 282  :                 return 1;
1082
1083   003e3 b8 01 00 00 00   mov     eax, 1
1084   003e8 5b               pop     ebx
1085
1086 ; 306  : }
1087
1088   003e9 8b e5            mov     esp, ebp
1089   003eb 5d               pop     ebp
1090   003ec c3               ret     0
1091 _inflate_table ENDP
1092 END