// File: /workspace/github_cpp_makefile_star2_O2/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 0x39e36
movq %r9, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
testl %r8d, %r8d
je 0x39d6e
cmpq %r12, %r15
je 0x39e11
leaq 0x8(%rsp), %rcx
leaq 0x7(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq *0x10(%r13)
testl %eax, %eax
je 0x39e21
incq %r12
movb 0x7(%rsp), %al
jmp 0x39d70
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)
andq $0x0, 0x98(%r14)
movups %xmm0, 0x38(%r14)
movups %xmm0, 0x28(%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 0x7f(%rip), %rcx        # 0x39e53
movq %rcx, 0x68(%r14)
leaq 0x96(%rip), %rcx        # 0x39e75
movq %rcx, 0x70(%r14)
movq %r14, 0x78(%r14)
movsbl %al, %esi
leaq 0x144a2(%rip), %rdx     # 0x4e293
pushq $0x70
popq %rcx
callq 0x44bcf
testl %eax, %eax
je 0x39e24
movl 0x9c(%r14), %eax
testl %eax, %eax
je 0x39e11
cmpl $0x0, 0x28(%rbx)
jne 0x39e11
movl %eax, 0x28(%rbx)
cmpl $0x0, 0x28(%rbx)
jne 0x39e21
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 0x1c196(%rip), %rdi     # 0x55fd3
leaq 0x1c1bc(%rip), %rsi     # 0x56000
leaq 0x1c1e9(%rip), %rcx     # 0x56034
pushq $0x6c
popq %rdx
callq 0x4230