// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/../HDiffPatch/decompress_plugin_demo.h
// Function: lzma_open(hpatch_TDecompress*, unsigned long long, hpatch_TStreamInput const*, unsigned long long, unsigned long long)
static hpatch_decompressHandle  _lzma_open(hpatch_TDecompress* decompressPlugin,
                                               hpatch_StreamPos_t dataSize,
                                               const hpatch_TStreamInput* codeStream,
                                               hpatch_StreamPos_t code_begin,
                                               hpatch_StreamPos_t code_end){
        _lzma_TDecompress* self=0;
        SRes ret;
        unsigned char propsSize=0;
        unsigned char props[256];
        //load propsSize
        if (code_end-code_begin<1) _dec_openErr_rt();
        if (!codeStream->read(codeStream,code_begin,&propsSize,&propsSize+1)) return 0;
        ++code_begin;
        if (propsSize>(code_end-code_begin)) _dec_openErr_rt();
        //load props
        if (!codeStream->read(codeStream,code_begin,props,props+propsSize)) return 0;
        code_begin+=propsSize;

        self=(_lzma_TDecompress*)_dec_malloc(sizeof(_lzma_TDecompress));
        if (!self) _dec_memErr_rt();
        memset(self,0,sizeof(_lzma_TDecompress)-kDecompressBufSize);
        self->memAllocBase.Alloc=__lzma1_dec_Alloc;
        *((void**)&self->memAllocBase.Free)=(void*)__dec_free;
        self->codeStream=codeStream;
        self->code_begin=code_begin;
        self->code_end=code_end;
        
        self->decCopyPos=0;
        self->decReadPos=kDecompressBufSize;
        
        LzmaDec_Construct(&self->decEnv);
        ret=LzmaDec_Allocate(&self->decEnv,props,propsSize,&self->memAllocBase);
        if (ret!=SZ_OK){ _dec_onDecErr_up(); free(self); _dec_openErr_rt(); }
        LzmaDec_Init(&self->decEnv);
        return self;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
movb $0x0, 0xf(%rsp)
cmpq %rcx, %r8
je 0x7050
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
leaq 0x10(%rsp), %rcx
leaq 0xf(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq *0x10(%r13)
testl %eax, %eax
je 0x705d
incq %r12
movzbl 0xf(%rsp), %eax
movq %r15, %rcx
subq %r12, %rcx
cmpq %rax, %rcx
jae 0x7075
cmpl $0x0, 0x28(%rbx)
jne 0x705d
movl $0x2, 0x28(%rbx)
xorl %r14d, %r14d
movq %r14, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%rsp,%rax), %rcx
addq $0x10, %rcx
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq *0x10(%r13)
testl %eax, %eax
je 0x705d
movzbl 0xf(%rsp), %ebp
movl $0x80c0, %edi           # imm = 0x80C0
callq 0x6bb3
testq %rax, %rax
je 0x713b
movq %rax, %r14
addq %rbp, %r12
xorl %ebp, %ebp
movl $0xc0, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x41c0
leaq 0x285(%rip), %rax       # 0x734b
movq %rax, (%r14)
leaq -0x4e1(%rip), %rax      # 0x6bef
movq %rax, 0x8(%r14)
movq %r13, 0x10(%r14)
movq %r12, 0x18(%r14)
movq %r15, 0x20(%r14)
movq %rbp, 0xa8(%r14)
movq $0x8000, 0xb0(%r14) # imm = 0x8000
movq %r14, %r15
addq $0x28, %r15
movq %rbp, 0x40(%r14)
movq %rbp, 0x30(%r14)
movzbl 0xf(%rsp), %edx
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rcx
callq 0x5785f
testl %eax, %eax
je 0x7151
movl 0xb8(%r14), %eax
testl %eax, %eax
je 0x712e
cmpl $0x0, 0x28(%rbx)
jne 0x712e
movl %eax, 0x28(%rbx)
movq %r14, %rdi
callq 0x43b0
jmp 0x7050
cmpl $0x0, 0x28(%rbx)
jne 0x705d
movl $0x1, 0x28(%rbx)
jmp 0x705d
movq %r15, %rdi
callq 0x5520d
jmp 0x7060