// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/../../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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x20(%rsp)
movl %ecx, 0xc(%rsp)
cmpq %rdx, %rsi
ja 0x38a3c
movq %rdi, %r12
leaq 0x18(%rdi), %r13
movq %rsi, 0x18(%rdi)
subl %esi, %edx
movl %edx, 0x20(%rdi)
xorl %ebx, %ebx
pushq $0x1
popq %r15
leaq 0x1596c(%rip), %rax     # 0x4e299
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
movl 0x38(%r12), %eax
movq 0x10(%r12), %r14
xorl %ecx, %ecx
cmpq %rax, %r14
seta %cl
orl %ebx, %ecx
jne 0x38965
cmpl $0x0, 0x20(%r12)
je 0x389b0
movq %r13, %rdi
xorl %esi, %esi
callq 0x4126a
testl %eax, %eax
je 0x38934
jmp 0x389ec
movq 0x8(%r12), %rdx
subq %rax, %r14
movq 0x20(%rsp), %r15
je 0x38997
movq (%r12), %rdi
movq (%r15), %rsi
leaq (%rdx,%r14), %rcx
callq *0x18(%rdi)
testl %eax, %eax
je 0x38a2f
addq %r14, (%r15)
movq 0x8(%r12), %rdx
movl 0x10(%r12), %eax
movq %rdx, 0x30(%r12)
movl %eax, 0x38(%r12)
testl %ebx, %ebx
movl $0x0, %ebx
pushq $0x1
popq %r15
je 0x38934
jmp 0x38a1d
testl %ebp, %ebp
jne 0x389c4
movl %r15d, %ebp
cmpl $0x0, 0xc(%rsp)
jne 0x38934
jmp 0x38a1d
movq %r13, %rdi
pushq $0x4
popq %rsi
callq 0x4126a
xorl %ebx, %ebx
movl %r15d, %ebp
cmpl $0x1, %eax
sete %bl
jbe 0x38934
leaq 0x158bc(%rip), %rax     # 0x4e2a3
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
cmpl $0x0, (%rax)
je 0x38a07
leaq 0x16607(%rip), %rdi     # 0x4f004
callq 0x4510
xorl %r15d, %r15d
jmp 0x38a1d
leaq 0x158a8(%rip), %rdi     # 0x4e2b6
xorl %r15d, %r15d
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x4060
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rsp), %rax
movl $0x1, (%rax)
jmp 0x389f6
leaq 0x1d6d0(%rip), %rdi     # 0x56113
leaq 0x1d697(%rip), %rsi     # 0x560e1
leaq 0x1d6db(%rip), %rcx     # 0x5612c
movl $0xb8, %edx
callq 0x4230