1 ; Listing generated by Microsoft (R) Optimizing Compiler Version 16.00.30319.01
\r
3 TITLE D:\FMU\FMUSolution\zlib-1.2.6\inftrees.c
\r
11 PUBLIC _inflate_copyright
\r
12 _inflate_copyright DB ' inflate 1.2.6 Copyright 1995-2012 Mark Adler ', 00H
\r
14 ?lbase@?1??inflate_table@@9@9 DW 03H ; `inflate_table'::`2'::lbase
\r
46 ?lext@?1??inflate_table@@9@9 DW 010H ; `inflate_table'::`2'::lext
\r
78 ?dbase@?1??inflate_table@@9@9 DW 01H ; `inflate_table'::`2'::dbase
\r
110 ?dext@?1??inflate_table@@9@9 DW 010H ; `inflate_table'::`2'::dext
\r
142 PUBLIC _inflate_table
\r
143 ; Function compile flags: /Ogtp
\r
144 ; File d:\fmu\fmusolution\zlib-1.2.6\inftrees.c
\r
145 ; COMDAT _inflate_table
\r
147 _offs$ = -124 ; size = 32
\r
148 _count$ = -92 ; size = 32
\r
149 tv614 = -60 ; size = 4
\r
150 _min$ = -56 ; size = 4
\r
151 _mask$ = -52 ; size = 4
\r
152 _low$ = -48 ; size = 4
\r
153 tv585 = -44 ; size = 4
\r
154 _used$ = -40 ; size = 4
\r
155 _base$ = -36 ; size = 4
\r
156 _extra$ = -32 ; size = 4
\r
157 _end$ = -28 ; size = 4
\r
158 _next$ = -24 ; size = 4
\r
159 _max$ = -20 ; size = 4
\r
160 tv1134 = -16 ; size = 4
\r
161 _drop$ = -12 ; size = 4
\r
162 _huff$ = -8 ; size = 4
\r
163 _root$ = -4 ; size = 4
\r
164 _type$ = 8 ; size = 4
\r
165 _lens$ = 12 ; size = 4
\r
166 _here$ = 16 ; size = 4
\r
167 _codes$ = 16 ; size = 4
\r
168 _table$ = 20 ; size = 4
\r
169 _bits$ = 24 ; size = 4
\r
170 _work$ = 28 ; size = 4
\r
171 _inflate_table PROC ; COMDAT
\r
176 00001 8b ec mov ebp, esp
\r
177 00003 83 ec 7c sub esp, 124 ; 0000007cH
\r
178 00006 8b 55 10 mov edx, DWORD PTR _codes$[ebp]
\r
180 ; 40 : unsigned len; /* a code's length in bits */
\r
181 ; 41 : unsigned sym; /* index of code symbols */
\r
182 ; 42 : unsigned min, max; /* minimum and maximum code lengths */
\r
183 ; 43 : unsigned root; /* number of index bits for root table */
\r
184 ; 44 : unsigned curr; /* number of index bits for current table */
\r
185 ; 45 : unsigned drop; /* code bits to drop for sub-table */
\r
186 ; 46 : int left; /* number of prefix codes available */
\r
187 ; 47 : unsigned used; /* code entries in table used */
\r
188 ; 48 : unsigned huff; /* Huffman code */
\r
189 ; 49 : unsigned incr; /* for incrementing code, index */
\r
190 ; 50 : unsigned fill; /* index for replicating entries */
\r
191 ; 51 : unsigned low; /* low bits for current root entry */
\r
192 ; 52 : unsigned mask; /* mask for low root bits */
\r
193 ; 53 : code here; /* table entry for duplication */
\r
194 ; 54 : code FAR *next; /* next available space in table */
\r
195 ; 55 : const unsigned short FAR *base; /* base value table to use */
\r
196 ; 56 : const unsigned short FAR *extra; /* extra bits table to use */
\r
197 ; 57 : int end; /* use base and extra for symbol > end */
\r
198 ; 58 : unsigned short count[MAXBITS+1]; /* number of codes of each length */
\r
199 ; 59 : unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
\r
200 ; 60 : static const unsigned short lbase[31] = { /* Length codes 257..285 base */
\r
201 ; 61 : 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
\r
202 ; 62 : 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
\r
203 ; 63 : static const unsigned short lext[31] = { /* Length codes 257..285 extra */
\r
204 ; 64 : 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
\r
205 ; 65 : 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 69};
\r
206 ; 66 : static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
\r
207 ; 67 : 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
\r
208 ; 68 : 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
\r
209 ; 69 : 8193, 12289, 16385, 24577, 0, 0};
\r
210 ; 70 : static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
\r
211 ; 71 : 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
\r
212 ; 72 : 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
\r
213 ; 73 : 28, 28, 29, 29, 64, 64};
\r
216 ; 76 : Process a set of code lengths to create a canonical Huffman code. The
\r
217 ; 77 : code lengths are lens[0..codes-1]. Each length corresponds to the
\r
218 ; 78 : symbols 0..codes-1. The Huffman code is generated by first sorting the
\r
219 ; 79 : symbols by length from short to long, and retaining the symbol order
\r
220 ; 80 : for codes with equal lengths. Then the code starts with all zero bits
\r
221 ; 81 : for the first code of the shortest length, and the codes are integer
\r
222 ; 82 : increments for the same length, and zeros are appended as the length
\r
223 ; 83 : increases. For the deflate format, these bits are stored backwards
\r
224 ; 84 : from their more natural integer increment ordering, and so when the
\r
225 ; 85 : decoding tables are built in the large loop below, the integer codes
\r
226 ; 86 : are incremented backwards.
\r
228 ; 88 : This routine assumes, but does not check, that all of the entries in
\r
229 ; 89 : lens[] are in the range 0..MAXBITS. The caller must assure this.
\r
230 ; 90 : 1..MAXBITS is interpreted as that code length. zero means that that
\r
231 ; 91 : symbol does not occur in this code.
\r
233 ; 93 : The codes are sorted by computing a count of codes for each length,
\r
234 ; 94 : creating from that a table of starting indices for each length in the
\r
235 ; 95 : sorted table, and then entering the symbols in order in the sorted
\r
236 ; 96 : table. The sorted table is work[], with that space being provided by
\r
239 ; 99 : The length counts are used for other purposes as well, i.e. finding
\r
240 ; 100 : the minimum and maximum length codes, determining if there are any
\r
241 ; 101 : codes at all, checking for a valid set of lengths, and looking ahead
\r
242 ; 102 : at length counts to determine sub-table sizes when building the
\r
243 ; 103 : decoding tables.
\r
246 ; 106 : /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
\r
247 ; 107 : for (len = 0; len <= MAXBITS; len++)
\r
248 ; 108 : count[len] = 0;
\r
250 00009 33 c0 xor eax, eax
\r
251 0000b 0f b7 c8 movzx ecx, ax
\r
252 0000e 8b c1 mov eax, ecx
\r
253 00010 c1 e1 10 shl ecx, 16 ; 00000010H
\r
254 00013 0b c1 or eax, ecx
\r
256 00016 8b 5d 18 mov ebx, DWORD PTR _bits$[ebp]
\r
258 0001a 8b 75 14 mov esi, DWORD PTR _table$[ebp]
\r
259 0001d 89 45 a4 mov DWORD PTR _count$[ebp], eax
\r
260 00020 89 45 a8 mov DWORD PTR _count$[ebp+4], eax
\r
261 00023 89 45 ac mov DWORD PTR _count$[ebp+8], eax
\r
262 00026 89 45 b0 mov DWORD PTR _count$[ebp+12], eax
\r
263 00029 89 45 b4 mov DWORD PTR _count$[ebp+16], eax
\r
264 0002c 89 45 b8 mov DWORD PTR _count$[ebp+20], eax
\r
265 0002f 89 45 bc mov DWORD PTR _count$[ebp+24], eax
\r
266 00032 89 45 c0 mov DWORD PTR _count$[ebp+28], eax
\r
268 ; 109 : for (sym = 0; sym < codes; sym++)
\r
270 00035 33 c0 xor eax, eax
\r
272 00038 8b 7d 0c mov edi, DWORD PTR _lens$[ebp]
\r
273 0003b 85 d2 test edx, edx
\r
274 0003d 74 13 je SHORT $LN57@inflate_ta
\r
278 ; 110 : count[lens[sym]]++;
\r
280 00040 0f b7 0c 47 movzx ecx, WORD PTR [edi+eax*2]
\r
281 00044 66 ff 44 4d a4 inc WORD PTR _count$[ebp+ecx*2]
\r
282 00049 8d 4c 4d a4 lea ecx, DWORD PTR _count$[ebp+ecx*2]
\r
284 0004e 3b c2 cmp eax, edx
\r
285 00050 72 ee jb SHORT $LL59@inflate_ta
\r
289 ; 112 : /* bound code lengths, force root to be within code lengths */
\r
290 ; 113 : root = *bits;
\r
292 00052 8b 0b mov ecx, DWORD PTR [ebx]
\r
293 00054 89 4d fc mov DWORD PTR _root$[ebp], ecx
\r
295 ; 114 : for (max = MAXBITS; max >= 1; max--)
\r
297 00057 b8 0f 00 00 00 mov eax, 15 ; 0000000fH
\r
298 0005c 8d 64 24 00 npad 4
\r
301 ; 115 : if (count[max] != 0) break;
\r
303 00060 66 83 7c 45 a4
\r
304 00 cmp WORD PTR _count$[ebp+eax*2], 0
\r
305 00066 75 06 jne SHORT $LN105@inflate_ta
\r
307 ; 114 : for (max = MAXBITS; max >= 1; max--)
\r
310 00069 83 f8 01 cmp eax, 1
\r
311 0006c 73 f2 jae SHORT $LL56@inflate_ta
\r
313 0006e 89 45 ec mov DWORD PTR _max$[ebp], eax
\r
315 ; 116 : if (root > max) root = max;
\r
317 00071 3b c8 cmp ecx, eax
\r
318 00073 76 05 jbe SHORT $LN52@inflate_ta
\r
319 00075 89 45 fc mov DWORD PTR _root$[ebp], eax
\r
320 00078 8b c8 mov ecx, eax
\r
323 ; 117 : if (max == 0) { /* no symbols to code at all */
\r
325 0007a 85 c0 test eax, eax
\r
326 0007c 75 27 jne SHORT $LN51@inflate_ta
\r
328 ; 118 : here.op = (unsigned char)64; /* invalid code marker */
\r
329 ; 119 : here.bits = (unsigned char)1;
\r
330 ; 120 : here.val = (unsigned short)0;
\r
331 ; 121 : *(*table)++ = here; /* make a table to force an error */
\r
333 0007e 8b 0e mov ecx, DWORD PTR [esi]
\r
334 00080 c7 45 10 40 01
\r
335 00 00 mov DWORD PTR _here$[ebp], 320 ; 00000140H
\r
336 00087 8b 45 10 mov eax, DWORD PTR _here$[ebp]
\r
337 0008a 89 01 mov DWORD PTR [ecx], eax
\r
338 0008c 83 06 04 add DWORD PTR [esi], 4
\r
339 0008f 8b 0e mov ecx, DWORD PTR [esi]
\r
341 ; 122 : *(*table)++ = here;
\r
343 00091 89 01 mov DWORD PTR [ecx], eax
\r
344 00093 83 06 04 add DWORD PTR [esi], 4
\r
350 00098 c7 03 01 00 00
\r
351 00 mov DWORD PTR [ebx], 1
\r
353 ; 124 : return 0; /* no symbols, but wait for decoding to report error */
\r
355 0009e 33 c0 xor eax, eax
\r
360 000a1 8b e5 mov esp, ebp
\r
366 ; 126 : for (min = 1; min < max; min++)
\r
368 000a5 bb 01 00 00 00 mov ebx, 1
\r
369 000aa 3b c3 cmp eax, ebx
\r
370 000ac 76 0f jbe SHORT $LN78@inflate_ta
\r
374 ; 127 : if (count[min] != 0) break;
\r
376 000b0 66 83 7c 5d a4
\r
377 00 cmp WORD PTR _count$[ebp+ebx*2], 0
\r
378 000b6 75 05 jne SHORT $LN78@inflate_ta
\r
381 ; 126 : for (min = 1; min < max; min++)
\r
384 000b9 3b d8 cmp ebx, eax
\r
385 000bb 72 f3 jb SHORT $LL50@inflate_ta
\r
388 ; 128 : if (root < min) root = min;
\r
390 000bd 3b cb cmp ecx, ebx
\r
391 000bf 73 03 jae SHORT $LN46@inflate_ta
\r
392 000c1 89 5d fc mov DWORD PTR _root$[ebp], ebx
\r
396 ; 130 : /* check for an over-subscribed or incomplete set of lengths */
\r
399 000c4 ba 01 00 00 00 mov edx, 1
\r
401 ; 132 : for (len = 1; len <= MAXBITS; len++) {
\r
403 000c9 8b ca mov ecx, edx
\r
404 000cb eb 03 8d 49 00 npad 5
\r
407 ; 133 : left <<= 1;
\r
408 ; 134 : left -= count[len];
\r
410 000d0 0f b7 74 4d a4 movzx esi, WORD PTR _count$[ebp+ecx*2]
\r
411 000d5 03 d2 add edx, edx
\r
412 000d7 2b d6 sub edx, esi
\r
414 ; 135 : if (left < 0) return -1; /* over-subscribed */
\r
416 000d9 0f 88 90 00 00
\r
417 00 js $LN79@inflate_ta
\r
419 ; 132 : for (len = 1; len <= MAXBITS; len++) {
\r
422 000e0 83 f9 0f cmp ecx, 15 ; 0000000fH
\r
423 000e3 76 eb jbe SHORT $LL45@inflate_ta
\r
426 ; 137 : if (left > 0 && (type == CODES || max != 1))
\r
428 000e5 85 d2 test edx, edx
\r
429 000e7 7e 0f jle SHORT $LN102@inflate_ta
\r
430 000e9 83 7d 08 00 cmp DWORD PTR _type$[ebp], 0
\r
431 000ed 0f 84 7c 00 00
\r
432 00 je $LN79@inflate_ta
\r
433 000f3 83 f8 01 cmp eax, 1
\r
435 ; 138 : return -1; /* incomplete set */
\r
437 000f6 75 77 jne SHORT $LN79@inflate_ta
\r
441 ; 140 : /* generate offsets into symbol table for each length for sorting */
\r
442 ; 141 : offs[1] = 0;
\r
444 000f8 33 c0 xor eax, eax
\r
445 000fa 66 89 45 86 mov WORD PTR _offs$[ebp+2], ax
\r
447 ; 142 : for (len = 1; len < MAXBITS; len++)
\r
449 000fe b8 02 00 00 00 mov eax, 2
\r
452 ; 143 : offs[len + 1] = offs[len] + count[len];
\r
454 00103 66 8b 4c 05 84 mov cx, WORD PTR _offs$[ebp+eax]
\r
455 00108 66 03 4c 05 a4 add cx, WORD PTR _count$[ebp+eax]
\r
456 0010d 83 c0 02 add eax, 2
\r
457 00110 66 89 4c 05 84 mov WORD PTR _offs$[ebp+eax], cx
\r
458 00115 83 f8 1e cmp eax, 30 ; 0000001eH
\r
459 00118 72 e9 jb SHORT $LL39@inflate_ta
\r
462 ; 145 : /* sort symbols by length, by symbol order within each length */
\r
463 ; 146 : for (sym = 0; sym < codes; sym++)
\r
465 0011a 8b 55 10 mov edx, DWORD PTR _codes$[ebp]
\r
466 0011d 8b 75 1c mov esi, DWORD PTR _work$[ebp]
\r
467 00120 33 c0 xor eax, eax
\r
468 00122 85 d2 test edx, edx
\r
469 00124 74 26 je SHORT $LN34@inflate_ta
\r
472 ; 147 : if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
\r
474 00126 66 83 3c 47 00 cmp WORD PTR [edi+eax*2], 0
\r
475 0012b 74 1a je SHORT $LN35@inflate_ta
\r
476 0012d 0f b7 0c 47 movzx ecx, WORD PTR [edi+eax*2]
\r
477 00131 0f b7 4c 4d 84 movzx ecx, WORD PTR _offs$[ebp+ecx*2]
\r
478 00136 66 89 04 4e mov WORD PTR [esi+ecx*2], ax
\r
479 0013a 0f b7 0c 47 movzx ecx, WORD PTR [edi+eax*2]
\r
480 0013e 66 ff 44 4d 84 inc WORD PTR _offs$[ebp+ecx*2]
\r
481 00143 8d 4c 4d 84 lea ecx, DWORD PTR _offs$[ebp+ecx*2]
\r
485 ; 145 : /* sort symbols by length, by symbol order within each length */
\r
486 ; 146 : for (sym = 0; sym < codes; sym++)
\r
489 00148 3b c2 cmp eax, edx
\r
490 0014a 72 da jb SHORT $LL104@inflate_ta
\r
495 ; 150 : Create and fill in decoding tables. In this loop, the table being
\r
496 ; 151 : filled is at next and has curr index bits. The code being used is huff
\r
497 ; 152 : with length len. That code is converted to an index by dropping drop
\r
498 ; 153 : bits off of the bottom. For codes where len is less than drop + curr,
\r
499 ; 154 : those top drop + curr - len bits are incremented through all values to
\r
500 ; 155 : fill the table with replicated entries.
\r
502 ; 157 : root is the number of index bits for the root table. When len exceeds
\r
503 ; 158 : root, sub-tables are created pointed to by the root entry with an index
\r
504 ; 159 : of the low root bits of huff. This is saved in low to check for when a
\r
505 ; 160 : new sub-table should be started. drop is zero when the root table is
\r
506 ; 161 : being filled, and drop is root when sub-tables are being filled.
\r
508 ; 163 : When a new sub-table is needed, it is necessary to look ahead in the
\r
509 ; 164 : code lengths to determine what size sub-table is needed. The length
\r
510 ; 165 : counts are used for this, and so count[] is decremented as codes are
\r
511 ; 166 : entered in the tables.
\r
513 ; 168 : used keeps track of how many table entries have been allocated from the
\r
514 ; 169 : provided *table space. It is checked for LENS and DIST tables against
\r
515 ; 170 : the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
\r
516 ; 171 : the initial root table size constants. See the comments in inftrees.h
\r
517 ; 172 : for more information.
\r
519 ; 174 : sym increments through all symbols, and the loop terminates when
\r
520 ; 175 : all codes of length max, i.e. all codes, have been processed. This
\r
521 ; 176 : routine permits incomplete codes, so another loop after this one fills
\r
522 ; 177 : in the rest of the decoding tables with invalid code markers.
\r
525 ; 180 : /* set up for code type */
\r
526 ; 181 : switch (type) {
\r
528 0014c 8b 45 08 mov eax, DWORD PTR _type$[ebp]
\r
529 0014f 83 e8 00 sub eax, 0
\r
530 00152 b9 ff ff ff ff mov ecx, -1
\r
531 00157 74 43 je SHORT $LN30@inflate_ta
\r
533 0015a 74 1d je SHORT $LN29@inflate_ta
\r
535 ; 193 : default: /* DISTS */
\r
536 ; 194 : base = dbase;
\r
538 0015c c7 45 dc 00 00
\r
539 00 00 mov DWORD PTR _base$[ebp], OFFSET ?dbase@?1??inflate_table@@9@9
\r
541 ; 195 : extra = dext;
\r
543 00163 c7 45 e0 00 00
\r
544 00 00 mov DWORD PTR _extra$[ebp], OFFSET ?dext@?1??inflate_table@@9@9
\r
548 0016a 89 4d e4 mov DWORD PTR _end$[ebp], ecx
\r
549 0016d eb 3a jmp SHORT $LN31@inflate_ta
\r
554 ; 135 : if (left < 0) return -1; /* over-subscribed */
\r
556 00171 83 c8 ff or eax, -1
\r
561 00175 8b e5 mov esp, ebp
\r
568 ; 187 : base = lbase;
\r
569 ; 188 : base -= 257;
\r
571 00179 b8 00 00 00 00 mov eax, OFFSET ?lbase@?1??inflate_table@@9@9
\r
572 0017e 2d 02 02 00 00 sub eax, 514 ; 00000202H
\r
573 00183 89 45 dc mov DWORD PTR _base$[ebp], eax
\r
575 ; 189 : extra = lext;
\r
576 ; 190 : extra -= 257;
\r
578 00186 b8 00 00 00 00 mov eax, OFFSET ?lext@?1??inflate_table@@9@9
\r
579 0018b 2d 02 02 00 00 sub eax, 514 ; 00000202H
\r
580 00190 89 45 e0 mov DWORD PTR _extra$[ebp], eax
\r
584 00193 c7 45 e4 00 01
\r
585 00 00 mov DWORD PTR _end$[ebp], 256 ; 00000100H
\r
589 0019a eb 0d jmp SHORT $LN31@inflate_ta
\r
592 ; 182 : case CODES:
\r
593 ; 183 : base = extra = work; /* dummy value--not used */
\r
595 0019c 89 75 e0 mov DWORD PTR _extra$[ebp], esi
\r
596 0019f 89 75 dc mov DWORD PTR _base$[ebp], esi
\r
600 001a2 c7 45 e4 13 00
\r
601 00 00 mov DWORD PTR _end$[ebp], 19 ; 00000013H
\r
606 ; 199 : /* initialize state for loop */
\r
607 ; 200 : huff = 0; /* starting code */
\r
608 ; 201 : sym = 0; /* starting code symbol */
\r
609 ; 202 : len = min; /* starting code length */
\r
610 ; 203 : next = *table; /* current table to fill in */
\r
612 001a9 8b 55 14 mov edx, DWORD PTR _table$[ebp]
\r
613 001ac 8b 12 mov edx, DWORD PTR [edx]
\r
614 001ae 33 c0 xor eax, eax
\r
616 ; 204 : curr = root; /* current table index bits */
\r
617 ; 205 : drop = 0; /* current bits to drop from code for index */
\r
618 ; 206 : low = (unsigned)(-1); /* trigger new sub-table when len > root */
\r
620 001b0 89 4d d0 mov DWORD PTR _low$[ebp], ecx
\r
622 ; 207 : used = 1U << root; /* use root table entries */
\r
624 001b3 8b 4d fc mov ecx, DWORD PTR _root$[ebp]
\r
625 001b6 89 45 f8 mov DWORD PTR _huff$[ebp], eax
\r
626 001b9 89 45 f4 mov DWORD PTR _drop$[ebp], eax
\r
627 001bc b8 01 00 00 00 mov eax, 1
\r
628 001c1 d3 e0 shl eax, cl
\r
629 001c3 89 55 e8 mov DWORD PTR _next$[ebp], edx
\r
631 ; 208 : mask = used - 1; /* mask for comparing low */
\r
633 001c6 8d 48 ff lea ecx, DWORD PTR [eax-1]
\r
634 001c9 89 4d cc mov DWORD PTR _mask$[ebp], ecx
\r
637 ; 210 : /* check available table space */
\r
638 ; 211 : if ((type == LENS && used >= ENOUGH_LENS) ||
\r
639 ; 212 : (type == DISTS && used >= ENOUGH_DISTS))
\r
641 001cc 8b 4d 08 mov ecx, DWORD PTR _type$[ebp]
\r
642 001cf 8b f8 mov edi, eax
\r
643 001d1 89 7d d4 mov DWORD PTR tv585[ebp], edi
\r
644 001d4 89 45 d8 mov DWORD PTR _used$[ebp], eax
\r
645 001d7 83 f9 01 cmp ecx, 1
\r
646 001da 75 07 jne SHORT $LN25@inflate_ta
\r
647 001dc 3d 54 03 00 00 cmp eax, 852 ; 00000354H
\r
648 001e1 eb 0a jmp SHORT $LN112@inflate_ta
\r
650 001e3 83 f9 02 cmp ecx, 2
\r
651 001e6 75 0b jne SHORT $LN95@inflate_ta
\r
652 001e8 3d 50 02 00 00 cmp eax, 592 ; 00000250H
\r
657 001ed 0f 83 ee 01 00
\r
658 00 jae $LN3@inflate_ta
\r
662 ; 215 : /* process all codes and make table entries */
\r
664 ; 217 : /* create table entry */
\r
665 ; 218 : here.bits = (unsigned char)(len - drop);
\r
667 001f3 89 75 f0 mov DWORD PTR tv1134[ebp], esi
\r
672 001f6 eb 0b jmp SHORT $LL24@inflate_ta
\r
673 001f8 eb 06 8d 9b 00
\r
676 00200 8b 7d d4 mov edi, DWORD PTR tv585[ebp]
\r
680 ; 215 : /* process all codes and make table entries */
\r
682 ; 217 : /* create table entry */
\r
683 ; 218 : here.bits = (unsigned char)(len - drop);
\r
685 00203 8b 55 f4 mov edx, DWORD PTR _drop$[ebp]
\r
687 ; 219 : if ((int)(work[sym]) < end) {
\r
689 00206 8b 4d f0 mov ecx, DWORD PTR tv1134[ebp]
\r
690 00209 8b 75 e4 mov esi, DWORD PTR _end$[ebp]
\r
691 0020c 8a c3 mov al, bl
\r
692 0020e 2a c2 sub al, dl
\r
693 00210 88 45 11 mov BYTE PTR _here$[ebp+1], al
\r
694 00213 0f b7 01 movzx eax, WORD PTR [ecx]
\r
695 00216 8b c8 mov ecx, eax
\r
696 00218 3b ce cmp ecx, esi
\r
697 0021a 7d 0a jge SHORT $LN110@inflate_ta
\r
699 ; 220 : here.op = (unsigned char)0;
\r
701 0021c c6 45 10 00 mov BYTE PTR _here$[ebp], 0
\r
703 ; 221 : here.val = work[sym];
\r
705 00220 66 89 45 12 mov WORD PTR _here$[ebp+2], ax
\r
706 00224 eb 2a jmp SHORT $LN19@inflate_ta
\r
710 ; 223 : else if ((int)(work[sym]) > end) {
\r
712 00226 7e 1e jle SHORT $LN20@inflate_ta
\r
714 ; 224 : here.op = (unsigned char)(extra[work[sym]]);
\r
716 00228 8b 45 f0 mov eax, DWORD PTR tv1134[ebp]
\r
717 0022b 0f b7 00 movzx eax, WORD PTR [eax]
\r
718 0022e 8b 4d e0 mov ecx, DWORD PTR _extra$[ebp]
\r
719 00231 03 c0 add eax, eax
\r
720 00233 8a 0c 08 mov cl, BYTE PTR [eax+ecx]
\r
721 00236 88 4d 10 mov BYTE PTR _here$[ebp], cl
\r
723 ; 225 : here.val = base[work[sym]];
\r
725 00239 8b 4d dc mov ecx, DWORD PTR _base$[ebp]
\r
726 0023c 66 8b 04 08 mov ax, WORD PTR [eax+ecx]
\r
727 00240 66 89 45 12 mov WORD PTR _here$[ebp+2], ax
\r
732 00244 eb 0a jmp SHORT $LN19@inflate_ta
\r
735 ; 228 : here.op = (unsigned char)(32 + 64); /* end of block */
\r
736 ; 229 : here.val = 0;
\r
738 00246 33 c9 xor ecx, ecx
\r
739 00248 c6 45 10 60 mov BYTE PTR _here$[ebp], 96 ; 00000060H
\r
740 0024c 66 89 4d 12 mov WORD PTR _here$[ebp+2], cx
\r
745 ; 232 : /* replicate for those indices with low len bits equal to huff */
\r
746 ; 233 : incr = 1U << (len - drop);
\r
748 00250 8b cb mov ecx, ebx
\r
749 00252 2b ca sub ecx, edx
\r
751 ; 234 : fill = 1U << curr;
\r
753 00254 8b c7 mov eax, edi
\r
754 00256 8b 7d f8 mov edi, DWORD PTR _huff$[ebp]
\r
755 00259 ba 01 00 00 00 mov edx, 1
\r
756 0025e d3 e2 shl edx, cl
\r
757 00260 8b 4d f4 mov ecx, DWORD PTR _drop$[ebp]
\r
758 00263 d3 ef shr edi, cl
\r
759 00265 8b 4d e8 mov ecx, DWORD PTR _next$[ebp]
\r
761 ; 235 : min = fill; /* save offset to next table */
\r
763 00268 89 45 c8 mov DWORD PTR _min$[ebp], eax
\r
764 0026b 8d 34 95 00 00
\r
765 00 00 lea esi, DWORD PTR [edx*4]
\r
766 00272 03 f8 add edi, eax
\r
767 00274 8d 0c b9 lea ecx, DWORD PTR [ecx+edi*4]
\r
768 00277 8b 7d 10 mov edi, DWORD PTR _here$[ebp]
\r
769 0027a 8d 9b 00 00 00
\r
774 ; 237 : fill -= incr;
\r
776 00280 2b ce sub ecx, esi
\r
777 00282 2b c2 sub eax, edx
\r
779 ; 238 : next[(huff >> drop) + fill] = here;
\r
781 00284 89 39 mov DWORD PTR [ecx], edi
\r
783 ; 239 : } while (fill != 0);
\r
785 00286 75 f8 jne SHORT $LL18@inflate_ta
\r
788 ; 241 : /* backwards increment the len-bit code huff */
\r
789 ; 242 : incr = 1U << (len - 1);
\r
791 00288 8d 4b ff lea ecx, DWORD PTR [ebx-1]
\r
792 0028b b8 01 00 00 00 mov eax, 1
\r
793 00290 d3 e0 shl eax, cl
\r
795 ; 243 : while (huff & incr)
\r
797 00292 8b 4d f8 mov ecx, DWORD PTR _huff$[ebp]
\r
798 00295 85 c1 test eax, ecx
\r
799 00297 74 0d je SHORT $LN14@inflate_ta
\r
800 00299 8d a4 24 00 00
\r
804 ; 244 : incr >>= 1;
\r
806 002a0 d1 e8 shr eax, 1
\r
807 002a2 85 c1 test eax, ecx
\r
808 002a4 75 fa jne SHORT $LL15@inflate_ta
\r
811 ; 245 : if (incr != 0) {
\r
813 002a6 85 c0 test eax, eax
\r
814 002a8 74 0c je SHORT $LN13@inflate_ta
\r
816 ; 246 : huff &= incr - 1;
\r
818 002aa 8d 50 ff lea edx, DWORD PTR [eax-1]
\r
819 002ad 23 d1 and edx, ecx
\r
821 ; 247 : huff += incr;
\r
823 002af 03 d0 add edx, eax
\r
824 002b1 89 55 f8 mov DWORD PTR _huff$[ebp], edx
\r
829 002b4 eb 07 jmp SHORT $LN12@inflate_ta
\r
834 002b6 c7 45 f8 00 00
\r
835 00 00 mov DWORD PTR _huff$[ebp], 0
\r
839 ; 252 : /* go to next symbol, update count, len */
\r
842 002bd 83 45 f0 02 add DWORD PTR tv1134[ebp], 2
\r
844 ; 254 : if (--(count[len]) == 0) {
\r
846 002c1 b8 ff ff 00 00 mov eax, 65535 ; 0000ffffH
\r
847 002c6 66 01 44 5d a4 add WORD PTR _count$[ebp+ebx*2], ax
\r
848 002cb 75 16 jne SHORT $LN100@inflate_ta
\r
850 ; 255 : if (len == max) break;
\r
852 002cd 3b 5d ec cmp ebx, DWORD PTR _max$[ebp]
\r
853 002d0 0f 84 cb 00 00
\r
854 00 je $LN81@inflate_ta
\r
856 ; 256 : len = lens[work[sym]];
\r
858 002d6 8b 4d f0 mov ecx, DWORD PTR tv1134[ebp]
\r
859 002d9 0f b7 11 movzx edx, WORD PTR [ecx]
\r
860 002dc 8b 45 0c mov eax, DWORD PTR _lens$[ebp]
\r
861 002df 0f b7 1c 50 movzx ebx, WORD PTR [eax+edx*2]
\r
866 ; 259 : /* create new sub-table if needed */
\r
867 ; 260 : if (len > root && (huff & mask) != low) {
\r
869 002e3 3b 5d fc cmp ebx, DWORD PTR _root$[ebp]
\r
870 002e6 0f 86 14 ff ff
\r
871 ff jbe $LL99@inflate_ta
\r
872 002ec 8b 75 cc mov esi, DWORD PTR _mask$[ebp]
\r
873 002ef 23 75 f8 and esi, DWORD PTR _huff$[ebp]
\r
874 002f2 89 75 c4 mov DWORD PTR tv614[ebp], esi
\r
875 002f5 3b 75 d0 cmp esi, DWORD PTR _low$[ebp]
\r
876 002f8 0f 84 02 ff ff
\r
877 ff je $LL99@inflate_ta
\r
879 ; 261 : /* if first time, transition to sub-tables */
\r
880 ; 262 : if (drop == 0)
\r
882 002fe 8b 55 f4 mov edx, DWORD PTR _drop$[ebp]
\r
883 00301 85 d2 test edx, edx
\r
884 00303 75 08 jne SHORT $LN8@inflate_ta
\r
886 ; 263 : drop = root;
\r
888 00305 8b 4d fc mov ecx, DWORD PTR _root$[ebp]
\r
889 00308 89 4d f4 mov DWORD PTR _drop$[ebp], ecx
\r
890 0030b 8b d1 mov edx, ecx
\r
894 ; 265 : /* increment past last table */
\r
895 ; 266 : next += min; /* here min is 1 << curr */
\r
897 0030d 8b 45 e8 mov eax, DWORD PTR _next$[ebp]
\r
898 00310 8b 4d c8 mov ecx, DWORD PTR _min$[ebp]
\r
899 00313 8d 04 88 lea eax, DWORD PTR [eax+ecx*4]
\r
902 ; 268 : /* determine length of next table */
\r
903 ; 269 : curr = len - drop;
\r
905 00316 8b cb mov ecx, ebx
\r
906 00318 2b ca sub ecx, edx
\r
907 0031a 89 45 e8 mov DWORD PTR _next$[ebp], eax
\r
909 ; 270 : left = (int)(1 << curr);
\r
911 0031d b8 01 00 00 00 mov eax, 1
\r
913 ; 271 : while (curr + drop < max) {
\r
915 00322 03 d1 add edx, ecx
\r
916 00324 d3 e0 shl eax, cl
\r
917 00326 3b 55 ec cmp edx, DWORD PTR _max$[ebp]
\r
918 00329 73 1d jae SHORT $LN80@inflate_ta
\r
921 ; 265 : /* increment past last table */
\r
922 ; 266 : next += min; /* here min is 1 << curr */
\r
924 0032b 8d 74 55 a4 lea esi, DWORD PTR _count$[ebp+edx*2]
\r
928 ; 272 : left -= count[curr + drop];
\r
930 00330 0f b7 3e movzx edi, WORD PTR [esi]
\r
931 00333 2b c7 sub eax, edi
\r
933 ; 273 : if (left <= 0) break;
\r
935 00335 85 c0 test eax, eax
\r
936 00337 7e 0c jle SHORT $LN101@inflate_ta
\r
942 0033b 83 c6 02 add esi, 2
\r
944 ; 275 : left <<= 1;
\r
946 0033e 03 c0 add eax, eax
\r
947 00340 3b 55 ec cmp edx, DWORD PTR _max$[ebp]
\r
948 00343 72 eb jb SHORT $LL7@inflate_ta
\r
951 ; 271 : while (curr + drop < max) {
\r
953 00345 8b 75 c4 mov esi, DWORD PTR tv614[ebp]
\r
958 ; 278 : /* check for enough space */
\r
959 ; 279 : used += 1U << curr;
\r
961 00348 8b 55 d8 mov edx, DWORD PTR _used$[ebp]
\r
963 ; 280 : if ((type == LENS && used >= ENOUGH_LENS) ||
\r
964 ; 281 : (type == DISTS && used >= ENOUGH_DISTS))
\r
966 0034b 8b 45 08 mov eax, DWORD PTR _type$[ebp]
\r
967 0034e bf 01 00 00 00 mov edi, 1
\r
968 00353 d3 e7 shl edi, cl
\r
969 00355 03 d7 add edx, edi
\r
970 00357 89 7d d4 mov DWORD PTR tv585[ebp], edi
\r
971 0035a 89 55 d8 mov DWORD PTR _used$[ebp], edx
\r
972 0035d 83 f8 01 cmp eax, 1
\r
973 00360 75 08 jne SHORT $LN2@inflate_ta
\r
974 00362 81 fa 54 03 00
\r
975 00 cmp edx, 852 ; 00000354H
\r
976 00368 eb 0b jmp SHORT $LN111@inflate_ta
\r
978 0036a 83 f8 02 cmp eax, 2
\r
979 0036d 75 08 jne SHORT $LN4@inflate_ta
\r
980 0036f 81 fa 50 02 00
\r
981 00 cmp edx, 592 ; 00000250H
\r
983 00375 73 6a jae SHORT $LN3@inflate_ta
\r
987 ; 284 : /* point entry in root table to sub-table */
\r
988 ; 285 : low = huff & mask;
\r
990 00377 8b d6 mov edx, esi
\r
992 ; 286 : (*table)[low].op = (unsigned char)curr;
\r
994 00379 8b 75 14 mov esi, DWORD PTR _table$[ebp]
\r
995 0037c 8b 06 mov eax, DWORD PTR [esi]
\r
996 0037e 88 0c 90 mov BYTE PTR [eax+edx*4], cl
\r
998 ; 287 : (*table)[low].bits = (unsigned char)root;
\r
1000 00381 8b 0e mov ecx, DWORD PTR [esi]
\r
1001 00383 8a 45 fc mov al, BYTE PTR _root$[ebp]
\r
1002 00386 88 44 91 01 mov BYTE PTR [ecx+edx*4+1], al
\r
1004 ; 288 : (*table)[low].val = (unsigned short)(next - *table);
\r
1006 0038a 8b 06 mov eax, DWORD PTR [esi]
\r
1007 0038c 8b 4d e8 mov ecx, DWORD PTR _next$[ebp]
\r
1008 0038f 2b c8 sub ecx, eax
\r
1009 00391 c1 f9 02 sar ecx, 2
\r
1010 00394 89 55 d0 mov DWORD PTR _low$[ebp], edx
\r
1011 00397 66 89 4c 90 02 mov WORD PTR [eax+edx*4+2], cx
\r
1016 0039c e9 62 fe ff ff jmp $LL24@inflate_ta
\r
1020 ; 292 : /* fill in remaining table entry if code is incomplete (guaranteed to have
\r
1021 ; 293 : at most one remaining entry, since if the code is incomplete, the
\r
1022 ; 294 : maximum code length that was allowed to get this far is one bit) */
\r
1023 ; 295 : if (huff != 0) {
\r
1025 003a1 8b 45 f8 mov eax, DWORD PTR _huff$[ebp]
\r
1026 003a4 85 c0 test eax, eax
\r
1027 003a6 74 19 je SHORT $LN1@inflate_ta
\r
1029 ; 296 : here.op = (unsigned char)64; /* invalid code marker */
\r
1030 ; 297 : here.bits = (unsigned char)(len - drop);
\r
1032 003a8 2a 5d f4 sub bl, BYTE PTR _drop$[ebp]
\r
1034 ; 298 : here.val = (unsigned short)0;
\r
1036 003ab 33 d2 xor edx, edx
\r
1037 003ad 66 89 55 12 mov WORD PTR _here$[ebp+2], dx
\r
1039 ; 299 : next[huff] = here;
\r
1041 003b1 8b 55 e8 mov edx, DWORD PTR _next$[ebp]
\r
1042 003b4 c6 45 10 40 mov BYTE PTR _here$[ebp], 64 ; 00000040H
\r
1043 003b8 88 5d 11 mov BYTE PTR _here$[ebp+1], bl
\r
1044 003bb 8b 4d 10 mov ecx, DWORD PTR _here$[ebp]
\r
1045 003be 89 0c 82 mov DWORD PTR [edx+eax*4], ecx
\r
1050 ; 302 : /* set return parameters */
\r
1051 ; 303 : *table += used;
\r
1053 003c1 8b 45 d8 mov eax, DWORD PTR _used$[ebp]
\r
1055 ; 304 : *bits = root;
\r
1057 003c4 8b 55 fc mov edx, DWORD PTR _root$[ebp]
\r
1058 003c7 8d 0c 85 00 00
\r
1059 00 00 lea ecx, DWORD PTR [eax*4]
\r
1060 003ce 8b 45 14 mov eax, DWORD PTR _table$[ebp]
\r
1061 003d1 01 08 add DWORD PTR [eax], ecx
\r
1062 003d3 8b 45 18 mov eax, DWORD PTR _bits$[ebp]
\r
1065 003d8 89 10 mov DWORD PTR [eax], edx
\r
1069 003da 33 c0 xor eax, eax
\r
1074 003dd 8b e5 mov esp, ebp
\r
1083 003e3 b8 01 00 00 00 mov eax, 1
\r
1088 003e9 8b e5 mov esp, ebp
\r
1091 _inflate_table ENDP
\r