// File: /workspace/github_cpp_makefile_star2_O1/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 0x4304e
movq %r9, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
testl %r8d, %r8d
je 0x42fa6
cmpq %r12, %r15
je 0x43029
leaq 0x8(%rsp), %rcx
leaq 0x7(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq *0x10(%r13)
testl %eax, %eax
je 0x43039
incq %r12
movl $0xa0, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x41c0
leaq 0xa0(%r14), %rax
movq %rax, 0x18(%r14)
addq $-0xa0, %rbp
movq %rbp, 0x20(%r14)
movq %r13, 0x10(%r14)
movq %r12, (%r14)
movq %r15, 0x8(%r14)
movsbl 0x7(%rsp), %esi
movb %sil, 0x98(%r14)
leaq 0x28(%r14), %rdi
leaq 0x80(%rip), %rax        # 0x4306d
movq %rax, 0x68(%r14)
leaq 0x97(%rip), %rax        # 0x4308f
movq %rax, 0x70(%r14)
movq %r14, 0x78(%r14)
leaq 0x1628c(%rip), %rdx     # 0x59293
movl $0x70, %ecx
callq 0x4f34e
testl %eax, %eax
je 0x4303c
movl 0x9c(%r14), %eax
testl %eax, %eax
je 0x43029
cmpl $0x0, 0x28(%rbx)
jne 0x43029
movl %eax, 0x28(%rbx)
cmpl $0x0, 0x28(%rbx)
jne 0x43039
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 0x1de5e(%rip), %rdi     # 0x60eb3
leaq 0x1de84(%rip), %rsi     # 0x60ee0
leaq 0x1deb1(%rip), %rcx     # 0x60f14
movl $0x6c, %edx
callq 0x4200