// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_compressedData_decompressTo
bool UnZipper_compressedData_decompressTo(UnZipper* self,const hpatch_TStreamInput* codeStream,
                                          hpatch_StreamPos_t code_begin,hpatch_StreamPos_t code_end,
                                          hpatch_StreamPos_t uncompressedSize,
                                          const hpatch_TStreamOutput* outStream,hpatch_StreamPos_t writeToPos){
    bool result=true;
    _zlib_TDecompress* decHandle=_zlib_decompress_open_by(decompressPlugin,codeStream,code_begin,
                                                          code_end,0,self->_buf,(kBufSize>>1));
    TByte* dataBuf=self->_buf+(kBufSize>>1);
    hpatch_StreamPos_t  curWritePos=0;
    check_clear(decHandle!=0);
    while (curWritePos<uncompressedSize){
        hpatch_StreamPos_t readLen=(kBufSize>>1);
        if (readLen>(uncompressedSize-curWritePos)) readLen=uncompressedSize-curWritePos;
        check_clear(_zlib_decompress_part(decHandle,dataBuf,dataBuf+readLen));
        check_clear(outStream->write(outStream,writeToPos+curWritePos,dataBuf,dataBuf+readLen));
        curWritePos+=readLen;
    }
    if (!_zlib_is_decompress_finish(decompressPlugin,decHandle))
        printf("WARNING: zip format error, decompress not finish!\n");
clear:
    _zlib_decompress_close_by(decompressPlugin,decHandle);
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %r14
movq %rdi, %r13
movq 0x90(%rdi), %r9
leaq 0x2000(%r9), %rax
addq $0x7, %r9
andq $-0x8, %r9
subq %r9, %rax
jbe 0x40b6d
movq %rax, (%rsp)
leaq 0x3b9b8(%rip), %rdi     # 0x7c518
xorl %r8d, %r8d
callq 0x42f48
movq %rax, %rbx
jmp 0x40b6f
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x40c8c
testq %r14, %r14
je 0x40bdf
movl $0x2000, %r12d          # imm = 0x2000
addq 0x90(%r13), %r12
xorl %ebp, %ebp
movq %r14, %r15
subq %rbp, %r15
movl $0x2000, %eax           # imm = 0x2000
cmpq %rax, %r15
cmovaeq %rax, %r15
leaq (%r12,%r15), %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x40cab
testl %eax, %eax
je 0x40c4e
movq 0x50(%rsp), %rax
leaq (%rax,%rbp), %rsi
movq 0x10(%rsp), %rdi
movq %r12, %rdx
movq %r13, %rcx
callq *0x18(%rdi)
testl %eax, %eax
je 0x40c6d
addq %r15, %rbp
cmpq %r14, %rbp
jb 0x40b8c
leaq 0xf(%rsp), %r14
movb $0x0, (%r14)
movq (%rbx), %rax
cmpq 0x8(%rbx), %rax
je 0x40c12
movq %r14, 0x40(%rbx)
movl $0x0, 0x48(%rbx)
movq %rbx, %rdi
callq 0x43191
testl %eax, %eax
jne 0x40be8
movq $0x0, 0x40(%rbx)
jmp 0x40c22
movq $0x0, 0x40(%rbx)
movl 0x48(%rbx), %eax
orl 0x30(%rbx), %eax
je 0x40c2e
leaq 0x20686(%rip), %rdi     # 0x612af
callq 0x44e0
leaq 0x3b8e3(%rip), %rdi     # 0x7c518
movq %rbx, %rsi
callq 0x40cf9
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x193fb(%rip), %rdi     # 0x5a050
leaq 0x1f605(%rip), %rsi     # 0x60261
leaq 0x1f7d2(%rip), %rcx     # 0x60435
movl $0x28f, %edx            # imm = 0x28F
callq 0x4200
leaq 0x193dc(%rip), %rdi     # 0x5a050
leaq 0x1f5e6(%rip), %rsi     # 0x60261
leaq 0x1f7b3(%rip), %rcx     # 0x60435
movl $0x290, %edx            # imm = 0x290
callq 0x4200
leaq 0x193bd(%rip), %rdi     # 0x5a050
leaq 0x1f5c7(%rip), %rsi     # 0x60261
leaq 0x1f794(%rip), %rcx     # 0x60435
movl $0x28b, %edx            # imm = 0x28B
callq 0x4200