// File: /workspace/github_c_makefile_star2_O3/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), %r10d
addl $-0x5, %r10d
addq %rbx, %r10
movq 0x18(%rdi), %r11
movl 0x20(%rdi), %r9d
subl %r9d, %esi
movq %r11, %rax
subq %rsi, %rax
movq %rax, -0x8(%rsp)
addl $0xfffffeff, %r9d       # imm = 0xFFFFFEFF
addq %r11, %r9
movl 0x3c(%r8), %edx
movl 0x40(%r8), %eax
movl %eax, -0x1c(%rsp)
movl 0x44(%r8), %esi
movq %rsi, -0x28(%rsp)
movq 0x48(%r8), %rax
movq %rax, -0x30(%rsp)
movq 0x50(%r8), %r15
movb 0x78(%r8), %cl
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
shll %cl, %r14d
movb 0x7c(%r8), %cl
shll %cl, %r12d
movl 0x58(%r8), %eax
notl %r14d
notl %r12d
movq 0x68(%r8), %r13
movq 0x70(%r8), %rcx
movq %rcx, -0x18(%rsp)
movq %rdx, -0x10(%rsp)
leal (%rsi,%rdx), %ecx
movl %ecx, -0x20(%rsp)
cmpl $0xe, %eax
ja 0xa31b4
movzbl (%rbx), %edx
movl %eax, %ecx
shlq %cl, %rdx
addq %r15, %rdx
movzbl 0x1(%rbx), %r15d
leal 0x8(%rax), %ecx
shlq %cl, %r15
addq $0x2, %rbx
addq %rdx, %r15
orl $0x10, %eax
movl %r15d, %ecx
andl %r14d, %ecx
leaq (,%rcx,4), %rsi
addq %r13, %rsi
movzbl 0x1(%rsi), %ecx
shrq %cl, %r15
subl %ecx, %eax
movb (%rsi), %cl
testb %cl, %cl
je 0xa3203
testb $0x10, %cl
jne 0xa3223
testb $0x40, %cl
jne 0xa3561
movzwl 0x2(%rsi), %edx
leaq (,%rdx,4), %rdx
addq %r13, %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
shll %cl, %esi
notl %esi
andl %r15d, %esi
leaq (%rdx,%rsi,4), %rsi
jmp 0xa31c5
movb 0x2(%rsi), %cl
movb %cl, (%r11)
incq %r11
cmpq %r10, %rbx
jae 0xa358d
cmpq %r9, %r11
jb 0xa318f
jmp 0xa358d
movzbl %cl, %edx
movzwl 0x2(%rsi), %ebp
andl $0xf, %edx
je 0xa3259
cmpl %edx, %eax
jae 0xa3244
movzbl (%rbx), %esi
movl %eax, %ecx
shlq %cl, %rsi
incq %rbx
addq %rsi, %r15
addl $0x8, %eax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %edx, %ecx
shll %cl, %esi
notl %esi
andl %r15d, %esi
addl %esi, %ebp
shrq %cl, %r15
subl %edx, %eax
cmpl $0xe, %eax
movq %r14, -0x38(%rsp)
movq %rbp, -0x40(%rsp)
ja 0xa3288
movzbl (%rbx), %edx
movl %eax, %ecx
shlq %cl, %rdx
addq %r15, %rdx
movzbl 0x1(%rbx), %r15d
leal 0x8(%rax), %ecx
shlq %cl, %r15
addq $0x2, %rbx
addq %rdx, %r15
orl $0x10, %eax
movl %r15d, %ecx
andl %r12d, %ecx
movq -0x18(%rsp), %rdx
leaq (%rdx,%rcx,4), %rbp
movzbl 0x1(%rbp), %ecx
shrq %cl, %r15
subl %ecx, %eax
movzbl (%rbp), %edx
movq %r15, %r14
movl %eax, %esi
testb $0x10, %dl
jne 0xa32e8
testb $0x40, %dl
jne 0xa3574
movzwl 0x2(%rbp), %eax
movq -0x18(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %edx, %ecx
shll %cl, %r15d
notl %r15d
andl %r14d, %r15d
leaq (%rax,%r15,4), %rbp
movzbl 0x1(%rbp), %ecx
shrq %cl, %r14
subl %ecx, %esi
movzbl (%rbp), %edx
jmp 0xa32a9
andl $0xf, %edx
cmpl %edx, %esi
jae 0xa331a
movzbl (%rbx), %r15d
movl %esi, %ecx
shlq %cl, %r15
addq %r14, %r15
leal 0x8(%rsi), %eax
cmpl %edx, %eax
jae 0xa3321
movzbl 0x1(%rbx), %r14d
movl %eax, %ecx
shlq %cl, %r14
addq $0x2, %rbx
addq %r14, %r15
addl $0x10, %esi
movl %esi, %eax
jmp 0xa3324
movl %esi, %eax
movq %r14, %r15
jmp 0xa3324
incq %rbx
movq -0x28(%rsp), %r14
movzwl 0x2(%rbp), %ebp
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %edx, %ecx
shll %cl, %esi
notl %esi
andl %r15d, %esi
addl %ebp, %esi
shrq %cl, %r15
subl %edx, %eax
movl %r11d, %ecx
subl -0x8(%rsp), %ecx
movl %esi, %ebp
subl %ecx, %ebp
jbe 0xa33e6
cmpl -0x1c(%rsp), %ebp
jbe 0xa3367
cmpl $0x0, 0x1be8(%r8)
jne 0xa35d9
testq %r14, %r14
je 0xa346b
cmpl %r14d, %ebp
movq -0x30(%rsp), %rcx
jbe 0xa34a1
movl -0x20(%rsp), %edx
subl %ebp, %edx
addq %rcx, %rdx
subl %r14d, %ebp
movq -0x40(%rsp), %r14
movl %r14d, %ecx
subl %ebp, %ecx
jbe 0xa34e0
movq %r12, -0x40(%rsp)
movl %ebp, %r14d
xorl %ebp, %ebp
movb (%rdx,%rbp), %r12b
movb %r12b, (%r11,%rbp)
incq %rbp
cmpl %ebp, %r14d
jne 0xa33a4
addq %rbp, %r11
movq -0x28(%rsp), %r14
cmpl %r14d, %ecx
jbe 0xa3557
xorl %edx, %edx
movq -0x30(%rsp), %r12
movb (%r12,%rdx), %bpl
movb %bpl, (%r11)
incq %r11
incq %rdx
cmpl %edx, %r14d
jne 0xa33cc
subl %r14d, %ecx
jmp 0xa34d1
movl %esi, %ecx
movq %r11, %rsi
subq %rcx, %rsi
negq %rcx
addq $0x2, %rsi
xorl %edx, %edx
movq -0x40(%rsp), %r14
movl %r14d, %ebp
movb -0x2(%rsi,%rdx), %r14b
movb %r14b, (%r11,%rdx)
movb -0x1(%rsi,%rdx), %r14b
movb %r14b, 0x1(%r11,%rdx)
movb (%rsi,%rdx), %r14b
movb %r14b, 0x2(%r11,%rdx)
addl $-0x3, %ebp
addq $0x3, %rdx
cmpl $0x2, %ebp
ja 0xa33ff
movq -0x40(%rsp), %r14
negl %r14d
leaq (%r14,%rdx), %rsi
testl %esi, %esi
je 0xa3463
leaq (%r14,%rdx), %rsi
addq $0x2, %rsi
leaq (%r11,%rcx), %r14
addq $0x2, %r14
movb -0x2(%r14,%rdx), %bpl
movb %bpl, (%r11,%rdx)
testl %esi, %esi
je 0xa353a
addq %rdx, %r11
incq %r11
jmp 0xa354d
addq %rdx, %r11
jmp 0xa354d
movq -0x10(%rsp), %rdx
subl %ebp, %edx
addq -0x30(%rsp), %rdx
movq -0x40(%rsp), %r14
movl %r14d, %ecx
subl %ebp, %ecx
jbe 0xa34e0
movq %r12, -0x40(%rsp)
movl %ebp, %r14d
xorl %ebp, %ebp
movb (%rdx,%rbp), %r12b
movb %r12b, (%r11)
incq %r11
incq %rbp
cmpl %ebp, %r14d
jne 0xa348d
jmp 0xa34d1
movl %r14d, %edx
subl %ebp, %edx
addq %rcx, %rdx
movq -0x40(%rsp), %r14
movl %r14d, %ecx
subl %ebp, %ecx
jbe 0xa34e0
movq %r12, -0x40(%rsp)
movl %ebp, %r14d
xorl %ebp, %ebp
movb (%rdx,%rbp), %r12b
movb %r12b, (%r11)
incq %r11
incq %rbp
cmpl %ebp, %r14d
jne 0xa34bf
movl %esi, %esi
movq %r11, %rdx
subq %rsi, %rdx
movq -0x40(%rsp), %r12
jmp 0xa34e3
movl %r14d, %ecx
cmpl $0x3, %ecx
movq -0x38(%rsp), %r14
jb 0xa3513
movb (%rdx), %sil
movb %sil, (%r11)
movb 0x1(%rdx), %sil
movb %sil, 0x1(%r11)
movb 0x2(%rdx), %sil
addq $0x3, %rdx
movb %sil, 0x2(%r11)
addq $0x3, %r11
addl $-0x3, %ecx
cmpl $0x2, %ecx
ja 0xa34ed
testl %ecx, %ecx
je 0xa320c
movb (%rdx), %sil
movb %sil, (%r11)
cmpl $0x2, %ecx
jne 0xa3209
movb 0x1(%rdx), %cl
movb %cl, 0x1(%r11)
addq $0x2, %r11
jmp 0xa320c
leaq (%r11,%rdx), %rsi
movb 0x1(%rcx,%rsi), %cl
addq %rdx, %r11
addq $0x2, %r11
movb %cl, -0x1(%r11)
movq -0x38(%rsp), %r14
jmp 0xa320c
movq -0x30(%rsp), %rdx
jmp 0xa34d9
movl $0x3f3f, %edx           # imm = 0x3F3F
testb $0x20, %cl
jne 0xa3589
leaq 0x55f7f(%rip), %rcx     # 0xf94f1
jmp 0xa3580
movl %esi, %eax
movq %r14, %r15
leaq 0x55f8d(%rip), %rcx     # 0xf950d
movq %rcx, 0x30(%rdi)
movl $0x3f51, %edx           # imm = 0x3F51
movl %edx, 0x8(%r8)
movl %eax, %ecx
shrl $0x3, %ecx
subq %rcx, %rbx
movq %rbx, (%rdi)
movq %r11, 0x18(%rdi)
subl %ebx, %r10d
addl $0x5, %r10d
andl $0x7, %eax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %eax, %ecx
shll %cl, %edx
movl %r10d, 0x8(%rdi)
subl %r11d, %r9d
notl %edx
andl %edx, %r15d
addl $0x101, %r9d            # imm = 0x101
movl %r9d, 0x20(%rdi)
movq %r15, 0x50(%r8)
movl %eax, 0x58(%r8)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x55f43(%rip), %rcx     # 0xf9523
jmp 0xa3580
nop