// File: /workspace/github_cpp_makefile_star2_O2/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 0x64c1
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 0x64ce
incq %r12
movzbl 0xf(%rsp), %eax
movq %r15, %rcx
subq %r12, %rcx
cmpq %rax, %rcx
jae 0x64e6
cmpl $0x0, 0x28(%rbx)
jne 0x64ce
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 0x64ce
movzbl 0xf(%rsp), %ebp
movl $0x80c0, %edi           # imm = 0x80C0
callq 0x6000
testq %rax, %rax
je 0x65a0
movq %rax, %r14
addq %rbp, %r12
movq %rax, %rbp
addq $0x28, %rbp
movl $0x98, %edx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x41f0
leaq 0x276(%rip), %rax       # 0x67b2
movq %rax, (%r14)
leaq -0x4db(%rip), %rax      # 0x606b
movq %rax, 0x8(%r14)
movq %r13, 0x10(%r14)
movq %r12, 0x18(%r14)
movq %r15, 0x20(%r14)
movq $0x8000, 0xb0(%r14) # imm = 0x8000
andq $0x0, 0x30(%r14)
movzbl 0xf(%rsp), %edx
leaq 0x10(%rsp), %rsi
movq %rbp, %rdi
movq %r14, %rcx
callq 0x4ceb2
testl %eax, %eax
je 0x65b6
movl 0xb8(%r14), %eax
testl %eax, %eax
je 0x6593
cmpl $0x0, 0x28(%rbx)
jne 0x6593
movl %eax, 0x28(%rbx)
movq %r14, %rdi
callq 0x43d0
jmp 0x64c1
cmpl $0x0, 0x28(%rbx)
jne 0x64ce
movl $0x1, 0x28(%rbx)
jmp 0x64ce
movq %rbp, %rdi
callq 0x4aad3
jmp 0x64d1