// File: /workspace/github_cpp_makefile_star2_O3/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 $0x18, %rsp
movq %r9, 0x10(%rsp)
movl %ecx, 0x4(%rsp)
cmpq %rdx, %rsi
ja 0x41511
movq %r8, %r14
movq %rdi, %r12
leaq 0x18(%rdi), %r13
movq %rsi, 0x18(%rdi)
subl %esi, %edx
movl %edx, 0x20(%rdi)
xorl %ebx, %ebx
leaq 0x17ea3(%rip), %rax     # 0x59299
movq %rax, 0x8(%rsp)
xorl %r15d, %r15d
movl 0x38(%r12), %eax
movq 0x10(%r12), %rbp
xorl %ecx, %ecx
cmpq %rax, %rbp
seta %cl
orl %ebx, %ecx
jne 0x4142f
cmpl $0x0, 0x20(%r12)
je 0x41474
movq %r13, %rdi
xorl %esi, %esi
callq 0x4ab03
testl %eax, %eax
je 0x413fe
jmp 0x414b9
movq 0x8(%r12), %rdx
subq %rax, %rbp
je 0x4145c
movq (%r12), %rdi
movq (%r14), %rsi
leaq (%rdx,%rbp), %rcx
callq *0x18(%rdi)
testl %eax, %eax
je 0x41504
addq %rbp, (%r14)
movq 0x8(%r12), %rdx
movl 0x10(%r12), %eax
movq %rdx, 0x30(%r12)
movl %eax, 0x38(%r12)
testl %ebx, %ebx
movl $0x0, %ebx
je 0x413fe
jmp 0x414fc
testl %r15d, %r15d
jne 0x4148c
movl $0x1, %r15d
cmpl $0x0, 0x4(%rsp)
jne 0x413fe
jmp 0x414ea
movq %r13, %rdi
movl $0x4, %esi
callq 0x4ab03
xorl %ebx, %ebx
movl $0x1, %r15d
cmpl $0x1, %eax
sete %bl
jbe 0x413fe
leaq 0x17def(%rip), %rax     # 0x592a3
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
je 0x414d4
leaq 0x18b3a(%rip), %rdi     # 0x5a004
callq 0x44e0
xorl %r15d, %r15d
jmp 0x414ea
leaq 0x17ddb(%rip), %rdi     # 0x592b6
xorl %r15d, %r15d
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x4060
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %r15d
jmp 0x414ea
movq 0x10(%rsp), %rax
movl $0x1, (%rax)
jmp 0x414c3
leaq 0x1fb5b(%rip), %rdi     # 0x61073
leaq 0x1fb22(%rip), %rsi     # 0x61041
leaq 0x1fb66(%rip), %rcx     # 0x6108c
movl $0xb8, %edx
callq 0x4200