1 ; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.40219.01
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
11 PUBLIC _inflate_copyright
12 _inflate_copyright DB ' inflate 1.2.8 Copyright 1995-2013 Mark Adler ', 00H
14 ?lbase@?1??inflate_table@@9@9 DW 03H ; `inflate_table'::`2'::lbase
46 ?lext@?1??inflate_table@@9@9 DW 010H ; `inflate_table'::`2'::lext
78 ?dbase@?1??inflate_table@@9@9 DW 01H ; `inflate_table'::`2'::dbase
110 ?dext@?1??inflate_table@@9@9 DW 010H ; `inflate_table'::`2'::dext
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
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
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]
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};
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.
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.
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
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.
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;
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
256 00016 8b 5d 18 mov ebx, DWORD PTR _bits$[ebp]
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
268 ; 109 : for (sym = 0; sym < codes; sym++)
270 00035 33 c0 xor eax, eax
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
278 ; 110 : count[lens[sym]]++;
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]
284 0004e 3b c2 cmp eax, edx
285 00050 72 ee jb SHORT $LL59@inflate_ta
289 ; 112 : /* bound code lengths, force root to be within code lengths */
290 ; 113 : root = *bits;
292 00052 8b 0b mov ecx, DWORD PTR [ebx]
293 00054 89 4d fc mov DWORD PTR _root$[ebp], ecx
295 ; 114 : for (max = MAXBITS; max >= 1; max--)
297 00057 b8 0f 00 00 00 mov eax, 15 ; 0000000fH
298 0005c 8d 64 24 00 npad 4
301 ; 115 : if (count[max] != 0) break;
304 00 cmp WORD PTR _count$[ebp+eax*2], 0
305 00066 75 06 jne SHORT $LN105@inflate_ta
307 ; 114 : for (max = MAXBITS; max >= 1; max--)
310 00069 83 f8 01 cmp eax, 1
311 0006c 73 f2 jae SHORT $LL56@inflate_ta
313 0006e 89 45 ec mov DWORD PTR _max$[ebp], eax
315 ; 116 : if (root > max) root = max;
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
323 ; 117 : if (max == 0) { /* no symbols to code at all */
325 0007a 85 c0 test eax, eax
326 0007c 75 27 jne SHORT $LN51@inflate_ta
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 */
333 0007e 8b 0e mov ecx, DWORD PTR [esi]
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]
341 ; 122 : *(*table)++ = here;
343 00091 89 01 mov DWORD PTR [ecx], eax
344 00093 83 06 04 add DWORD PTR [esi], 4
351 00 mov DWORD PTR [ebx], 1
353 ; 124 : return 0; /* no symbols, but wait for decoding to report error */
355 0009e 33 c0 xor eax, eax
360 000a1 8b e5 mov esp, ebp
366 ; 126 : for (min = 1; min < max; min++)
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
374 ; 127 : if (count[min] != 0) break;
377 00 cmp WORD PTR _count$[ebp+ebx*2], 0
378 000b6 75 05 jne SHORT $LN78@inflate_ta
381 ; 126 : for (min = 1; min < max; min++)
384 000b9 3b d8 cmp ebx, eax
385 000bb 72 f3 jb SHORT $LL50@inflate_ta
388 ; 128 : if (root < min) root = min;
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
396 ; 130 : /* check for an over-subscribed or incomplete set of lengths */
399 000c4 ba 01 00 00 00 mov edx, 1
401 ; 132 : for (len = 1; len <= MAXBITS; len++) {
403 000c9 8b ca mov ecx, edx
404 000cb eb 03 8d 49 00 npad 5
408 ; 134 : left -= count[len];
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
414 ; 135 : if (left < 0) return -1; /* over-subscribed */
417 00 js $LN79@inflate_ta
419 ; 132 : for (len = 1; len <= MAXBITS; len++) {
422 000e0 83 f9 0f cmp ecx, 15 ; 0000000fH
423 000e3 76 eb jbe SHORT $LL45@inflate_ta
426 ; 137 : if (left > 0 && (type == CODES || max != 1))
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
432 00 je $LN79@inflate_ta
433 000f3 83 f8 01 cmp eax, 1
435 ; 138 : return -1; /* incomplete set */
437 000f6 75 77 jne SHORT $LN79@inflate_ta
441 ; 140 : /* generate offsets into symbol table for each length for sorting */
444 000f8 33 c0 xor eax, eax
445 000fa 66 89 45 86 mov WORD PTR _offs$[ebp+2], ax
447 ; 142 : for (len = 1; len < MAXBITS; len++)
449 000fe b8 02 00 00 00 mov eax, 2
452 ; 143 : offs[len + 1] = offs[len] + count[len];
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
462 ; 145 : /* sort symbols by length, by symbol order within each length */
463 ; 146 : for (sym = 0; sym < codes; sym++)
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
472 ; 147 : if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
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]
485 ; 145 : /* sort symbols by length, by symbol order within each length */
486 ; 146 : for (sym = 0; sym < codes; sym++)
489 00148 3b c2 cmp eax, edx
490 0014a 72 da jb SHORT $LL104@inflate_ta
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.
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.
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.
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.
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.
525 ; 180 : /* set up for code type */
526 ; 181 : switch (type) {
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
533 0015a 74 1d je SHORT $LN29@inflate_ta
535 ; 193 : default: /* DISTS */
536 ; 194 : base = dbase;
539 00 00 mov DWORD PTR _base$[ebp], OFFSET ?dbase@?1??inflate_table@@9@9
541 ; 195 : extra = dext;
544 00 00 mov DWORD PTR _extra$[ebp], OFFSET ?dext@?1??inflate_table@@9@9
548 0016a 89 4d e4 mov DWORD PTR _end$[ebp], ecx
549 0016d eb 3a jmp SHORT $LN31@inflate_ta
554 ; 135 : if (left < 0) return -1; /* over-subscribed */
556 00171 83 c8 ff or eax, -1
561 00175 8b e5 mov esp, ebp
568 ; 187 : base = lbase;
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
575 ; 189 : extra = lext;
576 ; 190 : extra -= 257;
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
585 00 00 mov DWORD PTR _end$[ebp], 256 ; 00000100H
589 0019a eb 0d jmp SHORT $LN31@inflate_ta
593 ; 183 : base = extra = work; /* dummy value--not used */
595 0019c 89 75 e0 mov DWORD PTR _extra$[ebp], esi
596 0019f 89 75 dc mov DWORD PTR _base$[ebp], esi
601 00 00 mov DWORD PTR _end$[ebp], 19 ; 00000013H
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 */
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
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 */
620 001b0 89 4d d0 mov DWORD PTR _low$[ebp], ecx
622 ; 207 : used = 1U << root; /* use root table entries */
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
631 ; 208 : mask = used - 1; /* mask for comparing low */
633 001c6 8d 48 ff lea ecx, DWORD PTR [eax-1]
634 001c9 89 4d cc mov DWORD PTR _mask$[ebp], ecx
637 ; 210 : /* check available table space */
638 ; 211 : if ((type == LENS && used > ENOUGH_LENS) ||
639 ; 212 : (type == DISTS && used > ENOUGH_DISTS))
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
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
658 00 ja $LN3@inflate_ta
662 ; 215 : /* process all codes and make table entries */
664 ; 217 : /* create table entry */
665 ; 218 : here.bits = (unsigned char)(len - drop);
667 001f3 89 75 f0 mov DWORD PTR tv1134[ebp], esi
672 001f6 eb 0b jmp SHORT $LL24@inflate_ta
676 00200 8b 7d d4 mov edi, DWORD PTR tv585[ebp]
680 ; 215 : /* process all codes and make table entries */
682 ; 217 : /* create table entry */
683 ; 218 : here.bits = (unsigned char)(len - drop);
685 00203 8b 55 f4 mov edx, DWORD PTR _drop$[ebp]
687 ; 219 : if ((int)(work[sym]) < end) {
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
699 ; 220 : here.op = (unsigned char)0;
701 0021c c6 45 10 00 mov BYTE PTR _here$[ebp], 0
703 ; 221 : here.val = work[sym];
705 00220 66 89 45 12 mov WORD PTR _here$[ebp+2], ax
706 00224 eb 2a jmp SHORT $LN19@inflate_ta
710 ; 223 : else if ((int)(work[sym]) > end) {
712 00226 7e 1e jle SHORT $LN20@inflate_ta
714 ; 224 : here.op = (unsigned char)(extra[work[sym]]);
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
723 ; 225 : here.val = base[work[sym]];
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
732 00244 eb 0a jmp SHORT $LN19@inflate_ta
735 ; 228 : here.op = (unsigned char)(32 + 64); /* end of block */
736 ; 229 : here.val = 0;
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
745 ; 232 : /* replicate for those indices with low len bits equal to huff */
746 ; 233 : incr = 1U << (len - drop);
748 00250 8b cb mov ecx, ebx
749 00252 2b ca sub ecx, edx
751 ; 234 : fill = 1U << curr;
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]
761 ; 235 : min = fill; /* save offset to next table */
763 00268 89 45 c8 mov DWORD PTR _min$[ebp], eax
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]
774 ; 237 : fill -= incr;
776 00280 2b ce sub ecx, esi
777 00282 2b c2 sub eax, edx
779 ; 238 : next[(huff >> drop) + fill] = here;
781 00284 89 39 mov DWORD PTR [ecx], edi
783 ; 239 : } while (fill != 0);
785 00286 75 f8 jne SHORT $LL18@inflate_ta
788 ; 241 : /* backwards increment the len-bit code huff */
789 ; 242 : incr = 1U << (len - 1);
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
795 ; 243 : while (huff & incr)
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
806 002a0 d1 e8 shr eax, 1
807 002a2 85 c1 test eax, ecx
808 002a4 75 fa jne SHORT $LL15@inflate_ta
811 ; 245 : if (incr != 0) {
813 002a6 85 c0 test eax, eax
814 002a8 74 0c je SHORT $LN13@inflate_ta
816 ; 246 : huff &= incr - 1;
818 002aa 8d 50 ff lea edx, DWORD PTR [eax-1]
819 002ad 23 d1 and edx, ecx
821 ; 247 : huff += incr;
823 002af 03 d0 add edx, eax
824 002b1 89 55 f8 mov DWORD PTR _huff$[ebp], edx
829 002b4 eb 07 jmp SHORT $LN12@inflate_ta
835 00 00 mov DWORD PTR _huff$[ebp], 0
839 ; 252 : /* go to next symbol, update count, len */
842 002bd 83 45 f0 02 add DWORD PTR tv1134[ebp], 2
844 ; 254 : if (--(count[len]) == 0) {
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
850 ; 255 : if (len == max) break;
852 002cd 3b 5d ec cmp ebx, DWORD PTR _max$[ebp]
854 00 je $LN81@inflate_ta
856 ; 256 : len = lens[work[sym]];
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]
866 ; 259 : /* create new sub-table if needed */
867 ; 260 : if (len > root && (huff & mask) != low) {
869 002e3 3b 5d fc cmp ebx, DWORD PTR _root$[ebp]
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]
877 ff je $LL99@inflate_ta
879 ; 261 : /* if first time, transition to sub-tables */
880 ; 262 : if (drop == 0)
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
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
894 ; 265 : /* increment past last table */
895 ; 266 : next += min; /* here min is 1 << curr */
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]
902 ; 268 : /* determine length of next table */
903 ; 269 : curr = len - drop;
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
909 ; 270 : left = (int)(1 << curr);
911 0031d b8 01 00 00 00 mov eax, 1
913 ; 271 : while (curr + drop < max) {
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
921 ; 265 : /* increment past last table */
922 ; 266 : next += min; /* here min is 1 << curr */
924 0032b 8d 74 55 a4 lea esi, DWORD PTR _count$[ebp+edx*2]
928 ; 272 : left -= count[curr + drop];
930 00330 0f b7 3e movzx edi, WORD PTR [esi]
931 00333 2b c7 sub eax, edi
933 ; 273 : if (left <= 0) break;
935 00335 85 c0 test eax, eax
936 00337 7e 0c jle SHORT $LN101@inflate_ta
942 0033b 83 c6 02 add esi, 2
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
951 ; 271 : while (curr + drop < max) {
953 00345 8b 75 c4 mov esi, DWORD PTR tv614[ebp]
958 ; 278 : /* check for enough space */
959 ; 279 : used += 1U << curr;
961 00348 8b 55 d8 mov edx, DWORD PTR _used$[ebp]
963 ; 280 : if ((type == LENS && used > ENOUGH_LENS) ||
964 ; 281 : (type == DISTS && used > ENOUGH_DISTS))
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
975 00 cmp edx, 852 ; 00000354H
976 00368 eb 0b jmp SHORT $LN111@inflate_ta
978 0036a 83 f8 02 cmp eax, 2
979 0036d 75 08 jne SHORT $LN4@inflate_ta
981 00 cmp edx, 592 ; 00000250H
983 00375 77 6a ja SHORT $LN3@inflate_ta
987 ; 284 : /* point entry in root table to sub-table */
988 ; 285 : low = huff & mask;
990 00377 8b d6 mov edx, esi
992 ; 286 : (*table)[low].op = (unsigned char)curr;
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
998 ; 287 : (*table)[low].bits = (unsigned char)root;
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
1004 ; 288 : (*table)[low].val = (unsigned short)(next - *table);
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
1016 0039c e9 62 fe ff ff jmp $LL24@inflate_ta
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) {
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
1029 ; 296 : here.op = (unsigned char)64; /* invalid code marker */
1030 ; 297 : here.bits = (unsigned char)(len - drop);
1032 003a8 2a 5d f4 sub bl, BYTE PTR _drop$[ebp]
1034 ; 298 : here.val = (unsigned short)0;
1036 003ab 33 d2 xor edx, edx
1037 003ad 66 89 55 12 mov WORD PTR _here$[ebp+2], dx
1039 ; 299 : next[huff] = here;
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
1050 ; 302 : /* set return parameters */
1051 ; 303 : *table += used;
1053 003c1 8b 45 d8 mov eax, DWORD PTR _used$[ebp]
1055 ; 304 : *bits = root;
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]
1065 003d8 89 10 mov DWORD PTR [eax], edx
1069 003da 33 c0 xor eax, eax
1074 003dd 8b e5 mov esp, ebp
1083 003e3 b8 01 00 00 00 mov eax, 1
1088 003e9 8b e5 mov esp, ebp