// File: sisong[P]ApkDiffPatch/src/../HDiffPatch/compress_plugin_demo.h
// Function: zlib_compress_part(_zlib_TCompress*, unsigned char const*, unsigned char const*, int, unsigned long long*, int*)
static int _zlib_compress_part(_zlib_TCompress* self,
                                   const unsigned char* part_data,const unsigned char* part_data_end,
                                   int is_data_end,hpatch_StreamPos_t* curWritedPos,int* outStream_isCanceled){
        int                 result=1; //true
        const char*         errAt="";
        int                 is_stream_end=0;
        int                 is_eof=0;
        assert(part_data<=part_data_end);
        self->c_stream.next_in=(Bytef*)part_data;
        self->c_stream.avail_in=(uInt)(part_data_end-part_data);
        while (1) {
            if ((self->c_stream.avail_out<self->c_buf_size)|is_stream_end){
                size_t writeLen=self->c_buf_size-self->c_stream.avail_out;
                if (writeLen>0){
                    _stream_out_code_write(self->out_code,*outStream_isCanceled,
                                           (*curWritedPos),self->c_buf,writeLen);
                }
                self->c_stream.next_out=(Bytef*)self->c_buf;
                self->c_stream.avail_out=(uInt)self->c_buf_size;
                if (is_stream_end)
                    break;//end loop
            }else{
                if (self->c_stream.avail_in>0){
                    if (Z_OK!=deflate(&self->c_stream,Z_NO_FLUSH)) _compress_error_return("deflate()");
                }else if (is_eof){
                    int ret=deflate(&self->c_stream,Z_FINISH);
                    is_stream_end= (ret==Z_STREAM_END);
                    if ((ret!=Z_STREAM_END)&&(ret!=Z_OK))
                        _compress_error_return("deflate() Z_FINISH");
                }else{
                    if (!is_data_end)
                        break;//part ok
                    else
                        is_eof=1;
                }
            }
        }
    clear:
        _check_compress_result(result,*outStream_isCanceled,"_zlib_compress_part()",errAt);
        return result;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
leaq 0xa588a(%rip), %rax     # 0xac447
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
ja 0x6bdb
jmp 0x6bfa
leaq 0xa6013(%rip), %rdi     # 0xacbf5
leaq 0xa5f59(%rip), %rsi     # 0xacb42
movl $0xb8, %edx
leaq 0xa6019(%rip), %rcx     # 0xacc0e
callq 0x4270
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
setb %al
andb $0x1, %al
movzbl %al, %eax
orl -0x44(%rbp), %eax
cmpl $0x0, %eax
je 0x6cfd
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x38(%rcx), %ecx
subq %rcx, %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jbe 0x6ccc
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rdi
movq -0x28(%rbp), %rcx
movq (%rcx), %rsi
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rdx
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
addq -0x50(%rbp), %rcx
callq *%rax
cmpl $0x0, %eax
jne 0x6cbe
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
movl $0x0, -0x34(%rbp)
movq -0x40(%rbp), %rdi
callq 0x4180
cmpq $0x0, %rax
jne 0x6cb9
leaq 0xa5db4(%rip), %rax     # 0xaca69
movq %rax, -0x40(%rbp)
jmp 0x6dbe
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x38(%rax)
cmpl $0x0, -0x44(%rbp)
je 0x6cf8
jmp 0x6dbc
jmp 0x6db7
movq -0x8(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jbe 0x6d45
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
xorl %esi, %esi
callq 0x94260
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x6d43
jmp 0x6d20
movl $0x0, -0x34(%rbp)
movq -0x40(%rbp), %rdi
callq 0x4180
cmpq $0x0, %rax
jne 0x6d41
leaq 0xa5f4c(%rip), %rax     # 0xacc89
movq %rax, -0x40(%rbp)
jmp 0x6dbe
jmp 0x6db5
cmpl $0x0, -0x48(%rbp)
je 0x6da2
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
movl $0x4, %esi
callq 0x94260
movl %eax, -0x54(%rbp)
cmpl $0x1, -0x54(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x44(%rbp)
cmpl $0x1, -0x54(%rbp)
je 0x6da0
cmpl $0x0, -0x54(%rbp)
je 0x6da0
jmp 0x6d7d
movl $0x0, -0x34(%rbp)
movq -0x40(%rbp), %rdi
callq 0x4180
cmpq $0x0, %rax
jne 0x6d9e
leaq 0xa5ef9(%rip), %rax     # 0xacc93
movq %rax, -0x40(%rbp)
jmp 0x6dbe
jmp 0x6db3
cmpl $0x0, -0x1c(%rbp)
jne 0x6daa
jmp 0x6dbc
movl $0x1, -0x48(%rbp)
jmp 0x6db3
jmp 0x6db5
jmp 0x6db7
jmp 0x6c1a
jmp 0x6dbe
cmpl $0x0, -0x34(%rbp)
jne 0x6df1
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6ddd
leaq 0xa5ed2(%rip), %rdi     # 0xacca6
movb $0x0, %al
callq 0x4060
jmp 0x6def
movq -0x40(%rbp), %rsi
leaq 0xa5ef7(%rip), %rdi     # 0xaccdf
movb $0x0, %al
callq 0x4060
jmp 0x6df1
movl -0x34(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)