// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/zlib-1.3.0.1/deflate.c
// Function: deflateParams
int ZEXPORT deflateParams(z_streamp strm, int level, int strategy) {
    deflate_state *s;
    compress_func func;

    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
    s = strm->state;

#ifdef FASTEST
    if (level != 0) level = 1;
#else
    if (level == Z_DEFAULT_COMPRESSION) level = 6;
#endif
    if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
        return Z_STREAM_ERROR;
    }
    func = configuration_table[s->level].func;

    if ((strategy != s->strategy || func != configuration_table[level].func) &&
        s->last_flush != -2) {
        /* Flush the last buffer: */
        int err = deflate(strm, Z_BLOCK);
        if (err == Z_STREAM_ERROR)
            return err;
        if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead)
            return Z_BUF_ERROR;
    }
    if (s->level != level) {
        if (s->level == 0 && s->matches != 0) {
            if (s->matches == 1)
                slide_hash(s);
            else
                CLEAR_HASH(s);
            s->matches = 0;
        }
        s->level = level;
        s->max_lazy_match   = configuration_table[level].max_lazy;
        s->good_match       = configuration_table[level].good_length;
        s->nice_match       = configuration_table[level].nice_length;
        s->max_chain_length = configuration_table[level].max_chain;
    }
    s->strategy = strategy;
    return Z_OK;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movq 0x28(%rsp), %rdi
callq 0xd0920
cmpl $0x0, %eax
je 0xd146d
movl $0xfffffffe, 0x34(%rsp) # imm = 0xFFFFFFFE
jmp 0xd16cb
movq 0x28(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x18(%rsp)
cmpl $-0x1, 0x24(%rsp)
jne 0xd148a
movl $0x6, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jl 0xd14a6
cmpl $0x9, 0x24(%rsp)
jg 0xd14a6
cmpl $0x0, 0x20(%rsp)
jl 0xd14a6
cmpl $0x4, 0x20(%rsp)
jle 0xd14b3
movl $0xfffffffe, 0x34(%rsp) # imm = 0xFFFFFFFE
jmp 0xd16cb
movq 0x18(%rsp), %rax
movslq 0xc4(%rax), %rcx
leaq 0xe1e3a(%rip), %rax     # 0x1b3300
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movl 0x20(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0xc8(%rcx), %eax
jne 0xd1505
movq 0x10(%rsp), %rax
movslq 0x24(%rsp), %rdx
leaq 0xe1e08(%rip), %rcx     # 0x1b3300
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
je 0xd157c
movq 0x18(%rsp), %rax
cmpl $-0x2, 0x4c(%rax)
je 0xd157c
movq 0x28(%rsp), %rdi
movl $0x5, %esi
callq 0xd16e0
movl %eax, 0xc(%rsp)
cmpl $-0x2, 0xc(%rsp)
jne 0xd1537
movl 0xc(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0xd16cb
movq 0x28(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0xd156d
movq 0x18(%rsp), %rax
movl 0xac(%rax), %eax
movq 0x18(%rsp), %rcx
subq 0x98(%rcx), %rax
movq 0x18(%rsp), %rcx
movl 0xb4(%rcx), %ecx
addq %rcx, %rax
cmpq $0x0, %rax
je 0xd157a
movl $0xfffffffb, 0x34(%rsp) # imm = 0xFFFFFFFB
jmp 0xd16cb
jmp 0xd157c
movq 0x18(%rsp), %rax
movl 0xc4(%rax), %eax
cmpl 0x24(%rsp), %eax
je 0xd16b4
movq 0x18(%rsp), %rax
cmpl $0x0, 0xc4(%rax)
jne 0xd161e
movq 0x18(%rsp), %rax
cmpl $0x0, 0x1728(%rax)
je 0xd161e
movq 0x18(%rsp), %rax
cmpl $0x1, 0x1728(%rax)
jne 0xd15c7
movq 0x18(%rsp), %rdi
callq 0xd2aa0
jmp 0xd160f
jmp 0xd15c9
movq 0x18(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x18(%rsp), %rcx
movl 0x84(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movw $0x0, (%rax,%rcx,2)
movq 0x18(%rsp), %rax
movq 0x78(%rax), %rdi
movq 0x18(%rsp), %rax
movl 0x84(%rax), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
shlq %rdx
xorl %esi, %esi
callq 0xb2d0
jmp 0xd160f
movq 0x18(%rsp), %rax
movl $0x0, 0x1728(%rax)
movl 0x24(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0xc4(%rax)
movslq 0x24(%rsp), %rcx
leaq 0xe1cc7(%rip), %rax     # 0x1b3300
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x2(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0xc0(%rax)
movslq 0x24(%rsp), %rcx
leaq 0xe1ca5(%rip), %rax     # 0x1b3300
shlq $0x4, %rcx
addq %rcx, %rax
movzwl (%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0xcc(%rax)
movslq 0x24(%rsp), %rcx
leaq 0xe1c84(%rip), %rax     # 0x1b3300
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0xd0(%rax)
movslq 0x24(%rsp), %rcx
leaq 0xe1c62(%rip), %rax     # 0x1b3300
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x6(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0xbc(%rax)
movl 0x20(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0xc8(%rax)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)