0000: 2f 2a 20 69 6e 66 66 61 73 38 36 2e 63 20 69 73 /* inffas86.c is
0010: 20 61 20 68 61 6e 64 20 74 75 6e 65 64 20 61 73 a hand tuned as
0020: 73 65 6d 62 6c 65 72 20 76 65 72 73 69 6f 6e 20 sembler version
0030: 6f 66 0a 20 2a 0a 20 2a 20 69 6e 66 66 61 73 74 of. *. * inffast
0040: 2e 63 20 2d 2d 20 66 61 73 74 20 64 65 63 6f 64 .c -- fast decod
0050: 69 6e 67 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 ing. * Copyright
0060: 20 28 43 29 20 31 39 39 35 2d 32 30 30 33 20 4d (C) 1995-2003 M
0070: 61 72 6b 20 41 64 6c 65 72 0a 20 2a 20 46 6f 72 ark Adler. * For
0080: 20 63 6f 6e 64 69 74 69 6f 6e 73 20 6f 66 20 64 conditions of d
0090: 69 73 74 72 69 62 75 74 69 6f 6e 20 61 6e 64 20 istribution and
00a0: 75 73 65 2c 20 73 65 65 20 63 6f 70 79 72 69 67 use, see copyrig
00b0: 68 74 20 6e 6f 74 69 63 65 20 69 6e 20 7a 6c 69 ht notice in zli
00c0: 62 2e 68 0a 20 2a 0a 20 2a 20 43 6f 70 79 72 69 b.h. *. * Copyri
00d0: 67 68 74 20 28 43 29 20 32 30 30 33 20 43 68 72 ght (C) 2003 Chr
00e0: 69 73 20 41 6e 64 65 72 73 6f 6e 20 3c 63 68 72 is Anderson <chr
00f0: 69 73 74 6f 70 40 63 68 61 72 6d 2e 6e 65 74 3e istop@charm.net>
0100: 0a 20 2a 20 50 6c 65 61 73 65 20 75 73 65 20 74 . * Please use t
0110: 68 65 20 63 6f 70 79 72 69 67 68 74 20 63 6f 6e he copyright con
0120: 64 69 74 69 6f 6e 73 20 61 62 6f 76 65 2e 0a 20 ditions above..
0130: 2a 0a 20 2a 20 44 65 63 2d 32 39 2d 32 30 30 33 *. * Dec-29-2003
0140: 20 2d 2d 20 49 20 61 64 64 65 64 20 41 4d 44 36 -- I added AMD6
0150: 34 20 69 6e 66 6c 61 74 65 20 61 73 6d 20 73 75 4 inflate asm su
0160: 70 70 6f 72 74 2e 20 20 54 68 69 73 20 76 65 72 pport. This ver
0170: 73 69 6f 6e 20 69 73 20 61 6c 73 6f 0a 20 2a 20 sion is also. *
0180: 73 6c 69 67 68 74 6c 79 20 71 75 69 63 6b 65 72 slightly quicker
0190: 20 6f 6e 20 78 38 36 20 73 79 73 74 65 6d 73 20 on x86 systems
01a0: 62 65 63 61 75 73 65 2c 20 69 6e 73 74 65 61 64 because, instead
01b0: 20 6f 66 20 75 73 69 6e 67 20 72 65 70 20 6d 6f of using rep mo
01c0: 76 73 62 20 74 6f 20 63 6f 70 79 0a 20 2a 20 64 vsb to copy. * d
01d0: 61 74 61 2c 20 69 74 20 75 73 65 73 20 72 65 70 ata, it uses rep
01e0: 20 6d 6f 76 73 77 2c 20 77 68 69 63 68 20 6d 6f movsw, which mo
01f0: 76 65 73 20 64 61 74 61 20 69 6e 20 32 2d 62 79 ves data in 2-by
0200: 74 65 20 63 68 75 6e 6b 73 20 69 6e 73 74 65 61 te chunks instea
0210: 64 20 6f 66 20 73 69 6e 67 6c 65 0a 20 2a 20 62 d of single. * b
0220: 79 74 65 73 2e 20 20 49 27 76 65 20 74 65 73 74 ytes. I've test
0230: 65 64 20 74 68 65 20 41 4d 44 36 34 20 63 6f 64 ed the AMD64 cod
0240: 65 20 6f 6e 20 61 20 46 65 64 6f 72 61 20 43 6f e on a Fedora Co
0250: 72 65 20 31 20 2b 20 74 68 65 20 78 38 36 5f 36 re 1 + the x86_6
0260: 34 20 75 70 64 61 74 65 73 0a 20 2a 20 66 72 6f 4 updates. * fro
0270: 6d 20 68 74 74 70 3a 2f 2f 66 65 64 6f 72 61 2e m http://fedora.
0280: 6c 69 6e 75 78 2e 64 75 6b 65 2e 65 64 75 2f 66 linux.duke.edu/f
0290: 63 31 5f 78 38 36 5f 36 34 0a 20 2a 20 77 68 69 c1_x86_64. * whi
02a0: 63 68 20 69 73 20 72 75 6e 6e 69 6e 67 20 6f 6e ch is running on
02b0: 20 61 6e 20 41 74 68 6c 6f 6e 20 36 34 20 33 30 an Athlon 64 30
02c0: 30 30 2b 20 2f 20 47 69 67 61 62 79 74 65 20 47 00+ / Gigabyte G
02d0: 41 2d 4b 38 56 54 38 30 30 4d 20 73 79 73 74 65 A-K8VT800M syste
02e0: 6d 20 77 69 74 68 0a 20 2a 20 31 47 42 20 72 61 m with. * 1GB ra
02f0: 6d 2e 20 20 54 68 65 20 36 34 2d 62 69 74 20 76 m. The 64-bit v
0300: 65 72 73 69 6f 6e 20 69 73 20 61 62 6f 75 74 20 ersion is about
0310: 34 25 20 66 61 73 74 65 72 20 74 68 61 6e 20 74 4% faster than t
0320: 68 65 20 33 32 2d 62 69 74 20 76 65 72 73 69 6f he 32-bit versio
0330: 6e 2c 0a 20 2a 20 77 68 65 6e 20 64 65 63 6f 6d n,. * when decom
0340: 70 72 65 73 73 69 6e 67 20 6d 6f 7a 69 6c 6c 61 pressing mozilla
0350: 2d 73 6f 75 72 63 65 2d 31 2e 33 2e 74 61 72 2e -source-1.3.tar.
0360: 67 7a 2e 0a 20 2a 0a 20 2a 20 4d 61 72 2d 31 33 gz.. *. * Mar-13
0370: 2d 32 30 30 33 20 2d 2d 20 4d 6f 73 74 20 6f 66 -2003 -- Most of
0380: 20 74 68 69 73 20 69 73 20 64 65 72 69 76 65 64 this is derived
0390: 20 66 72 6f 6d 20 69 6e 66 66 61 73 74 2e 53 20 from inffast.S
03a0: 77 68 69 63 68 20 69 73 20 64 65 72 69 76 65 64 which is derived
03b0: 20 66 72 6f 6d 0a 20 2a 20 74 68 65 20 67 63 63 from. * the gcc
03c0: 20 2d 53 20 6f 75 74 70 75 74 20 6f 66 20 7a 6c -S output of zl
03d0: 69 62 2d 31 2e 32 2e 30 2f 69 6e 66 66 61 73 74 ib-1.2.0/inffast
03e0: 2e 63 2e 20 20 5a 6c 69 62 2d 31 2e 32 2e 30 20 .c. Zlib-1.2.0
03f0: 69 73 20 69 6e 20 62 65 74 61 20 72 65 6c 65 61 is in beta relea
0400: 73 65 20 61 74 0a 20 2a 20 74 68 65 20 6d 6f 6d se at. * the mom
0410: 65 6e 74 2e 20 20 49 20 68 61 76 65 20 73 75 63 ent. I have suc
0420: 63 65 73 73 66 75 6c 6c 79 20 63 6f 6d 70 69 6c cessfully compil
0430: 65 64 20 61 6e 64 20 74 65 73 74 65 64 20 74 68 ed and tested th
0440: 69 73 20 63 6f 64 65 20 77 69 74 68 20 67 63 63 is code with gcc
0450: 32 2e 39 36 2c 0a 20 2a 20 67 63 63 33 2e 32 2c 2.96,. * gcc3.2,
0460: 20 69 63 63 35 2e 30 2c 20 6d 73 76 63 36 2e 30 icc5.0, msvc6.0
0470: 2e 20 20 49 74 20 69 73 20 76 65 72 79 20 63 6c . It is very cl
0480: 6f 73 65 20 74 6f 20 74 68 65 20 73 70 65 65 64 ose to the speed
0490: 20 6f 66 20 69 6e 66 66 61 73 74 2e 53 0a 20 2a of inffast.S. *
04a0: 20 63 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 67 compiled with g
04b0: 63 63 20 2d 44 4e 4f 5f 4d 4d 58 2c 20 62 75 74 cc -DNO_MMX, but
04c0: 20 69 6e 66 66 61 73 74 2e 53 20 69 73 20 73 74 inffast.S is st
04d0: 69 6c 6c 20 66 61 73 74 65 72 20 6f 6e 20 74 68 ill faster on th
04e0: 65 20 50 33 20 77 69 74 68 20 4d 4d 58 0a 20 2a e P3 with MMX. *
04f0: 20 65 6e 61 62 6c 65 64 2e 20 20 49 20 77 69 6c enabled. I wil
0500: 6c 20 61 74 74 65 6d 70 74 20 74 6f 20 6d 65 72 l attempt to mer
0510: 67 65 20 74 68 65 20 4d 4d 58 20 63 6f 64 65 20 ge the MMX code
0520: 69 6e 74 6f 20 74 68 69 73 20 76 65 72 73 69 6f into this versio
0530: 6e 2e 20 20 4e 65 77 65 72 0a 20 2a 20 76 65 72 n. Newer. * ver
0540: 73 69 6f 6e 73 20 6f 66 20 74 68 69 73 20 61 6e sions of this an
0550: 64 20 69 6e 66 66 61 73 74 2e 53 20 63 61 6e 20 d inffast.S can
0560: 62 65 20 66 6f 75 6e 64 20 61 74 0a 20 2a 20 68 be found at. * h
0570: 74 74 70 3a 2f 2f 77 77 77 2e 65 65 74 62 65 65 ttp://www.eetbee
0580: 74 65 65 2e 63 6f 6d 2f 7a 6c 69 62 2f 20 61 6e tee.com/zlib/ an
0590: 64 20 68 74 74 70 3a 2f 2f 77 77 77 2e 63 68 61 d http://www.cha
05a0: 72 6d 2e 6e 65 74 2f 7e 63 68 72 69 73 74 6f 70 rm.net/~christop
05b0: 2f 7a 6c 69 62 2f 0a 20 2a 2f 0a 0a 23 69 6e 63 /zlib/. */..#inc
05c0: 6c 75 64 65 20 22 7a 75 74 69 6c 2e 68 22 0a 23 lude "zutil.h".#
05d0: 69 6e 63 6c 75 64 65 20 22 69 6e 66 74 72 65 65 include "inftree
05e0: 73 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 22 69 s.h".#include "i
05f0: 6e 66 6c 61 74 65 2e 68 22 0a 23 69 6e 63 6c 75 nflate.h".#inclu
0600: 64 65 20 22 69 6e 66 66 61 73 74 2e 68 22 0a 0a de "inffast.h"..
0610: 2f 2a 20 4d 61 72 6b 20 41 64 6c 65 72 27 73 20 /* Mark Adler's
0620: 63 6f 6d 6d 65 6e 74 73 20 66 72 6f 6d 20 69 6e comments from in
0630: 66 66 61 73 74 2e 63 3a 20 2a 2f 0a 0a 2f 2a 0a ffast.c: */../*.
0640: 20 20 20 44 65 63 6f 64 65 20 6c 69 74 65 72 61 Decode litera
0650: 6c 2c 20 6c 65 6e 67 74 68 2c 20 61 6e 64 20 64 l, length, and d
0660: 69 73 74 61 6e 63 65 20 63 6f 64 65 73 20 61 6e istance codes an
0670: 64 20 77 72 69 74 65 20 6f 75 74 20 74 68 65 20 d write out the
0680: 72 65 73 75 6c 74 69 6e 67 0a 20 20 20 6c 69 74 resulting. lit
0690: 65 72 61 6c 20 61 6e 64 20 6d 61 74 63 68 20 62 eral and match b
06a0: 79 74 65 73 20 75 6e 74 69 6c 20 65 69 74 68 65 ytes until eithe
06b0: 72 20 6e 6f 74 20 65 6e 6f 75 67 68 20 69 6e 70 r not enough inp
06c0: 75 74 20 6f 72 20 6f 75 74 70 75 74 20 69 73 0a ut or output is.
06d0: 20 20 20 61 76 61 69 6c 61 62 6c 65 2c 20 61 6e available, an
06e0: 20 65 6e 64 2d 6f 66 2d 62 6c 6f 63 6b 20 69 73 end-of-block is
06f0: 20 65 6e 63 6f 75 6e 74 65 72 65 64 2c 20 6f 72 encountered, or
0700: 20 61 20 64 61 74 61 20 65 72 72 6f 72 20 69 73 a data error is
0710: 20 65 6e 63 6f 75 6e 74 65 72 65 64 2e 0a 20 20 encountered..
0720: 20 57 68 65 6e 20 6c 61 72 67 65 20 65 6e 6f 75 When large enou
0730: 67 68 20 69 6e 70 75 74 20 61 6e 64 20 6f 75 74 gh input and out
0740: 70 75 74 20 62 75 66 66 65 72 73 20 61 72 65 20 put buffers are
0750: 73 75 70 70 6c 69 65 64 20 74 6f 20 69 6e 66 6c supplied to infl
0760: 61 74 65 28 29 2c 20 66 6f 72 0a 20 20 20 65 78 ate(), for. ex
0770: 61 6d 70 6c 65 2c 20 61 20 31 36 4b 20 69 6e 70 ample, a 16K inp
0780: 75 74 20 62 75 66 66 65 72 20 61 6e 64 20 61 20 ut buffer and a
0790: 36 34 4b 20 6f 75 74 70 75 74 20 62 75 66 66 65 64K output buffe
07a0: 72 2c 20 6d 6f 72 65 20 74 68 61 6e 20 39 35 25 r, more than 95%
07b0: 20 6f 66 20 74 68 65 0a 20 20 20 69 6e 66 6c 61 of the. infla
07c0: 74 65 20 65 78 65 63 75 74 69 6f 6e 20 74 69 6d te execution tim
07d0: 65 20 69 73 20 73 70 65 6e 74 20 69 6e 20 74 68 e is spent in th
07e0: 69 73 20 72 6f 75 74 69 6e 65 2e 0a 0a 20 20 20 is routine...
07f0: 45 6e 74 72 79 20 61 73 73 75 6d 70 74 69 6f 6e Entry assumption
0800: 73 3a 0a 0a 20 20 20 20 20 20 20 20 73 74 61 74 s:.. stat
0810: 65 2d 3e 6d 6f 64 65 20 3d 3d 20 4c 45 4e 0a 20 e->mode == LEN.
0820: 20 20 20 20 20 20 20 73 74 72 6d 2d 3e 61 76 61 strm->ava
0830: 69 6c 5f 69 6e 20 3e 3d 20 36 0a 20 20 20 20 20 il_in >= 6.
0840: 20 20 20 73 74 72 6d 2d 3e 61 76 61 69 6c 5f 6f strm->avail_o
0850: 75 74 20 3e 3d 20 32 35 38 0a 20 20 20 20 20 20 ut >= 258.
0860: 20 20 73 74 61 72 74 20 3e 3d 20 73 74 72 6d 2d start >= strm-
0870: 3e 61 76 61 69 6c 5f 6f 75 74 0a 20 20 20 20 20 >avail_out.
0880: 20 20 20 73 74 61 74 65 2d 3e 62 69 74 73 20 3c state->bits <
0890: 20 38 0a 0a 20 20 20 4f 6e 20 72 65 74 75 72 6e 8.. On return
08a0: 2c 20 73 74 61 74 65 2d 3e 6d 6f 64 65 20 69 73 , state->mode is
08b0: 20 6f 6e 65 20 6f 66 3a 0a 0a 20 20 20 20 20 20 one of:..
08c0: 20 20 4c 45 4e 20 2d 2d 20 72 61 6e 20 6f 75 74 LEN -- ran out
08d0: 20 6f 66 20 65 6e 6f 75 67 68 20 6f 75 74 70 75 of enough outpu
08e0: 74 20 73 70 61 63 65 20 6f 72 20 65 6e 6f 75 67 t space or enoug
08f0: 68 20 61 76 61 69 6c 61 62 6c 65 20 69 6e 70 75 h available inpu
0900: 74 0a 20 20 20 20 20 20 20 20 54 59 50 45 20 2d t. TYPE -
0910: 2d 20 72 65 61 63 68 65 64 20 65 6e 64 20 6f 66 - reached end of
0920: 20 62 6c 6f 63 6b 20 63 6f 64 65 2c 20 69 6e 66 block code, inf
0930: 6c 61 74 65 28 29 20 74 6f 20 69 6e 74 65 72 70 late() to interp
0940: 72 65 74 20 6e 65 78 74 20 62 6c 6f 63 6b 0a 20 ret next block.
0950: 20 20 20 20 20 20 20 42 41 44 20 2d 2d 20 65 72 BAD -- er
0960: 72 6f 72 20 69 6e 20 62 6c 6f 63 6b 20 64 61 74 ror in block dat
0970: 61 0a 0a 20 20 20 4e 6f 74 65 73 3a 0a 0a 20 20 a.. Notes:..
0980: 20 20 2d 20 54 68 65 20 6d 61 78 69 6d 75 6d 20 - The maximum
0990: 69 6e 70 75 74 20 62 69 74 73 20 75 73 65 64 20 input bits used
09a0: 62 79 20 61 20 6c 65 6e 67 74 68 2f 64 69 73 74 by a length/dist
09b0: 61 6e 63 65 20 70 61 69 72 20 69 73 20 31 35 20 ance pair is 15
09c0: 62 69 74 73 20 66 6f 72 20 74 68 65 0a 20 20 20 bits for the.
09d0: 20 20 20 6c 65 6e 67 74 68 20 63 6f 64 65 2c 20 length code,
09e0: 35 20 62 69 74 73 20 66 6f 72 20 74 68 65 20 6c 5 bits for the l
09f0: 65 6e 67 74 68 20 65 78 74 72 61 2c 20 31 35 20 ength extra, 15
0a00: 62 69 74 73 20 66 6f 72 20 74 68 65 20 64 69 73 bits for the dis
0a10: 74 61 6e 63 65 20 63 6f 64 65 2c 0a 20 20 20 20 tance code,.
0a20: 20 20 61 6e 64 20 31 33 20 62 69 74 73 20 66 6f and 13 bits fo
0a30: 72 20 74 68 65 20 64 69 73 74 61 6e 63 65 20 65 r the distance e
0a40: 78 74 72 61 2e 20 20 54 68 69 73 20 74 6f 74 61 xtra. This tota
0a50: 6c 73 20 34 38 20 62 69 74 73 2c 20 6f 72 20 73 ls 48 bits, or s
0a60: 69 78 20 62 79 74 65 73 2e 0a 20 20 20 20 20 20 ix bytes..
0a70: 54 68 65 72 65 66 6f 72 65 20 69 66 20 73 74 72 Therefore if str
0a80: 6d 2d 3e 61 76 61 69 6c 5f 69 6e 20 3e 3d 20 36 m->avail_in >= 6
0a90: 2c 20 74 68 65 6e 20 74 68 65 72 65 20 69 73 20 , then there is
0aa0: 65 6e 6f 75 67 68 20 69 6e 70 75 74 20 74 6f 20 enough input to
0ab0: 61 76 6f 69 64 0a 20 20 20 20 20 20 63 68 65 63 avoid. chec
0ac0: 6b 69 6e 67 20 66 6f 72 20 61 76 61 69 6c 61 62 king for availab
0ad0: 6c 65 20 69 6e 70 75 74 20 77 68 69 6c 65 20 64 le input while d
0ae0: 65 63 6f 64 69 6e 67 2e 0a 0a 20 20 20 20 2d 20 ecoding... -
0af0: 54 68 65 20 6d 61 78 69 6d 75 6d 20 62 79 74 65 The maximum byte
0b00: 73 20 74 68 61 74 20 61 20 73 69 6e 67 6c 65 20 s that a single
0b10: 6c 65 6e 67 74 68 2f 64 69 73 74 61 6e 63 65 20 length/distance
0b20: 70 61 69 72 20 63 61 6e 20 6f 75 74 70 75 74 20 pair can output
0b30: 69 73 20 32 35 38 0a 20 20 20 20 20 20 62 79 74 is 258. byt
0b40: 65 73 2c 20 77 68 69 63 68 20 69 73 20 74 68 65 es, which is the
0b50: 20 6d 61 78 69 6d 75 6d 20 6c 65 6e 67 74 68 20 maximum length
0b60: 74 68 61 74 20 63 61 6e 20 62 65 20 63 6f 64 65 that can be code
0b70: 64 2e 20 20 69 6e 66 6c 61 74 65 5f 66 61 73 74 d. inflate_fast
0b80: 28 29 0a 20 20 20 20 20 20 72 65 71 75 69 72 65 (). require
0b90: 73 20 73 74 72 6d 2d 3e 61 76 61 69 6c 5f 6f 75 s strm->avail_ou
0ba0: 74 20 3e 3d 20 32 35 38 20 66 6f 72 20 65 61 63 t >= 258 for eac
0bb0: 68 20 6c 6f 6f 70 20 74 6f 20 61 76 6f 69 64 20 h loop to avoid
0bc0: 63 68 65 63 6b 69 6e 67 20 66 6f 72 0a 20 20 20 checking for.
0bd0: 20 20 20 6f 75 74 70 75 74 20 73 70 61 63 65 2e output space.
0be0: 0a 20 2a 2f 0a 76 6f 69 64 20 69 6e 66 6c 61 74 . */.void inflat
0bf0: 65 5f 66 61 73 74 28 73 74 72 6d 2c 20 73 74 61 e_fast(strm, sta
0c00: 72 74 29 0a 7a 5f 73 74 72 65 61 6d 70 20 73 74 rt).z_streamp st
0c10: 72 6d 3b 0a 75 6e 73 69 67 6e 65 64 20 73 74 61 rm;.unsigned sta
0c20: 72 74 3b 20 20 20 20 20 20 20 20 20 2f 2a 20 69 rt; /* i
0c30: 6e 66 6c 61 74 65 28 29 27 73 20 73 74 61 72 74 nflate()'s start
0c40: 69 6e 67 20 76 61 6c 75 65 20 66 6f 72 20 73 74 ing value for st
0c50: 72 6d 2d 3e 61 76 61 69 6c 5f 6f 75 74 20 2a 2f rm->avail_out */
0c60: 0a 7b 0a 20 20 20 20 73 74 72 75 63 74 20 69 6e .{. struct in
0c70: 66 6c 61 74 65 5f 73 74 61 74 65 20 46 41 52 20 flate_state FAR
0c80: 2a 73 74 61 74 65 3b 0a 20 20 20 20 73 74 72 75 *state;. stru
0c90: 63 74 20 69 6e 66 66 61 73 74 5f 61 72 20 7b 0a ct inffast_ar {.
0ca0: 2f 2a 20 36 34 20 20 20 33 32 20 20 20 20 20 20 /* 64 32
0cb0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0cc0: 20 20 20 20 20 20 20 20 20 78 38 36 20 20 78 38 x86 x8
0cd0: 36 5f 36 34 20 2a 2f 0a 2f 2a 20 61 72 20 6f 66 6_64 */./* ar of
0ce0: 66 73 65 74 20 20 20 20 20 20 20 20 20 20 20 20 fset
0cf0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0d00: 20 20 72 65 67 69 73 74 65 72 20 2a 2f 0a 2f 2a register */./*
0d10: 20 20 30 20 20 20 20 30 20 2a 2f 20 76 6f 69 64 0 0 */ void
0d20: 20 2a 65 73 70 3b 20 20 20 20 20 20 20 20 20 20 *esp;
0d30: 20 20 20 20 20 20 2f 2a 20 65 73 70 20 73 61 76 /* esp sav
0d40: 65 20 2a 2f 0a 2f 2a 20 20 38 20 20 20 20 34 20 e */./* 8 4
0d50: 2a 2f 20 76 6f 69 64 20 2a 65 62 70 3b 20 20 20 */ void *ebp;
0d60: 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 /*
0d70: 65 62 70 20 73 61 76 65 20 2a 2f 0a 2f 2a 20 31 ebp save */./* 1
0d80: 36 20 20 20 20 38 20 2a 2f 20 75 6e 73 69 67 6e 6 8 */ unsign
0d90: 65 64 20 63 68 61 72 20 46 41 52 20 2a 69 6e 3b ed char FAR *in;
0da0: 20 20 20 20 2f 2a 20 65 73 69 20 72 73 69 20 20 /* esi rsi
0db0: 6c 6f 63 61 6c 20 73 74 72 6d 2d 3e 6e 65 78 74 local strm->next
0dc0: 5f 69 6e 20 2a 2f 0a 2f 2a 20 32 34 20 20 20 31 _in */./* 24 1
0dd0: 32 20 2a 2f 20 75 6e 73 69 67 6e 65 64 20 63 68 2 */ unsigned ch
0de0: 61 72 20 46 41 52 20 2a 6c 61 73 74 3b 20 20 2f ar FAR *last; /
0df0: 2a 20 20 20 20 20 72 39 20 20 20 77 68 69 6c 65 * r9 while
0e00: 20 69 6e 20 3c 20 6c 61 73 74 20 2a 2f 0a 2f 2a in < last */./*
0e10: 20 33 32 20 20 20 31 36 20 2a 2f 20 75 6e 73 69 32 16 */ unsi
0e20: 67 6e 65 64 20 63 68 61 72 20 46 41 52 20 2a 6f gned char FAR *o
0e30: 75 74 3b 20 20 20 2f 2a 20 65 64 69 20 72 64 69 ut; /* edi rdi
0e40: 20 20 6c 6f 63 61 6c 20 73 74 72 6d 2d 3e 6e 65 local strm->ne
0e50: 78 74 5f 6f 75 74 20 2a 2f 0a 2f 2a 20 34 30 20 xt_out */./* 40
0e60: 20 20 32 30 20 2a 2f 20 75 6e 73 69 67 6e 65 64 20 */ unsigned
0e70: 20 63 68 61 72 20 46 41 52 20 2a 62 65 67 3b 20 char FAR *beg;
0e80: 20 20 2f 2a 20 20 20 20 20 20 20 20 20 20 69 6e /* in
0e90: 66 6c 61 74 65 28 29 27 73 20 69 6e 69 74 20 6e flate()'s init n
0ea0: 65 78 74 5f 6f 75 74 20 2a 2f 0a 2f 2a 20 34 38 ext_out */./* 48
0eb0: 20 20 20 32 34 20 2a 2f 20 75 6e 73 69 67 6e 65 24 */ unsigne
0ec0: 64 20 63 68 61 72 20 46 41 52 20 2a 65 6e 64 3b d char FAR *end;
0ed0: 20 20 20 2f 2a 20 20 20 20 20 72 31 30 20 20 77 /* r10 w
0ee0: 68 69 6c 65 20 6f 75 74 20 3c 20 65 6e 64 20 2a hile out < end *
0ef0: 2f 0a 2f 2a 20 35 36 20 20 20 32 38 20 2a 2f 20 /./* 56 28 */
0f00: 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 46 41 unsigned char FA
0f10: 52 20 2a 77 69 6e 64 6f 77 3b 2f 2a 20 20 20 20 R *window;/*
0f20: 20 20 20 20 20 20 73 69 7a 65 20 6f 66 20 77 69 size of wi
0f30: 6e 64 6f 77 2c 20 77 73 69 7a 65 21 3d 30 20 2a ndow, wsize!=0 *
0f40: 2f 0a 2f 2a 20 36 34 20 20 20 33 32 20 2a 2f 20 /./* 64 32 */
0f50: 63 6f 64 65 20 63 6f 6e 73 74 20 46 41 52 20 2a code const FAR *
0f60: 6c 63 6f 64 65 3b 20 20 20 20 2f 2a 20 65 62 70 lcode; /* ebp
0f70: 20 72 62 70 20 20 6c 6f 63 61 6c 20 73 74 72 6d rbp local strm
0f80: 2d 3e 6c 65 6e 63 6f 64 65 20 2a 2f 0a 2f 2a 20 ->lencode */./*
0f90: 37 32 20 20 20 33 36 20 2a 2f 20 63 6f 64 65 20 72 36 */ code
0fa0: 63 6f 6e 73 74 20 46 41 52 20 2a 64 63 6f 64 65 const FAR *dcode
0fb0: 3b 20 20 20 20 2f 2a 20 20 20 20 20 72 31 31 20 ; /* r11
0fc0: 20 6c 6f 63 61 6c 20 73 74 72 6d 2d 3e 64 69 73 local strm->dis
0fd0: 74 63 6f 64 65 20 2a 2f 0a 2f 2a 20 38 30 20 20 tcode */./* 80
0fe0: 20 34 30 20 2a 2f 20 75 6e 73 69 67 6e 65 64 20 40 */ unsigned
0ff0: 6c 6f 6e 67 20 68 6f 6c 64 3b 20 20 20 20 20 20 long hold;
1000: 20 2f 2a 20 65 64 78 20 72 64 78 20 20 6c 6f 63 /* edx rdx loc
1010: 61 6c 20 73 74 72 6d 2d 3e 68 6f 6c 64 20 2a 2f al strm->hold */
1020: 0a 2f 2a 20 38 38 20 20 20 34 34 20 2a 2f 20 75 ./* 88 44 */ u
1030: 6e 73 69 67 6e 65 64 20 62 69 74 73 3b 20 20 20 nsigned bits;
1040: 20 20 20 20 20 20 20 20 20 2f 2a 20 65 62 78 20 /* ebx
1050: 72 62 78 20 20 6c 6f 63 61 6c 20 73 74 72 6d 2d rbx local strm-
1060: 3e 62 69 74 73 20 2a 2f 0a 2f 2a 20 39 32 20 20 >bits */./* 92
1070: 20 34 38 20 2a 2f 20 75 6e 73 69 67 6e 65 64 20 48 */ unsigned
1080: 77 73 69 7a 65 3b 20 20 20 20 20 20 20 20 20 20 wsize;
1090: 20 2f 2a 20 20 20 20 20 20 20 20 20 20 77 69 6e /* win
10a0: 64 6f 77 20 73 69 7a 65 20 2a 2f 0a 2f 2a 20 39 dow size */./* 9
10b0: 36 20 20 20 35 32 20 2a 2f 20 75 6e 73 69 67 6e 6 52 */ unsign
10c0: 65 64 20 77 72 69 74 65 3b 20 20 20 20 20 20 20 ed write;
10d0: 20 20 20 20 2f 2a 20 20 20 20 20 20 20 20 20 20 /*
10e0: 77 69 6e 64 6f 77 20 77 72 69 74 65 20 69 6e 64 window write ind
10f0: 65 78 20 2a 2f 0a 2f 2a 31 30 30 20 20 20 35 36 ex */./*100 56
1100: 20 2a 2f 20 75 6e 73 69 67 6e 65 64 20 6c 6d 61 */ unsigned lma
1110: 73 6b 3b 20 20 20 20 20 20 20 20 20 20 20 2f 2a sk; /*
1120: 20 20 20 20 20 72 31 32 20 20 6d 61 73 6b 20 66 r12 mask f
1130: 6f 72 20 6c 63 6f 64 65 20 2a 2f 0a 2f 2a 31 30 or lcode */./*10
1140: 34 20 20 20 36 30 20 2a 2f 20 75 6e 73 69 67 6e 4 60 */ unsign
1150: 65 64 20 64 6d 61 73 6b 3b 20 20 20 20 20 20 20 ed dmask;
1160: 20 20 20 20 2f 2a 20 20 20 20 20 72 31 33 20 20 /* r13
1170: 6d 61 73 6b 20 66 6f 72 20 64 63 6f 64 65 20 2a mask for dcode *
1180: 2f 0a 2f 2a 31 30 38 20 20 20 36 34 20 2a 2f 20 /./*108 64 */
1190: 75 6e 73 69 67 6e 65 64 20 6c 65 6e 3b 20 20 20 unsigned len;
11a0: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 20 20 20 /*
11b0: 20 72 31 34 20 20 6d 61 74 63 68 20 6c 65 6e 67 r14 match leng
11c0: 74 68 20 2a 2f 0a 2f 2a 31 31 32 20 20 20 36 38 th */./*112 68
11d0: 20 2a 2f 20 75 6e 73 69 67 6e 65 64 20 64 69 73 */ unsigned dis
11e0: 74 3b 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a t; /*
11f0: 20 20 20 20 20 72 31 35 20 20 6d 61 74 63 68 20 r15 match
1200: 64 69 73 74 61 6e 63 65 20 2a 2f 0a 2f 2a 31 31 distance */./*11
1210: 36 20 20 20 37 32 20 2a 2f 20 75 6e 73 69 67 6e 6 72 */ unsign
1220: 65 64 20 73 74 61 74 75 73 3b 20 20 20 20 20 20 ed status;
1230: 20 20 20 20 2f 2a 20 20 20 20 20 20 20 20 20 20 /*
1240: 73 65 74 20 77 68 65 6e 20 73 74 61 74 65 20 63 set when state c
1250: 68 6e 67 2a 2f 0a 20 20 20 20 7d 20 61 72 3b 0a hng*/. } ar;.
1260: 0a 23 69 66 20 64 65 66 69 6e 65 64 28 20 5f 5f .#if defined( __
1270: 47 4e 55 43 5f 5f 20 29 20 26 26 20 64 65 66 69 GNUC__ ) && defi
1280: 6e 65 64 28 20 5f 5f 61 6d 64 36 34 5f 5f 20 29 ned( __amd64__ )
1290: 20 26 26 20 21 20 64 65 66 69 6e 65 64 28 20 5f && ! defined( _
12a0: 5f 69 33 38 36 20 29 0a 23 64 65 66 69 6e 65 20 _i386 ).#define
12b0: 50 41 44 5f 41 56 41 49 4c 5f 49 4e 20 36 0a 23 PAD_AVAIL_IN 6.#
12c0: 64 65 66 69 6e 65 20 50 41 44 5f 41 56 41 49 4c define PAD_AVAIL
12d0: 5f 4f 55 54 20 32 35 38 0a 23 65 6c 73 65 0a 23 _OUT 258.#else.#
12e0: 64 65 66 69 6e 65 20 50 41 44 5f 41 56 41 49 4c define PAD_AVAIL
12f0: 5f 49 4e 20 35 0a 23 64 65 66 69 6e 65 20 50 41 _IN 5.#define PA
1300: 44 5f 41 56 41 49 4c 5f 4f 55 54 20 32 35 37 0a D_AVAIL_OUT 257.
1310: 23 65 6e 64 69 66 0a 0a 20 20 20 20 2f 2a 20 63 #endif.. /* c
1320: 6f 70 79 20 73 74 61 74 65 20 74 6f 20 6c 6f 63 opy state to loc
1330: 61 6c 20 76 61 72 69 61 62 6c 65 73 20 2a 2f 0a al variables */.
1340: 20 20 20 20 73 74 61 74 65 20 3d 20 28 73 74 72 state = (str
1350: 75 63 74 20 69 6e 66 6c 61 74 65 5f 73 74 61 74 uct inflate_stat
1360: 65 20 46 41 52 20 2a 29 73 74 72 6d 2d 3e 73 74 e FAR *)strm->st
1370: 61 74 65 3b 0a 20 20 20 20 61 72 2e 69 6e 20 3d ate;. ar.in =
1380: 20 73 74 72 6d 2d 3e 6e 65 78 74 5f 69 6e 3b 0a strm->next_in;.
1390: 20 20 20 20 61 72 2e 6c 61 73 74 20 3d 20 61 72 ar.last = ar
13a0: 2e 69 6e 20 2b 20 28 73 74 72 6d 2d 3e 61 76 61 .in + (strm->ava
13b0: 69 6c 5f 69 6e 20 2d 20 50 41 44 5f 41 56 41 49 il_in - PAD_AVAI
13c0: 4c 5f 49 4e 29 3b 0a 20 20 20 20 61 72 2e 6f 75 L_IN);. ar.ou
13d0: 74 20 3d 20 73 74 72 6d 2d 3e 6e 65 78 74 5f 6f t = strm->next_o
13e0: 75 74 3b 0a 20 20 20 20 61 72 2e 62 65 67 20 3d ut;. ar.beg =
13f0: 20 61 72 2e 6f 75 74 20 2d 20 28 73 74 61 72 74 ar.out - (start
1400: 20 2d 20 73 74 72 6d 2d 3e 61 76 61 69 6c 5f 6f - strm->avail_o
1410: 75 74 29 3b 0a 20 20 20 20 61 72 2e 65 6e 64 20 ut);. ar.end
1420: 3d 20 61 72 2e 6f 75 74 20 2b 20 28 73 74 72 6d = ar.out + (strm
1430: 2d 3e 61 76 61 69 6c 5f 6f 75 74 20 2d 20 50 41 ->avail_out - PA
1440: 44 5f 41 56 41 49 4c 5f 4f 55 54 29 3b 0a 20 20 D_AVAIL_OUT);.
1450: 20 20 61 72 2e 77 73 69 7a 65 20 3d 20 73 74 61 ar.wsize = sta
1460: 74 65 2d 3e 77 73 69 7a 65 3b 0a 20 20 20 20 61 te->wsize;. a
1470: 72 2e 77 72 69 74 65 20 3d 20 73 74 61 74 65 2d r.write = state-
1480: 3e 77 6e 65 78 74 3b 0a 20 20 20 20 61 72 2e 77 >wnext;. ar.w
1490: 69 6e 64 6f 77 20 3d 20 73 74 61 74 65 2d 3e 77 indow = state->w
14a0: 69 6e 64 6f 77 3b 0a 20 20 20 20 61 72 2e 68 6f indow;. ar.ho
14b0: 6c 64 20 3d 20 73 74 61 74 65 2d 3e 68 6f 6c 64 ld = state->hold
14c0: 3b 0a 20 20 20 20 61 72 2e 62 69 74 73 20 3d 20 ;. ar.bits =
14d0: 73 74 61 74 65 2d 3e 62 69 74 73 3b 0a 20 20 20 state->bits;.
14e0: 20 61 72 2e 6c 63 6f 64 65 20 3d 20 73 74 61 74 ar.lcode = stat
14f0: 65 2d 3e 6c 65 6e 63 6f 64 65 3b 0a 20 20 20 20 e->lencode;.
1500: 61 72 2e 64 63 6f 64 65 20 3d 20 73 74 61 74 65 ar.dcode = state
1510: 2d 3e 64 69 73 74 63 6f 64 65 3b 0a 20 20 20 20 ->distcode;.
1520: 61 72 2e 6c 6d 61 73 6b 20 3d 20 28 31 55 20 3c ar.lmask = (1U <
1530: 3c 20 73 74 61 74 65 2d 3e 6c 65 6e 62 69 74 73 < state->lenbits
1540: 29 20 2d 20 31 3b 0a 20 20 20 20 61 72 2e 64 6d ) - 1;. ar.dm
1550: 61 73 6b 20 3d 20 28 31 55 20 3c 3c 20 73 74 61 ask = (1U << sta
1560: 74 65 2d 3e 64 69 73 74 62 69 74 73 29 20 2d 20 te->distbits) -
1570: 31 3b 0a 0a 20 20 20 20 2f 2a 20 64 65 63 6f 64 1;.. /* decod
1580: 65 20 6c 69 74 65 72 61 6c 73 20 61 6e 64 20 6c e literals and l
1590: 65 6e 67 74 68 2f 64 69 73 74 61 6e 63 65 73 20 ength/distances
15a0: 75 6e 74 69 6c 20 65 6e 64 2d 6f 66 2d 62 6c 6f until end-of-blo
15b0: 63 6b 20 6f 72 20 6e 6f 74 20 65 6e 6f 75 67 68 ck or not enough
15c0: 0a 20 20 20 20 20 20 20 69 6e 70 75 74 20 64 61 . input da
15d0: 74 61 20 6f 72 20 6f 75 74 70 75 74 20 73 70 61 ta or output spa
15e0: 63 65 20 2a 2f 0a 0a 20 20 20 20 2f 2a 20 61 6c ce */.. /* al
15f0: 69 67 6e 20 69 6e 20 6f 6e 20 31 2f 32 20 68 6f ign in on 1/2 ho
1600: 6c 64 20 73 69 7a 65 20 62 6f 75 6e 64 61 72 79 ld size boundary
1610: 20 2a 2f 0a 20 20 20 20 77 68 69 6c 65 20 28 28 */. while ((
1620: 28 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 29 28 (unsigned long)(
1630: 76 6f 69 64 20 2a 29 61 72 2e 69 6e 20 26 20 28 void *)ar.in & (
1640: 73 69 7a 65 6f 66 28 61 72 2e 68 6f 6c 64 29 20 sizeof(ar.hold)
1650: 2f 20 32 20 2d 20 31 29 29 20 21 3d 20 30 29 20 / 2 - 1)) != 0)
1660: 7b 0a 20 20 20 20 20 20 20 20 61 72 2e 68 6f 6c {. ar.hol
1670: 64 20 2b 3d 20 28 75 6e 73 69 67 6e 65 64 20 6c d += (unsigned l
1680: 6f 6e 67 29 2a 61 72 2e 69 6e 2b 2b 20 3c 3c 20 ong)*ar.in++ <<
1690: 61 72 2e 62 69 74 73 3b 0a 20 20 20 20 20 20 20 ar.bits;.
16a0: 20 61 72 2e 62 69 74 73 20 2b 3d 20 38 3b 0a 20 ar.bits += 8;.
16b0: 20 20 20 7d 0a 0a 23 69 66 20 64 65 66 69 6e 65 }..#if define
16c0: 64 28 20 5f 5f 47 4e 55 43 5f 5f 20 29 20 26 26 d( __GNUC__ ) &&
16d0: 20 64 65 66 69 6e 65 64 28 20 5f 5f 61 6d 64 36 defined( __amd6
16e0: 34 5f 5f 20 29 20 26 26 20 21 20 64 65 66 69 6e 4__ ) && ! defin
16f0: 65 64 28 20 5f 5f 69 33 38 36 20 29 0a 20 20 20 ed( __i386 ).
1700: 20 5f 5f 61 73 6d 5f 5f 20 5f 5f 76 6f 6c 61 74 __asm__ __volat
1710: 69 6c 65 5f 5f 20 28 0a 22 20 20 20 20 20 20 20 ile__ (."
1720: 20 6c 65 61 71 20 20 20 20 25 30 2c 20 25 25 72 leaq %0, %%r
1730: 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d ax\n"." m
1740: 6f 76 71 20 20 20 20 25 25 72 62 70 2c 20 38 28 ovq %%rbp, 8(
1750: 25 25 72 61 78 29 5c 6e 22 20 20 20 20 20 20 20 %%rax)\n"
1760: 2f 2a 20 73 61 76 65 20 72 65 67 73 20 72 62 70 /* save regs rbp
1770: 20 61 6e 64 20 72 73 70 20 2a 2f 0a 22 20 20 20 and rsp */."
1780: 20 20 20 20 20 6d 6f 76 71 20 20 20 20 25 25 72 movq %%r
1790: 73 70 2c 20 28 25 25 72 61 78 29 5c 6e 22 0a 22 sp, (%%rax)\n"."
17a0: 20 20 20 20 20 20 20 20 6d 6f 76 71 20 20 20 20 movq
17b0: 25 25 72 61 78 2c 20 25 25 72 73 70 5c 6e 22 20 %%rax, %%rsp\n"
17c0: 20 20 20 20 20 20 20 20 20 2f 2a 20 6d 61 6b 65 /* make
17d0: 20 72 73 70 20 70 6f 69 6e 74 20 74 6f 20 26 61 rsp point to &a
17e0: 72 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f r */." mo
17f0: 76 71 20 20 20 20 31 36 28 25 25 72 73 70 29 2c vq 16(%%rsp),
1800: 20 25 25 72 73 69 5c 6e 22 20 20 20 20 20 20 2f %%rsi\n" /
1810: 2a 20 72 73 69 20 20 3d 20 69 6e 20 2a 2f 0a 22 * rsi = in */."
1820: 20 20 20 20 20 20 20 20 6d 6f 76 71 20 20 20 20 movq
1830: 33 32 28 25 25 72 73 70 29 2c 20 25 25 72 64 69 32(%%rsp), %%rdi
1840: 5c 6e 22 20 20 20 20 20 20 2f 2a 20 72 64 69 20 \n" /* rdi
1850: 20 3d 20 6f 75 74 20 2a 2f 0a 22 20 20 20 20 20 = out */."
1860: 20 20 20 6d 6f 76 71 20 20 20 20 32 34 28 25 25 movq 24(%%
1870: 72 73 70 29 2c 20 25 25 72 39 5c 6e 22 20 20 20 rsp), %%r9\n"
1880: 20 20 20 20 2f 2a 20 72 39 20 20 20 3d 20 6c 61 /* r9 = la
1890: 73 74 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d st */." m
18a0: 6f 76 71 20 20 20 20 34 38 28 25 25 72 73 70 29 ovq 48(%%rsp)
18b0: 2c 20 25 25 72 31 30 5c 6e 22 20 20 20 20 20 20 , %%r10\n"
18c0: 2f 2a 20 72 31 30 20 20 3d 20 65 6e 64 20 2a 2f /* r10 = end */
18d0: 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 71 20 20 ." movq
18e0: 20 20 36 34 28 25 25 72 73 70 29 2c 20 25 25 72 64(%%rsp), %%r
18f0: 62 70 5c 6e 22 20 20 20 20 20 20 2f 2a 20 72 62 bp\n" /* rb
1900: 70 20 20 3d 20 6c 63 6f 64 65 20 2a 2f 0a 22 20 p = lcode */."
1910: 20 20 20 20 20 20 20 6d 6f 76 71 20 20 20 20 37 movq 7
1920: 32 28 25 25 72 73 70 29 2c 20 25 25 72 31 31 5c 2(%%rsp), %%r11\
1930: 6e 22 20 20 20 20 20 20 2f 2a 20 72 31 31 20 20 n" /* r11
1940: 3d 20 64 63 6f 64 65 20 2a 2f 0a 22 20 20 20 20 = dcode */."
1950: 20 20 20 20 6d 6f 76 71 20 20 20 20 38 30 28 25 movq 80(%
1960: 25 72 73 70 29 2c 20 25 25 72 64 78 5c 6e 22 20 %rsp), %%rdx\n"
1970: 20 20 20 20 20 2f 2a 20 72 64 78 20 20 3d 20 68 /* rdx = h
1980: 6f 6c 64 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 old */."
1990: 6d 6f 76 6c 20 20 20 20 38 38 28 25 25 72 73 70 movl 88(%%rsp
19a0: 29 2c 20 25 25 65 62 78 5c 6e 22 20 20 20 20 20 ), %%ebx\n"
19b0: 20 2f 2a 20 65 62 78 20 20 3d 20 62 69 74 73 20 /* ebx = bits
19c0: 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c */." movl
19d0: 20 20 20 20 31 30 30 28 25 25 72 73 70 29 2c 20 100(%%rsp),
19e0: 25 25 72 31 32 64 5c 6e 22 20 20 20 20 2f 2a 20 %%r12d\n" /*
19f0: 72 31 32 64 20 3d 20 6c 6d 61 73 6b 20 2a 2f 0a r12d = lmask */.
1a00: 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 " movl
1a10: 20 31 30 34 28 25 25 72 73 70 29 2c 20 25 25 72 104(%%rsp), %%r
1a20: 31 33 64 5c 6e 22 20 20 20 20 2f 2a 20 72 31 33 13d\n" /* r13
1a30: 64 20 3d 20 64 6d 61 73 6b 20 2a 2f 0a 20 20 20 d = dmask */.
1a40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1a50: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1a60: 20 20 20 20 20 20 20 2f 2a 20 72 31 34 64 20 3d /* r14d =
1a70: 20 6c 65 6e 20 2a 2f 0a 20 20 20 20 20 20 20 20 len */.
1a80: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1a90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1aa0: 20 20 2f 2a 20 72 31 35 64 20 3d 20 64 69 73 74 /* r15d = dist
1ab0: 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 63 6c 64 */." cld
1ac0: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 63 6d 70 \n"." cmp
1ad0: 71 20 20 20 20 25 25 72 64 69 2c 20 25 25 72 31 q %%rdi, %%r1
1ae0: 30 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 65 0\n"." je
1af0: 20 20 20 20 20 20 2e 4c 5f 6f 6e 65 5f 74 69 6d .L_one_tim
1b00: 65 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 2f e\n" /
1b10: 2a 20 69 66 20 6f 6e 6c 79 20 6f 6e 65 20 64 65 * if only one de
1b20: 63 6f 64 65 20 6c 65 66 74 20 2a 2f 0a 22 20 20 code left */."
1b30: 20 20 20 20 20 20 63 6d 70 71 20 20 20 20 25 25 cmpq %%
1b40: 72 73 69 2c 20 25 25 72 39 5c 6e 22 0a 22 20 20 rsi, %%r9\n"."
1b50: 20 20 20 20 20 20 6a 65 20 20 20 20 20 20 2e 4c je .L
1b60: 5f 6f 6e 65 5f 74 69 6d 65 5c 6e 22 0a 22 20 20 _one_time\n"."
1b70: 20 20 20 20 20 20 6a 6d 70 20 20 20 20 20 2e 4c jmp .L
1b80: 5f 64 6f 5f 6c 6f 6f 70 5c 6e 22 0a 0a 22 2e 4c _do_loop\n"..".L
1b90: 5f 6f 6e 65 5f 74 69 6d 65 3a 5c 6e 22 0a 22 20 _one_time:\n"."
1ba0: 20 20 20 20 20 20 20 6d 6f 76 71 20 20 20 20 25 movq %
1bb0: 25 72 31 32 2c 20 25 25 72 38 5c 6e 22 20 20 20 %r12, %%r8\n"
1bc0: 20 20 20 20 20 20 20 20 2f 2a 20 72 38 20 3d 20 /* r8 =
1bd0: 6c 6d 61 73 6b 20 2a 2f 0a 22 20 20 20 20 20 20 lmask */."
1be0: 20 20 63 6d 70 62 20 20 20 20 24 33 32 2c 20 25 cmpb $32, %
1bf0: 25 62 6c 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 %bl\n"."
1c00: 6a 61 20 20 20 20 20 20 2e 4c 5f 67 65 74 5f 6c ja .L_get_l
1c10: 65 6e 67 74 68 5f 63 6f 64 65 5f 6f 6e 65 5f 74 ength_code_one_t
1c20: 69 6d 65 5c 6e 22 0a 0a 22 20 20 20 20 20 20 20 ime\n".."
1c30: 20 6c 6f 64 73 6c 5c 6e 22 20 20 20 20 20 20 20 lodsl\n"
1c40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1c50: 20 20 2f 2a 20 65 61 78 20 3d 20 2a 28 75 69 6e /* eax = *(uin
1c60: 74 20 2a 29 69 6e 2b 2b 20 2a 2f 0a 22 20 20 20 t *)in++ */."
1c70: 20 20 20 20 20 6d 6f 76 62 20 20 20 20 25 25 62 movb %%b
1c80: 6c 2c 20 25 25 63 6c 5c 6e 22 20 20 20 20 20 20 l, %%cl\n"
1c90: 20 20 20 20 20 20 2f 2a 20 63 6c 20 3d 20 62 69 /* cl = bi
1ca0: 74 73 2c 20 6e 65 65 64 73 20 69 74 20 66 6f 72 ts, needs it for
1cb0: 20 73 68 69 66 74 69 6e 67 20 2a 2f 0a 22 20 20 shifting */."
1cc0: 20 20 20 20 20 20 61 64 64 62 20 20 20 20 24 33 addb $3
1cd0: 32 2c 20 25 25 62 6c 5c 6e 22 20 20 20 20 20 20 2, %%bl\n"
1ce0: 20 20 20 20 20 20 20 2f 2a 20 62 69 74 73 20 2b /* bits +
1cf0: 3d 20 33 32 20 2a 2f 0a 22 20 20 20 20 20 20 20 = 32 */."
1d00: 20 73 68 6c 71 20 20 20 20 25 25 63 6c 2c 20 25 shlq %%cl, %
1d10: 25 72 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 %rax\n"."
1d20: 20 6f 72 71 20 20 20 20 20 25 25 72 61 78 2c 20 orq %%rax,
1d30: 25 25 72 64 78 5c 6e 22 20 20 20 20 20 20 20 20 %%rdx\n"
1d40: 20 20 2f 2a 20 68 6f 6c 64 20 7c 3d 20 2a 28 28 /* hold |= *((
1d50: 75 69 6e 74 20 2a 29 69 6e 29 2b 2b 20 3c 3c 20 uint *)in)++ <<
1d60: 62 69 74 73 20 2a 2f 0a 22 20 20 20 20 20 20 20 bits */."
1d70: 20 6a 6d 70 20 20 20 20 20 2e 4c 5f 67 65 74 5f jmp .L_get_
1d80: 6c 65 6e 67 74 68 5f 63 6f 64 65 5f 6f 6e 65 5f length_code_one_
1d90: 74 69 6d 65 5c 6e 22 0a 0a 22 2e 61 6c 69 67 6e time\n"..".align
1da0: 20 33 32 2c 30 78 39 30 5c 6e 22 0a 22 2e 4c 5f 32,0x90\n".".L_
1db0: 77 68 69 6c 65 5f 74 65 73 74 3a 5c 6e 22 0a 22 while_test:\n"."
1dc0: 20 20 20 20 20 20 20 20 63 6d 70 71 20 20 20 20 cmpq
1dd0: 25 25 72 64 69 2c 20 25 25 72 31 30 5c 6e 22 0a %%rdi, %%r10\n".
1de0: 22 20 20 20 20 20 20 20 20 6a 62 65 20 20 20 20 " jbe
1df0: 20 2e 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 5c 6e .L_break_loop\n
1e00: 22 0a 22 20 20 20 20 20 20 20 20 63 6d 70 71 20 "." cmpq
1e10: 20 20 20 25 25 72 73 69 2c 20 25 25 72 39 5c 6e %%rsi, %%r9\n
1e20: 22 0a 22 20 20 20 20 20 20 20 20 6a 62 65 20 20 "." jbe
1e30: 20 20 20 2e 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 .L_break_loop
1e40: 5c 6e 22 0a 0a 22 2e 4c 5f 64 6f 5f 6c 6f 6f 70 \n"..".L_do_loop
1e50: 3a 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f :\n"." mo
1e60: 76 71 20 20 20 20 25 25 72 31 32 2c 20 25 25 72 vq %%r12, %%r
1e70: 38 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 2f 8\n" /
1e80: 2a 20 72 38 20 3d 20 6c 6d 61 73 6b 20 2a 2f 0a * r8 = lmask */.
1e90: 22 20 20 20 20 20 20 20 20 63 6d 70 62 20 20 20 " cmpb
1ea0: 20 24 33 32 2c 20 25 25 62 6c 5c 6e 22 0a 22 20 $32, %%bl\n"."
1eb0: 20 20 20 20 20 20 20 6a 61 20 20 20 20 20 20 2e ja .
1ec0: 4c 5f 67 65 74 5f 6c 65 6e 67 74 68 5f 63 6f 64 L_get_length_cod
1ed0: 65 5c 6e 22 20 20 20 20 2f 2a 20 69 66 20 28 33 e\n" /* if (3
1ee0: 32 20 3c 20 62 69 74 73 29 20 2a 2f 0a 0a 22 20 2 < bits) */.."
1ef0: 20 20 20 20 20 20 20 6c 6f 64 73 6c 5c 6e 22 20 lodsl\n"
1f00: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1f10: 20 20 20 20 20 20 20 20 2f 2a 20 65 61 78 20 3d /* eax =
1f20: 20 2a 28 75 69 6e 74 20 2a 29 69 6e 2b 2b 20 2a *(uint *)in++ *
1f30: 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 62 20 /." movb
1f40: 20 20 20 25 25 62 6c 2c 20 25 25 63 6c 5c 6e 22 %%bl, %%cl\n"
1f50: 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 63 /* c
1f60: 6c 20 3d 20 62 69 74 73 2c 20 6e 65 65 64 73 20 l = bits, needs
1f70: 69 74 20 66 6f 72 20 73 68 69 66 74 69 6e 67 20 it for shifting
1f80: 2a 2f 0a 22 20 20 20 20 20 20 20 20 61 64 64 62 */." addb
1f90: 20 20 20 20 24 33 32 2c 20 25 25 62 6c 5c 6e 22 $32, %%bl\n"
1fa0: 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 /*
1fb0: 62 69 74 73 20 2b 3d 20 33 32 20 2a 2f 0a 22 20 bits += 32 */."
1fc0: 20 20 20 20 20 20 20 73 68 6c 71 20 20 20 20 25 shlq %
1fd0: 25 63 6c 2c 20 25 25 72 61 78 5c 6e 22 0a 22 20 %cl, %%rax\n"."
1fe0: 20 20 20 20 20 20 20 6f 72 71 20 20 20 20 20 25 orq %
1ff0: 25 72 61 78 2c 20 25 25 72 64 78 5c 6e 22 20 20 %rax, %%rdx\n"
2000: 20 20 20 20 20 20 20 20 2f 2a 20 68 6f 6c 64 20 /* hold
2010: 7c 3d 20 2a 28 28 75 69 6e 74 20 2a 29 69 6e 29 |= *((uint *)in)
2020: 2b 2b 20 3c 3c 20 62 69 74 73 20 2a 2f 0a 0a 22 ++ << bits */.."
2030: 2e 4c 5f 67 65 74 5f 6c 65 6e 67 74 68 5f 63 6f .L_get_length_co
2040: 64 65 3a 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 de:\n"."
2050: 61 6e 64 71 20 20 20 20 25 25 72 64 78 2c 20 25 andq %%rdx, %
2060: 25 72 38 5c 6e 22 20 20 20 20 20 20 20 20 20 20 %r8\n"
2070: 20 20 2f 2a 20 72 38 20 26 3d 20 68 6f 6c 64 20 /* r8 &= hold
2080: 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c */." movl
2090: 20 20 20 20 28 25 25 72 62 70 2c 25 25 72 38 2c (%%rbp,%%r8,
20a0: 34 29 2c 20 25 25 65 61 78 5c 6e 22 20 20 2f 2a 4), %%eax\n" /*
20b0: 20 65 61 78 20 3d 20 6c 63 6f 64 65 5b 68 6f 6c eax = lcode[hol
20c0: 64 20 26 20 6c 6d 61 73 6b 5d 20 2a 2f 0a 0a 22 d & lmask] */.."
20d0: 20 20 20 20 20 20 20 20 6d 6f 76 62 20 20 20 20 movb
20e0: 25 25 61 68 2c 20 25 25 63 6c 5c 6e 22 20 20 20 %%ah, %%cl\n"
20f0: 20 20 20 20 20 20 20 20 20 2f 2a 20 63 6c 20 3d /* cl =
2100: 20 74 68 69 73 2e 62 69 74 73 20 2a 2f 0a 22 20 this.bits */."
2110: 20 20 20 20 20 20 20 73 75 62 62 20 20 20 20 25 subb %
2120: 25 61 68 2c 20 25 25 62 6c 5c 6e 22 20 20 20 20 %ah, %%bl\n"
2130: 20 20 20 20 20 20 20 20 2f 2a 20 62 69 74 73 20 /* bits
2140: 2d 3d 20 74 68 69 73 2e 62 69 74 73 20 2a 2f 0a -= this.bits */.
2150: 22 20 20 20 20 20 20 20 20 73 68 72 71 20 20 20 " shrq
2160: 20 25 25 63 6c 2c 20 25 25 72 64 78 5c 6e 22 20 %%cl, %%rdx\n"
2170: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 68 6f 6c /* hol
2180: 64 20 3e 3e 3d 20 74 68 69 73 2e 62 69 74 73 20 d >>= this.bits
2190: 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 74 65 73 */.." tes
21a0: 74 62 20 20 20 25 25 61 6c 2c 20 25 25 61 6c 5c tb %%al, %%al\
21b0: 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 6e 7a 20 n"." jnz
21c0: 20 20 20 20 2e 4c 5f 74 65 73 74 5f 66 6f 72 5f .L_test_for_
21d0: 6c 65 6e 67 74 68 5f 62 61 73 65 5c 6e 22 20 2f length_base\n" /
21e0: 2a 20 69 66 20 28 6f 70 20 21 3d 20 30 29 20 34 * if (op != 0) 4
21f0: 35 2e 37 25 20 2a 2f 0a 0a 22 20 20 20 20 20 20 5.7% */.."
2200: 20 20 6d 6f 76 71 20 20 20 20 25 25 72 31 32 2c movq %%r12,
2210: 20 25 25 72 38 5c 6e 22 20 20 20 20 20 20 20 20 %%r8\n"
2220: 20 20 20 20 2f 2a 20 72 38 20 3d 20 6c 6d 61 73 /* r8 = lmas
2230: 6b 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 k */." sh
2240: 72 6c 20 20 20 20 24 31 36 2c 20 25 25 65 61 78 rl $16, %%eax
2250: 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 2f \n" /
2260: 2a 20 6f 75 74 70 75 74 20 74 68 69 73 2e 76 61 * output this.va
2270: 6c 20 63 68 61 72 20 2a 2f 0a 22 20 20 20 20 20 l char */."
2280: 20 20 20 73 74 6f 73 62 5c 6e 22 0a 0a 22 2e 4c stosb\n"..".L
2290: 5f 67 65 74 5f 6c 65 6e 67 74 68 5f 63 6f 64 65 _get_length_code
22a0: 5f 6f 6e 65 5f 74 69 6d 65 3a 5c 6e 22 0a 22 20 _one_time:\n"."
22b0: 20 20 20 20 20 20 20 61 6e 64 71 20 20 20 20 25 andq %
22c0: 25 72 64 78 2c 20 25 25 72 38 5c 6e 22 20 20 20 %rdx, %%r8\n"
22d0: 20 20 20 20 20 20 20 20 20 2f 2a 20 72 38 20 26 /* r8 &
22e0: 3d 20 68 6f 6c 64 20 2a 2f 0a 22 20 20 20 20 20 = hold */."
22f0: 20 20 20 6d 6f 76 6c 20 20 20 20 28 25 25 72 62 movl (%%rb
2300: 70 2c 25 25 72 38 2c 34 29 2c 20 25 25 65 61 78 p,%%r8,4), %%eax
2310: 5c 6e 22 20 2f 2a 20 65 61 78 20 3d 20 6c 63 6f \n" /* eax = lco
2320: 64 65 5b 68 6f 6c 64 20 26 20 6c 6d 61 73 6b 5d de[hold & lmask]
2330: 20 2a 2f 0a 0a 22 2e 4c 5f 64 6f 6c 65 6e 3a 5c */..".L_dolen:\
2340: 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 62 n"." movb
2350: 20 20 20 20 25 25 61 68 2c 20 25 25 63 6c 5c 6e %%ah, %%cl\n
2360: 22 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 " /*
2370: 63 6c 20 3d 20 74 68 69 73 2e 62 69 74 73 20 2a cl = this.bits *
2380: 2f 0a 22 20 20 20 20 20 20 20 20 73 75 62 62 20 /." subb
2390: 20 20 20 25 25 61 68 2c 20 25 25 62 6c 5c 6e 22 %%ah, %%bl\n"
23a0: 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 62 /* b
23b0: 69 74 73 20 2d 3d 20 74 68 69 73 2e 62 69 74 73 its -= this.bits
23c0: 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 72 */." shr
23d0: 71 20 20 20 20 25 25 63 6c 2c 20 25 25 72 64 78 q %%cl, %%rdx
23e0: 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 2f 2a \n" /*
23f0: 20 68 6f 6c 64 20 3e 3e 3d 20 74 68 69 73 2e 62 hold >>= this.b
2400: 69 74 73 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 its */.."
2410: 20 74 65 73 74 62 20 20 20 25 25 61 6c 2c 20 25 testb %%al, %
2420: 25 61 6c 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 %al\n"."
2430: 6a 6e 7a 20 20 20 20 20 2e 4c 5f 74 65 73 74 5f jnz .L_test_
2440: 66 6f 72 5f 6c 65 6e 67 74 68 5f 62 61 73 65 5c for_length_base\
2450: 6e 22 20 2f 2a 20 69 66 20 28 6f 70 20 21 3d 20 n" /* if (op !=
2460: 30 29 20 34 35 2e 37 25 20 2a 2f 0a 0a 22 20 20 0) 45.7% */.."
2470: 20 20 20 20 20 20 73 68 72 6c 20 20 20 20 24 31 shrl $1
2480: 36 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 20 6, %%eax\n"
2490: 20 20 20 20 20 20 20 2f 2a 20 6f 75 74 70 75 74 /* output
24a0: 20 74 68 69 73 2e 76 61 6c 20 63 68 61 72 20 2a this.val char *
24b0: 2f 0a 22 20 20 20 20 20 20 20 20 73 74 6f 73 62 /." stosb
24c0: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 \n"." jmp
24d0: 20 20 20 20 20 2e 4c 5f 77 68 69 6c 65 5f 74 65 .L_while_te
24e0: 73 74 5c 6e 22 0a 0a 22 2e 61 6c 69 67 6e 20 33 st\n"..".align 3
24f0: 32 2c 30 78 39 30 5c 6e 22 0a 22 2e 4c 5f 74 65 2,0x90\n".".L_te
2500: 73 74 5f 66 6f 72 5f 6c 65 6e 67 74 68 5f 62 61 st_for_length_ba
2510: 73 65 3a 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 se:\n"."
2520: 6d 6f 76 6c 20 20 20 20 25 25 65 61 78 2c 20 25 movl %%eax, %
2530: 25 72 31 34 64 5c 6e 22 20 20 20 20 20 20 20 20 %r14d\n"
2540: 20 2f 2a 20 6c 65 6e 20 3d 20 74 68 69 73 20 2a /* len = this *
2550: 2f 0a 22 20 20 20 20 20 20 20 20 73 68 72 6c 20 /." shrl
2560: 20 20 20 24 31 36 2c 20 25 25 72 31 34 64 5c 6e $16, %%r14d\n
2570: 22 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 6c " /* l
2580: 65 6e 20 3d 20 74 68 69 73 2e 76 61 6c 20 2a 2f en = this.val */
2590: 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 62 20 20 ." movb
25a0: 20 20 25 25 61 6c 2c 20 25 25 63 6c 5c 6e 22 0a %%al, %%cl\n".
25b0: 0a 22 20 20 20 20 20 20 20 20 74 65 73 74 62 20 ." testb
25c0: 20 20 24 31 36 2c 20 25 25 61 6c 5c 6e 22 0a 22 $16, %%al\n"."
25d0: 20 20 20 20 20 20 20 20 6a 7a 20 20 20 20 20 20 jz
25e0: 2e 4c 5f 74 65 73 74 5f 66 6f 72 5f 73 65 63 6f .L_test_for_seco
25f0: 6e 64 5f 6c 65 76 65 6c 5f 6c 65 6e 67 74 68 5c nd_level_length\
2600: 6e 22 20 2f 2a 20 69 66 20 28 28 6f 70 20 26 20 n" /* if ((op &
2610: 31 36 29 20 3d 3d 20 30 29 20 38 25 20 2a 2f 0a 16) == 0) 8% */.
2620: 22 20 20 20 20 20 20 20 20 61 6e 64 62 20 20 20 " andb
2630: 20 24 31 35 2c 20 25 25 63 6c 5c 6e 22 20 20 20 $15, %%cl\n"
2640: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 6f 70 20 /* op
2650: 26 3d 20 31 35 20 2a 2f 0a 22 20 20 20 20 20 20 &= 15 */."
2660: 20 20 6a 7a 20 20 20 20 20 20 2e 4c 5f 64 65 63 jz .L_dec
2670: 6f 64 65 5f 64 69 73 74 61 6e 63 65 5c 6e 22 20 ode_distance\n"
2680: 20 20 20 2f 2a 20 69 66 20 28 21 6f 70 29 20 2a /* if (!op) *
2690: 2f 0a 0a 22 2e 4c 5f 61 64 64 5f 62 69 74 73 5f /..".L_add_bits_
26a0: 74 6f 5f 6c 65 6e 3a 5c 6e 22 0a 22 20 20 20 20 to_len:\n"."
26b0: 20 20 20 20 73 75 62 62 20 20 20 20 25 25 63 6c subb %%cl
26c0: 2c 20 25 25 62 6c 5c 6e 22 0a 22 20 20 20 20 20 , %%bl\n"."
26d0: 20 20 20 78 6f 72 6c 20 20 20 20 25 25 65 61 78 xorl %%eax
26e0: 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 , %%eax\n"."
26f0: 20 20 20 20 69 6e 63 6c 20 20 20 20 25 25 65 61 incl %%ea
2700: 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 73 68 x\n"." sh
2710: 6c 6c 20 20 20 20 25 25 63 6c 2c 20 25 25 65 61 ll %%cl, %%ea
2720: 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 64 65 x\n"." de
2730: 63 6c 20 20 20 20 25 25 65 61 78 5c 6e 22 0a 22 cl %%eax\n"."
2740: 20 20 20 20 20 20 20 20 61 6e 64 6c 20 20 20 20 andl
2750: 25 25 65 64 78 2c 20 25 25 65 61 78 5c 6e 22 20 %%edx, %%eax\n"
2760: 20 20 20 20 20 20 20 20 20 2f 2a 20 65 61 78 20 /* eax
2770: 26 3d 20 68 6f 6c 64 20 2a 2f 0a 22 20 20 20 20 &= hold */."
2780: 20 20 20 20 73 68 72 71 20 20 20 20 25 25 63 6c shrq %%cl
2790: 2c 20 25 25 72 64 78 5c 6e 22 0a 22 20 20 20 20 , %%rdx\n"."
27a0: 20 20 20 20 61 64 64 6c 20 20 20 20 25 25 65 61 addl %%ea
27b0: 78 2c 20 25 25 72 31 34 64 5c 6e 22 20 20 20 20 x, %%r14d\n"
27c0: 20 20 20 20 20 2f 2a 20 6c 65 6e 20 2b 3d 20 68 /* len += h
27d0: 6f 6c 64 20 26 20 6d 61 73 6b 5b 6f 70 5d 20 2a old & mask[op] *
27e0: 2f 0a 0a 22 2e 4c 5f 64 65 63 6f 64 65 5f 64 69 /..".L_decode_di
27f0: 73 74 61 6e 63 65 3a 5c 6e 22 0a 22 20 20 20 20 stance:\n"."
2800: 20 20 20 20 6d 6f 76 71 20 20 20 20 25 25 72 31 movq %%r1
2810: 33 2c 20 25 25 72 38 5c 6e 22 20 20 20 20 20 20 3, %%r8\n"
2820: 20 20 20 20 20 2f 2a 20 72 38 20 3d 20 64 6d 61 /* r8 = dma
2830: 73 6b 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 63 sk */." c
2840: 6d 70 62 20 20 20 20 24 33 32 2c 20 25 25 62 6c mpb $32, %%bl
2850: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 61 20 \n"." ja
2860: 20 20 20 20 20 2e 4c 5f 67 65 74 5f 64 69 73 74 .L_get_dist
2870: 61 6e 63 65 5f 63 6f 64 65 5c 6e 22 20 20 2f 2a ance_code\n" /*
2880: 20 69 66 20 28 33 32 20 3c 20 62 69 74 73 29 20 if (32 < bits)
2890: 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 6c 6f 64 */.." lod
28a0: 73 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 sl\n"
28b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a /*
28c0: 20 65 61 78 20 3d 20 2a 28 75 69 6e 74 20 2a 29 eax = *(uint *)
28d0: 69 6e 2b 2b 20 2a 2f 0a 22 20 20 20 20 20 20 20 in++ */."
28e0: 20 6d 6f 76 62 20 20 20 20 25 25 62 6c 2c 20 25 movb %%bl, %
28f0: 25 63 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 %cl\n"
2900: 20 20 2f 2a 20 63 6c 20 3d 20 62 69 74 73 2c 20 /* cl = bits,
2910: 6e 65 65 64 73 20 69 74 20 66 6f 72 20 73 68 69 needs it for shi
2920: 66 74 69 6e 67 20 2a 2f 0a 22 20 20 20 20 20 20 fting */."
2930: 20 20 61 64 64 62 20 20 20 20 24 33 32 2c 20 25 addb $32, %
2940: 25 62 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 %bl\n"
2950: 20 20 20 2f 2a 20 62 69 74 73 20 2b 3d 20 33 32 /* bits += 32
2960: 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 6c */." shl
2970: 71 20 20 20 20 25 25 63 6c 2c 20 25 25 72 61 78 q %%cl, %%rax
2980: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6f 72 71 \n"." orq
2990: 20 20 20 20 20 25 25 72 61 78 2c 20 25 25 72 64 %%rax, %%rd
29a0: 78 5c 6e 22 20 20 20 20 20 20 20 20 20 20 2f 2a x\n" /*
29b0: 20 68 6f 6c 64 20 7c 3d 20 2a 28 28 75 69 6e 74 hold |= *((uint
29c0: 20 2a 29 69 6e 29 2b 2b 20 3c 3c 20 62 69 74 73 *)in)++ << bits
29d0: 20 2a 2f 0a 0a 22 2e 4c 5f 67 65 74 5f 64 69 73 */..".L_get_dis
29e0: 74 61 6e 63 65 5f 63 6f 64 65 3a 5c 6e 22 0a 22 tance_code:\n"."
29f0: 20 20 20 20 20 20 20 20 61 6e 64 71 20 20 20 20 andq
2a00: 25 25 72 64 78 2c 20 25 25 72 38 5c 6e 22 20 20 %%rdx, %%r8\n"
2a10: 20 20 20 20 20 20 20 20 20 2f 2a 20 72 38 20 26 /* r8 &
2a20: 3d 20 68 6f 6c 64 20 2a 2f 0a 22 20 20 20 20 20 = hold */."
2a30: 20 20 20 6d 6f 76 6c 20 20 20 20 28 25 25 72 31 movl (%%r1
2a40: 31 2c 25 25 72 38 2c 34 29 2c 20 25 25 65 61 78 1,%%r8,4), %%eax
2a50: 5c 6e 22 20 2f 2a 20 65 61 78 20 3d 20 64 63 6f \n" /* eax = dco
2a60: 64 65 5b 68 6f 6c 64 20 26 20 64 6d 61 73 6b 5d de[hold & dmask]
2a70: 20 2a 2f 0a 0a 22 2e 4c 5f 64 6f 64 69 73 74 3a */..".L_dodist:
2a80: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 \n"." mov
2a90: 6c 20 20 20 20 25 25 65 61 78 2c 20 25 25 72 31 l %%eax, %%r1
2aa0: 35 64 5c 6e 22 20 20 20 20 20 20 20 20 20 2f 2a 5d\n" /*
2ab0: 20 64 69 73 74 20 3d 20 74 68 69 73 20 2a 2f 0a dist = this */.
2ac0: 22 20 20 20 20 20 20 20 20 73 68 72 6c 20 20 20 " shrl
2ad0: 20 24 31 36 2c 20 25 25 72 31 35 64 5c 6e 22 20 $16, %%r15d\n"
2ae0: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 64 69 73 /* dis
2af0: 74 20 3d 20 74 68 69 73 2e 76 61 6c 20 2a 2f 0a t = this.val */.
2b00: 22 20 20 20 20 20 20 20 20 6d 6f 76 62 20 20 20 " movb
2b10: 20 25 25 61 68 2c 20 25 25 63 6c 5c 6e 22 0a 22 %%ah, %%cl\n"."
2b20: 20 20 20 20 20 20 20 20 73 75 62 62 20 20 20 20 subb
2b30: 25 25 61 68 2c 20 25 25 62 6c 5c 6e 22 20 20 20 %%ah, %%bl\n"
2b40: 20 20 20 20 20 20 20 20 20 2f 2a 20 62 69 74 73 /* bits
2b50: 20 2d 3d 20 74 68 69 73 2e 62 69 74 73 20 2a 2f -= this.bits */
2b60: 0a 22 20 20 20 20 20 20 20 20 73 68 72 71 20 20 ." shrq
2b70: 20 20 25 25 63 6c 2c 20 25 25 72 64 78 5c 6e 22 %%cl, %%rdx\n"
2b80: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 68 6f /* ho
2b90: 6c 64 20 3e 3e 3d 20 74 68 69 73 2e 62 69 74 73 ld >>= this.bits
2ba0: 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 */." mov
2bb0: 62 20 20 20 20 25 25 61 6c 2c 20 25 25 63 6c 5c b %%al, %%cl\
2bc0: 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a n" /*
2bd0: 20 63 6c 20 3d 20 74 68 69 73 2e 6f 70 20 2a 2f cl = this.op */
2be0: 0a 0a 22 20 20 20 20 20 20 20 20 74 65 73 74 62 .." testb
2bf0: 20 20 20 24 31 36 2c 20 25 25 61 6c 5c 6e 22 20 $16, %%al\n"
2c00: 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 69 /* i
2c10: 66 20 28 28 6f 70 20 26 20 31 36 29 20 3d 3d 20 f ((op & 16) ==
2c20: 30 29 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6a 0) */." j
2c30: 7a 20 20 20 20 20 20 2e 4c 5f 74 65 73 74 5f 66 z .L_test_f
2c40: 6f 72 5f 73 65 63 6f 6e 64 5f 6c 65 76 65 6c 5f or_second_level_
2c50: 64 69 73 74 5c 6e 22 0a 22 20 20 20 20 20 20 20 dist\n"."
2c60: 20 61 6e 64 62 20 20 20 20 24 31 35 2c 20 25 25 andb $15, %%
2c70: 63 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 cl\n"
2c80: 20 20 2f 2a 20 6f 70 20 26 3d 20 31 35 20 2a 2f /* op &= 15 */
2c90: 0a 22 20 20 20 20 20 20 20 20 6a 7a 20 20 20 20 ." jz
2ca0: 20 20 2e 4c 5f 63 68 65 63 6b 5f 64 69 73 74 5f .L_check_dist_
2cb0: 6f 6e 65 5c 6e 22 0a 0a 22 2e 4c 5f 61 64 64 5f one\n"..".L_add_
2cc0: 62 69 74 73 5f 74 6f 5f 64 69 73 74 3a 5c 6e 22 bits_to_dist:\n"
2cd0: 0a 22 20 20 20 20 20 20 20 20 73 75 62 62 20 20 ." subb
2ce0: 20 20 25 25 63 6c 2c 20 25 25 62 6c 5c 6e 22 0a %%cl, %%bl\n".
2cf0: 22 20 20 20 20 20 20 20 20 78 6f 72 6c 20 20 20 " xorl
2d00: 20 25 25 65 61 78 2c 20 25 25 65 61 78 5c 6e 22 %%eax, %%eax\n"
2d10: 0a 22 20 20 20 20 20 20 20 20 69 6e 63 6c 20 20 ." incl
2d20: 20 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 %%eax\n"."
2d30: 20 20 20 20 73 68 6c 6c 20 20 20 20 25 25 63 6c shll %%cl
2d40: 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 , %%eax\n"."
2d50: 20 20 20 20 64 65 63 6c 20 20 20 20 25 25 65 61 decl %%ea
2d60: 78 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 x\n"
2d70: 20 20 20 20 20 2f 2a 20 28 31 20 3c 3c 20 6f 70 /* (1 << op
2d80: 29 20 2d 20 31 20 2a 2f 0a 22 20 20 20 20 20 20 ) - 1 */."
2d90: 20 20 61 6e 64 6c 20 20 20 20 25 25 65 64 78 2c andl %%edx,
2da0: 20 25 25 65 61 78 5c 6e 22 20 20 20 20 20 20 20 %%eax\n"
2db0: 20 20 20 2f 2a 20 65 61 78 20 26 3d 20 68 6f 6c /* eax &= hol
2dc0: 64 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 d */." sh
2dd0: 72 71 20 20 20 20 25 25 63 6c 2c 20 25 25 72 64 rq %%cl, %%rd
2de0: 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 61 64 x\n"." ad
2df0: 64 6c 20 20 20 20 25 25 65 61 78 2c 20 25 25 72 dl %%eax, %%r
2e00: 31 35 64 5c 6e 22 20 20 20 20 20 20 20 20 20 2f 15d\n" /
2e10: 2a 20 64 69 73 74 20 2b 3d 20 68 6f 6c 64 20 26 * dist += hold &
2e20: 20 28 28 31 20 3c 3c 20 6f 70 29 20 2d 20 31 29 ((1 << op) - 1)
2e30: 20 2a 2f 0a 0a 22 2e 4c 5f 63 68 65 63 6b 5f 77 */..".L_check_w
2e40: 69 6e 64 6f 77 3a 5c 6e 22 0a 22 20 20 20 20 20 indow:\n"."
2e50: 20 20 20 6d 6f 76 71 20 20 20 20 25 25 72 73 69 movq %%rsi
2e60: 2c 20 25 25 72 38 5c 6e 22 20 20 20 20 20 20 20 , %%r8\n"
2e70: 20 20 20 20 2f 2a 20 73 61 76 65 20 69 6e 20 73 /* save in s
2e80: 6f 20 66 72 6f 6d 20 63 61 6e 20 75 73 65 20 69 o from can use i
2e90: 74 27 73 20 72 65 67 20 2a 2f 0a 22 20 20 20 20 t's reg */."
2ea0: 20 20 20 20 6d 6f 76 71 20 20 20 20 25 25 72 64 movq %%rd
2eb0: 69 2c 20 25 25 72 61 78 5c 6e 22 0a 22 20 20 20 i, %%rax\n"."
2ec0: 20 20 20 20 20 73 75 62 71 20 20 20 20 34 30 28 subq 40(
2ed0: 25 25 72 73 70 29 2c 20 25 25 72 61 78 5c 6e 22 %%rsp), %%rax\n"
2ee0: 20 20 20 20 20 20 2f 2a 20 6e 62 79 74 65 73 20 /* nbytes
2ef0: 3d 20 6f 75 74 20 2d 20 62 65 67 20 2a 2f 0a 0a = out - beg */..
2f00: 22 20 20 20 20 20 20 20 20 63 6d 70 6c 20 20 20 " cmpl
2f10: 20 25 25 72 31 35 64 2c 20 25 25 65 61 78 5c 6e %%r15d, %%eax\n
2f20: 22 0a 22 20 20 20 20 20 20 20 20 6a 62 20 20 20 "." jb
2f30: 20 20 20 2e 4c 5f 63 6c 69 70 5f 77 69 6e 64 6f .L_clip_windo
2f40: 77 5c 6e 22 20 20 20 20 20 20 20 20 2f 2a 20 69 w\n" /* i
2f50: 66 20 28 64 69 73 74 20 3e 20 6e 62 79 74 65 73 f (dist > nbytes
2f60: 29 20 34 2e 32 25 20 2a 2f 0a 0a 22 20 20 20 20 ) 4.2% */.."
2f70: 20 20 20 20 6d 6f 76 6c 20 20 20 20 25 25 72 31 movl %%r1
2f80: 34 64 2c 20 25 25 65 63 78 5c 6e 22 20 20 20 20 4d, %%ecx\n"
2f90: 20 20 20 20 20 2f 2a 20 65 63 78 20 3d 20 6c 65 /* ecx = le
2fa0: 6e 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f n */." mo
2fb0: 76 71 20 20 20 20 25 25 72 64 69 2c 20 25 25 72 vq %%rdi, %%r
2fc0: 73 69 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 73 si\n"." s
2fd0: 75 62 71 20 20 20 20 25 25 72 31 35 2c 20 25 25 ubq %%r15, %%
2fe0: 72 73 69 5c 6e 22 20 20 20 20 20 20 20 20 20 20 rsi\n"
2ff0: 2f 2a 20 66 72 6f 6d 20 3d 20 6f 75 74 20 2d 20 /* from = out -
3000: 64 69 73 74 20 2a 2f 0a 0a 22 20 20 20 20 20 20 dist */.."
3010: 20 20 73 61 72 6c 20 20 20 20 25 25 65 63 78 5c sarl %%ecx\
3020: 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 6e 63 20 n"." jnc
3030: 20 20 20 20 2e 4c 5f 63 6f 70 79 5f 74 77 6f 5c .L_copy_two\
3040: 6e 22 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 n" /*
3050: 69 66 20 6c 65 6e 20 25 20 32 20 3d 3d 20 30 20 if len % 2 == 0
3060: 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 72 65 70 */.." rep
3070: 20 20 20 20 20 6d 6f 76 73 77 5c 6e 22 0a 22 20 movsw\n"."
3080: 20 20 20 20 20 20 20 6d 6f 76 62 20 20 20 20 28 movb (
3090: 25 25 72 73 69 29 2c 20 25 25 61 6c 5c 6e 22 0a %%rsi), %%al\n".
30a0: 22 20 20 20 20 20 20 20 20 6d 6f 76 62 20 20 20 " movb
30b0: 20 25 25 61 6c 2c 20 28 25 25 72 64 69 29 5c 6e %%al, (%%rdi)\n
30c0: 22 0a 22 20 20 20 20 20 20 20 20 69 6e 63 71 20 "." incq
30d0: 20 20 20 25 25 72 64 69 5c 6e 22 0a 0a 22 20 20 %%rdi\n".."
30e0: 20 20 20 20 20 20 6d 6f 76 71 20 20 20 20 25 25 movq %%
30f0: 72 38 2c 20 25 25 72 73 69 5c 6e 22 20 20 20 20 r8, %%rsi\n"
3100: 20 20 20 20 20 20 20 2f 2a 20 6d 6f 76 65 20 69 /* move i
3110: 6e 20 62 61 63 6b 20 74 6f 20 25 72 73 69 2c 20 n back to %rsi,
3120: 74 6f 73 73 20 66 72 6f 6d 20 2a 2f 0a 22 20 20 toss from */."
3130: 20 20 20 20 20 20 6a 6d 70 20 20 20 20 20 2e 4c jmp .L
3140: 5f 77 68 69 6c 65 5f 74 65 73 74 5c 6e 22 0a 0a _while_test\n"..
3150: 22 2e 4c 5f 63 6f 70 79 5f 74 77 6f 3a 5c 6e 22 ".L_copy_two:\n"
3160: 0a 22 20 20 20 20 20 20 20 20 72 65 70 20 20 20 ." rep
3170: 20 20 6d 6f 76 73 77 5c 6e 22 0a 22 20 20 20 20 movsw\n"."
3180: 20 20 20 20 6d 6f 76 71 20 20 20 20 25 25 72 38 movq %%r8
3190: 2c 20 25 25 72 73 69 5c 6e 22 20 20 20 20 20 20 , %%rsi\n"
31a0: 20 20 20 20 20 2f 2a 20 6d 6f 76 65 20 69 6e 20 /* move in
31b0: 62 61 63 6b 20 74 6f 20 25 72 73 69 2c 20 74 6f back to %rsi, to
31c0: 73 73 20 66 72 6f 6d 20 2a 2f 0a 22 20 20 20 20 ss from */."
31d0: 20 20 20 20 6a 6d 70 20 20 20 20 20 2e 4c 5f 77 jmp .L_w
31e0: 68 69 6c 65 5f 74 65 73 74 5c 6e 22 0a 0a 22 2e hile_test\n"..".
31f0: 61 6c 69 67 6e 20 33 32 2c 30 78 39 30 5c 6e 22 align 32,0x90\n"
3200: 0a 22 2e 4c 5f 63 68 65 63 6b 5f 64 69 73 74 5f .".L_check_dist_
3210: 6f 6e 65 3a 5c 6e 22 0a 22 20 20 20 20 20 20 20 one:\n"."
3220: 20 63 6d 70 6c 20 20 20 20 24 31 2c 20 25 25 72 cmpl $1, %%r
3230: 31 35 64 5c 6e 22 20 20 20 20 20 20 20 20 20 20 15d\n"
3240: 20 20 2f 2a 20 69 66 20 64 69 73 74 20 31 2c 20 /* if dist 1,
3250: 69 73 20 61 20 6d 65 6d 73 65 74 20 2a 2f 0a 22 is a memset */."
3260: 20 20 20 20 20 20 20 20 6a 6e 65 20 20 20 20 20 jne
3270: 2e 4c 5f 63 68 65 63 6b 5f 77 69 6e 64 6f 77 5c .L_check_window\
3280: 6e 22 0a 22 20 20 20 20 20 20 20 20 63 6d 70 71 n"." cmpq
3290: 20 20 20 20 25 25 72 64 69 2c 20 34 30 28 25 25 %%rdi, 40(%%
32a0: 72 73 70 29 5c 6e 22 20 20 20 20 20 20 2f 2a 20 rsp)\n" /*
32b0: 69 66 20 6f 75 74 20 3d 3d 20 62 65 67 2c 20 6f if out == beg, o
32c0: 75 74 73 69 64 65 20 77 69 6e 64 6f 77 20 2a 2f utside window */
32d0: 0a 22 20 20 20 20 20 20 20 20 6a 65 20 20 20 20 ." je
32e0: 20 20 2e 4c 5f 63 68 65 63 6b 5f 77 69 6e 64 6f .L_check_windo
32f0: 77 5c 6e 22 0a 0a 22 20 20 20 20 20 20 20 20 6d w\n".." m
3300: 6f 76 6c 20 20 20 20 25 25 72 31 34 64 2c 20 25 ovl %%r14d, %
3310: 25 65 63 78 5c 6e 22 20 20 20 20 20 20 20 20 20 %ecx\n"
3320: 2f 2a 20 65 63 78 20 3d 20 6c 65 6e 20 2a 2f 0a /* ecx = len */.
3330: 22 20 20 20 20 20 20 20 20 6d 6f 76 62 20 20 20 " movb
3340: 20 2d 31 28 25 25 72 64 69 29 2c 20 25 25 61 6c -1(%%rdi), %%al
3350: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 \n"." mov
3360: 62 20 20 20 20 25 25 61 6c 2c 20 25 25 61 68 5c b %%al, %%ah\
3370: 6e 22 0a 0a 22 20 20 20 20 20 20 20 20 73 61 72 n".." sar
3380: 6c 20 20 20 20 25 25 65 63 78 5c 6e 22 0a 22 20 l %%ecx\n"."
3390: 20 20 20 20 20 20 20 6a 6e 63 20 20 20 20 20 2e jnc .
33a0: 4c 5f 73 65 74 5f 74 77 6f 5c 6e 22 0a 22 20 20 L_set_two\n"."
33b0: 20 20 20 20 20 20 6d 6f 76 62 20 20 20 20 25 25 movb %%
33c0: 61 6c 2c 20 28 25 25 72 64 69 29 5c 6e 22 0a 22 al, (%%rdi)\n"."
33d0: 20 20 20 20 20 20 20 20 69 6e 63 71 20 20 20 20 incq
33e0: 25 25 72 64 69 5c 6e 22 0a 0a 22 2e 4c 5f 73 65 %%rdi\n"..".L_se
33f0: 74 5f 74 77 6f 3a 5c 6e 22 0a 22 20 20 20 20 20 t_two:\n"."
3400: 20 20 20 72 65 70 20 20 20 20 20 73 74 6f 73 77 rep stosw
3410: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 \n"." jmp
3420: 20 20 20 20 20 2e 4c 5f 77 68 69 6c 65 5f 74 65 .L_while_te
3430: 73 74 5c 6e 22 0a 0a 22 2e 61 6c 69 67 6e 20 33 st\n"..".align 3
3440: 32 2c 30 78 39 30 5c 6e 22 0a 22 2e 4c 5f 74 65 2,0x90\n".".L_te
3450: 73 74 5f 66 6f 72 5f 73 65 63 6f 6e 64 5f 6c 65 st_for_second_le
3460: 76 65 6c 5f 6c 65 6e 67 74 68 3a 5c 6e 22 0a 22 vel_length:\n"."
3470: 20 20 20 20 20 20 20 20 74 65 73 74 62 20 20 20 testb
3480: 24 36 34 2c 20 25 25 61 6c 5c 6e 22 0a 22 20 20 $64, %%al\n"."
3490: 20 20 20 20 20 20 6a 6e 7a 20 20 20 20 20 2e 4c jnz .L
34a0: 5f 74 65 73 74 5f 66 6f 72 5f 65 6e 64 5f 6f 66 _test_for_end_of
34b0: 5f 62 6c 6f 63 6b 5c 6e 22 20 2f 2a 20 69 66 20 _block\n" /* if
34c0: 28 28 6f 70 20 26 20 36 34 29 20 21 3d 20 30 29 ((op & 64) != 0)
34d0: 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 78 6f */.." xo
34e0: 72 6c 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 rl %%eax, %%e
34f0: 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 69 ax\n"." i
3500: 6e 63 6c 20 20 20 20 25 25 65 61 78 5c 6e 22 0a ncl %%eax\n".
3510: 22 20 20 20 20 20 20 20 20 73 68 6c 6c 20 20 20 " shll
3520: 20 25 25 63 6c 2c 20 25 25 65 61 78 5c 6e 22 0a %%cl, %%eax\n".
3530: 22 20 20 20 20 20 20 20 20 64 65 63 6c 20 20 20 " decl
3540: 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 20 %%eax\n"."
3550: 20 20 20 61 6e 64 6c 20 20 20 20 25 25 65 64 78 andl %%edx
3560: 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 20 20 , %%eax\n"
3570: 20 20 20 2f 2a 20 65 61 78 20 26 3d 20 68 6f 6c /* eax &= hol
3580: 64 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 61 64 d */." ad
3590: 64 6c 20 20 20 20 25 25 72 31 34 64 2c 20 25 25 dl %%r14d, %%
35a0: 65 61 78 5c 6e 22 20 20 20 20 20 20 20 20 2f 2a eax\n" /*
35b0: 20 65 61 78 20 2b 3d 20 6c 65 6e 20 2a 2f 0a 22 eax += len */."
35c0: 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 movl
35d0: 28 25 25 72 62 70 2c 25 25 72 61 78 2c 34 29 2c (%%rbp,%%rax,4),
35e0: 20 25 25 65 61 78 5c 6e 22 20 2f 2a 20 65 61 78 %%eax\n" /* eax
35f0: 20 3d 20 6c 63 6f 64 65 5b 76 61 6c 2b 28 68 6f = lcode[val+(ho
3600: 6c 64 26 6d 61 73 6b 5b 6f 70 5d 29 5d 2a 2f 0a ld&mask[op])]*/.
3610: 22 20 20 20 20 20 20 20 20 6a 6d 70 20 20 20 20 " jmp
3620: 20 2e 4c 5f 64 6f 6c 65 6e 5c 6e 22 0a 0a 22 2e .L_dolen\n"..".
3630: 61 6c 69 67 6e 20 33 32 2c 30 78 39 30 5c 6e 22 align 32,0x90\n"
3640: 0a 22 2e 4c 5f 74 65 73 74 5f 66 6f 72 5f 73 65 .".L_test_for_se
3650: 63 6f 6e 64 5f 6c 65 76 65 6c 5f 64 69 73 74 3a cond_level_dist:
3660: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 74 65 73 \n"." tes
3670: 74 62 20 20 20 24 36 34 2c 20 25 25 61 6c 5c 6e tb $64, %%al\n
3680: 22 0a 22 20 20 20 20 20 20 20 20 6a 6e 7a 20 20 "." jnz
3690: 20 20 20 2e 4c 5f 69 6e 76 61 6c 69 64 5f 64 69 .L_invalid_di
36a0: 73 74 61 6e 63 65 5f 63 6f 64 65 5c 6e 22 20 2f stance_code\n" /
36b0: 2a 20 69 66 20 28 28 6f 70 20 26 20 36 34 29 20 * if ((op & 64)
36c0: 21 3d 20 30 29 20 2a 2f 0a 0a 22 20 20 20 20 20 != 0) */.."
36d0: 20 20 20 78 6f 72 6c 20 20 20 20 25 25 65 61 78 xorl %%eax
36e0: 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 , %%eax\n"."
36f0: 20 20 20 20 69 6e 63 6c 20 20 20 20 25 25 65 61 incl %%ea
3700: 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 73 68 x\n"." sh
3710: 6c 6c 20 20 20 20 25 25 63 6c 2c 20 25 25 65 61 ll %%cl, %%ea
3720: 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 64 65 x\n"." de
3730: 63 6c 20 20 20 20 25 25 65 61 78 5c 6e 22 0a 22 cl %%eax\n"."
3740: 20 20 20 20 20 20 20 20 61 6e 64 6c 20 20 20 20 andl
3750: 25 25 65 64 78 2c 20 25 25 65 61 78 5c 6e 22 20 %%edx, %%eax\n"
3760: 20 20 20 20 20 20 20 20 2f 2a 20 65 61 78 20 26 /* eax &
3770: 3d 20 68 6f 6c 64 20 2a 2f 0a 22 20 20 20 20 20 = hold */."
3780: 20 20 20 61 64 64 6c 20 20 20 20 25 25 72 31 35 addl %%r15
3790: 64 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 20 d, %%eax\n"
37a0: 20 20 20 2f 2a 20 65 61 78 20 2b 3d 20 64 69 73 /* eax += dis
37b0: 74 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f t */." mo
37c0: 76 6c 20 20 20 20 28 25 25 72 31 31 2c 25 25 72 vl (%%r11,%%r
37d0: 61 78 2c 34 29 2c 20 25 25 65 61 78 5c 6e 22 20 ax,4), %%eax\n"
37e0: 2f 2a 20 65 61 78 20 3d 20 64 63 6f 64 65 5b 76 /* eax = dcode[v
37f0: 61 6c 2b 28 68 6f 6c 64 26 6d 61 73 6b 5b 6f 70 al+(hold&mask[op
3800: 5d 29 5d 2a 2f 0a 22 20 20 20 20 20 20 20 20 6a ])]*/." j
3810: 6d 70 20 20 20 20 20 2e 4c 5f 64 6f 64 69 73 74 mp .L_dodist
3820: 5c 6e 22 0a 0a 22 2e 61 6c 69 67 6e 20 33 32 2c \n"..".align 32,
3830: 30 78 39 30 5c 6e 22 0a 22 2e 4c 5f 63 6c 69 70 0x90\n".".L_clip
3840: 5f 77 69 6e 64 6f 77 3a 5c 6e 22 0a 22 20 20 20 _window:\n"."
3850: 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 25 25 65 movl %%e
3860: 61 78 2c 20 25 25 65 63 78 5c 6e 22 20 20 20 20 ax, %%ecx\n"
3870: 20 20 20 20 20 2f 2a 20 65 63 78 20 3d 20 6e 62 /* ecx = nb
3880: 79 74 65 73 20 2a 2f 0a 22 20 20 20 20 20 20 20 ytes */."
3890: 20 6d 6f 76 6c 20 20 20 20 39 32 28 25 25 72 73 movl 92(%%rs
38a0: 70 29 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 p), %%eax\n"
38b0: 20 2f 2a 20 65 61 78 20 3d 20 77 73 69 7a 65 2c /* eax = wsize,
38c0: 20 70 72 65 70 61 72 65 20 66 6f 72 20 64 69 73 prepare for dis
38d0: 74 20 63 6d 70 20 2a 2f 0a 22 20 20 20 20 20 20 t cmp */."
38e0: 20 20 6e 65 67 6c 20 20 20 20 25 25 65 63 78 5c negl %%ecx\
38f0: 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 n"
3900: 20 20 2f 2a 20 6e 62 79 74 65 73 20 3d 20 2d 6e /* nbytes = -n
3910: 62 79 74 65 73 20 2a 2f 0a 0a 22 20 20 20 20 20 bytes */.."
3920: 20 20 20 63 6d 70 6c 20 20 20 20 25 25 72 31 35 cmpl %%r15
3930: 64 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 d, %%eax\n"."
3940: 20 20 20 20 20 6a 62 20 20 20 20 20 20 2e 4c 5f jb .L_
3950: 69 6e 76 61 6c 69 64 5f 64 69 73 74 61 6e 63 65 invalid_distance
3960: 5f 74 6f 6f 5f 66 61 72 5c 6e 22 20 2f 2a 20 69 _too_far\n" /* i
3970: 66 20 28 64 69 73 74 20 3e 20 77 73 69 7a 65 29 f (dist > wsize)
3980: 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 61 64 */.." ad
3990: 64 6c 20 20 20 20 25 25 72 31 35 64 2c 20 25 25 dl %%r15d, %%
39a0: 65 63 78 5c 6e 22 20 20 20 20 20 20 20 20 20 2f ecx\n" /
39b0: 2a 20 6e 62 79 74 65 73 20 3d 20 64 69 73 74 20 * nbytes = dist
39c0: 2d 20 6e 62 79 74 65 73 20 2a 2f 0a 22 20 20 20 - nbytes */."
39d0: 20 20 20 20 20 63 6d 70 6c 20 20 20 20 24 30 2c cmpl $0,
39e0: 20 39 36 28 25 25 72 73 70 29 5c 6e 22 0a 22 20 96(%%rsp)\n"."
39f0: 20 20 20 20 20 20 20 6a 6e 65 20 20 20 20 20 2e jne .
3a00: 4c 5f 77 72 61 70 5f 61 72 6f 75 6e 64 5f 77 69 L_wrap_around_wi
3a10: 6e 64 6f 77 5c 6e 22 20 2f 2a 20 69 66 20 28 77 ndow\n" /* if (w
3a20: 72 69 74 65 20 21 3d 20 30 29 20 2a 2f 0a 0a 22 rite != 0) */.."
3a30: 20 20 20 20 20 20 20 20 6d 6f 76 71 20 20 20 20 movq
3a40: 35 36 28 25 25 72 73 70 29 2c 20 25 25 72 73 69 56(%%rsp), %%rsi
3a50: 5c 6e 22 20 20 20 20 20 2f 2a 20 66 72 6f 6d 20 \n" /* from
3a60: 20 3d 20 77 69 6e 64 6f 77 20 2a 2f 0a 22 20 20 = window */."
3a70: 20 20 20 20 20 20 73 75 62 6c 20 20 20 20 25 25 subl %%
3a80: 65 63 78 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 ecx, %%eax\n"
3a90: 20 20 20 20 20 20 2f 2a 20 65 61 78 20 20 2d 3d /* eax -=
3aa0: 20 6e 62 79 74 65 73 20 2a 2f 0a 22 20 20 20 20 nbytes */."
3ab0: 20 20 20 20 61 64 64 71 20 20 20 20 25 25 72 61 addq %%ra
3ac0: 78 2c 20 25 25 72 73 69 5c 6e 22 20 20 20 20 20 x, %%rsi\n"
3ad0: 20 20 20 20 2f 2a 20 66 72 6f 6d 20 2b 3d 20 77 /* from += w
3ae0: 73 69 7a 65 20 2d 20 6e 62 79 74 65 73 20 2a 2f size - nbytes */
3af0: 0a 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 .." movl
3b00: 20 20 20 25 25 72 31 34 64 2c 20 25 25 65 61 78 %%r14d, %%eax
3b10: 5c 6e 22 20 20 20 20 20 20 20 20 2f 2a 20 65 61 \n" /* ea
3b20: 78 20 3d 20 6c 65 6e 20 2a 2f 0a 22 20 20 20 20 x = len */."
3b30: 20 20 20 20 63 6d 70 6c 20 20 20 20 25 25 65 63 cmpl %%ec
3b40: 78 2c 20 25 25 72 31 34 64 5c 6e 22 0a 22 20 20 x, %%r14d\n"."
3b50: 20 20 20 20 20 20 6a 62 65 20 20 20 20 20 2e 4c jbe .L
3b60: 5f 64 6f 5f 63 6f 70 79 5c 6e 22 20 20 20 20 20 _do_copy\n"
3b70: 20 20 20 20 20 20 2f 2a 20 69 66 20 28 6e 62 79 /* if (nby
3b80: 74 65 73 20 3e 3d 20 6c 65 6e 29 20 2a 2f 0a 0a tes >= len) */..
3b90: 22 20 20 20 20 20 20 20 20 73 75 62 6c 20 20 20 " subl
3ba0: 20 25 25 65 63 78 2c 20 25 25 65 61 78 5c 6e 22 %%ecx, %%eax\n"
3bb0: 20 20 20 20 20 20 20 20 20 2f 2a 20 65 61 78 20 /* eax
3bc0: 2d 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 22 20 20 -= nbytes */."
3bd0: 20 20 20 20 20 20 72 65 70 20 20 20 20 20 6d 6f rep mo
3be0: 76 73 62 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 vsb\n"."
3bf0: 6d 6f 76 71 20 20 20 20 25 25 72 64 69 2c 20 25 movq %%rdi, %
3c00: 25 72 73 69 5c 6e 22 0a 22 20 20 20 20 20 20 20 %rsi\n"."
3c10: 20 73 75 62 71 20 20 20 20 25 25 72 31 35 2c 20 subq %%r15,
3c20: 25 25 72 73 69 5c 6e 22 20 20 20 20 20 20 20 20 %%rsi\n"
3c30: 20 2f 2a 20 66 72 6f 6d 20 3d 20 26 6f 75 74 5b /* from = &out[
3c40: 20 2d 64 69 73 74 20 5d 20 2a 2f 0a 22 20 20 20 -dist ] */."
3c50: 20 20 20 20 20 6a 6d 70 20 20 20 20 20 2e 4c 5f jmp .L_
3c60: 64 6f 5f 63 6f 70 79 5c 6e 22 0a 0a 22 2e 61 6c do_copy\n"..".al
3c70: 69 67 6e 20 33 32 2c 30 78 39 30 5c 6e 22 0a 22 ign 32,0x90\n"."
3c80: 2e 4c 5f 77 72 61 70 5f 61 72 6f 75 6e 64 5f 77 .L_wrap_around_w
3c90: 69 6e 64 6f 77 3a 5c 6e 22 0a 22 20 20 20 20 20 indow:\n"."
3ca0: 20 20 20 6d 6f 76 6c 20 20 20 20 39 36 28 25 25 movl 96(%%
3cb0: 72 73 70 29 2c 20 25 25 65 61 78 5c 6e 22 20 20 rsp), %%eax\n"
3cc0: 20 20 20 2f 2a 20 65 61 78 20 3d 20 77 72 69 74 /* eax = writ
3cd0: 65 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 63 6d e */." cm
3ce0: 70 6c 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 pl %%eax, %%e
3cf0: 63 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a cx\n"." j
3d00: 62 65 20 20 20 20 20 2e 4c 5f 63 6f 6e 74 69 67 be .L_contig
3d10: 75 6f 75 73 5f 69 6e 5f 77 69 6e 64 6f 77 5c 6e uous_in_window\n
3d20: 22 20 2f 2a 20 69 66 20 28 77 72 69 74 65 20 3e " /* if (write >
3d30: 3d 20 6e 62 79 74 65 73 29 20 2a 2f 0a 0a 22 20 = nbytes) */.."
3d40: 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 39 movl 9
3d50: 32 28 25 25 72 73 70 29 2c 20 25 25 65 73 69 5c 2(%%rsp), %%esi\
3d60: 6e 22 20 20 20 20 20 2f 2a 20 66 72 6f 6d 20 20 n" /* from
3d70: 3d 20 77 73 69 7a 65 20 2a 2f 0a 22 20 20 20 20 = wsize */."
3d80: 20 20 20 20 61 64 64 71 20 20 20 20 35 36 28 25 addq 56(%
3d90: 25 72 73 70 29 2c 20 25 25 72 73 69 5c 6e 22 20 %rsp), %%rsi\n"
3da0: 20 20 20 20 2f 2a 20 66 72 6f 6d 20 2b 3d 20 77 /* from += w
3db0: 69 6e 64 6f 77 20 2a 2f 0a 22 20 20 20 20 20 20 indow */."
3dc0: 20 20 61 64 64 71 20 20 20 20 25 25 72 61 78 2c addq %%rax,
3dd0: 20 25 25 72 73 69 5c 6e 22 20 20 20 20 20 20 20 %%rsi\n"
3de0: 20 20 2f 2a 20 66 72 6f 6d 20 2b 3d 20 77 72 69 /* from += wri
3df0: 74 65 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 te */." s
3e00: 75 62 71 20 20 20 20 25 25 72 63 78 2c 20 25 25 ubq %%rcx, %%
3e10: 72 73 69 5c 6e 22 20 20 20 20 20 20 20 20 20 2f rsi\n" /
3e20: 2a 20 66 72 6f 6d 20 2d 3d 20 6e 62 79 74 65 73 * from -= nbytes
3e30: 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 75 62 */." sub
3e40: 6c 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 63 l %%eax, %%ec
3e50: 78 5c 6e 22 20 20 20 20 20 20 20 20 20 2f 2a 20 x\n" /*
3e60: 6e 62 79 74 65 73 20 2d 3d 20 77 72 69 74 65 20 nbytes -= write
3e70: 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 */.." mov
3e80: 6c 20 20 20 20 25 25 72 31 34 64 2c 20 25 25 65 l %%r14d, %%e
3e90: 61 78 5c 6e 22 20 20 20 20 20 20 20 20 2f 2a 20 ax\n" /*
3ea0: 65 61 78 20 3d 20 6c 65 6e 20 2a 2f 0a 22 20 20 eax = len */."
3eb0: 20 20 20 20 20 20 63 6d 70 6c 20 20 20 20 25 25 cmpl %%
3ec0: 65 63 78 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 ecx, %%eax\n"."
3ed0: 20 20 20 20 20 20 20 6a 62 65 20 20 20 20 20 2e jbe .
3ee0: 4c 5f 64 6f 5f 63 6f 70 79 5c 6e 22 20 20 20 20 L_do_copy\n"
3ef0: 20 20 20 20 20 20 20 2f 2a 20 69 66 20 28 6e 62 /* if (nb
3f00: 79 74 65 73 20 3e 3d 20 6c 65 6e 29 20 2a 2f 0a ytes >= len) */.
3f10: 0a 22 20 20 20 20 20 20 20 20 73 75 62 6c 20 20 ." subl
3f20: 20 20 25 25 65 63 78 2c 20 25 25 65 61 78 5c 6e %%ecx, %%eax\n
3f30: 22 20 20 20 20 20 20 20 20 20 2f 2a 20 6c 65 6e " /* len
3f40: 20 2d 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 22 20 -= nbytes */."
3f50: 20 20 20 20 20 20 20 72 65 70 20 20 20 20 20 6d rep m
3f60: 6f 76 73 62 5c 6e 22 0a 22 20 20 20 20 20 20 20 ovsb\n"."
3f70: 20 6d 6f 76 71 20 20 20 20 35 36 28 25 25 72 73 movq 56(%%rs
3f80: 70 29 2c 20 25 25 72 73 69 5c 6e 22 20 20 20 20 p), %%rsi\n"
3f90: 20 2f 2a 20 66 72 6f 6d 20 3d 20 77 69 6e 64 6f /* from = windo
3fa0: 77 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f w */." mo
3fb0: 76 6c 20 20 20 20 39 36 28 25 25 72 73 70 29 2c vl 96(%%rsp),
3fc0: 20 25 25 65 63 78 5c 6e 22 20 20 20 20 20 2f 2a %%ecx\n" /*
3fd0: 20 6e 62 79 74 65 73 20 3d 20 77 72 69 74 65 20 nbytes = write
3fe0: 2a 2f 0a 22 20 20 20 20 20 20 20 20 63 6d 70 6c */." cmpl
3ff0: 20 20 20 20 25 25 65 63 78 2c 20 25 25 65 61 78 %%ecx, %%eax
4000: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 62 65 \n"." jbe
4010: 20 20 20 20 20 2e 4c 5f 64 6f 5f 63 6f 70 79 5c .L_do_copy\
4020: 6e 22 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 n" /*
4030: 69 66 20 28 6e 62 79 74 65 73 20 3e 3d 20 6c 65 if (nbytes >= le
4040: 6e 29 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 n) */.."
4050: 73 75 62 6c 20 20 20 20 25 25 65 63 78 2c 20 25 subl %%ecx, %
4060: 25 65 61 78 5c 6e 22 20 20 20 20 20 20 20 20 20 %eax\n"
4070: 2f 2a 20 6c 65 6e 20 2d 3d 20 6e 62 79 74 65 73 /* len -= nbytes
4080: 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 72 65 70 */." rep
4090: 20 20 20 20 20 6d 6f 76 73 62 5c 6e 22 0a 22 20 movsb\n"."
40a0: 20 20 20 20 20 20 20 6d 6f 76 71 20 20 20 20 25 movq %
40b0: 25 72 64 69 2c 20 25 25 72 73 69 5c 6e 22 0a 22 %rdi, %%rsi\n"."
40c0: 20 20 20 20 20 20 20 20 73 75 62 71 20 20 20 20 subq
40d0: 25 25 72 31 35 2c 20 25 25 72 73 69 5c 6e 22 20 %%r15, %%rsi\n"
40e0: 20 20 20 20 20 20 20 20 2f 2a 20 66 72 6f 6d 20 /* from
40f0: 3d 20 6f 75 74 20 2d 20 64 69 73 74 20 2a 2f 0a = out - dist */.
4100: 22 20 20 20 20 20 20 20 20 6a 6d 70 20 20 20 20 " jmp
4110: 20 2e 4c 5f 64 6f 5f 63 6f 70 79 5c 6e 22 0a 0a .L_do_copy\n"..
4120: 22 2e 61 6c 69 67 6e 20 33 32 2c 30 78 39 30 5c ".align 32,0x90\
4130: 6e 22 0a 22 2e 4c 5f 63 6f 6e 74 69 67 75 6f 75 n".".L_contiguou
4140: 73 5f 69 6e 5f 77 69 6e 64 6f 77 3a 5c 6e 22 0a s_in_window:\n".
4150: 22 20 20 20 20 20 20 20 20 6d 6f 76 71 20 20 20 " movq
4160: 20 35 36 28 25 25 72 73 70 29 2c 20 25 25 72 73 56(%%rsp), %%rs
4170: 69 5c 6e 22 20 20 20 20 20 2f 2a 20 72 73 69 20 i\n" /* rsi
4180: 3d 20 77 69 6e 64 6f 77 20 2a 2f 0a 22 20 20 20 = window */."
4190: 20 20 20 20 20 61 64 64 71 20 20 20 20 25 25 72 addq %%r
41a0: 61 78 2c 20 25 25 72 73 69 5c 6e 22 0a 22 20 20 ax, %%rsi\n"."
41b0: 20 20 20 20 20 20 73 75 62 71 20 20 20 20 25 25 subq %%
41c0: 72 63 78 2c 20 25 25 72 73 69 5c 6e 22 20 20 20 rcx, %%rsi\n"
41d0: 20 20 20 20 20 20 2f 2a 20 66 72 6f 6d 20 2b 3d /* from +=
41e0: 20 77 72 69 74 65 20 2d 20 6e 62 79 74 65 73 20 write - nbytes
41f0: 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 */.." mov
4200: 6c 20 20 20 20 25 25 72 31 34 64 2c 20 25 25 65 l %%r14d, %%e
4210: 61 78 5c 6e 22 20 20 20 20 20 20 20 20 2f 2a 20 ax\n" /*
4220: 65 61 78 20 3d 20 6c 65 6e 20 2a 2f 0a 22 20 20 eax = len */."
4230: 20 20 20 20 20 20 63 6d 70 6c 20 20 20 20 25 25 cmpl %%
4240: 65 63 78 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 ecx, %%eax\n"."
4250: 20 20 20 20 20 20 20 6a 62 65 20 20 20 20 20 2e jbe .
4260: 4c 5f 64 6f 5f 63 6f 70 79 5c 6e 22 20 20 20 20 L_do_copy\n"
4270: 20 20 20 20 20 20 20 2f 2a 20 69 66 20 28 6e 62 /* if (nb
4280: 79 74 65 73 20 3e 3d 20 6c 65 6e 29 20 2a 2f 0a ytes >= len) */.
4290: 0a 22 20 20 20 20 20 20 20 20 73 75 62 6c 20 20 ." subl
42a0: 20 20 25 25 65 63 78 2c 20 25 25 65 61 78 5c 6e %%ecx, %%eax\n
42b0: 22 20 20 20 20 20 20 20 20 20 2f 2a 20 6c 65 6e " /* len
42c0: 20 2d 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 22 20 -= nbytes */."
42d0: 20 20 20 20 20 20 20 72 65 70 20 20 20 20 20 6d rep m
42e0: 6f 76 73 62 5c 6e 22 0a 22 20 20 20 20 20 20 20 ovsb\n"."
42f0: 20 6d 6f 76 71 20 20 20 20 25 25 72 64 69 2c 20 movq %%rdi,
4300: 25 25 72 73 69 5c 6e 22 0a 22 20 20 20 20 20 20 %%rsi\n"."
4310: 20 20 73 75 62 71 20 20 20 20 25 25 72 31 35 2c subq %%r15,
4320: 20 25 25 72 73 69 5c 6e 22 20 20 20 20 20 20 20 %%rsi\n"
4330: 20 20 2f 2a 20 66 72 6f 6d 20 3d 20 6f 75 74 20 /* from = out
4340: 2d 20 64 69 73 74 20 2a 2f 0a 22 20 20 20 20 20 - dist */."
4350: 20 20 20 6a 6d 70 20 20 20 20 20 2e 4c 5f 64 6f jmp .L_do
4360: 5f 63 6f 70 79 5c 6e 22 20 20 20 20 20 20 20 20 _copy\n"
4370: 20 20 20 2f 2a 20 69 66 20 28 6e 62 79 74 65 73 /* if (nbytes
4380: 20 3e 3d 20 6c 65 6e 29 20 2a 2f 0a 0a 22 2e 61 >= len) */..".a
4390: 6c 69 67 6e 20 33 32 2c 30 78 39 30 5c 6e 22 0a lign 32,0x90\n".
43a0: 22 2e 4c 5f 64 6f 5f 63 6f 70 79 3a 5c 6e 22 0a ".L_do_copy:\n".
43b0: 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 " movl
43c0: 20 25 25 65 61 78 2c 20 25 25 65 63 78 5c 6e 22 %%eax, %%ecx\n"
43d0: 20 20 20 20 20 20 20 20 20 2f 2a 20 65 63 78 20 /* ecx
43e0: 3d 20 6c 65 6e 20 2a 2f 0a 22 20 20 20 20 20 20 = len */."
43f0: 20 20 72 65 70 20 20 20 20 20 6d 6f 76 73 62 5c rep movsb\
4400: 6e 22 0a 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 n".." mov
4410: 71 20 20 20 20 25 25 72 38 2c 20 25 25 72 73 69 q %%r8, %%rsi
4420: 5c 6e 22 20 20 20 20 20 20 20 20 20 20 2f 2a 20 \n" /*
4430: 6d 6f 76 65 20 69 6e 20 62 61 63 6b 20 74 6f 20 move in back to
4440: 25 65 73 69 2c 20 74 6f 73 73 20 66 72 6f 6d 20 %esi, toss from
4450: 2a 2f 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 20 */." jmp
4460: 20 20 20 20 2e 4c 5f 77 68 69 6c 65 5f 74 65 73 .L_while_tes
4470: 74 5c 6e 22 0a 0a 22 2e 4c 5f 74 65 73 74 5f 66 t\n"..".L_test_f
4480: 6f 72 5f 65 6e 64 5f 6f 66 5f 62 6c 6f 63 6b 3a or_end_of_block:
4490: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 74 65 73 \n"." tes
44a0: 74 62 20 20 20 24 33 32 2c 20 25 25 61 6c 5c 6e tb $32, %%al\n
44b0: 22 0a 22 20 20 20 20 20 20 20 20 6a 7a 20 20 20 "." jz
44c0: 20 20 20 2e 4c 5f 69 6e 76 61 6c 69 64 5f 6c 69 .L_invalid_li
44d0: 74 65 72 61 6c 5f 6c 65 6e 67 74 68 5f 63 6f 64 teral_length_cod
44e0: 65 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f e\n"." mo
44f0: 76 6c 20 20 20 20 24 31 2c 20 31 31 36 28 25 25 vl $1, 116(%%
4500: 72 73 70 29 5c 6e 22 0a 22 20 20 20 20 20 20 20 rsp)\n"."
4510: 20 6a 6d 70 20 20 20 20 20 2e 4c 5f 62 72 65 61 jmp .L_brea
4520: 6b 5f 6c 6f 6f 70 5f 77 69 74 68 5f 73 74 61 74 k_loop_with_stat
4530: 75 73 5c 6e 22 0a 0a 22 2e 4c 5f 69 6e 76 61 6c us\n"..".L_inval
4540: 69 64 5f 6c 69 74 65 72 61 6c 5f 6c 65 6e 67 74 id_literal_lengt
4550: 68 5f 63 6f 64 65 3a 5c 6e 22 0a 22 20 20 20 20 h_code:\n"."
4560: 20 20 20 20 6d 6f 76 6c 20 20 20 20 24 32 2c 20 movl $2,
4570: 31 31 36 28 25 25 72 73 70 29 5c 6e 22 0a 22 20 116(%%rsp)\n"."
4580: 20 20 20 20 20 20 20 6a 6d 70 20 20 20 20 20 2e jmp .
4590: 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 5f 77 69 74 L_break_loop_wit
45a0: 68 5f 73 74 61 74 75 73 5c 6e 22 0a 0a 22 2e 4c h_status\n"..".L
45b0: 5f 69 6e 76 61 6c 69 64 5f 64 69 73 74 61 6e 63 _invalid_distanc
45c0: 65 5f 63 6f 64 65 3a 5c 6e 22 0a 22 20 20 20 20 e_code:\n"."
45d0: 20 20 20 20 6d 6f 76 6c 20 20 20 20 24 33 2c 20 movl $3,
45e0: 31 31 36 28 25 25 72 73 70 29 5c 6e 22 0a 22 20 116(%%rsp)\n"."
45f0: 20 20 20 20 20 20 20 6a 6d 70 20 20 20 20 20 2e jmp .
4600: 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 5f 77 69 74 L_break_loop_wit
4610: 68 5f 73 74 61 74 75 73 5c 6e 22 0a 0a 22 2e 4c h_status\n"..".L
4620: 5f 69 6e 76 61 6c 69 64 5f 64 69 73 74 61 6e 63 _invalid_distanc
4630: 65 5f 74 6f 6f 5f 66 61 72 3a 5c 6e 22 0a 22 20 e_too_far:\n"."
4640: 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 24 movl $
4650: 34 2c 20 31 31 36 28 25 25 72 73 70 29 5c 6e 22 4, 116(%%rsp)\n"
4660: 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 20 20 20 ." jmp
4670: 20 20 2e 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 5f .L_break_loop_
4680: 77 69 74 68 5f 73 74 61 74 75 73 5c 6e 22 0a 0a with_status\n"..
4690: 22 2e 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 3a 5c ".L_break_loop:\
46a0: 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c n"." movl
46b0: 20 20 20 20 24 30 2c 20 31 31 36 28 25 25 72 73 $0, 116(%%rs
46c0: 70 29 5c 6e 22 0a 0a 22 2e 4c 5f 62 72 65 61 6b p)\n"..".L_break
46d0: 5f 6c 6f 6f 70 5f 77 69 74 68 5f 73 74 61 74 75 _loop_with_statu
46e0: 73 3a 5c 6e 22 0a 2f 2a 20 70 75 74 20 69 6e 2c s:\n"./* put in,
46f0: 20 6f 75 74 2c 20 62 69 74 73 2c 20 61 6e 64 20 out, bits, and
4700: 68 6f 6c 64 20 62 61 63 6b 20 69 6e 74 6f 20 61 hold back into a
4710: 72 20 61 6e 64 20 70 6f 70 20 65 73 70 20 2a 2f r and pop esp */
4720: 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 71 20 20 ." movq
4730: 20 20 25 25 72 73 69 2c 20 31 36 28 25 25 72 73 %%rsi, 16(%%rs
4740: 70 29 5c 6e 22 20 20 20 20 20 2f 2a 20 69 6e 20 p)\n" /* in
4750: 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 71 */." movq
4760: 20 20 20 20 25 25 72 64 69 2c 20 33 32 28 25 25 %%rdi, 32(%%
4770: 72 73 70 29 5c 6e 22 20 20 20 20 20 2f 2a 20 6f rsp)\n" /* o
4780: 75 74 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d ut */." m
4790: 6f 76 6c 20 20 20 20 25 25 65 62 78 2c 20 38 38 ovl %%ebx, 88
47a0: 28 25 25 72 73 70 29 5c 6e 22 20 20 20 20 20 2f (%%rsp)\n" /
47b0: 2a 20 62 69 74 73 20 2a 2f 0a 22 20 20 20 20 20 * bits */."
47c0: 20 20 20 6d 6f 76 71 20 20 20 20 25 25 72 64 78 movq %%rdx
47d0: 2c 20 38 30 28 25 25 72 73 70 29 5c 6e 22 20 20 , 80(%%rsp)\n"
47e0: 20 20 20 2f 2a 20 68 6f 6c 64 20 2a 2f 0a 22 20 /* hold */."
47f0: 20 20 20 20 20 20 20 6d 6f 76 71 20 20 20 20 28 movq (
4800: 25 25 72 73 70 29 2c 20 25 25 72 61 78 5c 6e 22 %%rsp), %%rax\n"
4810: 20 20 20 20 20 20 20 2f 2a 20 72 65 73 74 6f 72 /* restor
4820: 65 20 72 62 70 20 61 6e 64 20 72 73 70 20 2a 2f e rbp and rsp */
4830: 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 71 20 20 ." movq
4840: 20 20 38 28 25 25 72 73 70 29 2c 20 25 25 72 62 8(%%rsp), %%rb
4850: 70 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f p\n"." mo
4860: 76 71 20 20 20 20 25 25 72 61 78 2c 20 25 25 72 vq %%rax, %%r
4870: 73 70 5c 6e 22 0a 20 20 20 20 20 20 20 20 20 20 sp\n".
4880: 3a 0a 20 20 20 20 20 20 20 20 20 20 3a 20 22 6d :. : "m
4890: 22 20 28 61 72 29 0a 20 20 20 20 20 20 20 20 20 " (ar).
48a0: 20 3a 20 22 6d 65 6d 6f 72 79 22 2c 20 22 25 72 : "memory", "%r
48b0: 61 78 22 2c 20 22 25 72 62 78 22 2c 20 22 25 72 ax", "%rbx", "%r
48c0: 63 78 22 2c 20 22 25 72 64 78 22 2c 20 22 25 72 cx", "%rdx", "%r
48d0: 73 69 22 2c 20 22 25 72 64 69 22 2c 0a 20 20 20 si", "%rdi",.
48e0: 20 20 20 20 20 20 20 20 20 22 25 72 38 22 2c 20 "%r8",
48f0: 22 25 72 39 22 2c 20 22 25 72 31 30 22 2c 20 22 "%r9", "%r10", "
4900: 25 72 31 31 22 2c 20 22 25 72 31 32 22 2c 20 22 %r11", "%r12", "
4910: 25 72 31 33 22 2c 20 22 25 72 31 34 22 2c 20 22 %r13", "%r14", "
4920: 25 72 31 35 22 0a 20 20 20 20 29 3b 0a 23 65 6c %r15". );.#el
4930: 69 66 20 28 20 64 65 66 69 6e 65 64 28 20 5f 5f if ( defined( __
4940: 47 4e 55 43 5f 5f 20 29 20 7c 7c 20 64 65 66 69 GNUC__ ) || defi
4950: 6e 65 64 28 20 5f 5f 49 43 43 20 29 20 29 20 26 ned( __ICC ) ) &
4960: 26 20 64 65 66 69 6e 65 64 28 20 5f 5f 69 33 38 & defined( __i38
4970: 36 20 29 0a 20 20 20 20 5f 5f 61 73 6d 5f 5f 20 6 ). __asm__
4980: 5f 5f 76 6f 6c 61 74 69 6c 65 5f 5f 20 28 0a 22 __volatile__ (."
4990: 20 20 20 20 20 20 20 20 6c 65 61 6c 20 20 20 20 leal
49a0: 25 30 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 %0, %%eax\n"."
49b0: 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 25 25 movl %%
49c0: 65 73 70 2c 20 28 25 25 65 61 78 29 5c 6e 22 20 esp, (%%eax)\n"
49d0: 20 20 20 20 20 20 20 2f 2a 20 73 61 76 65 20 65 /* save e
49e0: 73 70 2c 20 65 62 70 20 2a 2f 0a 22 20 20 20 20 sp, ebp */."
49f0: 20 20 20 20 6d 6f 76 6c 20 20 20 20 25 25 65 62 movl %%eb
4a00: 70 2c 20 34 28 25 25 65 61 78 29 5c 6e 22 0a 22 p, 4(%%eax)\n"."
4a10: 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 movl
4a20: 25 25 65 61 78 2c 20 25 25 65 73 70 5c 6e 22 0a %%eax, %%esp\n".
4a30: 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 " movl
4a40: 20 38 28 25 25 65 73 70 29 2c 20 25 25 65 73 69 8(%%esp), %%esi
4a50: 5c 6e 22 20 20 20 20 20 20 20 2f 2a 20 65 73 69 \n" /* esi
4a60: 20 3d 20 69 6e 20 2a 2f 0a 22 20 20 20 20 20 20 = in */."
4a70: 20 20 6d 6f 76 6c 20 20 20 20 31 36 28 25 25 65 movl 16(%%e
4a80: 73 70 29 2c 20 25 25 65 64 69 5c 6e 22 20 20 20 sp), %%edi\n"
4a90: 20 20 20 2f 2a 20 65 64 69 20 3d 20 6f 75 74 20 /* edi = out
4aa0: 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c */." movl
4ab0: 20 20 20 20 34 30 28 25 25 65 73 70 29 2c 20 25 40(%%esp), %
4ac0: 25 65 64 78 5c 6e 22 20 20 20 20 20 20 2f 2a 20 %edx\n" /*
4ad0: 65 64 78 20 3d 20 68 6f 6c 64 20 2a 2f 0a 22 20 edx = hold */."
4ae0: 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 34 movl 4
4af0: 34 28 25 25 65 73 70 29 2c 20 25 25 65 62 78 5c 4(%%esp), %%ebx\
4b00: 6e 22 20 20 20 20 20 20 2f 2a 20 65 62 78 20 3d n" /* ebx =
4b10: 20 62 69 74 73 20 2a 2f 0a 22 20 20 20 20 20 20 bits */."
4b20: 20 20 6d 6f 76 6c 20 20 20 20 33 32 28 25 25 65 movl 32(%%e
4b30: 73 70 29 2c 20 25 25 65 62 70 5c 6e 22 20 20 20 sp), %%ebp\n"
4b40: 20 20 20 2f 2a 20 65 62 70 20 3d 20 6c 63 6f 64 /* ebp = lcod
4b50: 65 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 63 e */.." c
4b60: 6c 64 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a ld\n"." j
4b70: 6d 70 20 20 20 20 20 2e 4c 5f 64 6f 5f 6c 6f 6f mp .L_do_loo
4b80: 70 5c 6e 22 0a 0a 22 2e 61 6c 69 67 6e 20 33 32 p\n"..".align 32
4b90: 2c 30 78 39 30 5c 6e 22 0a 22 2e 4c 5f 77 68 69 ,0x90\n".".L_whi
4ba0: 6c 65 5f 74 65 73 74 3a 5c 6e 22 0a 22 20 20 20 le_test:\n"."
4bb0: 20 20 20 20 20 63 6d 70 6c 20 20 20 20 25 25 65 cmpl %%e
4bc0: 64 69 2c 20 32 34 28 25 25 65 73 70 29 5c 6e 22 di, 24(%%esp)\n"
4bd0: 20 20 20 20 20 20 2f 2a 20 6f 75 74 20 3c 20 65 /* out < e
4be0: 6e 64 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6a nd */." j
4bf0: 62 65 20 20 20 20 20 2e 4c 5f 62 72 65 61 6b 5f be .L_break_
4c00: 6c 6f 6f 70 5c 6e 22 0a 22 20 20 20 20 20 20 20 loop\n"."
4c10: 20 63 6d 70 6c 20 20 20 20 25 25 65 73 69 2c 20 cmpl %%esi,
4c20: 31 32 28 25 25 65 73 70 29 5c 6e 22 20 20 20 20 12(%%esp)\n"
4c30: 20 20 2f 2a 20 69 6e 20 3c 20 6c 61 73 74 20 2a /* in < last *
4c40: 2f 0a 22 20 20 20 20 20 20 20 20 6a 62 65 20 20 /." jbe
4c50: 20 20 20 2e 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 .L_break_loop
4c60: 5c 6e 22 0a 0a 22 2e 4c 5f 64 6f 5f 6c 6f 6f 70 \n"..".L_do_loop
4c70: 3a 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 63 6d :\n"." cm
4c80: 70 62 20 20 20 20 24 31 35 2c 20 25 25 62 6c 5c pb $15, %%bl\
4c90: 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 61 20 20 n"." ja
4ca0: 20 20 20 20 2e 4c 5f 67 65 74 5f 6c 65 6e 67 74 .L_get_lengt
4cb0: 68 5f 63 6f 64 65 5c 6e 22 20 20 20 20 2f 2a 20 h_code\n" /*
4cc0: 69 66 20 28 31 35 20 3c 20 62 69 74 73 29 20 2a if (15 < bits) *
4cd0: 2f 0a 0a 22 20 20 20 20 20 20 20 20 78 6f 72 6c /.." xorl
4ce0: 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 61 78 %%eax, %%eax
4cf0: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6c 6f 64 \n"." lod
4d00: 73 77 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 sw\n"
4d10: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a /*
4d20: 20 61 6c 20 3d 20 2a 28 75 73 68 6f 72 74 20 2a al = *(ushort *
4d30: 29 69 6e 2b 2b 20 2a 2f 0a 22 20 20 20 20 20 20 )in++ */."
4d40: 20 20 6d 6f 76 62 20 20 20 20 25 25 62 6c 2c 20 movb %%bl,
4d50: 25 25 63 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 %%cl\n"
4d60: 20 20 20 2f 2a 20 63 6c 20 3d 20 62 69 74 73 2c /* cl = bits,
4d70: 20 6e 65 65 64 73 20 69 74 20 66 6f 72 20 73 68 needs it for sh
4d80: 69 66 74 69 6e 67 20 2a 2f 0a 22 20 20 20 20 20 ifting */."
4d90: 20 20 20 61 64 64 62 20 20 20 20 24 31 36 2c 20 addb $16,
4da0: 25 25 62 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 %%bl\n"
4db0: 20 20 20 20 2f 2a 20 62 69 74 73 20 2b 3d 20 31 /* bits += 1
4dc0: 36 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 6 */." sh
4dd0: 6c 6c 20 20 20 20 25 25 63 6c 2c 20 25 25 65 61 ll %%cl, %%ea
4de0: 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6f 72 x\n"." or
4df0: 6c 20 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 l %%eax, %%e
4e00: 64 78 5c 6e 22 20 20 20 20 20 20 20 20 2f 2a 20 dx\n" /*
4e10: 68 6f 6c 64 20 7c 3d 20 2a 28 28 75 73 68 6f 72 hold |= *((ushor
4e20: 74 20 2a 29 69 6e 29 2b 2b 20 3c 3c 20 62 69 74 t *)in)++ << bit
4e30: 73 20 2a 2f 0a 0a 22 2e 4c 5f 67 65 74 5f 6c 65 s */..".L_get_le
4e40: 6e 67 74 68 5f 63 6f 64 65 3a 5c 6e 22 0a 22 20 ngth_code:\n"."
4e50: 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 35 movl 5
4e60: 36 28 25 25 65 73 70 29 2c 20 25 25 65 61 78 5c 6(%%esp), %%eax\
4e70: 6e 22 20 20 20 20 20 20 2f 2a 20 65 61 78 20 3d n" /* eax =
4e80: 20 6c 6d 61 73 6b 20 2a 2f 0a 22 20 20 20 20 20 lmask */."
4e90: 20 20 20 61 6e 64 6c 20 20 20 20 25 25 65 64 78 andl %%edx
4ea0: 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 20 20 , %%eax\n"
4eb0: 20 20 20 20 2f 2a 20 65 61 78 20 26 3d 20 68 6f /* eax &= ho
4ec0: 6c 64 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d ld */." m
4ed0: 6f 76 6c 20 20 20 20 28 25 25 65 62 70 2c 25 25 ovl (%%ebp,%%
4ee0: 65 61 78 2c 34 29 2c 20 25 25 65 61 78 5c 6e 22 eax,4), %%eax\n"
4ef0: 20 2f 2a 20 65 61 78 20 3d 20 6c 63 6f 64 65 5b /* eax = lcode[
4f00: 68 6f 6c 64 20 26 20 6c 6d 61 73 6b 5d 20 2a 2f hold & lmask] */
4f10: 0a 0a 22 2e 4c 5f 64 6f 6c 65 6e 3a 5c 6e 22 0a ..".L_dolen:\n".
4f20: 22 20 20 20 20 20 20 20 20 6d 6f 76 62 20 20 20 " movb
4f30: 20 25 25 61 68 2c 20 25 25 63 6c 5c 6e 22 20 20 %%ah, %%cl\n"
4f40: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 63 6c 20 /* cl
4f50: 3d 20 74 68 69 73 2e 62 69 74 73 20 2a 2f 0a 22 = this.bits */."
4f60: 20 20 20 20 20 20 20 20 73 75 62 62 20 20 20 20 subb
4f70: 25 25 61 68 2c 20 25 25 62 6c 5c 6e 22 20 20 20 %%ah, %%bl\n"
4f80: 20 20 20 20 20 20 20 20 20 2f 2a 20 62 69 74 73 /* bits
4f90: 20 2d 3d 20 74 68 69 73 2e 62 69 74 73 20 2a 2f -= this.bits */
4fa0: 0a 22 20 20 20 20 20 20 20 20 73 68 72 6c 20 20 ." shrl
4fb0: 20 20 25 25 63 6c 2c 20 25 25 65 64 78 5c 6e 22 %%cl, %%edx\n"
4fc0: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 68 6f /* ho
4fd0: 6c 64 20 3e 3e 3d 20 74 68 69 73 2e 62 69 74 73 ld >>= this.bits
4fe0: 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 74 65 */.." te
4ff0: 73 74 62 20 20 20 25 25 61 6c 2c 20 25 25 61 6c stb %%al, %%al
5000: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 6e 7a \n"." jnz
5010: 20 20 20 20 20 2e 4c 5f 74 65 73 74 5f 66 6f 72 .L_test_for
5020: 5f 6c 65 6e 67 74 68 5f 62 61 73 65 5c 6e 22 20 _length_base\n"
5030: 2f 2a 20 69 66 20 28 6f 70 20 21 3d 20 30 29 20 /* if (op != 0)
5040: 34 35 2e 37 25 20 2a 2f 0a 0a 22 20 20 20 20 20 45.7% */.."
5050: 20 20 20 73 68 72 6c 20 20 20 20 24 31 36 2c 20 shrl $16,
5060: 25 25 65 61 78 5c 6e 22 20 20 20 20 20 20 20 20 %%eax\n"
5070: 20 20 20 20 2f 2a 20 6f 75 74 70 75 74 20 74 68 /* output th
5080: 69 73 2e 76 61 6c 20 63 68 61 72 20 2a 2f 0a 22 is.val char */."
5090: 20 20 20 20 20 20 20 20 73 74 6f 73 62 5c 6e 22 stosb\n"
50a0: 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 20 20 20 ." jmp
50b0: 20 20 2e 4c 5f 77 68 69 6c 65 5f 74 65 73 74 5c .L_while_test\
50c0: 6e 22 0a 0a 22 2e 61 6c 69 67 6e 20 33 32 2c 30 n"..".align 32,0
50d0: 78 39 30 5c 6e 22 0a 22 2e 4c 5f 74 65 73 74 5f x90\n".".L_test_
50e0: 66 6f 72 5f 6c 65 6e 67 74 68 5f 62 61 73 65 3a for_length_base:
50f0: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 \n"." mov
5100: 6c 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 63 l %%eax, %%ec
5110: 78 5c 6e 22 20 20 20 20 20 20 20 20 20 20 2f 2a x\n" /*
5120: 20 6c 65 6e 20 3d 20 74 68 69 73 20 2a 2f 0a 22 len = this */."
5130: 20 20 20 20 20 20 20 20 73 68 72 6c 20 20 20 20 shrl
5140: 24 31 36 2c 20 25 25 65 63 78 5c 6e 22 20 20 20 $16, %%ecx\n"
5150: 20 20 20 20 20 20 20 20 20 2f 2a 20 6c 65 6e 20 /* len
5160: 3d 20 74 68 69 73 2e 76 61 6c 20 2a 2f 0a 22 20 = this.val */."
5170: 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 25 movl %
5180: 25 65 63 78 2c 20 36 34 28 25 25 65 73 70 29 5c %ecx, 64(%%esp)\
5190: 6e 22 20 20 20 20 20 20 2f 2a 20 73 61 76 65 20 n" /* save
51a0: 6c 65 6e 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 len */."
51b0: 6d 6f 76 62 20 20 20 20 25 25 61 6c 2c 20 25 25 movb %%al, %%
51c0: 63 6c 5c 6e 22 0a 0a 22 20 20 20 20 20 20 20 20 cl\n".."
51d0: 74 65 73 74 62 20 20 20 24 31 36 2c 20 25 25 61 testb $16, %%a
51e0: 6c 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 7a l\n"." jz
51f0: 20 20 20 20 20 20 2e 4c 5f 74 65 73 74 5f 66 6f .L_test_fo
5200: 72 5f 73 65 63 6f 6e 64 5f 6c 65 76 65 6c 5f 6c r_second_level_l
5210: 65 6e 67 74 68 5c 6e 22 20 2f 2a 20 69 66 20 28 ength\n" /* if (
5220: 28 6f 70 20 26 20 31 36 29 20 3d 3d 20 30 29 20 (op & 16) == 0)
5230: 38 25 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 61 8% */." a
5240: 6e 64 62 20 20 20 20 24 31 35 2c 20 25 25 63 6c ndb $15, %%cl
5250: 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 20 \n"
5260: 2f 2a 20 6f 70 20 26 3d 20 31 35 20 2a 2f 0a 22 /* op &= 15 */."
5270: 20 20 20 20 20 20 20 20 6a 7a 20 20 20 20 20 20 jz
5280: 2e 4c 5f 64 65 63 6f 64 65 5f 64 69 73 74 61 6e .L_decode_distan
5290: 63 65 5c 6e 22 20 20 20 20 2f 2a 20 69 66 20 28 ce\n" /* if (
52a0: 21 6f 70 29 20 2a 2f 0a 22 20 20 20 20 20 20 20 !op) */."
52b0: 20 63 6d 70 62 20 20 20 20 25 25 63 6c 2c 20 25 cmpb %%cl, %
52c0: 25 62 6c 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 %bl\n"."
52d0: 6a 61 65 20 20 20 20 20 2e 4c 5f 61 64 64 5f 62 jae .L_add_b
52e0: 69 74 73 5f 74 6f 5f 6c 65 6e 5c 6e 22 20 20 20 its_to_len\n"
52f0: 20 2f 2a 20 69 66 20 28 6f 70 20 3c 3d 20 62 69 /* if (op <= bi
5300: 74 73 29 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 ts) */.."
5310: 20 6d 6f 76 62 20 20 20 20 25 25 63 6c 2c 20 25 movb %%cl, %
5320: 25 63 68 5c 6e 22 20 20 20 20 20 20 20 20 20 20 %ch\n"
5330: 20 20 2f 2a 20 73 74 61 73 68 20 6f 70 20 69 6e /* stash op in
5340: 20 63 68 2c 20 66 72 65 65 69 6e 67 20 63 6c 20 ch, freeing cl
5350: 2a 2f 0a 22 20 20 20 20 20 20 20 20 78 6f 72 6c */." xorl
5360: 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 61 78 %%eax, %%eax
5370: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6c 6f 64 \n"." lod
5380: 73 77 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 sw\n"
5390: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a /*
53a0: 20 61 6c 20 3d 20 2a 28 75 73 68 6f 72 74 20 2a al = *(ushort *
53b0: 29 69 6e 2b 2b 20 2a 2f 0a 22 20 20 20 20 20 20 )in++ */."
53c0: 20 20 6d 6f 76 62 20 20 20 20 25 25 62 6c 2c 20 movb %%bl,
53d0: 25 25 63 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 %%cl\n"
53e0: 20 20 20 2f 2a 20 63 6c 20 3d 20 62 69 74 73 2c /* cl = bits,
53f0: 20 6e 65 65 64 73 20 69 74 20 66 6f 72 20 73 68 needs it for sh
5400: 69 66 74 69 6e 67 20 2a 2f 0a 22 20 20 20 20 20 ifting */."
5410: 20 20 20 61 64 64 62 20 20 20 20 24 31 36 2c 20 addb $16,
5420: 25 25 62 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 %%bl\n"
5430: 20 20 20 20 2f 2a 20 62 69 74 73 20 2b 3d 20 31 /* bits += 1
5440: 36 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 6 */." sh
5450: 6c 6c 20 20 20 20 25 25 63 6c 2c 20 25 25 65 61 ll %%cl, %%ea
5460: 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6f 72 x\n"." or
5470: 6c 20 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 l %%eax, %%e
5480: 64 78 5c 6e 22 20 20 20 20 20 20 20 20 20 2f 2a dx\n" /*
5490: 20 68 6f 6c 64 20 7c 3d 20 2a 28 28 75 73 68 6f hold |= *((usho
54a0: 72 74 20 2a 29 69 6e 29 2b 2b 20 3c 3c 20 62 69 rt *)in)++ << bi
54b0: 74 73 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d ts */." m
54c0: 6f 76 62 20 20 20 20 25 25 63 68 2c 20 25 25 63 ovb %%ch, %%c
54d0: 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 l\n"
54e0: 2f 2a 20 6d 6f 76 65 20 6f 70 20 62 61 63 6b 20 /* move op back
54f0: 74 6f 20 65 63 78 20 2a 2f 0a 0a 22 2e 4c 5f 61 to ecx */..".L_a
5500: 64 64 5f 62 69 74 73 5f 74 6f 5f 6c 65 6e 3a 5c dd_bits_to_len:\
5510: 6e 22 0a 22 20 20 20 20 20 20 20 20 73 75 62 62 n"." subb
5520: 20 20 20 20 25 25 63 6c 2c 20 25 25 62 6c 5c 6e %%cl, %%bl\n
5530: 22 0a 22 20 20 20 20 20 20 20 20 78 6f 72 6c 20 "." xorl
5540: 20 20 20 25 25 65 61 78 2c 20 25 25 65 61 78 5c %%eax, %%eax\
5550: 6e 22 0a 22 20 20 20 20 20 20 20 20 69 6e 63 6c n"." incl
5560: 20 20 20 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 %%eax\n"."
5570: 20 20 20 20 20 20 73 68 6c 6c 20 20 20 20 25 25 shll %%
5580: 63 6c 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 cl, %%eax\n"."
5590: 20 20 20 20 20 20 64 65 63 6c 20 20 20 20 25 25 decl %%
55a0: 65 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 eax\n"."
55b0: 61 6e 64 6c 20 20 20 20 25 25 65 64 78 2c 20 25 andl %%edx, %
55c0: 25 65 61 78 5c 6e 22 20 20 20 20 20 20 20 20 20 %eax\n"
55d0: 20 2f 2a 20 65 61 78 20 26 3d 20 68 6f 6c 64 20 /* eax &= hold
55e0: 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 72 6c */." shrl
55f0: 20 20 20 20 25 25 63 6c 2c 20 25 25 65 64 78 5c %%cl, %%edx\
5600: 6e 22 0a 22 20 20 20 20 20 20 20 20 61 64 64 6c n"." addl
5610: 20 20 20 20 25 25 65 61 78 2c 20 36 34 28 25 25 %%eax, 64(%%
5620: 65 73 70 29 5c 6e 22 20 20 20 20 20 20 2f 2a 20 esp)\n" /*
5630: 6c 65 6e 20 2b 3d 20 68 6f 6c 64 20 26 20 6d 61 len += hold & ma
5640: 73 6b 5b 6f 70 5d 20 2a 2f 0a 0a 22 2e 4c 5f 64 sk[op] */..".L_d
5650: 65 63 6f 64 65 5f 64 69 73 74 61 6e 63 65 3a 5c ecode_distance:\
5660: 6e 22 0a 22 20 20 20 20 20 20 20 20 63 6d 70 62 n"." cmpb
5670: 20 20 20 20 24 31 35 2c 20 25 25 62 6c 5c 6e 22 $15, %%bl\n"
5680: 0a 22 20 20 20 20 20 20 20 20 6a 61 20 20 20 20 ." ja
5690: 20 20 2e 4c 5f 67 65 74 5f 64 69 73 74 61 6e 63 .L_get_distanc
56a0: 65 5f 63 6f 64 65 5c 6e 22 20 20 2f 2a 20 69 66 e_code\n" /* if
56b0: 20 28 31 35 20 3c 20 62 69 74 73 29 20 2a 2f 0a (15 < bits) */.
56c0: 0a 22 20 20 20 20 20 20 20 20 78 6f 72 6c 20 20 ." xorl
56d0: 20 20 25 25 65 61 78 2c 20 25 25 65 61 78 5c 6e %%eax, %%eax\n
56e0: 22 0a 22 20 20 20 20 20 20 20 20 6c 6f 64 73 77 "." lodsw
56f0: 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 20 \n"
5700: 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 61 /* a
5710: 6c 20 3d 20 2a 28 75 73 68 6f 72 74 20 2a 29 69 l = *(ushort *)i
5720: 6e 2b 2b 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 n++ */."
5730: 6d 6f 76 62 20 20 20 20 25 25 62 6c 2c 20 25 25 movb %%bl, %%
5740: 63 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 cl\n"
5750: 20 2f 2a 20 63 6c 20 3d 20 62 69 74 73 2c 20 6e /* cl = bits, n
5760: 65 65 64 73 20 69 74 20 66 6f 72 20 73 68 69 66 eeds it for shif
5770: 74 69 6e 67 20 2a 2f 0a 22 20 20 20 20 20 20 20 ting */."
5780: 20 61 64 64 62 20 20 20 20 24 31 36 2c 20 25 25 addb $16, %%
5790: 62 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 bl\n"
57a0: 20 20 2f 2a 20 62 69 74 73 20 2b 3d 20 31 36 20 /* bits += 16
57b0: 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 6c 6c */." shll
57c0: 20 20 20 20 25 25 63 6c 2c 20 25 25 65 61 78 5c %%cl, %%eax\
57d0: 6e 22 0a 22 20 20 20 20 20 20 20 20 6f 72 6c 20 n"." orl
57e0: 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 64 78 %%eax, %%edx
57f0: 5c 6e 22 20 20 20 20 20 20 20 20 20 2f 2a 20 68 \n" /* h
5800: 6f 6c 64 20 7c 3d 20 2a 28 28 75 73 68 6f 72 74 old |= *((ushort
5810: 20 2a 29 69 6e 29 2b 2b 20 3c 3c 20 62 69 74 73 *)in)++ << bits
5820: 20 2a 2f 0a 0a 22 2e 4c 5f 67 65 74 5f 64 69 73 */..".L_get_dis
5830: 74 61 6e 63 65 5f 63 6f 64 65 3a 5c 6e 22 0a 22 tance_code:\n"."
5840: 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 movl
5850: 36 30 28 25 25 65 73 70 29 2c 20 25 25 65 61 78 60(%%esp), %%eax
5860: 5c 6e 22 20 20 20 20 20 20 2f 2a 20 65 61 78 20 \n" /* eax
5870: 3d 20 64 6d 61 73 6b 20 2a 2f 0a 22 20 20 20 20 = dmask */."
5880: 20 20 20 20 6d 6f 76 6c 20 20 20 20 33 36 28 25 movl 36(%
5890: 25 65 73 70 29 2c 20 25 25 65 63 78 5c 6e 22 20 %esp), %%ecx\n"
58a0: 20 20 20 20 20 2f 2a 20 65 63 78 20 3d 20 64 63 /* ecx = dc
58b0: 6f 64 65 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 ode */."
58c0: 61 6e 64 6c 20 20 20 20 25 25 65 64 78 2c 20 25 andl %%edx, %
58d0: 25 65 61 78 5c 6e 22 20 20 20 20 20 20 20 20 20 %eax\n"
58e0: 20 2f 2a 20 65 61 78 20 26 3d 20 68 6f 6c 64 20 /* eax &= hold
58f0: 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c */." movl
5900: 20 20 20 20 28 25 25 65 63 78 2c 25 25 65 61 78 (%%ecx,%%eax
5910: 2c 34 29 2c 20 25 25 65 61 78 5c 6e 22 2f 2a 20 ,4), %%eax\n"/*
5920: 65 61 78 20 3d 20 64 63 6f 64 65 5b 68 6f 6c 64 eax = dcode[hold
5930: 20 26 20 64 6d 61 73 6b 5d 20 2a 2f 0a 0a 22 2e & dmask] */..".
5940: 4c 5f 64 6f 64 69 73 74 3a 5c 6e 22 0a 22 20 20 L_dodist:\n"."
5950: 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 25 25 movl %%
5960: 65 61 78 2c 20 25 25 65 62 70 5c 6e 22 20 20 20 eax, %%ebp\n"
5970: 20 20 20 20 20 20 20 2f 2a 20 64 69 73 74 20 3d /* dist =
5980: 20 74 68 69 73 20 2a 2f 0a 22 20 20 20 20 20 20 this */."
5990: 20 20 73 68 72 6c 20 20 20 20 24 31 36 2c 20 25 shrl $16, %
59a0: 25 65 62 70 5c 6e 22 20 20 20 20 20 20 20 20 20 %ebp\n"
59b0: 20 20 20 2f 2a 20 64 69 73 74 20 3d 20 74 68 69 /* dist = thi
59c0: 73 2e 76 61 6c 20 2a 2f 0a 22 20 20 20 20 20 20 s.val */."
59d0: 20 20 6d 6f 76 62 20 20 20 20 25 25 61 68 2c 20 movb %%ah,
59e0: 25 25 63 6c 5c 6e 22 0a 22 20 20 20 20 20 20 20 %%cl\n"."
59f0: 20 73 75 62 62 20 20 20 20 25 25 61 68 2c 20 25 subb %%ah, %
5a00: 25 62 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 %bl\n"
5a10: 20 20 2f 2a 20 62 69 74 73 20 2d 3d 20 74 68 69 /* bits -= thi
5a20: 73 2e 62 69 74 73 20 2a 2f 0a 22 20 20 20 20 20 s.bits */."
5a30: 20 20 20 73 68 72 6c 20 20 20 20 25 25 63 6c 2c shrl %%cl,
5a40: 20 25 25 65 64 78 5c 6e 22 20 20 20 20 20 20 20 %%edx\n"
5a50: 20 20 20 20 2f 2a 20 68 6f 6c 64 20 3e 3e 3d 20 /* hold >>=
5a60: 74 68 69 73 2e 62 69 74 73 20 2a 2f 0a 22 20 20 this.bits */."
5a70: 20 20 20 20 20 20 6d 6f 76 62 20 20 20 20 25 25 movb %%
5a80: 61 6c 2c 20 25 25 63 6c 5c 6e 22 20 20 20 20 20 al, %%cl\n"
5a90: 20 20 20 20 20 20 20 2f 2a 20 63 6c 20 3d 20 74 /* cl = t
5aa0: 68 69 73 2e 6f 70 20 2a 2f 0a 0a 22 20 20 20 20 his.op */.."
5ab0: 20 20 20 20 74 65 73 74 62 20 20 20 24 31 36 2c testb $16,
5ac0: 20 25 25 61 6c 5c 6e 22 20 20 20 20 20 20 20 20 %%al\n"
5ad0: 20 20 20 20 20 2f 2a 20 69 66 20 28 28 6f 70 20 /* if ((op
5ae0: 26 20 31 36 29 20 3d 3d 20 30 29 20 2a 2f 0a 22 & 16) == 0) */."
5af0: 20 20 20 20 20 20 20 20 6a 7a 20 20 20 20 20 20 jz
5b00: 2e 4c 5f 74 65 73 74 5f 66 6f 72 5f 73 65 63 6f .L_test_for_seco
5b10: 6e 64 5f 6c 65 76 65 6c 5f 64 69 73 74 5c 6e 22 nd_level_dist\n"
5b20: 0a 22 20 20 20 20 20 20 20 20 61 6e 64 62 20 20 ." andb
5b30: 20 20 24 31 35 2c 20 25 25 63 6c 5c 6e 22 20 20 $15, %%cl\n"
5b40: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 6f 70 /* op
5b50: 20 26 3d 20 31 35 20 2a 2f 0a 22 20 20 20 20 20 &= 15 */."
5b60: 20 20 20 6a 7a 20 20 20 20 20 20 2e 4c 5f 63 68 jz .L_ch
5b70: 65 63 6b 5f 64 69 73 74 5f 6f 6e 65 5c 6e 22 0a eck_dist_one\n".
5b80: 22 20 20 20 20 20 20 20 20 63 6d 70 62 20 20 20 " cmpb
5b90: 20 25 25 63 6c 2c 20 25 25 62 6c 5c 6e 22 0a 22 %%cl, %%bl\n"."
5ba0: 20 20 20 20 20 20 20 20 6a 61 65 20 20 20 20 20 jae
5bb0: 2e 4c 5f 61 64 64 5f 62 69 74 73 5f 74 6f 5f 64 .L_add_bits_to_d
5bc0: 69 73 74 5c 6e 22 20 20 20 2f 2a 20 69 66 20 28 ist\n" /* if (
5bd0: 6f 70 20 3c 3d 20 62 69 74 73 29 20 39 37 2e 36 op <= bits) 97.6
5be0: 25 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 6d % */.." m
5bf0: 6f 76 62 20 20 20 20 25 25 63 6c 2c 20 25 25 63 ovb %%cl, %%c
5c00: 68 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 h\n"
5c10: 2f 2a 20 73 74 61 73 68 20 6f 70 20 69 6e 20 63 /* stash op in c
5c20: 68 2c 20 66 72 65 65 69 6e 67 20 63 6c 20 2a 2f h, freeing cl */
5c30: 0a 22 20 20 20 20 20 20 20 20 78 6f 72 6c 20 20 ." xorl
5c40: 20 20 25 25 65 61 78 2c 20 25 25 65 61 78 5c 6e %%eax, %%eax\n
5c50: 22 0a 22 20 20 20 20 20 20 20 20 6c 6f 64 73 77 "." lodsw
5c60: 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 20 \n"
5c70: 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 61 /* a
5c80: 6c 20 3d 20 2a 28 75 73 68 6f 72 74 20 2a 29 69 l = *(ushort *)i
5c90: 6e 2b 2b 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 n++ */."
5ca0: 6d 6f 76 62 20 20 20 20 25 25 62 6c 2c 20 25 25 movb %%bl, %%
5cb0: 63 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 cl\n"
5cc0: 20 2f 2a 20 63 6c 20 3d 20 62 69 74 73 2c 20 6e /* cl = bits, n
5cd0: 65 65 64 73 20 69 74 20 66 6f 72 20 73 68 69 66 eeds it for shif
5ce0: 74 69 6e 67 20 2a 2f 0a 22 20 20 20 20 20 20 20 ting */."
5cf0: 20 61 64 64 62 20 20 20 20 24 31 36 2c 20 25 25 addb $16, %%
5d00: 62 6c 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 bl\n"
5d10: 20 20 2f 2a 20 62 69 74 73 20 2b 3d 20 31 36 20 /* bits += 16
5d20: 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 6c 6c */." shll
5d30: 20 20 20 20 25 25 63 6c 2c 20 25 25 65 61 78 5c %%cl, %%eax\
5d40: 6e 22 0a 22 20 20 20 20 20 20 20 20 6f 72 6c 20 n"." orl
5d50: 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 64 78 %%eax, %%edx
5d60: 5c 6e 22 20 20 20 20 20 20 20 20 2f 2a 20 68 6f \n" /* ho
5d70: 6c 64 20 7c 3d 20 2a 28 28 75 73 68 6f 72 74 20 ld |= *((ushort
5d80: 2a 29 69 6e 29 2b 2b 20 3c 3c 20 62 69 74 73 20 *)in)++ << bits
5d90: 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 62 */." movb
5da0: 20 20 20 20 25 25 63 68 2c 20 25 25 63 6c 5c 6e %%ch, %%cl\n
5db0: 22 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 " /*
5dc0: 6d 6f 76 65 20 6f 70 20 62 61 63 6b 20 74 6f 20 move op back to
5dd0: 65 63 78 20 2a 2f 0a 0a 22 2e 4c 5f 61 64 64 5f ecx */..".L_add_
5de0: 62 69 74 73 5f 74 6f 5f 64 69 73 74 3a 5c 6e 22 bits_to_dist:\n"
5df0: 0a 22 20 20 20 20 20 20 20 20 73 75 62 62 20 20 ." subb
5e00: 20 20 25 25 63 6c 2c 20 25 25 62 6c 5c 6e 22 0a %%cl, %%bl\n".
5e10: 22 20 20 20 20 20 20 20 20 78 6f 72 6c 20 20 20 " xorl
5e20: 20 25 25 65 61 78 2c 20 25 25 65 61 78 5c 6e 22 %%eax, %%eax\n"
5e30: 0a 22 20 20 20 20 20 20 20 20 69 6e 63 6c 20 20 ." incl
5e40: 20 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 %%eax\n"."
5e50: 20 20 20 20 73 68 6c 6c 20 20 20 20 25 25 63 6c shll %%cl
5e60: 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 , %%eax\n"."
5e70: 20 20 20 20 64 65 63 6c 20 20 20 20 25 25 65 61 decl %%ea
5e80: 78 5c 6e 22 20 20 20 20 20 20 20 20 20 20 20 20 x\n"
5e90: 20 20 20 20 20 2f 2a 20 28 31 20 3c 3c 20 6f 70 /* (1 << op
5ea0: 29 20 2d 20 31 20 2a 2f 0a 22 20 20 20 20 20 20 ) - 1 */."
5eb0: 20 20 61 6e 64 6c 20 20 20 20 25 25 65 64 78 2c andl %%edx,
5ec0: 20 25 25 65 61 78 5c 6e 22 20 20 20 20 20 20 20 %%eax\n"
5ed0: 20 20 20 2f 2a 20 65 61 78 20 26 3d 20 68 6f 6c /* eax &= hol
5ee0: 64 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 73 68 d */." sh
5ef0: 72 6c 20 20 20 20 25 25 63 6c 2c 20 25 25 65 64 rl %%cl, %%ed
5f00: 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 61 64 x\n"." ad
5f10: 64 6c 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 dl %%eax, %%e
5f20: 62 70 5c 6e 22 20 20 20 20 20 20 20 20 20 20 2f bp\n" /
5f30: 2a 20 64 69 73 74 20 2b 3d 20 68 6f 6c 64 20 26 * dist += hold &
5f40: 20 28 28 31 20 3c 3c 20 6f 70 29 20 2d 20 31 29 ((1 << op) - 1)
5f50: 20 2a 2f 0a 0a 22 2e 4c 5f 63 68 65 63 6b 5f 77 */..".L_check_w
5f60: 69 6e 64 6f 77 3a 5c 6e 22 0a 22 20 20 20 20 20 indow:\n"."
5f70: 20 20 20 6d 6f 76 6c 20 20 20 20 25 25 65 73 69 movl %%esi
5f80: 2c 20 38 28 25 25 65 73 70 29 5c 6e 22 20 20 20 , 8(%%esp)\n"
5f90: 20 20 20 20 2f 2a 20 73 61 76 65 20 69 6e 20 73 /* save in s
5fa0: 6f 20 66 72 6f 6d 20 63 61 6e 20 75 73 65 20 69 o from can use i
5fb0: 74 27 73 20 72 65 67 20 2a 2f 0a 22 20 20 20 20 t's reg */."
5fc0: 20 20 20 20 6d 6f 76 6c 20 20 20 20 25 25 65 64 movl %%ed
5fd0: 69 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 i, %%eax\n"."
5fe0: 20 20 20 20 20 73 75 62 6c 20 20 20 20 32 30 28 subl 20(
5ff0: 25 25 65 73 70 29 2c 20 25 25 65 61 78 5c 6e 22 %%esp), %%eax\n"
6000: 20 20 20 20 20 20 2f 2a 20 6e 62 79 74 65 73 20 /* nbytes
6010: 3d 20 6f 75 74 20 2d 20 62 65 67 20 2a 2f 0a 0a = out - beg */..
6020: 22 20 20 20 20 20 20 20 20 63 6d 70 6c 20 20 20 " cmpl
6030: 20 25 25 65 62 70 2c 20 25 25 65 61 78 5c 6e 22 %%ebp, %%eax\n"
6040: 0a 22 20 20 20 20 20 20 20 20 6a 62 20 20 20 20 ." jb
6050: 20 20 2e 4c 5f 63 6c 69 70 5f 77 69 6e 64 6f 77 .L_clip_window
6060: 5c 6e 22 20 20 20 20 20 20 20 20 2f 2a 20 69 66 \n" /* if
6070: 20 28 64 69 73 74 20 3e 20 6e 62 79 74 65 73 29 (dist > nbytes)
6080: 20 34 2e 32 25 20 2a 2f 0a 0a 22 20 20 20 20 20 4.2% */.."
6090: 20 20 20 6d 6f 76 6c 20 20 20 20 36 34 28 25 25 movl 64(%%
60a0: 65 73 70 29 2c 20 25 25 65 63 78 5c 6e 22 20 20 esp), %%ecx\n"
60b0: 20 20 20 20 2f 2a 20 65 63 78 20 3d 20 6c 65 6e /* ecx = len
60c0: 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 */." mov
60d0: 6c 20 20 20 20 25 25 65 64 69 2c 20 25 25 65 73 l %%edi, %%es
60e0: 69 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 73 75 i\n"." su
60f0: 62 6c 20 20 20 20 25 25 65 62 70 2c 20 25 25 65 bl %%ebp, %%e
6100: 73 69 5c 6e 22 20 20 20 20 20 20 20 20 20 20 2f si\n" /
6110: 2a 20 66 72 6f 6d 20 3d 20 6f 75 74 20 2d 20 64 * from = out - d
6120: 69 73 74 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 ist */.."
6130: 20 73 61 72 6c 20 20 20 20 25 25 65 63 78 5c 6e sarl %%ecx\n
6140: 22 0a 22 20 20 20 20 20 20 20 20 6a 6e 63 20 20 "." jnc
6150: 20 20 20 2e 4c 5f 63 6f 70 79 5f 74 77 6f 5c 6e .L_copy_two\n
6160: 22 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 69 " /* i
6170: 66 20 6c 65 6e 20 25 20 32 20 3d 3d 20 30 20 2a f len % 2 == 0 *
6180: 2f 0a 0a 22 20 20 20 20 20 20 20 20 72 65 70 20 /.." rep
6190: 20 20 20 20 6d 6f 76 73 77 5c 6e 22 0a 22 20 20 movsw\n"."
61a0: 20 20 20 20 20 20 6d 6f 76 62 20 20 20 20 28 25 movb (%
61b0: 25 65 73 69 29 2c 20 25 25 61 6c 5c 6e 22 0a 22 %esi), %%al\n"."
61c0: 20 20 20 20 20 20 20 20 6d 6f 76 62 20 20 20 20 movb
61d0: 25 25 61 6c 2c 20 28 25 25 65 64 69 29 5c 6e 22 %%al, (%%edi)\n"
61e0: 0a 22 20 20 20 20 20 20 20 20 69 6e 63 6c 20 20 ." incl
61f0: 20 20 25 25 65 64 69 5c 6e 22 0a 0a 22 20 20 20 %%edi\n".."
6200: 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 38 28 25 movl 8(%
6210: 25 65 73 70 29 2c 20 25 25 65 73 69 5c 6e 22 20 %esp), %%esi\n"
6220: 20 20 20 20 20 20 2f 2a 20 6d 6f 76 65 20 69 6e /* move in
6230: 20 62 61 63 6b 20 74 6f 20 25 65 73 69 2c 20 74 back to %esi, t
6240: 6f 73 73 20 66 72 6f 6d 20 2a 2f 0a 22 20 20 20 oss from */."
6250: 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 33 32 28 movl 32(
6260: 25 25 65 73 70 29 2c 20 25 25 65 62 70 5c 6e 22 %%esp), %%ebp\n"
6270: 20 20 20 20 20 20 2f 2a 20 65 62 70 20 3d 20 6c /* ebp = l
6280: 63 6f 64 65 20 2a 2f 0a 22 20 20 20 20 20 20 20 code */."
6290: 20 6a 6d 70 20 20 20 20 20 2e 4c 5f 77 68 69 6c jmp .L_whil
62a0: 65 5f 74 65 73 74 5c 6e 22 0a 0a 22 2e 4c 5f 63 e_test\n"..".L_c
62b0: 6f 70 79 5f 74 77 6f 3a 5c 6e 22 0a 22 20 20 20 opy_two:\n"."
62c0: 20 20 20 20 20 72 65 70 20 20 20 20 20 6d 6f 76 rep mov
62d0: 73 77 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d sw\n"." m
62e0: 6f 76 6c 20 20 20 20 38 28 25 25 65 73 70 29 2c ovl 8(%%esp),
62f0: 20 25 25 65 73 69 5c 6e 22 20 20 20 20 20 20 20 %%esi\n"
6300: 2f 2a 20 6d 6f 76 65 20 69 6e 20 62 61 63 6b 20 /* move in back
6310: 74 6f 20 25 65 73 69 2c 20 74 6f 73 73 20 66 72 to %esi, toss fr
6320: 6f 6d 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d om */." m
6330: 6f 76 6c 20 20 20 20 33 32 28 25 25 65 73 70 29 ovl 32(%%esp)
6340: 2c 20 25 25 65 62 70 5c 6e 22 20 20 20 20 20 20 , %%ebp\n"
6350: 2f 2a 20 65 62 70 20 3d 20 6c 63 6f 64 65 20 2a /* ebp = lcode *
6360: 2f 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 20 20 /." jmp
6370: 20 20 20 2e 4c 5f 77 68 69 6c 65 5f 74 65 73 74 .L_while_test
6380: 5c 6e 22 0a 0a 22 2e 61 6c 69 67 6e 20 33 32 2c \n"..".align 32,
6390: 30 78 39 30 5c 6e 22 0a 22 2e 4c 5f 63 68 65 63 0x90\n".".L_chec
63a0: 6b 5f 64 69 73 74 5f 6f 6e 65 3a 5c 6e 22 0a 22 k_dist_one:\n"."
63b0: 20 20 20 20 20 20 20 20 63 6d 70 6c 20 20 20 20 cmpl
63c0: 24 31 2c 20 25 25 65 62 70 5c 6e 22 20 20 20 20 $1, %%ebp\n"
63d0: 20 20 20 20 20 20 20 20 2f 2a 20 69 66 20 64 69 /* if di
63e0: 73 74 20 31 2c 20 69 73 20 61 20 6d 65 6d 73 65 st 1, is a memse
63f0: 74 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6a 6e t */." jn
6400: 65 20 20 20 20 20 2e 4c 5f 63 68 65 63 6b 5f 77 e .L_check_w
6410: 69 6e 64 6f 77 5c 6e 22 0a 22 20 20 20 20 20 20 indow\n"."
6420: 20 20 63 6d 70 6c 20 20 20 20 25 25 65 64 69 2c cmpl %%edi,
6430: 20 32 30 28 25 25 65 73 70 29 5c 6e 22 0a 22 20 20(%%esp)\n"."
6440: 20 20 20 20 20 20 20 6a 65 20 20 20 20 20 20 2e je .
6450: 4c 5f 63 68 65 63 6b 5f 77 69 6e 64 6f 77 5c 6e L_check_window\n
6460: 22 20 20 20 20 20 20 2f 2a 20 6f 75 74 20 3d 3d " /* out ==
6470: 20 62 65 67 2c 20 69 66 20 6f 75 74 73 69 64 65 beg, if outside
6480: 20 77 69 6e 64 6f 77 20 2a 2f 0a 0a 22 20 20 20 window */.."
6490: 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 36 34 28 movl 64(
64a0: 25 25 65 73 70 29 2c 20 25 25 65 63 78 5c 6e 22 %%esp), %%ecx\n"
64b0: 20 20 20 20 20 20 2f 2a 20 65 63 78 20 3d 20 6c /* ecx = l
64c0: 65 6e 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d en */." m
64d0: 6f 76 62 20 20 20 20 2d 31 28 25 25 65 64 69 29 ovb -1(%%edi)
64e0: 2c 20 25 25 61 6c 5c 6e 22 0a 22 20 20 20 20 20 , %%al\n"."
64f0: 20 20 20 6d 6f 76 62 20 20 20 20 25 25 61 6c 2c movb %%al,
6500: 20 25 25 61 68 5c 6e 22 0a 0a 22 20 20 20 20 20 %%ah\n".."
6510: 20 20 20 73 61 72 6c 20 20 20 20 25 25 65 63 78 sarl %%ecx
6520: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 6e 63 \n"." jnc
6530: 20 20 20 20 20 2e 4c 5f 73 65 74 5f 74 77 6f 5c .L_set_two\
6540: 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 62 n"." movb
6550: 20 20 20 20 25 25 61 6c 2c 20 28 25 25 65 64 69 %%al, (%%edi
6560: 29 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 69 6e )\n"." in
6570: 63 6c 20 20 20 20 25 25 65 64 69 5c 6e 22 0a 0a cl %%edi\n"..
6580: 22 2e 4c 5f 73 65 74 5f 74 77 6f 3a 5c 6e 22 0a ".L_set_two:\n".
6590: 22 20 20 20 20 20 20 20 20 72 65 70 20 20 20 20 " rep
65a0: 20 73 74 6f 73 77 5c 6e 22 0a 22 20 20 20 20 20 stosw\n"."
65b0: 20 20 20 6d 6f 76 6c 20 20 20 20 33 32 28 25 25 movl 32(%%
65c0: 65 73 70 29 2c 20 25 25 65 62 70 5c 6e 22 20 20 esp), %%ebp\n"
65d0: 20 20 20 20 2f 2a 20 65 62 70 20 3d 20 6c 63 6f /* ebp = lco
65e0: 64 65 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6a de */." j
65f0: 6d 70 20 20 20 20 20 2e 4c 5f 77 68 69 6c 65 5f mp .L_while_
6600: 74 65 73 74 5c 6e 22 0a 0a 22 2e 61 6c 69 67 6e test\n"..".align
6610: 20 33 32 2c 30 78 39 30 5c 6e 22 0a 22 2e 4c 5f 32,0x90\n".".L_
6620: 74 65 73 74 5f 66 6f 72 5f 73 65 63 6f 6e 64 5f test_for_second_
6630: 6c 65 76 65 6c 5f 6c 65 6e 67 74 68 3a 5c 6e 22 level_length:\n"
6640: 0a 22 20 20 20 20 20 20 20 20 74 65 73 74 62 20 ." testb
6650: 20 20 24 36 34 2c 20 25 25 61 6c 5c 6e 22 0a 22 $64, %%al\n"."
6660: 20 20 20 20 20 20 20 20 6a 6e 7a 20 20 20 20 20 jnz
6670: 2e 4c 5f 74 65 73 74 5f 66 6f 72 5f 65 6e 64 5f .L_test_for_end_
6680: 6f 66 5f 62 6c 6f 63 6b 5c 6e 22 20 2f 2a 20 69 of_block\n" /* i
6690: 66 20 28 28 6f 70 20 26 20 36 34 29 20 21 3d 20 f ((op & 64) !=
66a0: 30 29 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 0) */.."
66b0: 78 6f 72 6c 20 20 20 20 25 25 65 61 78 2c 20 25 xorl %%eax, %
66c0: 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 %eax\n"."
66d0: 20 69 6e 63 6c 20 20 20 20 25 25 65 61 78 5c 6e incl %%eax\n
66e0: 22 0a 22 20 20 20 20 20 20 20 20 73 68 6c 6c 20 "." shll
66f0: 20 20 20 25 25 63 6c 2c 20 25 25 65 61 78 5c 6e %%cl, %%eax\n
6700: 22 0a 22 20 20 20 20 20 20 20 20 64 65 63 6c 20 "." decl
6710: 20 20 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 %%eax\n"."
6720: 20 20 20 20 20 61 6e 64 6c 20 20 20 20 25 25 65 andl %%e
6730: 64 78 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 dx, %%eax\n"
6740: 20 20 20 20 20 2f 2a 20 65 61 78 20 26 3d 20 68 /* eax &= h
6750: 6f 6c 64 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 old */."
6760: 61 64 64 6c 20 20 20 20 36 34 28 25 25 65 73 70 addl 64(%%esp
6770: 29 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 20 ), %%eax\n"
6780: 2f 2a 20 65 61 78 20 2b 3d 20 6c 65 6e 20 2a 2f /* eax += len */
6790: 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 ." movl
67a0: 20 20 28 25 25 65 62 70 2c 25 25 65 61 78 2c 34 (%%ebp,%%eax,4
67b0: 29 2c 20 25 25 65 61 78 5c 6e 22 20 2f 2a 20 65 ), %%eax\n" /* e
67c0: 61 78 20 3d 20 6c 63 6f 64 65 5b 76 61 6c 2b 28 ax = lcode[val+(
67d0: 68 6f 6c 64 26 6d 61 73 6b 5b 6f 70 5d 29 5d 2a hold&mask[op])]*
67e0: 2f 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 20 20 /." jmp
67f0: 20 20 20 2e 4c 5f 64 6f 6c 65 6e 5c 6e 22 0a 0a .L_dolen\n"..
6800: 22 2e 61 6c 69 67 6e 20 33 32 2c 30 78 39 30 5c ".align 32,0x90\
6810: 6e 22 0a 22 2e 4c 5f 74 65 73 74 5f 66 6f 72 5f n".".L_test_for_
6820: 73 65 63 6f 6e 64 5f 6c 65 76 65 6c 5f 64 69 73 second_level_dis
6830: 74 3a 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 74 t:\n"." t
6840: 65 73 74 62 20 20 20 24 36 34 2c 20 25 25 61 6c estb $64, %%al
6850: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 6e 7a \n"." jnz
6860: 20 20 20 20 20 2e 4c 5f 69 6e 76 61 6c 69 64 5f .L_invalid_
6870: 64 69 73 74 61 6e 63 65 5f 63 6f 64 65 5c 6e 22 distance_code\n"
6880: 20 2f 2a 20 69 66 20 28 28 6f 70 20 26 20 36 34 /* if ((op & 64
6890: 29 20 21 3d 20 30 29 20 2a 2f 0a 0a 22 20 20 20 ) != 0) */.."
68a0: 20 20 20 20 20 78 6f 72 6c 20 20 20 20 25 25 65 xorl %%e
68b0: 61 78 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 ax, %%eax\n"."
68c0: 20 20 20 20 20 20 69 6e 63 6c 20 20 20 20 25 25 incl %%
68d0: 65 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 eax\n"."
68e0: 73 68 6c 6c 20 20 20 20 25 25 63 6c 2c 20 25 25 shll %%cl, %%
68f0: 65 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 eax\n"."
6900: 64 65 63 6c 20 20 20 20 25 25 65 61 78 5c 6e 22 decl %%eax\n"
6910: 0a 22 20 20 20 20 20 20 20 20 61 6e 64 6c 20 20 ." andl
6920: 20 20 25 25 65 64 78 2c 20 25 25 65 61 78 5c 6e %%edx, %%eax\n
6930: 22 20 20 20 20 20 20 20 20 20 2f 2a 20 65 61 78 " /* eax
6940: 20 26 3d 20 68 6f 6c 64 20 2a 2f 0a 22 20 20 20 &= hold */."
6950: 20 20 20 20 20 61 64 64 6c 20 20 20 20 25 25 65 addl %%e
6960: 62 70 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 bp, %%eax\n"
6970: 20 20 20 20 20 2f 2a 20 65 61 78 20 2b 3d 20 64 /* eax += d
6980: 69 73 74 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 ist */."
6990: 6d 6f 76 6c 20 20 20 20 33 36 28 25 25 65 73 70 movl 36(%%esp
69a0: 29 2c 20 25 25 65 63 78 5c 6e 22 20 20 20 20 20 ), %%ecx\n"
69b0: 2f 2a 20 65 63 78 20 3d 20 64 63 6f 64 65 20 2a /* ecx = dcode *
69c0: 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 /." movl
69d0: 20 20 20 28 25 25 65 63 78 2c 25 25 65 61 78 2c (%%ecx,%%eax,
69e0: 34 29 2c 20 25 25 65 61 78 5c 6e 22 20 2f 2a 20 4), %%eax\n" /*
69f0: 65 61 78 20 3d 20 64 63 6f 64 65 5b 76 61 6c 2b eax = dcode[val+
6a00: 28 68 6f 6c 64 26 6d 61 73 6b 5b 6f 70 5d 29 5d (hold&mask[op])]
6a10: 2a 2f 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 20 */." jmp
6a20: 20 20 20 20 2e 4c 5f 64 6f 64 69 73 74 5c 6e 22 .L_dodist\n"
6a30: 0a 0a 22 2e 61 6c 69 67 6e 20 33 32 2c 30 78 39 ..".align 32,0x9
6a40: 30 5c 6e 22 0a 22 2e 4c 5f 63 6c 69 70 5f 77 69 0\n".".L_clip_wi
6a50: 6e 64 6f 77 3a 5c 6e 22 0a 22 20 20 20 20 20 20 ndow:\n"."
6a60: 20 20 6d 6f 76 6c 20 20 20 20 25 25 65 61 78 2c movl %%eax,
6a70: 20 25 25 65 63 78 5c 6e 22 0a 22 20 20 20 20 20 %%ecx\n"."
6a80: 20 20 20 6d 6f 76 6c 20 20 20 20 34 38 28 25 25 movl 48(%%
6a90: 65 73 70 29 2c 20 25 25 65 61 78 5c 6e 22 20 20 esp), %%eax\n"
6aa0: 20 20 20 2f 2a 20 65 61 78 20 3d 20 77 73 69 7a /* eax = wsiz
6ab0: 65 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6e 65 e */." ne
6ac0: 67 6c 20 20 20 20 25 25 65 63 78 5c 6e 22 20 20 gl %%ecx\n"
6ad0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a /*
6ae0: 20 6e 62 79 74 65 73 20 3d 20 2d 6e 62 79 74 65 nbytes = -nbyte
6af0: 73 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f s */." mo
6b00: 76 6c 20 20 20 20 32 38 28 25 25 65 73 70 29 2c vl 28(%%esp),
6b10: 20 25 25 65 73 69 5c 6e 22 20 20 20 20 20 2f 2a %%esi\n" /*
6b20: 20 66 72 6f 6d 20 3d 20 77 69 6e 64 6f 77 20 2a from = window *
6b30: 2f 0a 0a 22 20 20 20 20 20 20 20 20 63 6d 70 6c /.." cmpl
6b40: 20 20 20 20 25 25 65 62 70 2c 20 25 25 65 61 78 %%ebp, %%eax
6b50: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 62 20 \n"." jb
6b60: 20 20 20 20 20 2e 4c 5f 69 6e 76 61 6c 69 64 5f .L_invalid_
6b70: 64 69 73 74 61 6e 63 65 5f 74 6f 6f 5f 66 61 72 distance_too_far
6b80: 5c 6e 22 20 2f 2a 20 69 66 20 28 64 69 73 74 20 \n" /* if (dist
6b90: 3e 20 77 73 69 7a 65 29 20 2a 2f 0a 0a 22 20 20 > wsize) */.."
6ba0: 20 20 20 20 20 20 61 64 64 6c 20 20 20 20 25 25 addl %%
6bb0: 65 62 70 2c 20 25 25 65 63 78 5c 6e 22 20 20 20 ebp, %%ecx\n"
6bc0: 20 20 20 20 20 20 2f 2a 20 6e 62 79 74 65 73 20 /* nbytes
6bd0: 3d 20 64 69 73 74 20 2d 20 6e 62 79 74 65 73 20 = dist - nbytes
6be0: 2a 2f 0a 22 20 20 20 20 20 20 20 20 63 6d 70 6c */." cmpl
6bf0: 20 20 20 20 24 30 2c 20 35 32 28 25 25 65 73 70 $0, 52(%%esp
6c00: 29 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 6e )\n"." jn
6c10: 65 20 20 20 20 20 2e 4c 5f 77 72 61 70 5f 61 72 e .L_wrap_ar
6c20: 6f 75 6e 64 5f 77 69 6e 64 6f 77 5c 6e 22 20 2f ound_window\n" /
6c30: 2a 20 69 66 20 28 77 72 69 74 65 20 21 3d 20 30 * if (write != 0
6c40: 29 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 73 ) */.." s
6c50: 75 62 6c 20 20 20 20 25 25 65 63 78 2c 20 25 25 ubl %%ecx, %%
6c60: 65 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 eax\n"."
6c70: 61 64 64 6c 20 20 20 20 25 25 65 61 78 2c 20 25 addl %%eax, %
6c80: 25 65 73 69 5c 6e 22 20 20 20 20 20 20 20 20 20 %esi\n"
6c90: 2f 2a 20 66 72 6f 6d 20 2b 3d 20 77 73 69 7a 65 /* from += wsize
6ca0: 20 2d 20 6e 62 79 74 65 73 20 2a 2f 0a 0a 22 20 - nbytes */.."
6cb0: 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 36 movl 6
6cc0: 34 28 25 25 65 73 70 29 2c 20 25 25 65 61 78 5c 4(%%esp), %%eax\
6cd0: 6e 22 20 20 20 20 20 2f 2a 20 65 61 78 20 3d 20 n" /* eax =
6ce0: 6c 65 6e 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 len */."
6cf0: 63 6d 70 6c 20 20 20 20 25 25 65 63 78 2c 20 25 cmpl %%ecx, %
6d00: 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 %eax\n"."
6d10: 20 6a 62 65 20 20 20 20 20 2e 4c 5f 64 6f 5f 63 jbe .L_do_c
6d20: 6f 70 79 5c 6e 22 20 20 20 20 20 20 20 20 20 20 opy\n"
6d30: 20 2f 2a 20 69 66 20 28 6e 62 79 74 65 73 20 3e /* if (nbytes >
6d40: 3d 20 6c 65 6e 29 20 2a 2f 0a 0a 22 20 20 20 20 = len) */.."
6d50: 20 20 20 20 73 75 62 6c 20 20 20 20 25 25 65 63 subl %%ec
6d60: 78 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 20 x, %%eax\n"
6d70: 20 20 20 20 2f 2a 20 6c 65 6e 20 2d 3d 20 6e 62 /* len -= nb
6d80: 79 74 65 73 20 2a 2f 0a 22 20 20 20 20 20 20 20 ytes */."
6d90: 20 72 65 70 20 20 20 20 20 6d 6f 76 73 62 5c 6e rep movsb\n
6da0: 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 "." movl
6db0: 20 20 20 25 25 65 64 69 2c 20 25 25 65 73 69 5c %%edi, %%esi\
6dc0: 6e 22 0a 22 20 20 20 20 20 20 20 20 73 75 62 6c n"." subl
6dd0: 20 20 20 20 25 25 65 62 70 2c 20 25 25 65 73 69 %%ebp, %%esi
6de0: 5c 6e 22 20 20 20 20 20 20 20 20 20 2f 2a 20 66 \n" /* f
6df0: 72 6f 6d 20 3d 20 6f 75 74 20 2d 20 64 69 73 74 rom = out - dist
6e00: 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 */." jmp
6e10: 20 20 20 20 20 2e 4c 5f 64 6f 5f 63 6f 70 79 5c .L_do_copy\
6e20: 6e 22 0a 0a 22 2e 61 6c 69 67 6e 20 33 32 2c 30 n"..".align 32,0
6e30: 78 39 30 5c 6e 22 0a 22 2e 4c 5f 77 72 61 70 5f x90\n".".L_wrap_
6e40: 61 72 6f 75 6e 64 5f 77 69 6e 64 6f 77 3a 5c 6e around_window:\n
6e50: 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 "." movl
6e60: 20 20 20 35 32 28 25 25 65 73 70 29 2c 20 25 25 52(%%esp), %%
6e70: 65 61 78 5c 6e 22 20 20 20 20 20 2f 2a 20 65 61 eax\n" /* ea
6e80: 78 20 3d 20 77 72 69 74 65 20 2a 2f 0a 22 20 20 x = write */."
6e90: 20 20 20 20 20 20 63 6d 70 6c 20 20 20 20 25 25 cmpl %%
6ea0: 65 61 78 2c 20 25 25 65 63 78 5c 6e 22 0a 22 20 eax, %%ecx\n"."
6eb0: 20 20 20 20 20 20 20 6a 62 65 20 20 20 20 20 2e jbe .
6ec0: 4c 5f 63 6f 6e 74 69 67 75 6f 75 73 5f 69 6e 5f L_contiguous_in_
6ed0: 77 69 6e 64 6f 77 5c 6e 22 20 2f 2a 20 69 66 20 window\n" /* if
6ee0: 28 77 72 69 74 65 20 3e 3d 20 6e 62 79 74 65 73 (write >= nbytes
6ef0: 29 20 2a 2f 0a 0a 22 20 20 20 20 20 20 20 20 61 ) */.." a
6f00: 64 64 6c 20 20 20 20 34 38 28 25 25 65 73 70 29 ddl 48(%%esp)
6f10: 2c 20 25 25 65 73 69 5c 6e 22 20 20 20 20 20 2f , %%esi\n" /
6f20: 2a 20 66 72 6f 6d 20 2b 3d 20 77 73 69 7a 65 20 * from += wsize
6f30: 2a 2f 0a 22 20 20 20 20 20 20 20 20 61 64 64 6c */." addl
6f40: 20 20 20 20 25 25 65 61 78 2c 20 25 25 65 73 69 %%eax, %%esi
6f50: 5c 6e 22 20 20 20 20 20 20 20 20 20 2f 2a 20 66 \n" /* f
6f60: 72 6f 6d 20 2b 3d 20 77 72 69 74 65 20 2a 2f 0a rom += write */.
6f70: 22 20 20 20 20 20 20 20 20 73 75 62 6c 20 20 20 " subl
6f80: 20 25 25 65 63 78 2c 20 25 25 65 73 69 5c 6e 22 %%ecx, %%esi\n"
6f90: 20 20 20 20 20 20 20 20 20 2f 2a 20 66 72 6f 6d /* from
6fa0: 20 2d 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 22 20 -= nbytes */."
6fb0: 20 20 20 20 20 20 20 73 75 62 6c 20 20 20 20 25 subl %
6fc0: 25 65 61 78 2c 20 25 25 65 63 78 5c 6e 22 20 20 %eax, %%ecx\n"
6fd0: 20 20 20 20 20 20 20 2f 2a 20 6e 62 79 74 65 73 /* nbytes
6fe0: 20 2d 3d 20 77 72 69 74 65 20 2a 2f 0a 0a 22 20 -= write */.."
6ff0: 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 36 movl 6
7000: 34 28 25 25 65 73 70 29 2c 20 25 25 65 61 78 5c 4(%%esp), %%eax\
7010: 6e 22 20 20 20 20 20 2f 2a 20 65 61 78 20 3d 20 n" /* eax =
7020: 6c 65 6e 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 len */."
7030: 63 6d 70 6c 20 20 20 20 25 25 65 63 78 2c 20 25 cmpl %%ecx, %
7040: 25 65 61 78 5c 6e 22 0a 22 20 20 20 20 20 20 20 %eax\n"."
7050: 20 6a 62 65 20 20 20 20 20 2e 4c 5f 64 6f 5f 63 jbe .L_do_c
7060: 6f 70 79 5c 6e 22 20 20 20 20 20 20 20 20 20 20 opy\n"
7070: 20 2f 2a 20 69 66 20 28 6e 62 79 74 65 73 20 3e /* if (nbytes >
7080: 3d 20 6c 65 6e 29 20 2a 2f 0a 0a 22 20 20 20 20 = len) */.."
7090: 20 20 20 20 73 75 62 6c 20 20 20 20 25 25 65 63 subl %%ec
70a0: 78 2c 20 25 25 65 61 78 5c 6e 22 20 20 20 20 20 x, %%eax\n"
70b0: 20 20 20 20 2f 2a 20 6c 65 6e 20 2d 3d 20 6e 62 /* len -= nb
70c0: 79 74 65 73 20 2a 2f 0a 22 20 20 20 20 20 20 20 ytes */."
70d0: 20 72 65 70 20 20 20 20 20 6d 6f 76 73 62 5c 6e rep movsb\n
70e0: 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 "." movl
70f0: 20 20 20 32 38 28 25 25 65 73 70 29 2c 20 25 25 28(%%esp), %%
7100: 65 73 69 5c 6e 22 20 20 20 20 20 2f 2a 20 66 72 esi\n" /* fr
7110: 6f 6d 20 3d 20 77 69 6e 64 6f 77 20 2a 2f 0a 22 om = window */."
7120: 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 movl
7130: 35 32 28 25 25 65 73 70 29 2c 20 25 25 65 63 78 52(%%esp), %%ecx
7140: 5c 6e 22 20 20 20 20 20 2f 2a 20 6e 62 79 74 65 \n" /* nbyte
7150: 73 20 3d 20 77 72 69 74 65 20 2a 2f 0a 22 20 20 s = write */."
7160: 20 20 20 20 20 20 63 6d 70 6c 20 20 20 20 25 25 cmpl %%
7170: 65 63 78 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 ecx, %%eax\n"."
7180: 20 20 20 20 20 20 20 6a 62 65 20 20 20 20 20 2e jbe .
7190: 4c 5f 64 6f 5f 63 6f 70 79 5c 6e 22 20 20 20 20 L_do_copy\n"
71a0: 20 20 20 20 20 20 20 2f 2a 20 69 66 20 28 6e 62 /* if (nb
71b0: 79 74 65 73 20 3e 3d 20 6c 65 6e 29 20 2a 2f 0a ytes >= len) */.
71c0: 0a 22 20 20 20 20 20 20 20 20 73 75 62 6c 20 20 ." subl
71d0: 20 20 25 25 65 63 78 2c 20 25 25 65 61 78 5c 6e %%ecx, %%eax\n
71e0: 22 20 20 20 20 20 20 20 20 20 2f 2a 20 6c 65 6e " /* len
71f0: 20 2d 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 22 20 -= nbytes */."
7200: 20 20 20 20 20 20 20 72 65 70 20 20 20 20 20 6d rep m
7210: 6f 76 73 62 5c 6e 22 0a 22 20 20 20 20 20 20 20 ovsb\n"."
7220: 20 6d 6f 76 6c 20 20 20 20 25 25 65 64 69 2c 20 movl %%edi,
7230: 25 25 65 73 69 5c 6e 22 0a 22 20 20 20 20 20 20 %%esi\n"."
7240: 20 20 73 75 62 6c 20 20 20 20 25 25 65 62 70 2c subl %%ebp,
7250: 20 25 25 65 73 69 5c 6e 22 20 20 20 20 20 20 20 %%esi\n"
7260: 20 20 2f 2a 20 66 72 6f 6d 20 3d 20 6f 75 74 20 /* from = out
7270: 2d 20 64 69 73 74 20 2a 2f 0a 22 20 20 20 20 20 - dist */."
7280: 20 20 20 6a 6d 70 20 20 20 20 20 2e 4c 5f 64 6f jmp .L_do
7290: 5f 63 6f 70 79 5c 6e 22 0a 0a 22 2e 61 6c 69 67 _copy\n"..".alig
72a0: 6e 20 33 32 2c 30 78 39 30 5c 6e 22 0a 22 2e 4c n 32,0x90\n".".L
72b0: 5f 63 6f 6e 74 69 67 75 6f 75 73 5f 69 6e 5f 77 _contiguous_in_w
72c0: 69 6e 64 6f 77 3a 5c 6e 22 0a 22 20 20 20 20 20 indow:\n"."
72d0: 20 20 20 61 64 64 6c 20 20 20 20 25 25 65 61 78 addl %%eax
72e0: 2c 20 25 25 65 73 69 5c 6e 22 0a 22 20 20 20 20 , %%esi\n"."
72f0: 20 20 20 20 73 75 62 6c 20 20 20 20 25 25 65 63 subl %%ec
7300: 78 2c 20 25 25 65 73 69 5c 6e 22 20 20 20 20 20 x, %%esi\n"
7310: 20 20 20 20 2f 2a 20 66 72 6f 6d 20 2b 3d 20 77 /* from += w
7320: 72 69 74 65 20 2d 20 6e 62 79 74 65 73 20 2a 2f rite - nbytes */
7330: 0a 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 .." movl
7340: 20 20 20 36 34 28 25 25 65 73 70 29 2c 20 25 25 64(%%esp), %%
7350: 65 61 78 5c 6e 22 20 20 20 20 20 2f 2a 20 65 61 eax\n" /* ea
7360: 78 20 3d 20 6c 65 6e 20 2a 2f 0a 22 20 20 20 20 x = len */."
7370: 20 20 20 20 63 6d 70 6c 20 20 20 20 25 25 65 63 cmpl %%ec
7380: 78 2c 20 25 25 65 61 78 5c 6e 22 0a 22 20 20 20 x, %%eax\n"."
7390: 20 20 20 20 20 6a 62 65 20 20 20 20 20 2e 4c 5f jbe .L_
73a0: 64 6f 5f 63 6f 70 79 5c 6e 22 20 20 20 20 20 20 do_copy\n"
73b0: 20 20 20 20 20 2f 2a 20 69 66 20 28 6e 62 79 74 /* if (nbyt
73c0: 65 73 20 3e 3d 20 6c 65 6e 29 20 2a 2f 0a 0a 22 es >= len) */.."
73d0: 20 20 20 20 20 20 20 20 73 75 62 6c 20 20 20 20 subl
73e0: 25 25 65 63 78 2c 20 25 25 65 61 78 5c 6e 22 20 %%ecx, %%eax\n"
73f0: 20 20 20 20 20 20 20 20 2f 2a 20 6c 65 6e 20 2d /* len -
7400: 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 22 20 20 20 = nbytes */."
7410: 20 20 20 20 20 72 65 70 20 20 20 20 20 6d 6f 76 rep mov
7420: 73 62 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d sb\n"." m
7430: 6f 76 6c 20 20 20 20 25 25 65 64 69 2c 20 25 25 ovl %%edi, %%
7440: 65 73 69 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 esi\n"."
7450: 73 75 62 6c 20 20 20 20 25 25 65 62 70 2c 20 25 subl %%ebp, %
7460: 25 65 73 69 5c 6e 22 20 20 20 20 20 20 20 20 20 %esi\n"
7470: 2f 2a 20 66 72 6f 6d 20 3d 20 6f 75 74 20 2d 20 /* from = out -
7480: 64 69 73 74 20 2a 2f 0a 22 20 20 20 20 20 20 20 dist */."
7490: 20 6a 6d 70 20 20 20 20 20 2e 4c 5f 64 6f 5f 63 jmp .L_do_c
74a0: 6f 70 79 5c 6e 22 20 20 20 20 20 20 20 20 20 20 opy\n"
74b0: 20 2f 2a 20 69 66 20 28 6e 62 79 74 65 73 20 3e /* if (nbytes >
74c0: 3d 20 6c 65 6e 29 20 2a 2f 0a 0a 22 2e 61 6c 69 = len) */..".ali
74d0: 67 6e 20 33 32 2c 30 78 39 30 5c 6e 22 0a 22 2e gn 32,0x90\n".".
74e0: 4c 5f 64 6f 5f 63 6f 70 79 3a 5c 6e 22 0a 22 20 L_do_copy:\n"."
74f0: 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 25 movl %
7500: 25 65 61 78 2c 20 25 25 65 63 78 5c 6e 22 0a 22 %eax, %%ecx\n"."
7510: 20 20 20 20 20 20 20 20 72 65 70 20 20 20 20 20 rep
7520: 6d 6f 76 73 62 5c 6e 22 0a 0a 22 20 20 20 20 20 movsb\n".."
7530: 20 20 20 6d 6f 76 6c 20 20 20 20 38 28 25 25 65 movl 8(%%e
7540: 73 70 29 2c 20 25 25 65 73 69 5c 6e 22 20 20 20 sp), %%esi\n"
7550: 20 20 20 2f 2a 20 6d 6f 76 65 20 69 6e 20 62 61 /* move in ba
7560: 63 6b 20 74 6f 20 25 65 73 69 2c 20 74 6f 73 73 ck to %esi, toss
7570: 20 66 72 6f 6d 20 2a 2f 0a 22 20 20 20 20 20 20 from */."
7580: 20 20 6d 6f 76 6c 20 20 20 20 33 32 28 25 25 65 movl 32(%%e
7590: 73 70 29 2c 20 25 25 65 62 70 5c 6e 22 20 20 20 sp), %%ebp\n"
75a0: 20 20 2f 2a 20 65 62 70 20 3d 20 6c 63 6f 64 65 /* ebp = lcode
75b0: 20 2a 2f 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 */." jmp
75c0: 20 20 20 20 20 2e 4c 5f 77 68 69 6c 65 5f 74 65 .L_while_te
75d0: 73 74 5c 6e 22 0a 0a 22 2e 4c 5f 74 65 73 74 5f st\n"..".L_test_
75e0: 66 6f 72 5f 65 6e 64 5f 6f 66 5f 62 6c 6f 63 6b for_end_of_block
75f0: 3a 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 74 65 :\n"." te
7600: 73 74 62 20 20 20 24 33 32 2c 20 25 25 61 6c 5c stb $32, %%al\
7610: 6e 22 0a 22 20 20 20 20 20 20 20 20 6a 7a 20 20 n"." jz
7620: 20 20 20 20 2e 4c 5f 69 6e 76 61 6c 69 64 5f 6c .L_invalid_l
7630: 69 74 65 72 61 6c 5f 6c 65 6e 67 74 68 5f 63 6f iteral_length_co
7640: 64 65 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d de\n"." m
7650: 6f 76 6c 20 20 20 20 24 31 2c 20 37 32 28 25 25 ovl $1, 72(%%
7660: 65 73 70 29 5c 6e 22 0a 22 20 20 20 20 20 20 20 esp)\n"."
7670: 20 6a 6d 70 20 20 20 20 20 2e 4c 5f 62 72 65 61 jmp .L_brea
7680: 6b 5f 6c 6f 6f 70 5f 77 69 74 68 5f 73 74 61 74 k_loop_with_stat
7690: 75 73 5c 6e 22 0a 0a 22 2e 4c 5f 69 6e 76 61 6c us\n"..".L_inval
76a0: 69 64 5f 6c 69 74 65 72 61 6c 5f 6c 65 6e 67 74 id_literal_lengt
76b0: 68 5f 63 6f 64 65 3a 5c 6e 22 0a 22 20 20 20 20 h_code:\n"."
76c0: 20 20 20 20 6d 6f 76 6c 20 20 20 20 24 32 2c 20 movl $2,
76d0: 37 32 28 25 25 65 73 70 29 5c 6e 22 0a 22 20 20 72(%%esp)\n"."
76e0: 20 20 20 20 20 20 6a 6d 70 20 20 20 20 20 2e 4c jmp .L
76f0: 5f 62 72 65 61 6b 5f 6c 6f 6f 70 5f 77 69 74 68 _break_loop_with
7700: 5f 73 74 61 74 75 73 5c 6e 22 0a 0a 22 2e 4c 5f _status\n"..".L_
7710: 69 6e 76 61 6c 69 64 5f 64 69 73 74 61 6e 63 65 invalid_distance
7720: 5f 63 6f 64 65 3a 5c 6e 22 0a 22 20 20 20 20 20 _code:\n"."
7730: 20 20 20 6d 6f 76 6c 20 20 20 20 24 33 2c 20 37 movl $3, 7
7740: 32 28 25 25 65 73 70 29 5c 6e 22 0a 22 20 20 20 2(%%esp)\n"."
7750: 20 20 20 20 20 6a 6d 70 20 20 20 20 20 2e 4c 5f jmp .L_
7760: 62 72 65 61 6b 5f 6c 6f 6f 70 5f 77 69 74 68 5f break_loop_with_
7770: 73 74 61 74 75 73 5c 6e 22 0a 0a 22 2e 4c 5f 69 status\n"..".L_i
7780: 6e 76 61 6c 69 64 5f 64 69 73 74 61 6e 63 65 5f nvalid_distance_
7790: 74 6f 6f 5f 66 61 72 3a 5c 6e 22 0a 22 20 20 20 too_far:\n"."
77a0: 20 20 20 20 20 6d 6f 76 6c 20 20 20 20 38 28 25 movl 8(%
77b0: 25 65 73 70 29 2c 20 25 25 65 73 69 5c 6e 22 0a %esp), %%esi\n".
77c0: 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 " movl
77d0: 20 24 34 2c 20 37 32 28 25 25 65 73 70 29 5c 6e $4, 72(%%esp)\n
77e0: 22 0a 22 20 20 20 20 20 20 20 20 6a 6d 70 20 20 "." jmp
77f0: 20 20 20 2e 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 .L_break_loop
7800: 5f 77 69 74 68 5f 73 74 61 74 75 73 5c 6e 22 0a _with_status\n".
7810: 0a 22 2e 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 3a .".L_break_loop:
7820: 5c 6e 22 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 \n"." mov
7830: 6c 20 20 20 20 24 30 2c 20 37 32 28 25 25 65 73 l $0, 72(%%es
7840: 70 29 5c 6e 22 0a 0a 22 2e 4c 5f 62 72 65 61 6b p)\n"..".L_break
7850: 5f 6c 6f 6f 70 5f 77 69 74 68 5f 73 74 61 74 75 _loop_with_statu
7860: 73 3a 5c 6e 22 0a 2f 2a 20 70 75 74 20 69 6e 2c s:\n"./* put in,
7870: 20 6f 75 74 2c 20 62 69 74 73 2c 20 61 6e 64 20 out, bits, and
7880: 68 6f 6c 64 20 62 61 63 6b 20 69 6e 74 6f 20 61 hold back into a
7890: 72 20 61 6e 64 20 70 6f 70 20 65 73 70 20 2a 2f r and pop esp */
78a0: 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 ." movl
78b0: 20 20 25 25 65 73 69 2c 20 38 28 25 25 65 73 70 %%esi, 8(%%esp
78c0: 29 5c 6e 22 20 20 20 20 20 20 2f 2a 20 73 61 76 )\n" /* sav
78d0: 65 20 69 6e 20 2a 2f 0a 22 20 20 20 20 20 20 20 e in */."
78e0: 20 6d 6f 76 6c 20 20 20 20 25 25 65 64 69 2c 20 movl %%edi,
78f0: 31 36 28 25 25 65 73 70 29 5c 6e 22 20 20 20 20 16(%%esp)\n"
7900: 20 2f 2a 20 73 61 76 65 20 6f 75 74 20 2a 2f 0a /* save out */.
7910: 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 20 20 " movl
7920: 20 25 25 65 62 78 2c 20 34 34 28 25 25 65 73 70 %%ebx, 44(%%esp
7930: 29 5c 6e 22 20 20 20 20 20 2f 2a 20 73 61 76 65 )\n" /* save
7940: 20 62 69 74 73 20 2a 2f 0a 22 20 20 20 20 20 20 bits */."
7950: 20 20 6d 6f 76 6c 20 20 20 20 25 25 65 64 78 2c movl %%edx,
7960: 20 34 30 28 25 25 65 73 70 29 5c 6e 22 20 20 20 40(%%esp)\n"
7970: 20 20 2f 2a 20 73 61 76 65 20 68 6f 6c 64 20 2a /* save hold *
7980: 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 /." movl
7990: 20 20 20 34 28 25 25 65 73 70 29 2c 20 25 25 65 4(%%esp), %%e
79a0: 62 70 5c 6e 22 20 20 20 20 20 20 2f 2a 20 72 65 bp\n" /* re
79b0: 73 74 6f 72 65 20 65 73 70 2c 20 65 62 70 20 2a store esp, ebp *
79c0: 2f 0a 22 20 20 20 20 20 20 20 20 6d 6f 76 6c 20 /." movl
79d0: 20 20 20 28 25 25 65 73 70 29 2c 20 25 25 65 73 (%%esp), %%es
79e0: 70 5c 6e 22 0a 20 20 20 20 20 20 20 20 20 20 3a p\n". :
79f0: 0a 20 20 20 20 20 20 20 20 20 20 3a 20 22 6d 22 . : "m"
7a00: 20 28 61 72 29 0a 20 20 20 20 20 20 20 20 20 20 (ar).
7a10: 3a 20 22 6d 65 6d 6f 72 79 22 2c 20 22 25 65 61 : "memory", "%ea
7a20: 78 22 2c 20 22 25 65 62 78 22 2c 20 22 25 65 63 x", "%ebx", "%ec
7a30: 78 22 2c 20 22 25 65 64 78 22 2c 20 22 25 65 73 x", "%edx", "%es
7a40: 69 22 2c 20 22 25 65 64 69 22 0a 20 20 20 20 29 i", "%edi". )
7a50: 3b 0a 23 65 6c 69 66 20 64 65 66 69 6e 65 64 28 ;.#elif defined(
7a60: 20 5f 4d 53 43 5f 56 45 52 20 29 20 26 26 20 21 _MSC_VER ) && !
7a70: 20 64 65 66 69 6e 65 64 28 20 5f 4d 5f 41 4d 44 defined( _M_AMD
7a80: 36 34 20 29 0a 20 20 20 20 5f 5f 61 73 6d 20 7b 64 ). __asm {
7a90: 0a 09 6c 65 61 09 65 61 78 2c 20 61 72 0a 09 6d ..lea.eax, ar..m
7aa0: 6f 76 09 5b 65 61 78 5d 2c 20 65 73 70 20 20 20 ov.[eax], esp
7ab0: 20 20 20 20 20 20 2f 2a 20 73 61 76 65 20 65 73 /* save es
7ac0: 70 2c 20 65 62 70 20 2a 2f 0a 09 6d 6f 76 09 5b p, ebp */..mov.[
7ad0: 65 61 78 2b 34 5d 2c 20 65 62 70 0a 09 6d 6f 76 eax+4], ebp..mov
7ae0: 09 65 73 70 2c 20 65 61 78 0a 09 6d 6f 76 09 65 .esp, eax..mov.e
7af0: 73 69 2c 20 5b 65 73 70 2b 38 5d 20 20 20 20 20 si, [esp+8]
7b00: 20 20 2f 2a 20 65 73 69 20 3d 20 69 6e 20 2a 2f /* esi = in */
7b10: 0a 09 6d 6f 76 09 65 64 69 2c 20 5b 65 73 70 2b ..mov.edi, [esp+
7b20: 31 36 5d 20 20 20 20 20 20 2f 2a 20 65 64 69 20 16] /* edi
7b30: 3d 20 6f 75 74 20 2a 2f 0a 09 6d 6f 76 09 65 64 = out */..mov.ed
7b40: 78 2c 20 5b 65 73 70 2b 34 30 5d 20 20 20 20 20 x, [esp+40]
7b50: 20 2f 2a 20 65 64 78 20 3d 20 68 6f 6c 64 20 2a /* edx = hold *
7b60: 2f 0a 09 6d 6f 76 09 65 62 78 2c 20 5b 65 73 70 /..mov.ebx, [esp
7b70: 2b 34 34 5d 20 20 20 20 20 20 2f 2a 20 65 62 78 +44] /* ebx
7b80: 20 3d 20 62 69 74 73 20 2a 2f 0a 09 6d 6f 76 09 = bits */..mov.
7b90: 65 62 70 2c 20 5b 65 73 70 2b 33 32 5d 20 20 20 ebp, [esp+32]
7ba0: 20 20 20 2f 2a 20 65 62 70 20 3d 20 6c 63 6f 64 /* ebp = lcod
7bb0: 65 20 2a 2f 0a 0a 09 63 6c 64 0a 09 6a 6d 70 09 e */...cld..jmp.
7bc0: 4c 5f 64 6f 5f 6c 6f 6f 70 0a 0a 41 4c 49 47 4e L_do_loop..ALIGN
7bd0: 20 34 0a 4c 5f 77 68 69 6c 65 5f 74 65 73 74 3a 4.L_while_test:
7be0: 0a 09 63 6d 70 09 5b 65 73 70 2b 32 34 5d 2c 20 ..cmp.[esp+24],
7bf0: 65 64 69 0a 09 6a 62 65 09 4c 5f 62 72 65 61 6b edi..jbe.L_break
7c00: 5f 6c 6f 6f 70 0a 09 63 6d 70 09 5b 65 73 70 2b _loop..cmp.[esp+
7c10: 31 32 5d 2c 20 65 73 69 0a 09 6a 62 65 09 4c 5f 12], esi..jbe.L_
7c20: 62 72 65 61 6b 5f 6c 6f 6f 70 0a 0a 4c 5f 64 6f break_loop..L_do
7c30: 5f 6c 6f 6f 70 3a 0a 09 63 6d 70 09 62 6c 2c 20 _loop:..cmp.bl,
7c40: 31 35 0a 09 6a 61 09 4c 5f 67 65 74 5f 6c 65 6e 15..ja.L_get_len
7c50: 67 74 68 5f 63 6f 64 65 20 20 20 20 2f 2a 20 69 gth_code /* i
7c60: 66 20 28 31 35 20 3c 20 62 69 74 73 29 20 2a 2f f (15 < bits) */
7c70: 0a 0a 09 78 6f 72 09 65 61 78 2c 20 65 61 78 0a ...xor.eax, eax.
7c80: 09 6c 6f 64 73 77 20 20 20 20 20 20 20 20 20 20 .lodsw
7c90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f /
7ca0: 2a 20 61 6c 20 3d 20 2a 28 75 73 68 6f 72 74 20 * al = *(ushort
7cb0: 2a 29 69 6e 2b 2b 20 2a 2f 0a 09 6d 6f 76 09 63 *)in++ */..mov.c
7cc0: 6c 2c 20 62 6c 20 20 20 20 20 20 20 20 20 20 20 l, bl
7cd0: 20 2f 2a 20 63 6c 20 3d 20 62 69 74 73 2c 20 6e /* cl = bits, n
7ce0: 65 65 64 73 20 69 74 20 66 6f 72 20 73 68 69 66 eeds it for shif
7cf0: 74 69 6e 67 20 2a 2f 0a 09 61 64 64 09 62 6c 2c ting */..add.bl,
7d00: 20 31 36 20 20 20 20 20 20 20 20 20 20 20 20 20 16
7d10: 2f 2a 20 62 69 74 73 20 2b 3d 20 31 36 20 2a 2f /* bits += 16 */
7d20: 0a 09 73 68 6c 09 65 61 78 2c 20 63 6c 0a 09 6f ..shl.eax, cl..o
7d30: 72 09 65 64 78 2c 20 65 61 78 20 20 20 20 20 20 r.edx, eax
7d40: 20 20 2f 2a 20 68 6f 6c 64 20 7c 3d 20 2a 28 28 /* hold |= *((
7d50: 75 73 68 6f 72 74 20 2a 29 69 6e 29 2b 2b 20 3c ushort *)in)++ <
7d60: 3c 20 62 69 74 73 20 2a 2f 0a 0a 4c 5f 67 65 74 < bits */..L_get
7d70: 5f 6c 65 6e 67 74 68 5f 63 6f 64 65 3a 0a 09 6d _length_code:..m
7d80: 6f 76 09 65 61 78 2c 20 5b 65 73 70 2b 35 36 5d ov.eax, [esp+56]
7d90: 20 20 20 20 20 20 2f 2a 20 65 61 78 20 3d 20 6c /* eax = l
7da0: 6d 61 73 6b 20 2a 2f 0a 09 61 6e 64 09 65 61 78 mask */..and.eax
7db0: 2c 20 65 64 78 20 20 20 20 20 20 20 20 20 20 2f , edx /
7dc0: 2a 20 65 61 78 20 26 3d 20 68 6f 6c 64 20 2a 2f * eax &= hold */
7dd0: 0a 09 6d 6f 76 09 65 61 78 2c 20 5b 65 62 70 2b ..mov.eax, [ebp+
7de0: 65 61 78 2a 34 5d 20 2f 2a 20 65 61 78 20 3d 20 eax*4] /* eax =
7df0: 6c 63 6f 64 65 5b 68 6f 6c 64 20 26 20 6c 6d 61 lcode[hold & lma
7e00: 73 6b 5d 20 2a 2f 0a 0a 4c 5f 64 6f 6c 65 6e 3a sk] */..L_dolen:
7e10: 0a 09 6d 6f 76 09 63 6c 2c 20 61 68 20 20 20 20 ..mov.cl, ah
7e20: 20 20 20 20 20 20 20 20 2f 2a 20 63 6c 20 3d 20 /* cl =
7e30: 74 68 69 73 2e 62 69 74 73 20 2a 2f 0a 09 73 75 this.bits */..su
7e40: 62 09 62 6c 2c 20 61 68 20 20 20 20 20 20 20 20 b.bl, ah
7e50: 20 20 20 20 2f 2a 20 62 69 74 73 20 2d 3d 20 74 /* bits -= t
7e60: 68 69 73 2e 62 69 74 73 20 2a 2f 0a 09 73 68 72 his.bits */..shr
7e70: 09 65 64 78 2c 20 63 6c 20 20 20 20 20 20 20 20 .edx, cl
7e80: 20 20 20 2f 2a 20 68 6f 6c 64 20 3e 3e 3d 20 74 /* hold >>= t
7e90: 68 69 73 2e 62 69 74 73 20 2a 2f 0a 0a 09 74 65 his.bits */...te
7ea0: 73 74 09 61 6c 2c 20 61 6c 0a 09 6a 6e 7a 09 4c st.al, al..jnz.L
7eb0: 5f 74 65 73 74 5f 66 6f 72 5f 6c 65 6e 67 74 68 _test_for_length
7ec0: 5f 62 61 73 65 20 2f 2a 20 69 66 20 28 6f 70 20 _base /* if (op
7ed0: 21 3d 20 30 29 20 34 35 2e 37 25 20 2a 2f 0a 0a != 0) 45.7% */..
7ee0: 09 73 68 72 09 65 61 78 2c 20 31 36 20 20 20 20 .shr.eax, 16
7ef0: 20 20 20 20 20 20 20 20 2f 2a 20 6f 75 74 70 75 /* outpu
7f00: 74 20 74 68 69 73 2e 76 61 6c 20 63 68 61 72 20 t this.val char
7f10: 2a 2f 0a 09 73 74 6f 73 62 0a 09 6a 6d 70 09 4c */..stosb..jmp.L
7f20: 5f 77 68 69 6c 65 5f 74 65 73 74 0a 0a 41 4c 49 _while_test..ALI
7f30: 47 4e 20 34 0a 4c 5f 74 65 73 74 5f 66 6f 72 5f GN 4.L_test_for_
7f40: 6c 65 6e 67 74 68 5f 62 61 73 65 3a 0a 09 6d 6f length_base:..mo
7f50: 76 09 65 63 78 2c 20 65 61 78 20 20 20 20 20 20 v.ecx, eax
7f60: 20 20 20 20 2f 2a 20 6c 65 6e 20 3d 20 74 68 69 /* len = thi
7f70: 73 20 2a 2f 0a 09 73 68 72 09 65 63 78 2c 20 31 s */..shr.ecx, 1
7f80: 36 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 6 /*
7f90: 6c 65 6e 20 3d 20 74 68 69 73 2e 76 61 6c 20 2a len = this.val *
7fa0: 2f 0a 09 6d 6f 76 09 5b 65 73 70 2b 36 34 5d 2c /..mov.[esp+64],
7fb0: 20 65 63 78 20 20 20 20 20 20 2f 2a 20 73 61 76 ecx /* sav
7fc0: 65 20 6c 65 6e 20 2a 2f 0a 09 6d 6f 76 09 63 6c e len */..mov.cl
7fd0: 2c 20 61 6c 0a 0a 09 74 65 73 74 09 61 6c 2c 20 , al...test.al,
7fe0: 31 36 0a 09 6a 7a 09 4c 5f 74 65 73 74 5f 66 6f 16..jz.L_test_fo
7ff0: 72 5f 73 65 63 6f 6e 64 5f 6c 65 76 65 6c 5f 6c r_second_level_l
8000: 65 6e 67 74 68 20 2f 2a 20 69 66 20 28 28 6f 70 ength /* if ((op
8010: 20 26 20 31 36 29 20 3d 3d 20 30 29 20 38 25 20 & 16) == 0) 8%
8020: 2a 2f 0a 09 61 6e 64 09 63 6c 2c 20 31 35 20 20 */..and.cl, 15
8030: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 6f 70 /* op
8040: 20 26 3d 20 31 35 20 2a 2f 0a 09 6a 7a 09 4c 5f &= 15 */..jz.L_
8050: 64 65 63 6f 64 65 5f 64 69 73 74 61 6e 63 65 20 decode_distance
8060: 20 20 20 2f 2a 20 69 66 20 28 21 6f 70 29 20 2a /* if (!op) *
8070: 2f 0a 09 63 6d 70 09 62 6c 2c 20 63 6c 0a 09 6a /..cmp.bl, cl..j
8080: 61 65 09 4c 5f 61 64 64 5f 62 69 74 73 5f 74 6f ae.L_add_bits_to
8090: 5f 6c 65 6e 20 20 20 20 2f 2a 20 69 66 20 28 6f _len /* if (o
80a0: 70 20 3c 3d 20 62 69 74 73 29 20 2a 2f 0a 0a 09 p <= bits) */...
80b0: 6d 6f 76 09 63 68 2c 20 63 6c 20 20 20 20 20 20 mov.ch, cl
80c0: 20 20 20 20 20 20 2f 2a 20 73 74 61 73 68 20 6f /* stash o
80d0: 70 20 69 6e 20 63 68 2c 20 66 72 65 65 69 6e 67 p in ch, freeing
80e0: 20 63 6c 20 2a 2f 0a 09 78 6f 72 09 65 61 78 2c cl */..xor.eax,
80f0: 20 65 61 78 0a 09 6c 6f 64 73 77 20 20 20 20 20 eax..lodsw
8100: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
8110: 20 20 20 20 2f 2a 20 61 6c 20 3d 20 2a 28 75 73 /* al = *(us
8120: 68 6f 72 74 20 2a 29 69 6e 2b 2b 20 2a 2f 0a 09 hort *)in++ */..
8130: 6d 6f 76 09 63 6c 2c 20 62 6c 20 20 20 20 20 20 mov.cl, bl
8140: 20 20 20 20 20 20 2f 2a 20 63 6c 20 3d 20 62 69 /* cl = bi
8150: 74 73 2c 20 6e 65 65 64 73 20 69 74 20 66 6f 72 ts, needs it for
8160: 20 73 68 69 66 74 69 6e 67 20 2a 2f 0a 09 61 64 shifting */..ad
8170: 64 09 62 6c 2c 20 31 36 20 20 20 20 20 20 20 20 d.bl, 16
8180: 20 20 20 20 20 2f 2a 20 62 69 74 73 20 2b 3d 20 /* bits +=
8190: 31 36 20 2a 2f 0a 09 73 68 6c 09 65 61 78 2c 20 16 */..shl.eax,
81a0: 63 6c 0a 09 6f 72 09 65 64 78 2c 20 65 61 78 20 cl..or.edx, eax
81b0: 20 20 20 20 20 20 20 20 2f 2a 20 68 6f 6c 64 20 /* hold
81c0: 7c 3d 20 2a 28 28 75 73 68 6f 72 74 20 2a 29 69 |= *((ushort *)i
81d0: 6e 29 2b 2b 20 3c 3c 20 62 69 74 73 20 2a 2f 0a n)++ << bits */.
81e0: 09 6d 6f 76 09 63 6c 2c 20 63 68 20 20 20 20 20 .mov.cl, ch
81f0: 20 20 20 20 20 20 20 2f 2a 20 6d 6f 76 65 20 6f /* move o
8200: 70 20 62 61 63 6b 20 74 6f 20 65 63 78 20 2a 2f p back to ecx */
8210: 0a 0a 4c 5f 61 64 64 5f 62 69 74 73 5f 74 6f 5f ..L_add_bits_to_
8220: 6c 65 6e 3a 0a 09 73 75 62 09 62 6c 2c 20 63 6c len:..sub.bl, cl
8230: 0a 09 78 6f 72 09 65 61 78 2c 20 65 61 78 0a 09 ..xor.eax, eax..
8240: 69 6e 63 09 65 61 78 0a 09 73 68 6c 09 65 61 78 inc.eax..shl.eax
8250: 2c 20 63 6c 0a 09 64 65 63 09 65 61 78 0a 09 61 , cl..dec.eax..a
8260: 6e 64 09 65 61 78 2c 20 65 64 78 20 20 20 20 20 nd.eax, edx
8270: 20 20 20 20 20 2f 2a 20 65 61 78 20 26 3d 20 68 /* eax &= h
8280: 6f 6c 64 20 2a 2f 0a 09 73 68 72 09 65 64 78 2c old */..shr.edx,
8290: 20 63 6c 0a 09 61 64 64 09 5b 65 73 70 2b 36 34 cl..add.[esp+64
82a0: 5d 2c 20 65 61 78 20 20 20 20 20 20 2f 2a 20 6c ], eax /* l
82b0: 65 6e 20 2b 3d 20 68 6f 6c 64 20 26 20 6d 61 73 en += hold & mas
82c0: 6b 5b 6f 70 5d 20 2a 2f 0a 0a 4c 5f 64 65 63 6f k[op] */..L_deco
82d0: 64 65 5f 64 69 73 74 61 6e 63 65 3a 0a 09 63 6d de_distance:..cm
82e0: 70 09 62 6c 2c 20 31 35 0a 09 6a 61 09 4c 5f 67 p.bl, 15..ja.L_g
82f0: 65 74 5f 64 69 73 74 61 6e 63 65 5f 63 6f 64 65 et_distance_code
8300: 20 20 2f 2a 20 69 66 20 28 31 35 20 3c 20 62 69 /* if (15 < bi
8310: 74 73 29 20 2a 2f 0a 0a 09 78 6f 72 09 65 61 78 ts) */...xor.eax
8320: 2c 20 65 61 78 0a 09 6c 6f 64 73 77 20 20 20 20 , eax..lodsw
8330: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
8340: 20 20 20 20 20 2f 2a 20 61 6c 20 3d 20 2a 28 75 /* al = *(u
8350: 73 68 6f 72 74 20 2a 29 69 6e 2b 2b 20 2a 2f 0a short *)in++ */.
8360: 09 6d 6f 76 09 63 6c 2c 20 62 6c 20 20 20 20 20 .mov.cl, bl
8370: 20 20 20 20 20 20 20 2f 2a 20 63 6c 20 3d 20 62 /* cl = b
8380: 69 74 73 2c 20 6e 65 65 64 73 20 69 74 20 66 6f its, needs it fo
8390: 72 20 73 68 69 66 74 69 6e 67 20 2a 2f 0a 09 61 r shifting */..a
83a0: 64 64 09 62 6c 2c 20 31 36 20 20 20 20 20 20 20 dd.bl, 16
83b0: 20 20 20 20 20 20 2f 2a 20 62 69 74 73 20 2b 3d /* bits +=
83c0: 20 31 36 20 2a 2f 0a 09 73 68 6c 09 65 61 78 2c 16 */..shl.eax,
83d0: 20 63 6c 0a 09 6f 72 09 65 64 78 2c 20 65 61 78 cl..or.edx, eax
83e0: 20 20 20 20 20 20 20 20 20 2f 2a 20 68 6f 6c 64 /* hold
83f0: 20 7c 3d 20 2a 28 28 75 73 68 6f 72 74 20 2a 29 |= *((ushort *)
8400: 69 6e 29 2b 2b 20 3c 3c 20 62 69 74 73 20 2a 2f in)++ << bits */
8410: 0a 0a 4c 5f 67 65 74 5f 64 69 73 74 61 6e 63 65 ..L_get_distance
8420: 5f 63 6f 64 65 3a 0a 09 6d 6f 76 09 65 61 78 2c _code:..mov.eax,
8430: 20 5b 65 73 70 2b 36 30 5d 20 20 20 20 20 20 2f [esp+60] /
8440: 2a 20 65 61 78 20 3d 20 64 6d 61 73 6b 20 2a 2f * eax = dmask */
8450: 0a 09 6d 6f 76 09 65 63 78 2c 20 5b 65 73 70 2b ..mov.ecx, [esp+
8460: 33 36 5d 20 20 20 20 20 20 2f 2a 20 65 63 78 20 36] /* ecx
8470: 3d 20 64 63 6f 64 65 20 2a 2f 0a 09 61 6e 64 09 = dcode */..and.
8480: 65 61 78 2c 20 65 64 78 20 20 20 20 20 20 20 20 eax, edx
8490: 20 20 2f 2a 20 65 61 78 20 26 3d 20 68 6f 6c 64 /* eax &= hold
84a0: 20 2a 2f 0a 09 6d 6f 76 09 65 61 78 2c 20 5b 65 */..mov.eax, [e
84b0: 63 78 2b 65 61 78 2a 34 5d 2f 2a 20 65 61 78 20 cx+eax*4]/* eax
84c0: 3d 20 64 63 6f 64 65 5b 68 6f 6c 64 20 26 20 64 = dcode[hold & d
84d0: 6d 61 73 6b 5d 20 2a 2f 0a 0a 4c 5f 64 6f 64 69 mask] */..L_dodi
84e0: 73 74 3a 0a 09 6d 6f 76 09 65 62 70 2c 20 65 61 st:..mov.ebp, ea
84f0: 78 20 20 20 20 20 20 20 20 20 20 2f 2a 20 64 69 x /* di
8500: 73 74 20 3d 20 74 68 69 73 20 2a 2f 0a 09 73 68 st = this */..sh
8510: 72 09 65 62 70 2c 20 31 36 20 20 20 20 20 20 20 r.ebp, 16
8520: 20 20 20 20 20 2f 2a 20 64 69 73 74 20 3d 20 74 /* dist = t
8530: 68 69 73 2e 76 61 6c 20 2a 2f 0a 09 6d 6f 76 09 his.val */..mov.
8540: 63 6c 2c 20 61 68 0a 09 73 75 62 09 62 6c 2c 20 cl, ah..sub.bl,
8550: 61 68 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a ah /*
8560: 20 62 69 74 73 20 2d 3d 20 74 68 69 73 2e 62 69 bits -= this.bi
8570: 74 73 20 2a 2f 0a 09 73 68 72 09 65 64 78 2c 20 ts */..shr.edx,
8580: 63 6c 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 cl /*
8590: 68 6f 6c 64 20 3e 3e 3d 20 74 68 69 73 2e 62 69 hold >>= this.bi
85a0: 74 73 20 2a 2f 0a 09 6d 6f 76 09 63 6c 2c 20 61 ts */..mov.cl, a
85b0: 6c 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 l /*
85c0: 63 6c 20 3d 20 74 68 69 73 2e 6f 70 20 2a 2f 0a cl = this.op */.
85d0: 0a 09 74 65 73 74 09 61 6c 2c 20 31 36 20 20 20 ..test.al, 16
85e0: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 69 66 20 /* if
85f0: 28 28 6f 70 20 26 20 31 36 29 20 3d 3d 20 30 29 ((op & 16) == 0)
8600: 20 2a 2f 0a 09 6a 7a 09 4c 5f 74 65 73 74 5f 66 */..jz.L_test_f
8610: 6f 72 5f 73 65 63 6f 6e 64 5f 6c 65 76 65 6c 5f or_second_level_
8620: 64 69 73 74 0a 09 61 6e 64 09 63 6c 2c 20 31 35 dist..and.cl, 15
8630: 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 /*
8640: 6f 70 20 26 3d 20 31 35 20 2a 2f 0a 09 6a 7a 09 op &= 15 */..jz.
8650: 4c 5f 63 68 65 63 6b 5f 64 69 73 74 5f 6f 6e 65 L_check_dist_one
8660: 0a 09 63 6d 70 09 62 6c 2c 20 63 6c 0a 09 6a 61 ..cmp.bl, cl..ja
8670: 65 09 4c 5f 61 64 64 5f 62 69 74 73 5f 74 6f 5f e.L_add_bits_to_
8680: 64 69 73 74 20 20 20 2f 2a 20 69 66 20 28 6f 70 dist /* if (op
8690: 20 3c 3d 20 62 69 74 73 29 20 39 37 2e 36 25 20 <= bits) 97.6%
86a0: 2a 2f 0a 0a 09 6d 6f 76 09 63 68 2c 20 63 6c 20 */...mov.ch, cl
86b0: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 73 74 /* st
86c0: 61 73 68 20 6f 70 20 69 6e 20 63 68 2c 20 66 72 ash op in ch, fr
86d0: 65 65 69 6e 67 20 63 6c 20 2a 2f 0a 09 78 6f 72 eeing cl */..xor
86e0: 09 65 61 78 2c 20 65 61 78 0a 09 6c 6f 64 73 77 .eax, eax..lodsw
86f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
8700: 20 20 20 20 20 20 20 20 20 2f 2a 20 61 6c 20 3d /* al =
8710: 20 2a 28 75 73 68 6f 72 74 20 2a 29 69 6e 2b 2b *(ushort *)in++
8720: 20 2a 2f 0a 09 6d 6f 76 09 63 6c 2c 20 62 6c 20 */..mov.cl, bl
8730: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 63 6c /* cl
8740: 20 3d 20 62 69 74 73 2c 20 6e 65 65 64 73 20 69 = bits, needs i
8750: 74 20 66 6f 72 20 73 68 69 66 74 69 6e 67 20 2a t for shifting *
8760: 2f 0a 09 61 64 64 09 62 6c 2c 20 31 36 20 20 20 /..add.bl, 16
8770: 20 20 20 20 20 20 20 20 20 20 2f 2a 20 62 69 74 /* bit
8780: 73 20 2b 3d 20 31 36 20 2a 2f 0a 09 73 68 6c 09 s += 16 */..shl.
8790: 65 61 78 2c 20 63 6c 0a 09 6f 72 09 65 64 78 2c eax, cl..or.edx,
87a0: 20 65 61 78 20 20 20 20 20 20 20 20 2f 2a 20 68 eax /* h
87b0: 6f 6c 64 20 7c 3d 20 2a 28 28 75 73 68 6f 72 74 old |= *((ushort
87c0: 20 2a 29 69 6e 29 2b 2b 20 3c 3c 20 62 69 74 73 *)in)++ << bits
87d0: 20 2a 2f 0a 09 6d 6f 76 09 63 6c 2c 20 63 68 20 */..mov.cl, ch
87e0: 20 20 20 20 20 20 20 20 20 20 20 2f 2a 20 6d 6f /* mo
87f0: 76 65 20 6f 70 20 62 61 63 6b 20 74 6f 20 65 63 ve op back to ec
8800: 78 20 2a 2f 0a 0a 4c 5f 61 64 64 5f 62 69 74 73 x */..L_add_bits
8810: 5f 74 6f 5f 64 69 73 74 3a 0a 09 73 75 62 09 62 _to_dist:..sub.b
8820: 6c 2c 20 63 6c 0a 09 78 6f 72 09 65 61 78 2c 20 l, cl..xor.eax,
8830: 65 61 78 0a 09 69 6e 63 09 65 61 78 0a 09 73 68 eax..inc.eax..sh
8840: 6c 09 65 61 78 2c 20 63 6c 0a 09 64 65 63 09 65 l.eax, cl..dec.e
8850: 61 78 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ax
8860: 20 20 20 2f 2a 20 28 31 20 3c 3c 20 6f 70 29 20 /* (1 << op)
8870: 2d 20 31 20 2a 2f 0a 09 61 6e 64 09 65 61 78 2c - 1 */..and.eax,
8880: 20 65 64 78 20 20 20 20 20 20 20 20 20 20 2f 2a edx /*
8890: 20 65 61 78 20 26 3d 20 68 6f 6c 64 20 2a 2f 0a eax &= hold */.
88a0: 09 73 68 72 09 65 64 78 2c 20 63 6c 0a 09 61 64 .shr.edx, cl..ad
88b0: 64 09 65 62 70 2c 20 65 61 78 20 20 20 20 20 20 d.ebp, eax
88c0: 20 20 20 20 2f 2a 20 64 69 73 74 20 2b 3d 20 68 /* dist += h
88d0: 6f 6c 64 20 26 20 28 28 31 20 3c 3c 20 6f 70 29 old & ((1 << op)
88e0: 20 2d 20 31 29 20 2a 2f 0a 0a 4c 5f 63 68 65 63 - 1) */..L_chec
88f0: 6b 5f 77 69 6e 64 6f 77 3a 0a 09 6d 6f 76 09 5b k_window:..mov.[
8900: 65 73 70 2b 38 5d 2c 20 65 73 69 20 20 20 20 20 esp+8], esi
8910: 20 20 2f 2a 20 73 61 76 65 20 69 6e 20 73 6f 20 /* save in so
8920: 66 72 6f 6d 20 63 61 6e 20 75 73 65 20 69 74 27 from can use it'
8930: 73 20 72 65 67 20 2a 2f 0a 09 6d 6f 76 09 65 61 s reg */..mov.ea
8940: 78 2c 20 65 64 69 0a 09 73 75 62 09 65 61 78 2c x, edi..sub.eax,
8950: 20 5b 65 73 70 2b 32 30 5d 20 20 20 20 20 20 2f [esp+20] /
8960: 2a 20 6e 62 79 74 65 73 20 3d 20 6f 75 74 20 2d * nbytes = out -
8970: 20 62 65 67 20 2a 2f 0a 0a 09 63 6d 70 09 65 61 beg */...cmp.ea
8980: 78 2c 20 65 62 70 0a 09 6a 62 09 4c 5f 63 6c 69 x, ebp..jb.L_cli
8990: 70 5f 77 69 6e 64 6f 77 20 20 20 20 20 20 20 20 p_window
89a0: 2f 2a 20 69 66 20 28 64 69 73 74 20 3e 20 6e 62 /* if (dist > nb
89b0: 79 74 65 73 29 20 34 2e 32 25 20 2a 2f 0a 0a 09 ytes) 4.2% */...
89c0: 6d 6f 76 09 65 63 78 2c 20 5b 65 73 70 2b 36 34 mov.ecx, [esp+64
89d0: 5d 20 20 20 20 20 20 2f 2a 20 65 63 78 20 3d 20 ] /* ecx =
89e0: 6c 65 6e 20 2a 2f 0a 09 6d 6f 76 09 65 73 69 2c len */..mov.esi,
89f0: 20 65 64 69 0a 09 73 75 62 09 65 73 69 2c 20 65 edi..sub.esi, e
8a00: 62 70 20 20 20 20 20 20 20 20 20 20 2f 2a 20 66 bp /* f
8a10: 72 6f 6d 20 3d 20 6f 75 74 20 2d 20 64 69 73 74 rom = out - dist
8a20: 20 2a 2f 0a 0a 09 73 61 72 09 65 63 78 2c 20 31 */...sar.ecx, 1
8a30: 0a 09 6a 6e 63 09 4c 5f 63 6f 70 79 5f 74 77 6f ..jnc.L_copy_two
8a40: 0a 0a 09 72 65 70 20 20 20 20 20 6d 6f 76 73 77 ...rep movsw
8a50: 0a 09 6d 6f 76 09 61 6c 2c 20 5b 65 73 69 5d 0a ..mov.al, [esi].
8a60: 09 6d 6f 76 09 5b 65 64 69 5d 2c 20 61 6c 0a 09 .mov.[edi], al..
8a70: 69 6e 63 09 65 64 69 0a 0a 09 6d 6f 76 09 65 73 inc.edi...mov.es
8a80: 69 2c 20 5b 65 73 70 2b 38 5d 20 20 20 20 20 20 i, [esp+8]
8a90: 2f 2a 20 6d 6f 76 65 20 69 6e 20 62 61 63 6b 20 /* move in back
8aa0: 74 6f 20 25 65 73 69 2c 20 74 6f 73 73 20 66 72 to %esi, toss fr
8ab0: 6f 6d 20 2a 2f 0a 09 6d 6f 76 09 65 62 70 2c 20 om */..mov.ebp,
8ac0: 5b 65 73 70 2b 33 32 5d 20 20 20 20 20 2f 2a 20 [esp+32] /*
8ad0: 65 62 70 20 3d 20 6c 63 6f 64 65 20 2a 2f 0a 09 ebp = lcode */..
8ae0: 6a 6d 70 09 4c 5f 77 68 69 6c 65 5f 74 65 73 74 jmp.L_while_test
8af0: 0a 0a 4c 5f 63 6f 70 79 5f 74 77 6f 3a 0a 09 72 ..L_copy_two:..r
8b00: 65 70 20 20 20 20 20 6d 6f 76 73 77 0a 09 6d 6f ep movsw..mo
8b10: 76 09 65 73 69 2c 20 5b 65 73 70 2b 38 5d 20 20 v.esi, [esp+8]
8b20: 20 20 20 20 2f 2a 20 6d 6f 76 65 20 69 6e 20 62 /* move in b
8b30: 61 63 6b 20 74 6f 20 25 65 73 69 2c 20 74 6f 73 ack to %esi, tos
8b40: 73 20 66 72 6f 6d 20 2a 2f 0a 09 6d 6f 76 09 65 s from */..mov.e
8b50: 62 70 2c 20 5b 65 73 70 2b 33 32 5d 20 20 20 20 bp, [esp+32]
8b60: 20 2f 2a 20 65 62 70 20 3d 20 6c 63 6f 64 65 20 /* ebp = lcode
8b70: 2a 2f 0a 09 6a 6d 70 09 4c 5f 77 68 69 6c 65 5f */..jmp.L_while_
8b80: 74 65 73 74 0a 0a 41 4c 49 47 4e 20 34 0a 4c 5f test..ALIGN 4.L_
8b90: 63 68 65 63 6b 5f 64 69 73 74 5f 6f 6e 65 3a 0a check_dist_one:.
8ba0: 09 63 6d 70 09 65 62 70 2c 20 31 20 20 20 20 20 .cmp.ebp, 1
8bb0: 20 20 20 20 20 20 20 2f 2a 20 69 66 20 64 69 73 /* if dis
8bc0: 74 20 31 2c 20 69 73 20 61 20 6d 65 6d 73 65 74 t 1, is a memset
8bd0: 20 2a 2f 0a 09 6a 6e 65 09 4c 5f 63 68 65 63 6b */..jne.L_check
8be0: 5f 77 69 6e 64 6f 77 0a 09 63 6d 70 09 5b 65 73 _window..cmp.[es
8bf0: 70 2b 32 30 5d 2c 20 65 64 69 0a 09 6a 65 09 4c p+20], edi..je.L
8c00: 5f 63 68 65 63 6b 5f 77 69 6e 64 6f 77 20 20 20 _check_window
8c10: 20 2f 2a 20 6f 75 74 20 3d 3d 20 62 65 67 2c 20 /* out == beg,
8c20: 69 66 20 6f 75 74 73 69 64 65 20 77 69 6e 64 6f if outside windo
8c30: 77 20 2a 2f 0a 0a 09 6d 6f 76 09 65 63 78 2c 20 w */...mov.ecx,
8c40: 5b 65 73 70 2b 36 34 5d 20 20 20 20 20 2f 2a 20 [esp+64] /*
8c50: 65 63 78 20 3d 20 6c 65 6e 20 2a 2f 0a 09 6d 6f ecx = len */..mo
8c60: 76 09 61 6c 2c 20 5b 65 64 69 2d 31 5d 0a 09 6d v.al, [edi-1]..m
8c70: 6f 76 09 61 68 2c 20 61 6c 0a 0a 09 73 61 72 09 ov.ah, al...sar.
8c80: 65 63 78 2c 20 31 0a 09 6a 6e 63 09 4c 5f 73 65 ecx, 1..jnc.L_se
8c90: 74 5f 74 77 6f 0a 09 6d 6f 76 09 5b 65 64 69 5d t_two..mov.[edi]
8ca0: 2c 20 61 6c 20 20 20 20 20 20 20 20 20 2f 2a 20 , al /*
8cb0: 6d 65 6d 73 65 74 20 6f 75 74 20 77 69 74 68 20 memset out with
8cc0: 66 72 6f 6d 5b 2d 31 5d 20 2a 2f 0a 09 69 6e 63 from[-1] */..inc
8cd0: 09 65 64 69 0a 0a 4c 5f 73 65 74 5f 74 77 6f 3a .edi..L_set_two:
8ce0: 0a 09 72 65 70 20 20 20 20 20 73 74 6f 73 77 0a ..rep stosw.
8cf0: 09 6d 6f 76 09 65 62 70 2c 20 5b 65 73 70 2b 33 .mov.ebp, [esp+3
8d00: 32 5d 20 20 20 20 20 2f 2a 20 65 62 70 20 3d 20 2] /* ebp =
8d10: 6c 63 6f 64 65 20 2a 2f 0a 09 6a 6d 70 09 4c 5f lcode */..jmp.L_
8d20: 77 68 69 6c 65 5f 74 65 73 74 0a 0a 41 4c 49 47 while_test..ALIG
8d30: 4e 20 34 0a 4c 5f 74 65 73 74 5f 66 6f 72 5f 73 N 4.L_test_for_s
8d40: 65 63 6f 6e 64 5f 6c 65 76 65 6c 5f 6c 65 6e 67 econd_level_leng
8d50: 74 68 3a 0a 09 74 65 73 74 09 61 6c 2c 20 36 34 th:..test.al, 64
8d60: 0a 09 6a 6e 7a 09 4c 5f 74 65 73 74 5f 66 6f 72 ..jnz.L_test_for
8d70: 5f 65 6e 64 5f 6f 66 5f 62 6c 6f 63 6b 20 2f 2a _end_of_block /*
8d80: 20 69 66 20 28 28 6f 70 20 26 20 36 34 29 20 21 if ((op & 64) !
8d90: 3d 20 30 29 20 2a 2f 0a 0a 09 78 6f 72 09 65 61 = 0) */...xor.ea
8da0: 78 2c 20 65 61 78 0a 09 69 6e 63 09 65 61 78 0a x, eax..inc.eax.
8db0: 09 73 68 6c 09 65 61 78 2c 20 63 6c 0a 09 64 65 .shl.eax, cl..de
8dc0: 63 09 65 61 78 0a 09 61 6e 64 09 65 61 78 2c 20 c.eax..and.eax,
8dd0: 65 64 78 20 20 20 20 20 20 20 20 20 2f 2a 20 65 edx /* e
8de0: 61 78 20 26 3d 20 68 6f 6c 64 20 2a 2f 0a 09 61 ax &= hold */..a
8df0: 64 64 09 65 61 78 2c 20 5b 65 73 70 2b 36 34 5d dd.eax, [esp+64]
8e00: 20 20 20 20 20 2f 2a 20 65 61 78 20 2b 3d 20 6c /* eax += l
8e10: 65 6e 20 2a 2f 0a 09 6d 6f 76 09 65 61 78 2c 20 en */..mov.eax,
8e20: 5b 65 62 70 2b 65 61 78 2a 34 5d 20 2f 2a 20 65 [ebp+eax*4] /* e
8e30: 61 78 20 3d 20 6c 63 6f 64 65 5b 76 61 6c 2b 28 ax = lcode[val+(
8e40: 68 6f 6c 64 26 6d 61 73 6b 5b 6f 70 5d 29 5d 2a hold&mask[op])]*
8e50: 2f 0a 09 6a 6d 70 09 4c 5f 64 6f 6c 65 6e 0a 0a /..jmp.L_dolen..
8e60: 41 4c 49 47 4e 20 34 0a 4c 5f 74 65 73 74 5f 66 ALIGN 4.L_test_f
8e70: 6f 72 5f 73 65 63 6f 6e 64 5f 6c 65 76 65 6c 5f or_second_level_
8e80: 64 69 73 74 3a 0a 09 74 65 73 74 09 61 6c 2c 20 dist:..test.al,
8e90: 36 34 0a 09 6a 6e 7a 09 4c 5f 69 6e 76 61 6c 69 64..jnz.L_invali
8ea0: 64 5f 64 69 73 74 61 6e 63 65 5f 63 6f 64 65 20 d_distance_code
8eb0: 2f 2a 20 69 66 20 28 28 6f 70 20 26 20 36 34 29 /* if ((op & 64)
8ec0: 20 21 3d 20 30 29 20 2a 2f 0a 0a 09 78 6f 72 09 != 0) */...xor.
8ed0: 65 61 78 2c 20 65 61 78 0a 09 69 6e 63 09 65 61 eax, eax..inc.ea
8ee0: 78 0a 09 73 68 6c 09 65 61 78 2c 20 63 6c 0a 09 x..shl.eax, cl..
8ef0: 64 65 63 09 65 61 78 0a 09 61 6e 64 09 65 61 78 dec.eax..and.eax
8f00: 2c 20 65 64 78 20 20 20 20 20 20 20 20 20 2f 2a , edx /*
8f10: 20 65 61 78 20 26 3d 20 68 6f 6c 64 20 2a 2f 0a eax &= hold */.
8f20: 09 61 64 64 09 65 61 78 2c 20 65 62 70 20 20 20 .add.eax, ebp
8f30: 20 20 20 20 20 20 2f 2a 20 65 61 78 20 2b 3d 20 /* eax +=
8f40: 64 69 73 74 20 2a 2f 0a 09 6d 6f 76 09 65 63 78 dist */..mov.ecx
8f50: 2c 20 5b 65 73 70 2b 33 36 5d 20 20 20 20 20 2f , [esp+36] /
8f60: 2a 20 65 63 78 20 3d 20 64 63 6f 64 65 20 2a 2f * ecx = dcode */
8f70: 0a 09 6d 6f 76 09 65 61 78 2c 20 5b 65 63 78 2b ..mov.eax, [ecx+
8f80: 65 61 78 2a 34 5d 20 2f 2a 20 65 61 78 20 3d 20 eax*4] /* eax =
8f90: 64 63 6f 64 65 5b 76 61 6c 2b 28 68 6f 6c 64 26 dcode[val+(hold&
8fa0: 6d 61 73 6b 5b 6f 70 5d 29 5d 2a 2f 0a 09 6a 6d mask[op])]*/..jm
8fb0: 70 09 4c 5f 64 6f 64 69 73 74 0a 0a 41 4c 49 47 p.L_dodist..ALIG
8fc0: 4e 20 34 0a 4c 5f 63 6c 69 70 5f 77 69 6e 64 6f N 4.L_clip_windo
8fd0: 77 3a 0a 09 6d 6f 76 09 65 63 78 2c 20 65 61 78 w:..mov.ecx, eax
8fe0: 0a 09 6d 6f 76 09 65 61 78 2c 20 5b 65 73 70 2b ..mov.eax, [esp+
8ff0: 34 38 5d 20 20 20 20 20 2f 2a 20 65 61 78 20 3d 48] /* eax =
9000: 20 77 73 69 7a 65 20 2a 2f 0a 09 6e 65 67 09 65 wsize */..neg.e
9010: 63 78 20 20 20 20 20 20 20 20 20 20 20 20 20 20 cx
9020: 20 20 2f 2a 20 6e 62 79 74 65 73 20 3d 20 2d 6e /* nbytes = -n
9030: 62 79 74 65 73 20 2a 2f 0a 09 6d 6f 76 09 65 73 bytes */..mov.es
9040: 69 2c 20 5b 65 73 70 2b 32 38 5d 20 20 20 20 20 i, [esp+28]
9050: 2f 2a 20 66 72 6f 6d 20 3d 20 77 69 6e 64 6f 77 /* from = window
9060: 20 2a 2f 0a 0a 09 63 6d 70 09 65 61 78 2c 20 65 */...cmp.eax, e
9070: 62 70 0a 09 6a 62 09 4c 5f 69 6e 76 61 6c 69 64 bp..jb.L_invalid
9080: 5f 64 69 73 74 61 6e 63 65 5f 74 6f 6f 5f 66 61 _distance_too_fa
9090: 72 20 2f 2a 20 69 66 20 28 64 69 73 74 20 3e 20 r /* if (dist >
90a0: 77 73 69 7a 65 29 20 2a 2f 0a 0a 09 61 64 64 09 wsize) */...add.
90b0: 65 63 78 2c 20 65 62 70 20 20 20 20 20 20 20 20 ecx, ebp
90c0: 20 2f 2a 20 6e 62 79 74 65 73 20 3d 20 64 69 73 /* nbytes = dis
90d0: 74 20 2d 20 6e 62 79 74 65 73 20 2a 2f 0a 09 63 t - nbytes */..c
90e0: 6d 70 09 64 77 6f 72 64 20 70 74 72 20 5b 65 73 mp.dword ptr [es
90f0: 70 2b 35 32 5d 2c 20 30 0a 09 6a 6e 65 09 4c 5f p+52], 0..jne.L_
9100: 77 72 61 70 5f 61 72 6f 75 6e 64 5f 77 69 6e 64 wrap_around_wind
9110: 6f 77 20 2f 2a 20 69 66 20 28 77 72 69 74 65 20 ow /* if (write
9120: 21 3d 20 30 29 20 2a 2f 0a 0a 09 73 75 62 09 65 != 0) */...sub.e
9130: 61 78 2c 20 65 63 78 0a 09 61 64 64 09 65 73 69 ax, ecx..add.esi
9140: 2c 20 65 61 78 20 20 20 20 20 20 20 20 20 2f 2a , eax /*
9150: 20 66 72 6f 6d 20 2b 3d 20 77 73 69 7a 65 20 2d from += wsize -
9160: 20 6e 62 79 74 65 73 20 2a 2f 0a 0a 09 6d 6f 76 nbytes */...mov
9170: 09 65 61 78 2c 20 5b 65 73 70 2b 36 34 5d 20 20 .eax, [esp+64]
9180: 20 20 2f 2a 20 65 61 78 20 3d 20 6c 65 6e 20 2a /* eax = len *
9190: 2f 0a 09 63 6d 70 09 65 61 78 2c 20 65 63 78 0a /..cmp.eax, ecx.
91a0: 09 6a 62 65 09 4c 5f 64 6f 5f 63 6f 70 79 20 20 .jbe.L_do_copy
91b0: 20 20 20 20 20 20 20 20 2f 2a 20 69 66 20 28 6e /* if (n
91c0: 62 79 74 65 73 20 3e 3d 20 6c 65 6e 29 20 2a 2f bytes >= len) */
91d0: 0a 0a 09 73 75 62 09 65 61 78 2c 20 65 63 78 20 ...sub.eax, ecx
91e0: 20 20 20 20 20 20 20 20 2f 2a 20 6c 65 6e 20 2d /* len -
91f0: 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 09 72 65 70 = nbytes */..rep
9200: 20 20 20 20 20 6d 6f 76 73 62 0a 09 6d 6f 76 09 movsb..mov.
9210: 65 73 69 2c 20 65 64 69 0a 09 73 75 62 09 65 73 esi, edi..sub.es
9220: 69 2c 20 65 62 70 20 20 20 20 20 20 20 20 20 2f i, ebp /
9230: 2a 20 66 72 6f 6d 20 3d 20 6f 75 74 20 2d 20 64 * from = out - d
9240: 69 73 74 20 2a 2f 0a 09 6a 6d 70 09 4c 5f 64 6f ist */..jmp.L_do
9250: 5f 63 6f 70 79 0a 0a 41 4c 49 47 4e 20 34 0a 4c _copy..ALIGN 4.L
9260: 5f 77 72 61 70 5f 61 72 6f 75 6e 64 5f 77 69 6e _wrap_around_win
9270: 64 6f 77 3a 0a 09 6d 6f 76 09 65 61 78 2c 20 5b dow:..mov.eax, [
9280: 65 73 70 2b 35 32 5d 20 20 20 20 2f 2a 20 65 61 esp+52] /* ea
9290: 78 20 3d 20 77 72 69 74 65 20 2a 2f 0a 09 63 6d x = write */..cm
92a0: 70 09 65 63 78 2c 20 65 61 78 0a 09 6a 62 65 09 p.ecx, eax..jbe.
92b0: 4c 5f 63 6f 6e 74 69 67 75 6f 75 73 5f 69 6e 5f L_contiguous_in_
92c0: 77 69 6e 64 6f 77 20 2f 2a 20 69 66 20 28 77 72 window /* if (wr
92d0: 69 74 65 20 3e 3d 20 6e 62 79 74 65 73 29 20 2a ite >= nbytes) *
92e0: 2f 0a 0a 09 61 64 64 09 65 73 69 2c 20 5b 65 73 /...add.esi, [es
92f0: 70 2b 34 38 5d 20 20 20 20 2f 2a 20 66 72 6f 6d p+48] /* from
9300: 20 2b 3d 20 77 73 69 7a 65 20 2a 2f 0a 09 61 64 += wsize */..ad
9310: 64 09 65 73 69 2c 20 65 61 78 20 20 20 20 20 20 d.esi, eax
9320: 20 20 20 2f 2a 20 66 72 6f 6d 20 2b 3d 20 77 72 /* from += wr
9330: 69 74 65 20 2a 2f 0a 09 73 75 62 09 65 73 69 2c ite */..sub.esi,
9340: 20 65 63 78 20 20 20 20 20 20 20 20 20 2f 2a 20 ecx /*
9350: 66 72 6f 6d 20 2d 3d 20 6e 62 79 74 65 73 20 2a from -= nbytes *
9360: 2f 0a 09 73 75 62 09 65 63 78 2c 20 65 61 78 20 /..sub.ecx, eax
9370: 20 20 20 20 20 20 20 20 2f 2a 20 6e 62 79 74 65 /* nbyte
9380: 73 20 2d 3d 20 77 72 69 74 65 20 2a 2f 0a 0a 09 s -= write */...
9390: 6d 6f 76 09 65 61 78 2c 20 5b 65 73 70 2b 36 34 mov.eax, [esp+64
93a0: 5d 20 20 20 20 2f 2a 20 65 61 78 20 3d 20 6c 65 ] /* eax = le
93b0: 6e 20 2a 2f 0a 09 63 6d 70 09 65 61 78 2c 20 65 n */..cmp.eax, e
93c0: 63 78 0a 09 6a 62 65 09 4c 5f 64 6f 5f 63 6f 70 cx..jbe.L_do_cop
93d0: 79 20 20 20 20 20 20 20 20 20 20 2f 2a 20 69 66 y /* if
93e0: 20 28 6e 62 79 74 65 73 20 3e 3d 20 6c 65 6e 29 (nbytes >= len)
93f0: 20 2a 2f 0a 0a 09 73 75 62 09 65 61 78 2c 20 65 */...sub.eax, e
9400: 63 78 20 20 20 20 20 20 20 20 20 2f 2a 20 6c 65 cx /* le
9410: 6e 20 2d 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 09 n -= nbytes */..
9420: 72 65 70 20 20 20 20 20 6d 6f 76 73 62 0a 09 6d rep movsb..m
9430: 6f 76 09 65 73 69 2c 20 5b 65 73 70 2b 32 38 5d ov.esi, [esp+28]
9440: 20 20 20 20 20 2f 2a 20 66 72 6f 6d 20 3d 20 77 /* from = w
9450: 69 6e 64 6f 77 20 2a 2f 0a 09 6d 6f 76 09 65 63 indow */..mov.ec
9460: 78 2c 20 5b 65 73 70 2b 35 32 5d 20 20 20 20 20 x, [esp+52]
9470: 2f 2a 20 6e 62 79 74 65 73 20 3d 20 77 72 69 74 /* nbytes = writ
9480: 65 20 2a 2f 0a 09 63 6d 70 09 65 61 78 2c 20 65 e */..cmp.eax, e
9490: 63 78 0a 09 6a 62 65 09 4c 5f 64 6f 5f 63 6f 70 cx..jbe.L_do_cop
94a0: 79 20 20 20 20 20 20 20 20 20 20 2f 2a 20 69 66 y /* if
94b0: 20 28 6e 62 79 74 65 73 20 3e 3d 20 6c 65 6e 29 (nbytes >= len)
94c0: 20 2a 2f 0a 0a 09 73 75 62 09 65 61 78 2c 20 65 */...sub.eax, e
94d0: 63 78 20 20 20 20 20 20 20 20 20 2f 2a 20 6c 65 cx /* le
94e0: 6e 20 2d 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 09 n -= nbytes */..
94f0: 72 65 70 20 20 20 20 20 6d 6f 76 73 62 0a 09 6d rep movsb..m
9500: 6f 76 09 65 73 69 2c 20 65 64 69 0a 09 73 75 62 ov.esi, edi..sub
9510: 09 65 73 69 2c 20 65 62 70 20 20 20 20 20 20 20 .esi, ebp
9520: 20 20 2f 2a 20 66 72 6f 6d 20 3d 20 6f 75 74 20 /* from = out
9530: 2d 20 64 69 73 74 20 2a 2f 0a 09 6a 6d 70 09 4c - dist */..jmp.L
9540: 5f 64 6f 5f 63 6f 70 79 0a 0a 41 4c 49 47 4e 20 _do_copy..ALIGN
9550: 34 0a 4c 5f 63 6f 6e 74 69 67 75 6f 75 73 5f 69 4.L_contiguous_i
9560: 6e 5f 77 69 6e 64 6f 77 3a 0a 09 61 64 64 09 65 n_window:..add.e
9570: 73 69 2c 20 65 61 78 0a 09 73 75 62 09 65 73 69 si, eax..sub.esi
9580: 2c 20 65 63 78 20 20 20 20 20 20 20 20 20 2f 2a , ecx /*
9590: 20 66 72 6f 6d 20 2b 3d 20 77 72 69 74 65 20 2d from += write -
95a0: 20 6e 62 79 74 65 73 20 2a 2f 0a 0a 09 6d 6f 76 nbytes */...mov
95b0: 09 65 61 78 2c 20 5b 65 73 70 2b 36 34 5d 20 20 .eax, [esp+64]
95c0: 20 20 2f 2a 20 65 61 78 20 3d 20 6c 65 6e 20 2a /* eax = len *
95d0: 2f 0a 09 63 6d 70 09 65 61 78 2c 20 65 63 78 0a /..cmp.eax, ecx.
95e0: 09 6a 62 65 09 4c 5f 64 6f 5f 63 6f 70 79 20 20 .jbe.L_do_copy
95f0: 20 20 20 20 20 20 20 20 2f 2a 20 69 66 20 28 6e /* if (n
9600: 62 79 74 65 73 20 3e 3d 20 6c 65 6e 29 20 2a 2f bytes >= len) */
9610: 0a 0a 09 73 75 62 09 65 61 78 2c 20 65 63 78 20 ...sub.eax, ecx
9620: 20 20 20 20 20 20 20 20 2f 2a 20 6c 65 6e 20 2d /* len -
9630: 3d 20 6e 62 79 74 65 73 20 2a 2f 0a 09 72 65 70 = nbytes */..rep
9640: 20 20 20 20 20 6d 6f 76 73 62 0a 09 6d 6f 76 09 movsb..mov.
9650: 65 73 69 2c 20 65 64 69 0a 09 73 75 62 09 65 73 esi, edi..sub.es
9660: 69 2c 20 65 62 70 20 20 20 20 20 20 20 20 20 2f i, ebp /
9670: 2a 20 66 72 6f 6d 20 3d 20 6f 75 74 20 2d 20 64 * from = out - d
9680: 69 73 74 20 2a 2f 0a 09 6a 6d 70 09 4c 5f 64 6f ist */..jmp.L_do
9690: 5f 63 6f 70 79 0a 0a 41 4c 49 47 4e 20 34 0a 4c _copy..ALIGN 4.L
96a0: 5f 64 6f 5f 63 6f 70 79 3a 0a 09 6d 6f 76 09 65 _do_copy:..mov.e
96b0: 63 78 2c 20 65 61 78 0a 09 72 65 70 20 20 20 20 cx, eax..rep
96c0: 20 6d 6f 76 73 62 0a 0a 09 6d 6f 76 09 65 73 69 movsb...mov.esi
96d0: 2c 20 5b 65 73 70 2b 38 5d 20 20 20 20 20 20 2f , [esp+8] /
96e0: 2a 20 6d 6f 76 65 20 69 6e 20 62 61 63 6b 20 74 * move in back t
96f0: 6f 20 25 65 73 69 2c 20 74 6f 73 73 20 66 72 6f o %esi, toss fro
9700: 6d 20 2a 2f 0a 09 6d 6f 76 09 65 62 70 2c 20 5b m */..mov.ebp, [
9710: 65 73 70 2b 33 32 5d 20 20 20 20 20 2f 2a 20 65 esp+32] /* e
9720: 62 70 20 3d 20 6c 63 6f 64 65 20 2a 2f 0a 09 6a bp = lcode */..j
9730: 6d 70 09 4c 5f 77 68 69 6c 65 5f 74 65 73 74 0a mp.L_while_test.
9740: 0a 4c 5f 74 65 73 74 5f 66 6f 72 5f 65 6e 64 5f .L_test_for_end_
9750: 6f 66 5f 62 6c 6f 63 6b 3a 0a 09 74 65 73 74 09 of_block:..test.
9760: 61 6c 2c 20 33 32 0a 09 6a 7a 09 4c 5f 69 6e 76 al, 32..jz.L_inv
9770: 61 6c 69 64 5f 6c 69 74 65 72 61 6c 5f 6c 65 6e alid_literal_len
9780: 67 74 68 5f 63 6f 64 65 0a 09 6d 6f 76 09 64 77 gth_code..mov.dw
9790: 6f 72 64 20 70 74 72 20 5b 65 73 70 2b 37 32 5d ord ptr [esp+72]
97a0: 2c 20 31 0a 09 6a 6d 70 09 4c 5f 62 72 65 61 6b , 1..jmp.L_break
97b0: 5f 6c 6f 6f 70 5f 77 69 74 68 5f 73 74 61 74 75 _loop_with_statu
97c0: 73 0a 0a 4c 5f 69 6e 76 61 6c 69 64 5f 6c 69 74 s..L_invalid_lit
97d0: 65 72 61 6c 5f 6c 65 6e 67 74 68 5f 63 6f 64 65 eral_length_code
97e0: 3a 0a 09 6d 6f 76 09 64 77 6f 72 64 20 70 74 72 :..mov.dword ptr
97f0: 20 5b 65 73 70 2b 37 32 5d 2c 20 32 0a 09 6a 6d [esp+72], 2..jm
9800: 70 09 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 5f 77 p.L_break_loop_w
9810: 69 74 68 5f 73 74 61 74 75 73 0a 0a 4c 5f 69 6e ith_status..L_in
9820: 76 61 6c 69 64 5f 64 69 73 74 61 6e 63 65 5f 63 valid_distance_c
9830: 6f 64 65 3a 0a 09 6d 6f 76 09 64 77 6f 72 64 20 ode:..mov.dword
9840: 70 74 72 20 5b 65 73 70 2b 37 32 5d 2c 20 33 0a ptr [esp+72], 3.
9850: 09 6a 6d 70 09 4c 5f 62 72 65 61 6b 5f 6c 6f 6f .jmp.L_break_loo
9860: 70 5f 77 69 74 68 5f 73 74 61 74 75 73 0a 0a 4c p_with_status..L
9870: 5f 69 6e 76 61 6c 69 64 5f 64 69 73 74 61 6e 63 _invalid_distanc
9880: 65 5f 74 6f 6f 5f 66 61 72 3a 0a 09 6d 6f 76 09 e_too_far:..mov.
9890: 65 73 69 2c 20 5b 65 73 70 2b 34 5d 0a 09 6d 6f esi, [esp+4]..mo
98a0: 76 09 64 77 6f 72 64 20 70 74 72 20 5b 65 73 70 v.dword ptr [esp
98b0: 2b 37 32 5d 2c 20 34 0a 09 6a 6d 70 09 4c 5f 62 +72], 4..jmp.L_b
98c0: 72 65 61 6b 5f 6c 6f 6f 70 5f 77 69 74 68 5f 73 reak_loop_with_s
98d0: 74 61 74 75 73 0a 0a 4c 5f 62 72 65 61 6b 5f 6c tatus..L_break_l
98e0: 6f 6f 70 3a 0a 09 6d 6f 76 09 64 77 6f 72 64 20 oop:..mov.dword
98f0: 70 74 72 20 5b 65 73 70 2b 37 32 5d 2c 20 30 0a ptr [esp+72], 0.
9900: 0a 4c 5f 62 72 65 61 6b 5f 6c 6f 6f 70 5f 77 69 .L_break_loop_wi
9910: 74 68 5f 73 74 61 74 75 73 3a 0a 2f 2a 20 70 75 th_status:./* pu
9920: 74 20 69 6e 2c 20 6f 75 74 2c 20 62 69 74 73 2c t in, out, bits,
9930: 20 61 6e 64 20 68 6f 6c 64 20 62 61 63 6b 20 69 and hold back i
9940: 6e 74 6f 20 61 72 20 61 6e 64 20 70 6f 70 20 65 nto ar and pop e
9950: 73 70 20 2a 2f 0a 09 6d 6f 76 09 5b 65 73 70 2b sp */..mov.[esp+
9960: 38 5d 2c 20 65 73 69 20 20 20 20 20 2f 2a 20 73 8], esi /* s
9970: 61 76 65 20 69 6e 20 2a 2f 0a 09 6d 6f 76 09 5b ave in */..mov.[
9980: 65 73 70 2b 31 36 5d 2c 20 65 64 69 20 20 20 20 esp+16], edi
9990: 2f 2a 20 73 61 76 65 20 6f 75 74 20 2a 2f 0a 09 /* save out */..
99a0: 6d 6f 76 09 5b 65 73 70 2b 34 34 5d 2c 20 65 62 mov.[esp+44], eb
99b0: 78 20 20 20 20 2f 2a 20 73 61 76 65 20 62 69 74 x /* save bit
99c0: 73 20 2a 2f 0a 09 6d 6f 76 09 5b 65 73 70 2b 34 s */..mov.[esp+4
99d0: 30 5d 2c 20 65 64 78 20 20 20 20 2f 2a 20 73 61 0], edx /* sa
99e0: 76 65 20 68 6f 6c 64 20 2a 2f 0a 09 6d 6f 76 09 ve hold */..mov.
99f0: 65 62 70 2c 20 5b 65 73 70 2b 34 5d 20 20 20 20 ebp, [esp+4]
9a00: 20 2f 2a 20 72 65 73 74 6f 72 65 20 65 73 70 2c /* restore esp,
9a10: 20 65 62 70 20 2a 2f 0a 09 6d 6f 76 09 65 73 70 ebp */..mov.esp
9a20: 2c 20 5b 65 73 70 5d 0a 20 20 20 20 7d 0a 23 65 , [esp]. }.#e
9a30: 6c 73 65 0a 23 65 72 72 6f 72 20 22 78 38 36 20 lse.#error "x86
9a40: 61 72 63 68 69 74 65 63 74 75 72 65 20 6e 6f 74 architecture not
9a50: 20 64 65 66 69 6e 65 64 22 0a 23 65 6e 64 69 66 defined".#endif
9a60: 0a 0a 20 20 20 20 69 66 20 28 61 72 2e 73 74 61 .. if (ar.sta
9a70: 74 75 73 20 3e 20 31 29 20 7b 0a 20 20 20 20 20 tus > 1) {.
9a80: 20 20 20 69 66 20 28 61 72 2e 73 74 61 74 75 73 if (ar.status
9a90: 20 3d 3d 20 32 29 0a 20 20 20 20 20 20 20 20 20 == 2).
9aa0: 20 20 20 73 74 72 6d 2d 3e 6d 73 67 20 3d 20 22 strm->msg = "
9ab0: 69 6e 76 61 6c 69 64 20 6c 69 74 65 72 61 6c 2f invalid literal/
9ac0: 6c 65 6e 67 74 68 20 63 6f 64 65 22 3b 0a 20 20 length code";.
9ad0: 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 61 else if (a
9ae0: 72 2e 73 74 61 74 75 73 20 3d 3d 20 33 29 0a 20 r.status == 3).
9af0: 20 20 20 20 20 20 20 20 20 20 20 73 74 72 6d 2d strm-
9b00: 3e 6d 73 67 20 3d 20 22 69 6e 76 61 6c 69 64 20 >msg = "invalid
9b10: 64 69 73 74 61 6e 63 65 20 63 6f 64 65 22 3b 0a distance code";.
9b20: 20 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20 else.
9b30: 20 20 20 20 20 20 20 20 20 73 74 72 6d 2d 3e 6d strm->m
9b40: 73 67 20 3d 20 22 69 6e 76 61 6c 69 64 20 64 69 sg = "invalid di
9b50: 73 74 61 6e 63 65 20 74 6f 6f 20 66 61 72 20 62 stance too far b
9b60: 61 63 6b 22 3b 0a 20 20 20 20 20 20 20 20 73 74 ack";. st
9b70: 61 74 65 2d 3e 6d 6f 64 65 20 3d 20 42 41 44 3b ate->mode = BAD;
9b80: 0a 20 20 20 20 7d 0a 20 20 20 20 65 6c 73 65 20 . }. else
9b90: 69 66 20 28 20 61 72 2e 73 74 61 74 75 73 20 3d if ( ar.status =
9ba0: 3d 20 31 20 29 20 7b 0a 20 20 20 20 20 20 20 20 = 1 ) {.
9bb0: 73 74 61 74 65 2d 3e 6d 6f 64 65 20 3d 20 54 59 state->mode = TY
9bc0: 50 45 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 2f PE;. }.. /
9bd0: 2a 20 72 65 74 75 72 6e 20 75 6e 75 73 65 64 20 * return unused
9be0: 62 79 74 65 73 20 28 6f 6e 20 65 6e 74 72 79 2c bytes (on entry,
9bf0: 20 62 69 74 73 20 3c 20 38 2c 20 73 6f 20 69 6e bits < 8, so in
9c00: 20 77 6f 6e 27 74 20 67 6f 20 74 6f 6f 20 66 61 won't go too fa
9c10: 72 20 62 61 63 6b 29 20 2a 2f 0a 20 20 20 20 61 r back) */. a
9c20: 72 2e 6c 65 6e 20 3d 20 61 72 2e 62 69 74 73 20 r.len = ar.bits
9c30: 3e 3e 20 33 3b 0a 20 20 20 20 61 72 2e 69 6e 20 >> 3;. ar.in
9c40: 2d 3d 20 61 72 2e 6c 65 6e 3b 0a 20 20 20 20 61 -= ar.len;. a
9c50: 72 2e 62 69 74 73 20 2d 3d 20 61 72 2e 6c 65 6e r.bits -= ar.len
9c60: 20 3c 3c 20 33 3b 0a 20 20 20 20 61 72 2e 68 6f << 3;. ar.ho
9c70: 6c 64 20 26 3d 20 28 31 55 20 3c 3c 20 61 72 2e ld &= (1U << ar.
9c80: 62 69 74 73 29 20 2d 20 31 3b 0a 0a 20 20 20 20 bits) - 1;..
9c90: 2f 2a 20 75 70 64 61 74 65 20 73 74 61 74 65 20 /* update state
9ca0: 61 6e 64 20 72 65 74 75 72 6e 20 2a 2f 0a 20 20 and return */.
9cb0: 20 20 73 74 72 6d 2d 3e 6e 65 78 74 5f 69 6e 20 strm->next_in
9cc0: 3d 20 61 72 2e 69 6e 3b 0a 20 20 20 20 73 74 72 = ar.in;. str
9cd0: 6d 2d 3e 6e 65 78 74 5f 6f 75 74 20 3d 20 61 72 m->next_out = ar
9ce0: 2e 6f 75 74 3b 0a 20 20 20 20 73 74 72 6d 2d 3e .out;. strm->
9cf0: 61 76 61 69 6c 5f 69 6e 20 3d 20 28 75 6e 73 69 avail_in = (unsi
9d00: 67 6e 65 64 29 28 61 72 2e 69 6e 20 3c 20 61 72 gned)(ar.in < ar
9d10: 2e 6c 61 73 74 20 3f 0a 20 20 20 20 20 20 20 20 .last ?.
9d20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9d30: 20 20 20 20 20 20 20 20 50 41 44 5f 41 56 41 49 PAD_AVAI
9d40: 4c 5f 49 4e 20 2b 20 28 61 72 2e 6c 61 73 74 20 L_IN + (ar.last
9d50: 2d 20 61 72 2e 69 6e 29 20 3a 0a 20 20 20 20 20 - ar.in) :.
9d60: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9d70: 20 20 20 20 20 20 20 20 20 20 20 50 41 44 5f 41 PAD_A
9d80: 56 41 49 4c 5f 49 4e 20 2d 20 28 61 72 2e 69 6e VAIL_IN - (ar.in
9d90: 20 2d 20 61 72 2e 6c 61 73 74 29 29 3b 0a 20 20 - ar.last));.
9da0: 20 20 73 74 72 6d 2d 3e 61 76 61 69 6c 5f 6f 75 strm->avail_ou
9db0: 74 20 3d 20 28 75 6e 73 69 67 6e 65 64 29 28 61 t = (unsigned)(a
9dc0: 72 2e 6f 75 74 20 3c 20 61 72 2e 65 6e 64 20 3f r.out < ar.end ?
9dd0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .
9de0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9df0: 20 20 50 41 44 5f 41 56 41 49 4c 5f 4f 55 54 20 PAD_AVAIL_OUT
9e00: 2b 20 28 61 72 2e 65 6e 64 20 2d 20 61 72 2e 6f + (ar.end - ar.o
9e10: 75 74 29 20 3a 0a 20 20 20 20 20 20 20 20 20 20 ut) :.
9e20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9e30: 20 20 20 20 20 20 20 50 41 44 5f 41 56 41 49 4c PAD_AVAIL
9e40: 5f 4f 55 54 20 2d 20 28 61 72 2e 6f 75 74 20 2d _OUT - (ar.out -
9e50: 20 61 72 2e 65 6e 64 29 29 3b 0a 20 20 20 20 73 ar.end));. s
9e60: 74 61 74 65 2d 3e 68 6f 6c 64 20 3d 20 61 72 2e tate->hold = ar.
9e70: 68 6f 6c 64 3b 0a 20 20 20 20 73 74 61 74 65 2d hold;. state-
9e80: 3e 62 69 74 73 20 3d 20 61 72 2e 62 69 74 73 3b >bits = ar.bits;
9e90: 0a 20 20 20 20 72 65 74 75 72 6e 3b 0a 7d 0a 0a . return;.}..