// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/zlib-1.3.0.1/inffast.c
// Function: inflate_fast
void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
    struct inflate_state FAR *state;
    z_const unsigned char FAR *in;      /* local strm->next_in */
    z_const unsigned char FAR *last;    /* have enough input while in < last */
    unsigned char FAR *out;     /* local strm->next_out */
    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
    unsigned char FAR *end;     /* while out < end, enough space available */
#ifdef INFLATE_STRICT
    unsigned dmax;              /* maximum distance from zlib header */
#endif
    unsigned wsize;             /* window size or zero if not using window */
    unsigned whave;             /* valid bytes in the window */
    unsigned wnext;             /* window write index */
    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
    unsigned long hold;         /* local strm->hold */
    unsigned bits;              /* local strm->bits */
    code const FAR *lcode;      /* local strm->lencode */
    code const FAR *dcode;      /* local strm->distcode */
    unsigned lmask;             /* mask for first level of length codes */
    unsigned dmask;             /* mask for first level of distance codes */
    code const *here;           /* retrieved table entry */
    unsigned op;                /* code bits, operation, extra bits, or */
                                /*  window position, window bytes to copy */
    unsigned len;               /* match length, unused bytes */
    unsigned dist;              /* match distance */
    unsigned char FAR *from;    /* where to copy match from */

    /* copy state to local variables */
    state = (struct inflate_state FAR *)strm->state;
    in = strm->next_in;
    last = in + (strm->avail_in - 5);
    out = strm->next_out;
    beg = out - (start - strm->avail_out);
    end = out + (strm->avail_out - 257);
#ifdef INFLATE_STRICT
    dmax = state->dmax;
