// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/src/../HDiffPatch/decompress_plugin_demo.h
// Function: lzma2_decompress_part(void*, unsigned char*, unsigned char*)
static hpatch_BOOL _lzma2_decompress_part(hpatch_decompressHandle decompressHandle,
                                            unsigned char* out_part_data,unsigned char* out_part_data_end){
        _lzma2_TDecompress* self=(_lzma2_TDecompress*)decompressHandle;
        unsigned char* out_cur=out_part_data;
        assert(out_part_data<=out_part_data_end);
        while (out_cur<out_part_data_end){
            size_t copyLen=(self->decEnv.decoder.dicPos-self->decCopyPos);
            if (copyLen>0){
                if (copyLen>(size_t)(out_part_data_end-out_cur))
                    copyLen=(out_part_data_end-out_cur);
                memcpy(out_cur,self->decEnv.decoder.dic+self->decCopyPos,copyLen);
                out_cur+=copyLen;
                self->decCopyPos+=copyLen;
                if ((self->decEnv.decoder.dicPos==self->decEnv.decoder.dicBufSize)
                    &&(self->decEnv.decoder.dicPos==self->decCopyPos)){
                    self->decEnv.decoder.dicPos=0;
                    self->decCopyPos=0;
                }
            }else{
                ELzmaStatus status;
                SizeT inSize,dicPos_back;
                SRes res;
                hpatch_StreamPos_t codeLen=(self->code_end - self->code_begin);
                if ((self->decReadPos==kDecompressBufSize)&&(codeLen>0)) {
                    size_t readLen=kDecompressBufSize;
                    if (readLen>codeLen) readLen=(size_t)codeLen;
                    self->decReadPos=kDecompressBufSize-readLen;
                    if (!self->codeStream->read(self->codeStream,self->code_begin,self->dec_buf+self->decReadPos,
                                                self->dec_buf+self->decReadPos+readLen)) return hpatch_FALSE;//error;
                    self->code_begin+=readLen;
                }
                
                inSize=kDecompressBufSize-self->decReadPos;
                dicPos_back=self->decEnv.decoder.dicPos;
                res=Lzma2Dec_DecodeToDic(&self->decEnv,self->decEnv.decoder.dicBufSize,
                                        self->dec_buf+self->decReadPos,&inSize,LZMA_FINISH_ANY,&status);
                if(res==SZ_OK){
                    if ((inSize==0)&&(self->decEnv.decoder.dicPos==dicPos_back))
                        _dec_onDecErr_rt();//error;
                }else{
                    _dec_onDecErr_rt();//error;
                }
                self->decReadPos+=inSize;
            }
        }
        return hpatch_TRUE;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpq %rdx, %rsi
ja 0x6e51
movl $0x1, %eax
jae 0x6e42
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x28(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0xcc(%rdi), %r13
leaq 0x80cc(%rdi), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rbx), %r14
movq 0xb8(%rbx), %rsi
movq %r14, %rax
subq %rsi, %rax
jne 0x6dd1
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %r12
movq 0xc0(%rbx), %rdx
cmpq $0x8000, %rdx           # imm = 0x8000
sete %al
subq %rsi, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x6d89
movl $0x8000, %eax           # imm = 0x8000
cmpq %rax, %r12
cmovaeq %rax, %r12
movl $0x8000, %edx           # imm = 0x8000
subq %r12, %rdx
movq %rdx, 0xc0(%rbx)
movq 0x10(%rbx), %rdi
addq %r13, %rdx
movq 0x10(%rsp), %rcx
callq *0x10(%rdi)
testl %eax, %eax
je 0x6e40
addq %r12, 0x18(%rbx)
movq 0x60(%rbx), %r14
movq 0xc0(%rbx), %rdx
movl $0x8000, %eax           # imm = 0x8000
subq %rdx, %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rbx), %rsi
addq %r13, %rdx
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
leaq 0x24(%rsp), %r9
callq 0x57800
testl %eax, %eax
jne 0x6e2a
movq 0x8(%rsp), %rax
testq %rax, %rax
jne 0x6dc8
cmpq %r14, 0x60(%rbx)
je 0x6e2a
addq %rax, 0xc0(%rbx)
jmp 0x6e1a
movq %rbp, %r14
subq %r15, %r14
cmpq %r14, %rax
cmovbq %rax, %r14
addq 0x50(%rbx), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x4290
addq %r14, %r15
addq 0xb8(%rbx), %r14
movq %r14, 0xb8(%rbx)
movq 0x60(%rbx), %rax
cmpq 0x58(%rbx), %rax
jne 0x6e1a
cmpq %r14, %rax
jne 0x6e1a
xorl %eax, %eax
movq %rax, 0x60(%rbx)
movq %rax, 0xb8(%rbx)
cmpq %rbp, %r15
jb 0x6d0b
movl $0x1, %eax
jmp 0x6e42
cmpl $0x0, 0xc8(%rbx)
jne 0x6e40
addq $0xc8, %rbx
movl $0x3, (%rbx)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5252f(%rip), %rdi     # 0x59387
leaq 0x524cd(%rip), %rsi     # 0x5932c
leaq 0x52644(%rip), %rcx     # 0x594aa
movl $0x380, %edx            # imm = 0x380
callq 0x4200