// File: /workspace/github_cpp_makefile_star2_O3/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 0x90(%rdi), %r9
leaq 0x2000(%r9), %rax
addq $0x7, %r9
andq $-0x8, %r9
subq %r9, %rax
jbe 0x4087e
movq %r8, %r14
movq %rdi, %r13
movq %rax, (%rsp)
leaq 0x3bdc2(%rip), %rdi     # 0x7c518
xorl %r8d, %r8d
callq 0x42a4c
testq %rax, %rax
je 0x4087e
movq %rax, %rbx
testq %r14, %r14
je 0x407d1
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 0x4089d
testl %eax, %eax
je 0x40840
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 0x4085f
addq %r15, %rbp
cmpq %r14, %rbp
jb 0x4077e
leaq 0xf(%rsp), %r14
movb $0x0, (%r14)
movq (%rbx), %rax
cmpq 0x8(%rbx), %rax
je 0x40804
movq %r14, 0x40(%rbx)
movl $0x0, 0x48(%rbx)
movq %rbx, %rdi
callq 0x42cb9
testl %eax, %eax
jne 0x407da
movq $0x0, 0x40(%rbx)
jmp 0x40814
movq $0x0, 0x40(%rbx)
movl 0x48(%rbx), %eax
orl 0x30(%rbx), %eax
je 0x40820
leaq 0x20b14(%rip), %rdi     # 0x6132f
callq 0x44e0
leaq 0x3bcf1(%rip), %rdi     # 0x7c518
movq %rbx, %rsi
callq 0x408f6
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19809(%rip), %rdi     # 0x5a050
leaq 0x1fa93(%rip), %rsi     # 0x602e1
leaq 0x1fc60(%rip), %rcx     # 0x604b5
movl $0x28f, %edx            # imm = 0x28F
callq 0x4200
leaq 0x197ea(%rip), %rdi     # 0x5a050
leaq 0x1fa74(%rip), %rsi     # 0x602e1
leaq 0x1fc41(%rip), %rcx     # 0x604b5
movl $0x290, %edx            # imm = 0x290
callq 0x4200
leaq 0x197cb(%rip), %rdi     # 0x5a050
leaq 0x1fa55(%rip), %rsi     # 0x602e1
leaq 0x1fc22(%rip), %rcx     # 0x604b5
movl $0x28b, %edx            # imm = 0x28B
callq 0x4200