// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/../HDiffPatch/decompress_plugin_demo.h
// Function: lzma_decompress_part(void*, unsigned char*, unsigned char*)
static hpatch_BOOL _lzma_decompress_part(hpatch_decompressHandle decompressHandle,
                                             unsigned char* out_part_data,unsigned char* out_part_data_end){
        _lzma_TDecompress* self=(_lzma_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.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.dic+self->decCopyPos,copyLen);
                out_cur+=copyLen;
                self->decCopyPos+=copyLen;
                if ((self->decEnv.dicPos==self->decEnv.dicBufSize)
                    &&(self->decEnv.dicPos==self->decCopyPos)){
                    self->decEnv.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.dicPos;
                res=LzmaDec_DecodeToDic(&self->decEnv,self->decEnv.dicBufSize,
                                        self->dec_buf+self->decReadPos,&inSize,LZMA_FINISH_ANY,&status);
                if(res==SZ_OK){
                    if ((inSize==0)&&(self->decEnv.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 0x6793
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x28(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0xbc(%rdi), %r13
leaq 0x80bc(%rdi), %rax
movq %rax, 0x10(%rsp)
cmpq %rbp, %r15
jae 0x6781
movq 0x50(%rbx), %r14
movq 0xa8(%rbx), %rsi
movq %r14, %rax
subq %rsi, %rax
jne 0x6711
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %r12
movq 0xb0(%rbx), %rdx
cmpq $0x8000, %rdx           # imm = 0x8000
sete %al
subq %rsi, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x66c6
movl $0x8000, %eax           # imm = 0x8000
cmpq %rax, %r12
cmovaeq %rax, %r12
movl $0x8000, %edx           # imm = 0x8000
subq %r12, %rdx
movq %rdx, 0xb0(%rbx)
movq 0x10(%rbx), %rdi
addq %r13, %rdx
movq 0x10(%rsp), %rcx
callq *0x10(%rdi)
testl %eax, %eax
je 0x677d
addq %r12, 0x18(%rbx)
movq 0x50(%rbx), %r14
movq 0xb0(%rbx), %rdx
movl $0x8000, %eax           # imm = 0x8000
subq %rdx, %rax
movq %rax, 0x8(%rsp)
movq 0x48(%rbx), %rsi
addq %r13, %rdx
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
leaq 0x24(%rsp), %r9
callq 0x4aae9
testl %eax, %eax
jne 0x6767
movq 0x8(%rsp), %rax
testq %rax, %rax
jne 0x6705
cmpq %r14, 0x50(%rbx)
je 0x6767
addq %rax, 0xb0(%rbx)
jmp 0x663f
movq %rbp, %r14
subq %r15, %r14
cmpq %r14, %rax
cmovbq %rax, %r14
addq 0x40(%rbx), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x42c0
addq %r14, %r15
addq 0xa8(%rbx), %r14
movq %r14, 0xa8(%rbx)
movq 0x50(%rbx), %rax
cmpq 0x48(%rbx), %rax
jne 0x663f
cmpq %r14, %rax
jne 0x663f
andq $0x0, 0x50(%rbx)
andq $0x0, 0xa8(%rbx)
jmp 0x663f
cmpl $0x0, 0xb8(%rbx)
jne 0x677d
addq $0xb8, %rbx
movl $0x3, (%rbx)
xorl %eax, %eax
jmp 0x6784
pushq $0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x47bed(%rip), %rdi     # 0x4e387
leaq 0x47b8b(%rip), %rsi     # 0x4e32c
leaq 0x47e5b(%rip), %rcx     # 0x4e603
movl $0x312, %edx            # imm = 0x312
callq 0x4230