// File: sisong[P]ApkDiffPatch/zlib1.3.1/deflate.c
// Function: deflateSetDictionary
int ZEXPORT deflateSetDictionary(z_streamp strm, const Bytef *dictionary,
                                 uInt  dictLength) {
    deflate_state *s;
    uInt str, n;
    int wrap;
    unsigned avail;
    z_const unsigned char *next;

    if (deflateStateCheck(strm) || dictionary == Z_NULL)
        return Z_STREAM_ERROR;
    s = strm->state;
    wrap = s->wrap;
    if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
        return Z_STREAM_ERROR;

    /* when using zlib wrappers, compute Adler-32 for provided dictionary */
    if (wrap == 1)
        strm->adler = adler32(strm->adler, dictionary, dictLength);
    s->wrap = 0;                    /* avoid computing Adler-32 in read_buf */

    /* if dictionary would fill window, just replace the history */
    if (dictLength >= s->w_size) {
        if (wrap == 0) {            /* already empty otherwise */
            CLEAR_HASH(s);
            s->strstart = 0;
            s->block_start = 0L;
            s->insert = 0;
        }
        dictionary += dictLength - s->w_size;  /* use the tail */
        dictLength = s->w_size;
    }

    /* insert dictionary into window and hash */
    avail = strm->avail_in;
    next = strm->next_in;
    strm->avail_in = dictLength;
    strm->next_in = (z_const Bytef *)dictionary;
    fill_window(s);
    while (s->lookahead >= MIN_MATCH) {
        str = s->strstart;
        n = s->lookahead - (MIN_MATCH-1);
        do {
            UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
#ifndef FASTEST
            s->prev[str & s->w_mask] = s->head[s->ins_h];
#endif
            s->head[s->ins_h] = (Pos)str;
            str++;
        } while (--n);
        s->strstart = str;
        s->lookahead = MIN_MATCH-1;
        fill_window(s);
    }
    s->strstart += s->lookahead;
    s->block_start = (long)s->strstart;
    s->insert = s->lookahead;
    s->lookahead = 0;
    s->match_length = s->prev_length = MIN_MATCH-1;
    s->match_available = 0;
    strm->next_in = next;
    strm->avail_in = avail;
    s->wrap = wrap;
    return Z_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x93560
cmpl $0x0, %eax
jne 0x93258
cmpq $0x0, -0x18(%rbp)
jne 0x93264
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x93554
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x34(%rbp)
cmpl $0x2, -0x34(%rbp)
je 0x9329d
cmpl $0x1, -0x34(%rbp)
jne 0x93290
movq -0x28(%rbp), %rax
cmpl $0x2a, 0x8(%rax)
jne 0x9329d
movq -0x28(%rbp), %rax
cmpl $0x0, 0xb4(%rax)
je 0x932a9
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x93554
cmpl $0x1, -0x34(%rbp)
jne 0x932ce
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x91ac0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x30(%rax)
movl -0x1c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jb 0x9337d
cmpl $0x0, -0x34(%rbp)
jne 0x9335c
jmp 0x932f1
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x28(%rbp), %rcx
movl 0x84(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movw $0x0, (%rax,%rcx,2)
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x84(%rax), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
shlq %rdx
xorl %esi, %esi
callq 0x4210
movq -0x28(%rbp), %rax
movl $0x0, 0xac(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x98(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x172c(%rax)
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %rax
subl 0x50(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x93620
movq -0x28(%rbp), %rax
cmpl $0x3, 0xb4(%rax)
jb 0x934b1
movq -0x28(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movl 0xb4(%rax), %eax
subl $0x2, %eax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movl 0x80(%rax), %eax
movq -0x28(%rbp), %rcx
movl 0x90(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x2c(%rbp), %edx
addl $0x3, %edx
subl $0x1, %edx
movl %edx, %edx
movzbl (%rax,%rdx), %eax
xorl %eax, %ecx
movq -0x28(%rbp), %rax
andl 0x8c(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x80(%rax)
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x28(%rbp), %rcx
movl 0x80(%rcx), %ecx
movw (%rax,%rcx,2), %dx
movq -0x28(%rbp), %rax
movq 0x70(%rax), %rax
movl -0x2c(%rbp), %ecx
movq -0x28(%rbp), %rsi
andl 0x58(%rsi), %ecx
movl %ecx, %ecx
movw %dx, (%rax,%rcx,2)
movl -0x2c(%rbp), %eax
movw %ax, %dx
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x28(%rbp), %rcx
movl 0x80(%rcx), %ecx
movw %dx, (%rax,%rcx,2)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
jne 0x933de
movl -0x2c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0xac(%rax)
movq -0x28(%rbp), %rax
movl $0x2, 0xb4(%rax)
movq -0x28(%rbp), %rdi
callq 0x93620
jmp 0x933b0
movq -0x28(%rbp), %rax
movl 0xb4(%rax), %ecx
movq -0x28(%rbp), %rax
addl 0xac(%rax), %ecx
movl %ecx, 0xac(%rax)
movq -0x28(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x28(%rbp), %rax
movl 0xb4(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x172c(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0xb4(%rax)
movq -0x28(%rbp), %rax
movl $0x2, 0xb8(%rax)
movq -0x28(%rbp), %rax
movl $0x2, 0xa0(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0xa8(%rax)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl -0x38(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x30(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)