// File: /workspace/github_cpp_makefile_star2_O2/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 0x359ca
leaq 0x19ac4(%rip), %rsi     # 0x4f3f8
movq %rsp, %rdi
pushq $0x7
popq %rdx
callq 0x4350
testl %eax, %eax
jne 0x359ef
testq %rbx, %rbx
je 0x35a14
leaq 0x7(%rsp), %r15
movq %r15, %rdi
callq 0x4150
cmpq $0x104, %rax            # imm = 0x104
jae 0x35a39
movq %rax, %r12
testq %r14, %r14
je 0x35979
leaq 0x8(%r12), %rax
movq %rax, (%r14)
leaq 0x110(%rsp), %r14
movl $0x118, %edx            # imm = 0x118
movq %r14, %rdi
xorl %esi, %esi
callq 0x41f0
movl $0x1, 0x10(%r14)
leaq 0x124(%rsp), %r14
incq %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x42c0
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 0x1f4ab(%rip), %rdi     # 0x54e7c
callq 0x4510
leaq 0x19673(%rip), %rdi     # 0x4f050
leaq 0x1f3cf(%rip), %rsi     # 0x54db3
leaq 0x1f43e(%rip), %rcx     # 0x54e29
pushq $0x40
jmp 0x35a5c
leaq 0x1f4b8(%rip), %rdi     # 0x54eae
callq 0x4510
leaq 0x1964e(%rip), %rdi     # 0x4f050
leaq 0x1f3aa(%rip), %rsi     # 0x54db3
leaq 0x1f419(%rip), %rcx     # 0x54e29
pushq $0x42
jmp 0x35a5c
leaq 0x1a366(%rip), %rdi     # 0x4fd81
callq 0x4510
leaq 0x19629(%rip), %rdi     # 0x4f050
leaq 0x1f385(%rip), %rsi     # 0x54db3
leaq 0x1f3f4(%rip), %rcx     # 0x54e29
pushq $0x44
jmp 0x35a5c
leaq 0x1f4af(%rip), %rdi     # 0x54eef
callq 0x4510
leaq 0x19604(%rip), %rdi     # 0x4f050
leaq 0x1f360(%rip), %rsi     # 0x54db3
leaq 0x1f3cf(%rip), %rcx     # 0x54e29
pushq $0x47
popq %rdx
callq 0x4230