// File: sisong[P]ApkDiffPatch/zlib1.3.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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x93560
cmpl $0x0, %eax
je 0x9401c
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x94248
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x94035
movl $0x6, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x9404d
cmpl $0x9, -0x14(%rbp)
jg 0x9404d
cmpl $0x0, -0x18(%rbp)
jl 0x9404d
cmpl $0x4, -0x18(%rbp)
jle 0x94059
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x94248
movq -0x20(%rbp), %rax
movslq 0xc4(%rax), %rcx
leaq 0x51bd5(%rip), %rax     # 0xe5c40
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x18(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0xc8(%rcx), %eax
jne 0x940a5
movq -0x28(%rbp), %rax
movslq -0x14(%rbp), %rdx
leaq 0x51ba8(%rip), %rcx     # 0xe5c40
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
je 0x94111
movq -0x20(%rbp), %rax
cmpl $-0x2, 0x4c(%rax)
je 0x94111
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x94260
movl %eax, -0x2c(%rbp)
cmpl $-0x2, -0x2c(%rbp)
jne 0x940d1
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x94248
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x94103
movq -0x20(%rbp), %rax
movl 0xac(%rax), %eax
movq -0x20(%rbp), %rcx
subq 0x98(%rcx), %rax
movq -0x20(%rbp), %rcx
movl 0xb4(%rcx), %ecx
addq %rcx, %rax
cmpq $0x0, %rax
je 0x9410f
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x94248
jmp 0x94111
movq -0x20(%rbp), %rax
movl 0xc4(%rax), %eax
cmpl -0x14(%rbp), %eax
je 0x94234
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc4(%rax)
jne 0x941a8
movq -0x20(%rbp), %rax
cmpl $0x0, 0x1728(%rax)
je 0x941a8
movq -0x20(%rbp), %rax
cmpl $0x1, 0x1728(%rax)
jne 0x94156
movq -0x20(%rbp), %rdi
callq 0x95490
jmp 0x9419a
jmp 0x94158
movq -0x20(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x84(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movw $0x0, (%rax,%rcx,2)
movq -0x20(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x84(%rax), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
shlq %rdx
xorl %esi, %esi
callq 0x4210
jmp 0x9419a
movq -0x20(%rbp), %rax
movl $0x0, 0x1728(%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc4(%rax)
movslq -0x14(%rbp), %rcx
leaq 0x51a80(%rip), %rax     # 0xe5c40
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x2(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc0(%rax)
movslq -0x14(%rbp), %rcx
leaq 0x51a60(%rip), %rax     # 0xe5c40
shlq $0x4, %rcx
addq %rcx, %rax
movzwl (%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xcc(%rax)
movslq -0x14(%rbp), %rcx
leaq 0x51a41(%rip), %rax     # 0xe5c40
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xd0(%rax)
movslq -0x14(%rbp), %rcx
leaq 0x51a21(%rip), %rax     # 0xe5c40
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x6(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xbc(%rax)
movl -0x18(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)