// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/src/patch/../../HDiffPatch/decompress_plugin_demo.h
// Function: zlib_decompress_open_at(hpatch_TDecompress*, hpatch_TStreamInput const*, unsigned long long, unsigned long long, int, _zlib_TDecompress*, unsigned long)
static _zlib_TDecompress*  _zlib_decompress_open_at(hpatch_TDecompress* decompressPlugin,
                                                        const hpatch_TStreamInput* codeStream,
                                                        hpatch_StreamPos_t code_begin,
                                                        hpatch_StreamPos_t code_end,
                                                        int  isSavedWindowBits,
                                                        _zlib_TDecompress* self,size_t _self_and_buf_size){
        int ret;
        signed char kWindowBits=-MAX_WBITS;
        assert(_self_and_buf_size>sizeof(_zlib_TDecompress));
        if (isSavedWindowBits){//load kWindowBits
            if (code_end-code_begin<1) _dec_openErr_rt();
            if (!codeStream->read(codeStream,code_begin,(unsigned char*)&kWindowBits,
                                  (unsigned char*)&kWindowBits+1)) return 0;
            ++code_begin;
        }
        
        memset(self,0,sizeof(_zlib_TDecompress));
        self->dec_buf=((unsigned char*)self)+sizeof(_zlib_TDecompress);
        self->dec_buf_size=_self_and_buf_size-sizeof(_zlib_TDecompress);
        self->codeStream=codeStream;
        self->code_begin=code_begin;
        self->code_end=code_end;
        self->windowBits=kWindowBits;
        self->d_stream.zalloc=__zlib_dec_Alloc;
        self->d_stream.zfree=__dec_free;
        self->d_stream.opaque=self;
        ret = inflateInit2(&self->d_stream,self->windowBits);
        if (ret!=Z_OK) { _dec_onDecErr_up(); _dec_openErr_rt(); }
        return self;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x40(%rsp), %rbp
movb $-0xf, 0x7(%rsp)
cmpq $0xa0, %rbp
jbe 0x42b7d
movq %r9, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
testl %r8d, %r8d
je 0x42ab0
cmpq %r12, %r15
je 0x42b58
leaq 0x8(%rsp), %rcx
leaq 0x7(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq *0x10(%r13)
testl %eax, %eax
je 0x42b68
incq %r12
movb 0x7(%rsp), %al
jmp 0x42ab2
movb $-0xf, %al
leaq 0x28(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%r14)
movups %xmm0, 0x78(%r14)
movups %xmm0, 0x88(%r14)
movups %xmm0, 0x58(%r14)
movups %xmm0, 0x48(%r14)
movups %xmm0, 0x38(%r14)
movups %xmm0, 0x28(%r14)
movq $0x0, 0x98(%r14)
leaq 0xa0(%r14), %rcx
movq %rcx, 0x18(%r14)
addq $-0xa0, %rbp
movq %rbp, 0x20(%r14)
movq %r13, 0x10(%r14)
movq %r12, (%r14)
movq %r15, 0x8(%r14)
movb %al, 0x98(%r14)
leaq 0x83(%rip), %rcx        # 0x42b9c
movq %rcx, 0x68(%r14)
leaq 0x9a(%rip), %rcx        # 0x42bbe
movq %rcx, 0x70(%r14)
movq %r14, 0x78(%r14)
movsbl %al, %esi
leaq 0x1675d(%rip), %rdx     # 0x59293
movl $0x70, %ecx
callq 0x4e72a
testl %eax, %eax
je 0x42b6b
movl 0x9c(%r14), %eax
testl %eax, %eax
je 0x42b58
cmpl $0x0, 0x28(%rbx)
jne 0x42b58
movl %eax, 0x28(%rbx)
cmpl $0x0, 0x28(%rbx)
jne 0x42b68
addq $0x28, %rbx
movl $0x2, (%rbx)
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e3af(%rip), %rdi     # 0x60f33
leaq 0x1e3d5(%rip), %rsi     # 0x60f60
leaq 0x1e402(%rip), %rcx     # 0x60f94
movl $0x6c, %edx
callq 0x4200