// File: sisong[P]ApkDiffPatch/zlib1.3.1/deflate.c
// Function: deflate_huff
local block_state deflate_huff(deflate_state *s, int flush) {
    int bflush;             /* set if current block must be flushed */

    for (;;) {
        /* Make sure that we have a literal to write. */
        if (s->lookahead == 0) {
            fill_window(s);
            if (s->lookahead == 0) {
                if (flush == Z_NO_FLUSH)
                    return need_more;
                break;      /* flush the current block */
            }
        }

        /* Output a literal byte */
        s->match_length = 0;
        Tracevv((stderr,"%c", s->window[s->strstart]));
        _tr_tally_lit(s, s->window[s->strstart], bflush);
        s->lookahead--;
        s->strstart++;
        if (bflush) FLUSH_BLOCK(s, 0);
    }
    s->insert = 0;
    if (flush == Z_FINISH) {
        FLUSH_BLOCK(s, 1);
        return finish_done;
    }
    if (s->sym_next)
        FLUSH_BLOCK(s, 0);
    return block_done;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0xb4(%rax)
jne 0x962db
movq -0x10(%rbp), %rdi
callq 0x93620
movq -0x10(%rbp), %rax
cmpl $0x0, 0xb4(%rax)
jne 0x962d9
cmpl $0x0, -0x14(%rbp)
jne 0x962d4
movl $0x0, -0x4(%rbp)
jmp 0x965ff
jmp 0x96485
jmp 0x962db
movq -0x10(%rbp), %rax
movl $0x0, 0xa0(%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0xac(%rcx), %ecx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rax
movq 0x1700(%rax), %rax
movq -0x10(%rbp), %rdx
movl 0x170c(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x170c(%rdx)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x1700(%rax), %rax
movq -0x10(%rbp), %rdx
movl 0x170c(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x170c(%rdx)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movb -0x19(%rbp), %dl
movq -0x10(%rbp), %rax
movq 0x1700(%rax), %rax
movq -0x10(%rbp), %rsi
movl 0x170c(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x170c(%rsi)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movzbl -0x19(%rbp), %ecx
movw 0xd4(%rax,%rcx,4), %dx
addw $0x1, %dx
movw %dx, 0xd4(%rax,%rcx,4)
movq -0x10(%rbp), %rax
movl 0x170c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x1710(%rcx), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0xb4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xb4(%rax)
movq -0x10(%rbp), %rax
movl 0xac(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xac(%rax)
cmpl $0x0, -0x18(%rbp)
je 0x96480
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x98(%rax)
jl 0x96414
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x98(%rcx), %rcx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
jmp 0x9641c
xorl %eax, %eax
movq %rax, -0x30(%rbp)
jmp 0x9641c
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, %edx
movq -0x10(%rbp), %rax
subq 0x98(%rax), %rdx
xorl %ecx, %ecx
callq 0x9f410
movq -0x10(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x95880
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x20(%rax)
jne 0x9647e
movl $0x0, -0x4(%rbp)
jmp 0x965ff
jmp 0x96480
jmp 0x9629f
movq -0x10(%rbp), %rax
movl $0x0, 0x172c(%rax)
cmpl $0x4, -0x14(%rbp)
jne 0x9654a
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x98(%rax)
jl 0x964d1
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x98(%rcx), %rcx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0x964d9
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x964d9
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, %edx
movq -0x10(%rbp), %rax
subq 0x98(%rax), %rdx
movl $0x1, %ecx
callq 0x9f410
movq -0x10(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x95880
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x20(%rax)
jne 0x9653e
movl $0x2, -0x4(%rbp)
jmp 0x965ff
movl $0x3, -0x4(%rbp)
jmp 0x965ff
movq -0x10(%rbp), %rax
cmpl $0x0, 0x170c(%rax)
je 0x965f8
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x98(%rax)
jl 0x9658f
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x98(%rcx), %rcx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
jmp 0x96597
xorl %eax, %eax
movq %rax, -0x50(%rbp)
jmp 0x96597
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, %edx
movq -0x10(%rbp), %rax
subq 0x98(%rax), %rdx
xorl %ecx, %ecx
callq 0x9f410
movq -0x10(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x95880
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x20(%rax)
jne 0x965f6
movl $0x0, -0x4(%rbp)
jmp 0x965ff
jmp 0x965f8
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)