// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/ZipDiffData.cpp
// Function: openZipDiffData(hpatch_TStreamInput const*, hpatch_TDecompress*, unsigned long*)
static bool _openZipDiffData(const hpatch_TStreamInput* diffData,hpatch_TDecompress* decompressPlugin,
                  size_t* out_headInfoPos=0){
    const char* kVersionType="ZiPat1&";
    const size_t kVersionTypeLen=7;
    assert(kVersionTypeLen==strlen(kVersionType));
    
    TByte buf[kVersionTypeLen + hpatch_kMaxPluginTypeLength+1+1];
    int readLen=sizeof(buf)-1;
    buf[readLen]='\0';
    if ((size_t)readLen>diffData->streamSize)
        readLen=(int)diffData->streamSize;
    check(diffData->read(diffData,0,buf,buf+readLen));
    //check type+version
    check(0==strncmp((const char*)buf,kVersionType,kVersionTypeLen));
    {//read compressType
        check(decompressPlugin!=0);
        const char* compressType=(const char*)buf+kVersionTypeLen;
        size_t compressTypeLen=strlen(compressType);//safe
        check(compressTypeLen<=hpatch_kMaxPluginTypeLength);
        if (out_headInfoPos)
            *out_headInfoPos=kVersionTypeLen+compressTypeLen+1;
        hpatch_compressedDiffInfo compressedInfo={0,0,1};
        memcpy(compressedInfo.compressType,compressType,compressTypeLen+1); //'\0'
        return 0!=decompressPlugin->is_can_open(compressedInfo.compressType);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdx, %r14
movq %rsi, %rbx
movq %rsp, %rdx
movb $0x0, 0x10b(%rdx)
movq 0x8(%rdi), %rax
movl $0x10b, %ecx            # imm = 0x10B
cmpq %rcx, %rax
cmovbq %rax, %rcx
addq %rsp, %rcx
xorl %esi, %esi
callq *0x10(%rdi)
testl %eax, %eax
je 0x3e708
movl $0x6150695a, %eax       # imm = 0x6150695A
xorl (%rsp), %eax
movl $0x26317461, %ecx       # imm = 0x26317461
xorl 0x3(%rsp), %ecx
orl %eax, %ecx
jne 0x3e733
testq %rbx, %rbx
je 0x3e75e
leaq 0x7(%rsp), %r15
movq %r15, %rdi
callq 0x4140
cmpq $0x104, %rax            # imm = 0x104
jae 0x3e789
movq %rax, %r12
testq %r14, %r14
je 0x3e6b7
leaq 0x8(%r12), %rax
movq %rax, (%r14)
leaq 0x110(%rsp), %r14
movl $0x118, %edx            # imm = 0x118
movq %r14, %rdi
xorl %esi, %esi
callq 0x41c0
movl $0x1, 0x10(%r14)
leaq 0x124(%rsp), %r14
incq %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4290
movq %r14, %rdi
callq *(%rbx)
testl %eax, %eax
setne %al
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x2164d(%rip), %rdi     # 0x5fd5c
callq 0x44e0
leaq 0x1b935(%rip), %rdi     # 0x5a050
leaq 0x21571(%rip), %rsi     # 0x5fc93
leaq 0x215e0(%rip), %rcx     # 0x5fd09
movl $0x40, %edx
callq 0x4200
leaq 0x21654(%rip), %rdi     # 0x5fd8e
callq 0x44e0
leaq 0x1b90a(%rip), %rdi     # 0x5a050
leaq 0x21546(%rip), %rsi     # 0x5fc93
leaq 0x215b5(%rip), %rcx     # 0x5fd09
movl $0x42, %edx
callq 0x4200
leaq 0x1c61c(%rip), %rdi     # 0x5ad81
callq 0x44e0
leaq 0x1b8df(%rip), %rdi     # 0x5a050
leaq 0x2151b(%rip), %rsi     # 0x5fc93
leaq 0x2158a(%rip), %rcx     # 0x5fd09
movl $0x44, %edx
callq 0x4200
leaq 0x2163f(%rip), %rdi     # 0x5fdcf
callq 0x44e0
leaq 0x1b8b4(%rip), %rdi     # 0x5a050
leaq 0x214f0(%rip), %rsi     # 0x5fc93
leaq 0x2155f(%rip), %rcx     # 0x5fd09
movl $0x47, %edx
callq 0x4200