#endif
    wsize = state->wsize;
    whave = state->whave;
    wnext = state->wnext;
    window = state->window;
    hold = state->hold;
    bits = state->bits;
    lcode = state->lencode;
    dcode = state->distcode;
    lmask = (1U << state->lenbits) - 1;
    dmask = (1U << state->distbits) - 1;

    /* decode literals and length/distances until end-of-block or not enough
       input data or output space */
    do {
        if (bits < 15) {
            hold += (unsigned long)(*in++) << bits;
            bits += 8;
            hold += (unsigned long)(*in++) << bits;
            bits += 8;
        }
        here = lcode + (hold & lmask);
      dolen:
        op = (unsigned)(here->bits);
        hold >>= op;
        bits -= op;
        op = (unsigned)(here->op);
        if (op == 0) {                          /* literal */
            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
                    "inflate:         literal '%c'\n" :
                    "inflate:         literal 0x%02x\n", here->val));
            *out++ = (unsigned char)(here->val);
        }
        else if (op & 16) {                     /* length base */
            len = (unsigned)(here->val);
            op &= 15;                           /* number of extra bits */
            if (op) {
                if (bits < op) {
                    hold += (unsigned long)(*in++) << bits;
                    bits += 8;
                }
                len += (unsigned)hold & ((1U << op) - 1);
                hold >>= op;
                bits -= op;
            }
            Tracevv((stderr, "inflate:         length %u\n", len));
            if (bits < 15) {
                hold += (unsigned long)(*in++) << bits;
                bits += 8;
                hold += (unsigned long)(*in++) << bits;
                bits += 8;
            }
            here = dcode + (hold & dmask);
          dodist:
            op = (unsigned)(here->bits);
            hold >>= op;
            bits -= op;
            op = (unsigned)(here->op);
            if (op & 16) {                      /* distance base */
                dist = (unsigned)(here->val);
                op &= 15;                       /* number of extra bits */
                if (bits < op) {
                    hold += (unsigned long)(*in++) << bits;
                    bits += 8;
                    if (bits < op) {
                        hold += (unsigned long)(*in++) << bits;
                        bits += 8;
                    }
                }
                dist += (unsigned)hold & ((1U << op) - 1);
#ifdef INFLATE_STRICT
                if (dist > dmax) {
                    strm->msg = (char *)"invalid distance too far back";
                    state->mode = BAD;
                    break;
                }
#endif
                hold >>= op;
                bits -= op;
                Tracevv((stderr, "inflate:         distance %u\n", dist));
                op = (unsigned)(out - beg);     /* max distance in output */
                if (dist > op) {                /* see if copy from window */
                    op = dist - op;             /* distance back in window */
                    if (op > whave) {
                        if (state->sane) {
                            strm->msg =
                                (char *)"invalid distance too far back";
                            state->mode = BAD;
                            break;
                        }
#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
                        if (len <= op - whave) {
                            do {
                                *out++ = 0;
                            } while (--len);
                            continue;
                        }
                        len -= op - whave;
                        do {
                            *out++ = 0;
                        } while (--op > whave);
                        if (op == 0) {
                            from = out - dist;
                            do {
                                *out++ = *from++;
                            } while (--len);
                            continue;
                        }
#endif
                    }
                    from = window;
                    if (wnext == 0) {           /* very common case */
                        from += wsize - op;
                        if (op < len) {         /* some from window */
                            len -= op;
                            do {
                                *out++ = *from++;
                            } while (--op);
                            from = out - dist;  /* rest from output */
                        }
                    }
                    else if (wnext < op) {      /* wrap around window */
                        from += wsize + wnext - op;
                        op -= wnext;
                        if (op < len) {         /* some from end of window */
                            len -= op;
                            do {
                                *out++ = *from++;
                            } while (--op);
                            from = window;
                            if (wnext < len) {  /* some from start of window */
                                op = wnext;
                                len -= op;
                                do {
                                    *out++ = *from++;
                                } while (--op);
                                from = out - dist;      /* rest from output */
                            }
                        }
                    }
                    else {                      /* contiguous in window */
                        from += wnext - op;
                        if (op < len) {         /* some from window */
                            len -= op;
                            do {
                                *out++ = *from++;
                            } while (--op);
                            from = out - dist;  /* rest from output */
                        }
                    }
                    while (len > 2) {
                        *out++ = *from++;
                        *out++ = *from++;
                        *out++ = *from++;
                        len -= 3;
                    }
                    if (len) {
                        *out++ = *from++;
                        if (len > 1)
                            *out++ = *from++;
                    }
                }
                else {
                    from = out - dist;          /* copy direct from output */
                    do {                        /* minimum length is three */
                        *out++ = *from++;
                        *out++ = *from++;
                        *out++ = *from++;
                        len -= 3;
                    } while (len > 2);
                    if (len) {
                        *out++ = *from++;
                        if (len > 1)
                            *out++ = *from++;
                    }
                }
            }
            else if ((op & 64) == 0) {          /* 2nd level distance code */
                here = dcode + here->val + (hold & ((1U << op) - 1));
                goto dodist;
            }
            else {
                strm->msg = (char *)"invalid distance code";
                state->mode = BAD;
                break;
            }
        }
        else if ((op & 64) == 0) {              /* 2nd level length code */
            here = lcode + here->val + (hold & ((1U << op) - 1));
            goto dolen;
        }
        else if (op & 32) {                     /* end-of-block */
            Tracevv((stderr, "inflate:         end of block\n"));
            state->mode = TYPE;
            break;
        }
        else {
            strm->msg = (char *)"invalid literal/length code";
            state->mode = BAD;
            break;
        }
    } while (in < last && out < end);

    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
    len = bits >> 3;
    in -= len;
    bits -= len << 3;
    hold &= (1U << bits) - 1;

    /* update state and return */
    strm->next_in = in;
    strm->next_out = out;
    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
    strm->avail_out = (unsigned)(out < end ?
                                 257 + (end - out) : 257 - (out - end));
    state->hold = hold;
    state->bits = bits;
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x38(%rdi), %r8
movq (%rdi), %rbx
movl 0x8(%rdi), %ebp
addl $-0x5, %ebp
addq %rbx, %rbp
movq 0x18(%rdi), %r11
movl 0x20(%rdi), %r9d
subl %r9d, %esi
movq %r11, %rax
subq %rsi, %rax
movq %rax, -0x18(%rsp)
addl $0xfffffeff, %r9d       # imm = 0xFFFFFEFF
addq %r11, %r9
movl 0x3c(%r8), %edx
movl 0x40(%r8), %eax
movl %eax, -0x2c(%rsp)
movl 0x44(%r8), %esi
movb 0x78(%r8), %cl
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movl %r10d, %eax
shll %cl, %eax
movq 0x48(%r8), %rcx
movq %rcx, -0x48(%rsp)
movq 0x50(%r8), %r14
movb 0x7c(%r8), %cl
movl %r10d, %r15d
shll %cl, %r15d
notl %eax
movq %rax, -0x8(%rsp)
notl %r15d
movq %r15, -0x10(%rsp)
movl 0x58(%r8), %eax
movq 0x68(%r8), %r15
movq 0x70(%r8), %r13
movq %rdx, -0x20(%rsp)
movq %rsi, -0x28(%rsp)
leal (%rsi,%rdx), %ecx
movl %ecx, -0x30(%rsp)
cmpl $0xe, %eax
ja 0x82c45
movzbl (%rbx), %edx
movl %eax, %ecx
shlq %cl, %rdx
addq %r14, %rdx
movzbl 0x1(%rbx), %r14d
leal 0x8(%rax), %ecx
shlq %cl, %r14
addq $0x2, %rbx
addq %rdx, %r14
orl $0x10, %eax
movl %r14d, %ecx
andl -0x8(%rsp), %ecx
leaq (%r15,%rcx,4), %rsi
movzbl 0x1(%rsi), %ecx
shrq %cl, %r14
subl %ecx, %eax
movzbl (%rsi), %edx
testl %edx, %edx
je 0x82c8a
testb $0x10, %dl
jne 0x82c98
testb $0x40, %dl
jne 0x82fdd
movzwl 0x2(%rsi), %esi
movl %r10d, %r12d
movl %edx, %ecx
shll %cl, %r12d
leaq (%r15,%rsi,4), %rcx
notl %r12d
andl %r14d, %r12d
leaq (%rcx,%r12,4), %rsi
jmp 0x82c50
movb 0x2(%rsi), %cl
movb %cl, (%r11)
incq %r11
jmp 0x82fc3
movzwl 0x2(%rsi), %r12d
andl $0xf, %edx
je 0x82ccb
cmpl %edx, %eax
jae 0x82cb7
movzbl (%rbx), %esi
movl %eax, %ecx
shlq %cl, %rsi
incq %rbx
addq %rsi, %r14
addl $0x8, %eax
movl %r10d, %esi
movl %edx, %ecx
shll %cl, %esi
notl %esi
andl %r14d, %esi
addl %esi, %r12d
shrq %cl, %r14
subl %edx, %eax
cmpl $0xe, %eax
movq %rbp, -0x50(%rsp)
movq %r12, -0x40(%rsp)
movq %rdi, -0x58(%rsp)
ja 0x82cff
movzbl (%rbx), %edx
movl %eax, %ecx
shlq %cl, %rdx
addq %r14, %rdx
movzbl 0x1(%rbx), %r14d
leal 0x8(%rax), %ecx
shlq %cl, %r14
addq $0x2, %rbx
addq %rdx, %r14
orl $0x10, %eax
movl %r14d, %ecx
andl -0x10(%rsp), %ecx
leaq (,%rcx,4), %r12
addq %r13, %r12
movl %eax, %esi
movq %r14, %rbp
movzbl 0x1(%r12), %ecx
shrq %cl, %rbp
subl %ecx, %esi
movzbl (%r12), %edx
testb $0x10, %dl
jne 0x82d59
testb $0x40, %dl
jne 0x82ff0
movzwl 0x2(%r12), %eax
movl %r10d, %r14d
movl %edx, %ecx
shll %cl, %r14d
leaq (,%rax,4), %rax
addq %r13, %rax
notl %r14d
andl %ebp, %r14d
leaq (%rax,%r14,4), %r12
jmp 0x82d16
andl $0xf, %edx
cmpl %edx, %esi
jae 0x82d8a
movzbl (%rbx), %r14d
movl %esi, %ecx
shlq %cl, %r14
addq %rbp, %r14
leal 0x8(%rsi), %eax
cmpl %edx, %eax
jae 0x82d91
movzbl 0x1(%rbx), %ebp
movl %eax, %ecx
shlq %cl, %rbp
addq $0x2, %rbx
addq %rbp, %r14
addl $0x10, %esi
movl %esi, %eax
jmp 0x82d94
movl %esi, %eax
movq %rbp, %r14
jmp 0x82d94
incq %rbx
movzwl 0x2(%r12), %esi
movl %r10d, %ebp
movl %edx, %ecx
shll %cl, %ebp
notl %ebp
andl %r14d, %ebp
addl %esi, %ebp
shrq %cl, %r14
subl %edx, %eax
movl %r11d, %edx
subl -0x18(%rsp), %edx
movl %ebp, %edi
subl %edx, %ebp
jbe 0x82e54
cmpl -0x2c(%rsp), %ebp
jbe 0x82dd2
cmpl $0x0, 0x1be8(%r8)
jne 0x83059
movq %rdi, -0x38(%rsp)
movl %ebp, %r12d
movq -0x28(%rsp), %rcx
testq %rcx, %rcx
je 0x82edc
cmpl %ecx, %ebp
jbe 0x82f08
movl -0x30(%rsp), %edx
movl %edx, %esi
subl %ebp, %esi
addq -0x48(%rsp), %rsi
subl %ecx, %ebp
movq -0x40(%rsp), %rcx
movl %ecx, %edx
subl %ebp, %edx
jbe 0x82f39
movl %ebp, %r12d
xorl %ebp, %ebp
movb (%rsi,%rbp), %cl
movb %cl, (%r11,%rbp)
incq %rbp
cmpl %ebp, %r12d
jne 0x82e13
addq %rbp, %r11
movq -0x28(%rsp), %r12
cmpl %r12d, %edx
jbe 0x82fd3
xorl %esi, %esi
movq -0x48(%rsp), %rbp
movb (%rbp,%rsi), %cl
movb %cl, (%r11)
incq %r11
incq %rsi
cmpl %esi, %r12d
jne 0x82e3a
subl %r12d, %edx
jmp 0x82f2f
movq %r11, %rsi
subq %rdi, %rsi
negq %rdi
addq $0x2, %rsi
xorl %edx, %edx
movq -0x40(%rsp), %r12
movl %r12d, %ebp
movb -0x2(%rsi,%rdx), %cl
movb %cl, (%r11,%rdx)
movb -0x1(%rsi,%rdx), %cl
movb %cl, 0x1(%r11,%rdx)
movb (%rsi,%rdx), %cl
movb %cl, 0x2(%r11,%rdx)
addl $-0x3, %ebp
addq $0x3, %rdx
cmpl $0x2, %ebp
ja 0x82e6b
negl %r12d
leaq (%r12,%rdx), %rcx
testl %ecx, %ecx
je 0x82ed4
leaq (%r12,%rdx), %rcx
addq $0x2, %rcx
movq %rdi, %r12
leaq (%r11,%rdi), %rsi
addq $0x2, %rsi
movb -0x2(%rsi,%rdx), %sil
movb %sil, (%r11,%rdx)
testl %ecx, %ecx
movq -0x58(%rsp), %rdi
movq -0x50(%rsp), %rbp
je 0x82f94
addq %rdx, %r11
incq %r11
jmp 0x82fc3
addq %rdx, %r11
jmp 0x82fb9
movq -0x20(%rsp), %rsi
subl %ebp, %esi
addq -0x48(%rsp), %rsi
movq -0x40(%rsp), %rcx
movl %ecx, %edx
subl %ebp, %edx
jbe 0x82f39
xorl %ebp, %ebp
movb (%rsi,%rbp), %cl
movb %cl, (%r11)
incq %r11
incq %rbp
cmpl %ebp, %r12d
jne 0x82ef5
jmp 0x82f2f
movl %ecx, %esi
subl %ebp, %esi
addq -0x48(%rsp), %rsi
movq -0x40(%rsp), %rcx
movl %ecx, %edx
subl %ebp, %edx
jbe 0x82f39
xorl %ebp, %ebp
movb (%rsi,%rbp), %cl
movb %cl, (%r11)
incq %r11
incq %rbp
cmpl %ebp, %r12d
jne 0x82f1e
movq %r11, %rsi
subq -0x38(%rsp), %rsi
jmp 0x82f3b
movl %ecx, %edx
xorl %ecx, %ecx
movl %edx, %ebp
cmpl $0x3, %ebp
jb 0x82f69
movb (%rsi,%rcx), %r12b
movb %r12b, (%r11,%rcx)
movb 0x1(%rsi,%rcx), %r12b
movb %r12b, 0x1(%r11,%rcx)
movb 0x2(%rsi,%rcx), %r12b
movb %r12b, 0x2(%r11,%rcx)
addl $-0x3, %ebp
addq $0x3, %rcx
jmp 0x82f3f
negl %edx
leaq (%rdx,%rcx), %r12
testl %r12d, %r12d
je 0x82f8f
addq %rcx, %rdx
addq $0x2, %rdx
movb (%rsi,%rcx), %bpl
movb %bpl, (%r11,%rcx)
testl %edx, %edx
je 0x82faa
addq %rcx, %r11
incq %r11
jmp 0x82fb9
addq %rcx, %r11
jmp 0x82fb9
leaq (%r11,%rdx), %rcx
movb 0x1(%r12,%rcx), %cl
addq %rdx, %r11
addq $0x2, %r11
movb %cl, -0x1(%r11)
jmp 0x82fc3
movb 0x1(%rsi,%rcx), %dl
addq %rcx, %r11
addq $0x2, %r11
movb %dl, -0x1(%r11)
movq -0x58(%rsp), %rdi
movq -0x50(%rsp), %rbp
cmpq %rbp, %rbx
jae 0x83013
cmpq %r9, %r11
jb 0x82c20
jmp 0x83013
movq -0x48(%rsp), %rsi
jmp 0x82f3b
movl $0x3f3f, %ecx           # imm = 0x3F3F
testb $0x20, %dl
jne 0x8300f
leaq 0x5f813(%rip), %rcx     # 0xe2801
jmp 0x83006
leaq 0x5f826(%rip), %rcx     # 0xe281d
movl %esi, %eax
movq %rbp, %r14
movq -0x58(%rsp), %rdi
movq -0x50(%rsp), %rbp
movq %rcx, 0x30(%rdi)
movl $0x3f51, %ecx           # imm = 0x3F51
movl %ecx, 0x8(%r8)
movl %eax, %ecx
shrl $0x3, %ecx
subq %rcx, %rbx
movq %rbx, (%rdi)
movq %r11, 0x18(%rdi)
subl %ebx, %ebp
addl $0x5, %ebp
andl $0x7, %eax
movl %eax, %ecx
shll %cl, %r10d
movl %ebp, 0x8(%rdi)
subl %r11d, %r9d
notl %r10d
andl %r10d, %r14d
addl $0x101, %r9d            # imm = 0x101
movl %r9d, 0x20(%rdi)
movq %r14, 0x50(%r8)
movl %eax, 0x58(%r8)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x58(%rsp), %rdi
movq -0x50(%rsp), %rbp
leaq 0x5f7c9(%rip), %rcx     # 0xe2833
jmp 0x83006