// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/zlib-1.3.0.1/infback.c
// Function: inflateBackInit_
int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
                             unsigned char FAR *window, const char *version,
                             int stream_size) {
    struct inflate_state FAR *state;

    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
        stream_size != (int)(sizeof(z_stream)))
        return Z_VERSION_ERROR;
    if (strm == Z_NULL || window == Z_NULL ||
        windowBits < 8 || windowBits > 15)
        return Z_STREAM_ERROR;
    strm->msg = Z_NULL;                 /* in case we return an error */
    if (strm->zalloc == (alloc_func)0) {
#ifdef Z_SOLO
        return Z_STREAM_ERROR;
#else
        strm->zalloc = zcalloc;
        strm->opaque = (voidpf)0;
#endif
    }
    if (strm->zfree == (free_func)0)
#ifdef Z_SOLO
        return Z_STREAM_ERROR;
#else
    strm->zfree = zcfree;
#endif
    state = (struct inflate_state FAR *)ZALLOC(strm, 1,
                                               sizeof(struct inflate_state));
    if (state == Z_NULL) return Z_MEM_ERROR;
    Tracev((stderr, "inflate: allocated\n"));
    strm->state = (struct internal_state FAR *)state;
    state->dmax = 32768U;
    state->wbits = (uInt)windowBits;
    state->wsize = 1U << windowBits;
    state->window = window;
    state->wnext = 0;
    state->whave = 0;
    state->sane = 1;
    return Z_OK;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movl %r8d, 0xc(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x4ecc4e
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
movsbl 0x8cd78(%rip), %ecx     # 0x5799bb
cmpl %ecx, %eax
jne 0x4ecc4e
cmpl $0x70, 0xc(%rsp)
je 0x4ecc5b
movl $0xfffffffa, 0x34(%rsp) # imm = 0xFFFFFFFA
jmp 0x4ecd7b
cmpq $0x0, 0x28(%rsp)
je 0x4ecc79
cmpq $0x0, 0x18(%rsp)
je 0x4ecc79
cmpl $0x8, 0x24(%rsp)
jl 0x4ecc79
cmpl $0xf, 0x24(%rsp)
jle 0x4ecc86
movl $0xfffffffe, 0x34(%rsp) # imm = 0xFFFFFFFE
jmp 0x4ecd7b
movq 0x28(%rsp), %rax
movq $0x0, 0x30(%rax)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x4eccbc
movq 0x28(%rsp), %rax
leaq -0x4b5b(%rip), %rcx     # 0x4e8150
movq %rcx, 0x40(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x50(%rax)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x4eccd8
movq 0x28(%rsp), %rax
leaq -0x4b54(%rip), %rcx     # 0x4e8180
movq %rcx, 0x48(%rax)
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x28(%rsp), %rcx
movq 0x50(%rcx), %rdi
movl $0x1, %esi
movl $0x1bf8, %edx           # imm = 0x1BF8
callq *%rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x4ecd0b
movl $0xfffffffc, 0x34(%rsp) # imm = 0xFFFFFFFC
jmp 0x4ecd7b
movq (%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x38(%rax)
movq (%rsp), %rax
movl $0x8000, 0x1c(%rax)     # imm = 0x8000
movl 0x24(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x38(%rax)
movl 0x24(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x3c(%rax)
movq 0x18(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x48(%rax)
movq (%rsp), %rax
movl $0x0, 0x44(%rax)
movq (%rsp), %rax
movl $0x0, 0x40(%rax)
movq (%rsp), %rax
movl $0x1, 0x1be8(%rax)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)