LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/OldStream.cpp
// Function: OldStream_open(OldStream*, UnZipper*, unsigned int const*, unsigned long, unsigned int const*, unsigned long, hpatch_TStreamInput const*)
bool OldStream_open(OldStream* self,UnZipper* oldZip,const uint32_t* refList,size_t refCount,
                    const uint32_t* refNotDecompressList,size_t refNotDecompressCount,
                    const hpatch_TStreamInput* input_decompressedStream _VIRTUAL_IN_D(virtual_in)){
    bool result=true;
    uint32_t oldDataSize;
    check(self->stream==0);
    
    self->_oldZip=oldZip;
    self->_input_decompressedStream=input_decompressedStream;
#if (_IS_NEED_VIRTUAL_ZIP)
    self->_vin=virtual_in;
    if (virtual_in!=0)
        check(refNotDecompressCount==0);
#endif
    check(_createRange(self,refList,refCount,refNotDecompressList,refNotDecompressCount));
    assert(self->_rangeCount>0);
    oldDataSize=self->_rangeEndList[self->_rangeCount-1];
    
    self->_stream.streamImport=self;
    self->_stream.streamSize=oldDataSize;
    self->_stream.read=_OldStream_read;
    self->stream=&self->_stream;
clear:
    return result;
}

// Assembly:
pushq %rbx
cmpq $0x0, (%rdi)
jne 0x356cd
movq %rdi, %rbx
movq 0x10(%rsp), %rax
movq %rsi, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
movq %r9, %r8
callq 0x353f0
movq 0x50(%rbx), %rax
testq %rax, %rax
je 0x356f8
movq 0x38(%rbx), %rcx
movl -0x4(%rcx,%rax,4), %eax
leaq 0x18(%rbx), %rcx
movq %rbx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
leaq 0x55(%rip), %rax        # 0x35717
movq %rax, 0x28(%rbx)
movq %rcx, (%rbx)
movb $0x1, %al
popq %rbx
retq
leaq 0x1f60c(%rip), %rdi     # 0x54ce0
callq 0x4510
leaq 0x19970(%rip), %rdi     # 0x4f050
leaq 0x1f417(%rip), %rsi     # 0x54afe
leaq 0x1f4d6(%rip), %rcx     # 0x54bc4
movl $0x127, %edx            # imm = 0x127
callq 0x4230
leaq 0x1f543(%rip), %rdi     # 0x54c42
leaq 0x1f3f8(%rip), %rsi     # 0x54afe
leaq 0x1f4b7(%rip), %rcx     # 0x54bc4
movl $0x131, %edx            # imm = 0x131
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/OldStream.cpp
// Function: OldStream_read_do(OldStream*, unsigned long long, unsigned char*, unsigned char*, int)
static bool _OldStream_read_do(OldStream* self,hpatch_StreamPos_t readFromPos,
                                 unsigned char* out_data,unsigned char* out_data_end,int curRangeIndex){
    hpatch_StreamPos_t readPos=readFromPos - self->_rangeEndList[curRangeIndex-1];
#if (_IS_NEED_VIRTUAL_ZIP)
    if ((self->_vin)&&(self->_rangIsInVirtualBuf[curRangeIndex])){
        int fileIndex=self->_rangeFileOffsets[curRangeIndex];
        TZipEntryData* entryData=self->_vin->entryDatas[fileIndex];
        return hpatch_FALSE!=entryData->dataStream->read(entryData->dataStream,
                                                         readPos,out_data,out_data_end);
    }
#endif
    readPos+=self->_rangeFileOffsets[curRangeIndex];
    if (curRangeIndex==0){
        const unsigned char* src;
#if (_IS_NEED_VIRTUAL_ZIP)
        if (self->_vin)
            src=UnZipper_CEData(&self->_vin->virtualZip);
        else
#endif
            src=UnZipper_CEData(self->_oldZip);
        memcpy(out_data,src+readPos,out_data_end-out_data);
        return true;
    }else if (self->_rangIsInDecBuf[curRangeIndex]){
        return hpatch_FALSE!=self->_input_decompressedStream->read(self->_input_decompressedStream,
                                                                   readPos,out_data,out_data_end);
    }else{
        return UnZipper_fileData_read(self->_oldZip,(ZipFilePos_t)readPos,out_data,out_data_end);
    }
}

// Assembly:
pushq %rax
movq %rsi, %rax
movslq %r8d, %r8
movq 0x38(%rdi), %rsi
movq 0x40(%rdi), %r9
movl -0x4(%rsi,%r8,4), %esi
subq %rsi, %rax
movl (%r9,%r8,4), %esi
addq %rax, %rsi
testl %r8d, %r8d
je 0x3589c
movq 0x48(%rdi), %rax
cmpb $0x0, (%rax,%r8)
je 0x358b6
movq 0x10(%rdi), %rdi
callq *0x10(%rdi)
testl %eax, %eax
setne %al
jmp 0x358b4
movq 0x8(%rdi), %rax
addq 0x50(%rax), %rsi
subq %rdx, %rcx
movq %rdx, %rdi
movq %rcx, %rdx
callq 0x42c0
movb $0x1, %al
popq %rcx
retq
movq 0x8(%rdi), %rdi
popq %rax
jmp 0x3766d
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_isHaveApkV1_or_jarSign
bool UnZipper_isHaveApkV1_or_jarSign(const UnZipper* self){
    int fCount=UnZipper_fileCount(self);
    for (int i=fCount-1; i>=0; --i) {
        if (UnZipper_file_isApkV1_or_jarSign(self,i))
            return true;
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movzwl 0x8(%rax), %ebp
movl %ebp, %r14d
testl %ebp, %ebp
jle 0x36c58
leal -0x1(%r14), %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x36c63
testb %al, %al
je 0x36c3f
testl %r14d, %r14d
setg %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_file_isApkV1_or_jarSign
bool UnZipper_file_isApkV1_or_jarSign(const UnZipper* self,int fileIndex){
    const char* kJarSignPath0="META-INF/";
    const char* kJarSignPath1="META-INF\\";
    const size_t kJarSignPathLen=8+1;
    if (UnZipper_file_nameLen(self,fileIndex)<(int)kJarSignPathLen) return false;
    const char* fn=UnZipper_file_nameBegin(self,fileIndex);
    return (0==memcmp(fn,kJarSignPath0,kJarSignPathLen))
         ||(0==memcmp(fn,kJarSignPath1,kJarSignPathLen));
}

// Assembly:
pushq %rbx
movq 0x50(%rdi), %rbx
movq 0x58(%rdi), %rax
movslq %esi, %rcx
movl (%rax,%rcx,4), %eax
cmpw $0x9, 0x1c(%rbx,%rax)
jae 0x36c7e
xorl %eax, %eax
jmp 0x36cb6
addq %rax, %rbx
addq $0x2e, %rbx
leaq 0x1e781(%rip), %rsi     # 0x5540d
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x4350
testl %eax, %eax
je 0x36cb4
leaq 0x1e775(%rip), %rsi     # 0x55417
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x4350
testl %eax, %eax
sete %al
jmp 0x36cb6
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_isHaveApkV1Sign
bool UnZipper_isHaveApkV1Sign(const UnZipper* self){
    int fCount=UnZipper_fileCount(self);
    for (int i=fCount-1; i>=0; --i) {
        if (UnZipper_file_isApkV1Sign(self,i))
            return true;
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movzwl 0x8(%rax), %ebp
movl %ebp, %r14d
testl %ebp, %ebp
jle 0x36ce0
leal -0x1(%r14), %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x36ceb
testb %al, %al
je 0x36cc7
testl %r14d, %r14d
setg %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_file_isApkV1Sign
bool UnZipper_file_isApkV1Sign(const UnZipper* self,int fileIndex){
    if (!UnZipper_file_isApkV1_or_jarSign(self,fileIndex)) return false;
    if (_fileName_isEndWith(self,fileIndex,kJarSignSF)) return true;
    if (_fileName_isEndWith(self,fileIndex,".RSA")) return true;
    if (_fileName_is(self,fileIndex,"META-INF/MANIFEST.MF")) return true;
    if (_fileName_is(self,fileIndex,"META-INF\\MANIFEST.MF")) return true;
    return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
callq 0x36c63
testb %al, %al
je 0x36d54
leaq 0x1f116(%rip), %rdx     # 0x55e1a
movq %r14, %rdi
movl %ebx, %esi
callq 0x3701b
movb $0x1, %bpl
testb %al, %al
jne 0x36d56
leaq 0x1e705(%rip), %rdx     # 0x55421
movq %r14, %rdi
movl %ebx, %esi
callq 0x3701b
testb %al, %al
jne 0x36d56
leaq 0x1e6f5(%rip), %rdx     # 0x55426
movq %r14, %rdi
movl %ebx, %esi
callq 0x3706c
testb %al, %al
jne 0x36d56
leaq 0x1e6f5(%rip), %rdx     # 0x5543b
movq %r14, %rdi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3706c
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_file_is_lastNameWith
bool UnZipper_file_is_lastNameWith(const UnZipper* self,int fileIndex,const char* lastName,int lastNameLen){
         if (!UnZipper_file_is_nameEndWith(self,fileIndex,lastName,lastNameLen)) return false;
        size_t nameL=UnZipper_file_nameLen(self,fileIndex);
        if (lastNameLen==nameL) return true;
        size_t s1=lastNameLen-nameL-1;
        const char* fn=UnZipper_file_nameBegin(self,fileIndex);
        return _isDirTag(fn[s1]);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebx
movl %esi, %ebp
movq %rdi, %r14
callq 0x36ded
testb %al, %al
je 0x36de6
movq 0x50(%r14), %rcx
movq 0x58(%r14), %rax
movslq %ebp, %rdx
movl (%rax,%rdx,4), %esi
movzwl 0x1c(%rcx,%rsi), %edx
movb $0x1, %al
cmpl %ebx, %edx
je 0x36de8
addq %rsi, %rcx
movslq %ebx, %rax
notl %edx
movslq %edx, %rdx
addq %rcx, %rdx
movb 0x2e(%rax,%rdx), %al
cmpb $0x5c, %al
sete %cl
cmpb $0x2f, %al
sete %al
orb %cl, %al
jmp 0x36de8
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_file_is_nameEndWith
bool UnZipper_file_is_nameEndWith(const UnZipper* self,int fileIndex,const char* nameSuffix,int nameSuffixLen){
    int fnLen=UnZipper_file_nameLen(self,fileIndex);
    if (fnLen<nameSuffixLen) return false;
    const char* fn=UnZipper_file_nameBegin(self,fileIndex);
    return (0==memcmp(fn+fnLen-nameSuffixLen,nameSuffix,nameSuffixLen));
}

// Assembly:
movq 0x50(%rdi), %rax
movq 0x58(%rdi), %rdi
movslq %esi, %rsi
movl (%rdi,%rsi,4), %esi
movzwl 0x1c(%rax,%rsi), %edi
cmpl %ecx, %edi
jge 0x36e07
xorl %eax, %eax
retq
pushq %rax
addq %rsi, %rax
addq %rax, %rdi
movslq %ecx, %rax
subq %rax, %rdi
addq $0x2e, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x4350
testl %eax, %eax
sete %al
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_searchFileIndexByName
int UnZipper_searchFileIndexByName(const UnZipper* self,const char* fileName,int fileNameLen){
    int fCount=UnZipper_fileCount(self);
    for (int i=0; i<fCount; ++i) {
        if (UnZipper_file_is_sameName(self,i,fileName,fileNameLen))
            return i;
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq 0x48(%rdi), %rax
movzwl 0x8(%rax), %r13d
xorl %r12d, %r12d
pushq $-0x1
popq %rbx
cmpl %r12d, %r13d
je 0x36e70
movq %r15, %rdi
movl %r12d, %esi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x36d5d
testb %al, %al
jne 0x36e6d
incl %r12d
jmp 0x36e4f
movl %r12d, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_isHaveApkV2orV3SignTag_in_ApkV1SignFile
bool UnZipper_isHaveApkV2orV3SignTag_in_ApkV1SignFile(UnZipper* self){
    int fCount=UnZipper_fileCount(self);
    for (int i=fCount-1; i>=0; --i) {
        if (_UnZipper_file_isHaveApkV2orV3SignTag_in_ApkV1SignFile(self,i))
            return true;
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movzwl 0x8(%rax), %r15d
leaq 0x1ef78(%rip), %r14     # 0x55e1a
movq %r15, %r12
testq %r15, %r15
jle 0x36fe7
leaq -0x1(%r12), %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0x36ceb
testb %al, %al
je 0x36ea2
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x3701b
testb %al, %al
je 0x36ea2
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
movl -0x4(%rcx,%r12,4), %ecx
movl 0x18(%rax,%rcx), %r13d
leaq 0x1(%r13), %rdi
callq 0x4430
testq %rax, %rax
je 0x36ffc
movq %rax, %r14
leaq (%rax,%r13), %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %rax, %rsi
callq 0x3a656
movq %rbx, %rdi
movl %r15d, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x37f48
movb $0x0, (%r14,%r13)
movq %r14, %rdi
leaq 0x1eed7(%rip), %rsi     # 0x55e05
callq 0x4090
testq %rax, %rax
je 0x36fda
movq %rax, %rbp
addq $0x14, %rbp
movq %rbp, %rdi
pushq $0xa
popq %rsi
callq 0x4110
movq %rax, %r13
testq %rax, %rax
jne 0x36f64
movq %r14, %rdi
callq 0x4150
movq %r14, %r13
addq %rax, %r13
movq %rbp, %rdi
pushq $0x3a
popq %rsi
callq 0x4110
movq %rax, %rbp
testq %rax, %rax
setne %al
cmpq %r13, %rbp
setb %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x36fda
incq %rbp
cmpq %r13, %rbp
jae 0x36fa2
movsbl (%rbp), %edi
callq 0x4070
incq %rbp
testl %eax, %eax
jne 0x36f88
decq %rbp
jmp 0x36fa5
movq %r13, %rbp
cmpq %r13, %rbp
jae 0x36fda
movsbl -0x1(%r13), %edi
decq %r13
callq 0x4070
testl %eax, %eax
jne 0x36fa5
movb (%rbp), %bpl
movq %r14, %rdi
callq 0x43d0
cmpb $0x32, %bpl
leaq 0x1ee48(%rip), %r14     # 0x55e1a
jne 0x36ea2
jmp 0x36fe7
movq %r14, %rdi
callq 0x43d0
jmp 0x36e9b
testq %r12, %r12
setg %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1804d(%rip), %rdi     # 0x4f050
leaq 0x1e377(%rip), %rsi     # 0x55381
leaq 0x1eda7(%rip), %rcx     # 0x55db8
movl $0x135, %edx            # imm = 0x135
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: fileName_isEndWith(UnZipper const*, int, char const*)
static bool _fileName_isEndWith(const UnZipper* self,int fileIndex,const char* tag){
        const size_t tagLen=strlen(tag);
        int fnameLen=UnZipper_file_nameLen(self,fileIndex);
        if (fnameLen<(int)tagLen) return false;
        const char* fnameBegin=UnZipper_file_nameBegin(self,fileIndex);
        return (0==memcmp(fnameBegin+fnameLen-tagLen,tag,tagLen));
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq %rdx, %rdi
callq 0x4150
movq 0x50(%r14), %rcx
movq 0x58(%r14), %rdx
movslq %ebp, %rsi
movl (%rdx,%rsi,4), %edx
movzwl 0x1c(%rcx,%rdx), %edi
cmpl %eax, %edi
jge 0x3704a
xorl %eax, %eax
jmp 0x37067
addq %rdx, %rcx
addq %rcx, %rdi
subq %rax, %rdi
addq $0x2e, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4350
testl %eax, %eax
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_close
bool UnZipper_close(UnZipper* self){
    self->stream=0;
    if (self->_buf) { free(self->_buf); self->_buf=0; }
    _UnZipper_close_fvce(self);
    if (self->_fileStream.m_file!=0) { check(hpatch_TFileStreamInput_close(&self->_fileStream)); }
    return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andq $0x0, (%rdi)
movq 0x90(%rdi), %rdi
testq %rdi, %rdi
je 0x37132
callq 0x43d0
andq $0x0, 0x90(%rbx)
movq %rbx, %rdi
callq 0x37174
cmpq $0x0, 0x28(%rbx)
je 0x37151
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x3ec30
testl %eax, %eax
je 0x37155
movb $0x1, %al
popq %rbx
retq
leaq 0x17ef4(%rip), %rdi     # 0x4f050
leaq 0x1e21e(%rip), %rsi     # 0x55381
leaq 0x1e2e6(%rip), %rcx     # 0x55450
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_open_begin(UnZipper*)
static bool _UnZipper_open_begin(UnZipper* self){
    assert(self->_buf==0);
    self->_buf=(unsigned char*)malloc(kBufSize);
    check(self->_buf!=0);
    self->_isDataNormalized=false;
    return true;
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x90(%rdi)
jne 0x37434
movq %rdi, %rbx
movl $0x4000, %edi           # imm = 0x4000
callq 0x4430
movq %rax, 0x90(%rbx)
testq %rax, %rax
je 0x37453
movb $0x0, 0x89(%rbx)
popq %rbx
retq
leaq 0x1d6b5(%rip), %rdi     # 0x54af0
leaq 0x1df3f(%rip), %rsi     # 0x55381
leaq 0x1e9d5(%rip), %rcx     # 0x55e1e
movl $0x1c7, %edx            # imm = 0x1C7
callq 0x4230
leaq 0x17bf6(%rip), %rdi     # 0x4f050
leaq 0x1df20(%rip), %rsi     # 0x55381
leaq 0x1e9b6(%rip), %rcx     # 0x55e1e
movl $0x1c9, %edx            # imm = 0x1C9
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_searchEndCentralDirectory(UnZipper*, unsigned int*)
static bool _UnZipper_searchEndCentralDirectory(UnZipper* self,ZipFilePos_t* out_endCentralDirectory_pos){
    TByte*       buf=self->_buf;
    ZipFilePos_t max_back_pos = kMaxEndGlobalComment+kMinEndCentralDirectorySize;
    ZipFilePos_t fileLength=(ZipFilePos_t)self->stream->streamSize;
    if (max_back_pos>fileLength)
        max_back_pos=fileLength;
    ZipFilePos_t readed_pos=0;
    uint32_t     cur_value=0;
    while (readed_pos<max_back_pos) {
        ZipFilePos_t readLen=max_back_pos-readed_pos;
        if (readLen>kBufSize) readLen=kBufSize;
        readed_pos+=readLen;
        check(self->stream->read(self->stream,fileLength-readed_pos,buf,buf+readLen));
        for (int i=(int)readLen-1; i>=0; --i) {
            cur_value=(cur_value<<8)|buf[i];
            if (cur_value==kENDHEADERMAGIC){
                *out_endCentralDirectory_pos=(fileLength-readed_pos)+i;
                return true;//ok
            }
        }
    }
    return false;//not found
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x10(%rsp)
movq (%rdi), %rax
movl 0x8(%rax), %eax
movl $0x10016, %r12d         # imm = 0x10016
cmpl %r12d, %eax
cmovbl %eax, %r12d
movq 0x90(%rdi), %r15
xorl %edx, %edx
movl $0x4000, %esi           # imm = 0x4000
xorl %ebx, %ebx
movl %r12d, 0xc(%rsp)
movq %rdi, 0x18(%rsp)
movl %r12d, %ebp
subl %edx, %ebp
jbe 0x37554
cmpl %esi, %ebp
movl $0x4000, %ecx           # imm = 0x4000
cmovbl %ebp, %ecx
movq %rdx, 0x20(%rsp)
leal (%rcx,%rdx), %r14d
movq (%rdi), %rdi
movl %eax, %r13d
movl $0x4000, %r12d          # imm = 0x4000
movl %eax, %esi
subl %r14d, %esi
addq %r15, %rcx
movq %r15, %rdx
callq *0x10(%rdi)
testl %eax, %eax
je 0x37569
cmpl %r12d, %ebp
movl $0x4000, %ecx           # imm = 0x4000
cmovbl %ebp, %ecx
movq %rcx, %rax
movl $0x4000, %esi           # imm = 0x4000
subq $0x1, %rax
jb 0x3751f
shll $0x8, %ebx
movzbl -0x1(%r15,%rcx), %ecx
orl %ecx, %ebx
movq %rax, %rcx
cmpl $0x6054b50, %ebx        # imm = 0x6054B50
jne 0x37501
jmp 0x37531
movl %r14d, %edx
movl 0xc(%rsp), %r12d
movl %r13d, %eax
movq 0x18(%rsp), %rdi
jmp 0x374b2
movl $0x4000, %ecx           # imm = 0x4000
cmpl %ecx, %ebp
cmovbl %ebp, %ecx
movq 0x20(%rsp), %rdx
addl %edx, %ecx
subl %ecx, %r13d
addl %r13d, %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
movl 0xc(%rsp), %r12d
cmpl %edx, %r12d
seta %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17ae0(%rip), %rdi     # 0x4f050
leaq 0x1de0a(%rip), %rsi     # 0x55381
leaq 0x1e8c6(%rip), %rcx     # 0x55e44
pushq $0x77
popq %rdx
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_open_fvce(UnZipper*, unsigned int, int)
static bool _UnZipper_open_fvce(UnZipper* self,ZipFilePos_t fvceSize,int fileCount){
    assert(self->_cache_fvce==0);
    self->_fvce_size=fvceSize;
    size_t memSize=self->_fvce_size+1*fileCount+sizeof(ZipFilePos_t)*(fileCount+1)+sizeof(ZipFilePos_t)*fileCount*2;
    if (self->_isSaved_fileEntryOffsets) memSize+=sizeof(ZipFilePos_t)*fileCount;
    self->_cache_fvce=(TByte*)malloc(memSize);
    check(self->_cache_fvce!=0);
    self->_dataDescriptors=self->_cache_fvce+self->_fvce_size;
    size_t curBuf=_hpatch_align_upper((self->_dataDescriptors+1*fileCount),sizeof(ZipFilePos_t));
    self->_fileDataOffsets=(ZipFilePos_t*)curBuf; curBuf+=sizeof(ZipFilePos_t)*fileCount;
    self->_fileEntryOffsets=0;
    if (self->_isSaved_fileEntryOffsets){
        self->_fileEntryOffsets=(ZipFilePos_t*)curBuf; curBuf+=sizeof(ZipFilePos_t)*fileCount; }
    self->_fileHeaderOffsets=(ZipFilePos_t*)curBuf; curBuf+=sizeof(ZipFilePos_t)*fileCount;
    self->_fileCompressedSizes=(ZipFilePos_t*)curBuf;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpq $0x0, 0xa0(%rdi)
jne 0x3762f
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, 0xa8(%rdi)
leal (%rdx,%r14), %eax
movslq %edx, %r12
leaq (%rax,%r12,8), %rax
leaq (%rax,%r12,4), %rax
leaq (,%r12,4), %r15
movb 0x88(%rdi), %bpl
xorl %ecx, %ecx
testb %bpl, %bpl
cmovneq %r15, %rcx
leaq (%rcx,%rax), %rdi
addq $0x4, %rdi
callq 0x4430
movq %rax, 0xa0(%rbx)
testq %rax, %rax
je 0x3764e
movl %r14d, %ecx
addq %rcx, %rax
movq %rax, 0x68(%rbx)
addq %r12, %rax
addq $0x3, %rax
andq $-0x4, %rax
movq %rax, 0x78(%rbx)
addq %r15, %rax
andq $0x0, 0x80(%rbx)
testb %bpl, %bpl
je 0x3761b
movq %rax, 0x80(%rbx)
addq %r15, %rax
movq %rax, 0x58(%rbx)
addq %rax, %r15
movq %r15, 0x60(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1de8e(%rip), %rdi     # 0x554c4
leaq 0x1dd44(%rip), %rsi     # 0x55381
leaq 0x1e8a1(%rip), %rcx     # 0x55ee5
movl $0x1cf, %edx            # imm = 0x1CF
callq 0x4230
leaq 0x179fb(%rip), %rdi     # 0x4f050
leaq 0x1dd25(%rip), %rsi     # 0x55381
leaq 0x1e882(%rip), %rcx     # 0x55ee5
movl $0x1d4, %edx            # imm = 0x1D4
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_openVirtualVCE
bool UnZipper_openVirtualVCE(UnZipper* self,ZipFilePos_t fvce_size,int fileCount){
    check(_UnZipper_open_begin(self));
    check(_UnZipper_open_fvce(self,fvce_size,fileCount));
    mem_as_hStreamInput(&self->_fileStream.base,self->_cache_fvce,self->_cache_fvce+self->_fvce_size);
    self->stream=&self->_fileStream.base;
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
callq 0x37407
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x37586
leaq 0x8(%r14), %rbx
movq 0xa0(%r14), %rsi
movl 0xa8(%r14), %edx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3a60a
movq %rbx, (%r14)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_updateVirtualVCE
bool UnZipper_updateVirtualVCE(UnZipper* self,bool isDataNormalized,size_t zipCESize){
    ZipFilePos_t endCentralDirectory_pos=0;
    ZipFilePos_t centralDirectory_pos=(ZipFilePos_t)(self->stream->streamSize-zipCESize);
    ZipFilePos_t v2sign_topPos=0;
    check(_UnZipper_searchEndCentralDirectory(self,&endCentralDirectory_pos));
    check(UnZipper_searchApkV2Sign(self->stream,centralDirectory_pos,&v2sign_topPos,0,&self->_isHaveV3Sign));
    ZipFilePos_t fileDataEndPos=0;
    self->_vce=self->_cache_fvce+(v2sign_topPos-fileDataEndPos);
    self->_centralDirectory=self->_vce+(centralDirectory_pos-v2sign_topPos);
    self->_endCentralDirectory=self->_vce+(endCentralDirectory_pos-v2sign_topPos);
    self->_isDataNormalized=isDataNormalized;
    
    bool isFileDataOffsetMatch=true;
    check(_UnZipper_vce_normalized(self,isFileDataOffsetMatch,&fileDataEndPos));
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x10(%rsp), %rsi
andl $0x0, (%rsi)
movq (%rdi), %rax
movq 0x8(%rax), %r15
andl $0x0, 0xc(%rsp)
callq 0x37472
testb %al, %al
je 0x37ae4
subq %r14, %r15
movq (%rbx), %rdi
movl %r15d, %esi
leaq 0x8b(%rbx), %r8
leaq 0xc(%rsp), %r14
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x3690c
leaq 0x14(%rsp), %rdx
andl $0x0, (%rdx)
movl (%r14), %eax
movq %rax, %rcx
addq 0xa0(%rbx), %rcx
movq %rcx, 0x98(%rbx)
subl %eax, %r15d
addq %rcx, %r15
movq %r15, 0x50(%rbx)
movl 0x10(%rsp), %esi
subl %eax, %esi
addq %rcx, %rsi
movq %rsi, 0x48(%rbx)
movb %bpl, 0x89(%rbx)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x3767d
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17565(%rip), %rdi     # 0x4f050
leaq 0x1d88f(%rip), %rsi     # 0x55381
leaq 0x1da23(%rip), %rcx     # 0x5551c
movl $0x222, %edx            # imm = 0x222
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_fileEntry_endOffset
ZipFilePos_t UnZipper_fileEntry_endOffset(const UnZipper* self,int fileIndex){
    ZipFilePos_t result=UnZipper_fileData_offset(self,fileIndex)
                        +UnZipper_file_compressedSize(self,fileIndex);
    TDataDescriptor desc=(TDataDescriptor)self->_dataDescriptors[fileIndex];
    if (desc==kDataDescriptor_12)
        result+=12;
    else if (desc==kDataDescriptor_16)
        result+=16;
    return result;
}

// Assembly:
movq 0x78(%rdi), %rcx
movslq %esi, %rdx
movq 0x60(%rdi), %rax
movq 0x68(%rdi), %rsi
movl (%rax,%rdx,4), %eax
addl (%rcx,%rdx,4), %eax
movzbl (%rsi,%rdx), %ecx
cmpl $0x2, %ecx
je 0x37b5b
cmpl $0x1, %ecx
jne 0x37b5e
addl $0xc, %eax
retq
addl $0x10, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_fileEntry_offset_unsafe
ZipFilePos_t UnZipper_fileEntry_offset_unsafe(const UnZipper* self,int fileIndex){
    if (self->_fileEntryOffsets)
        return self->_fileEntryOffsets[fileIndex];
    //_UnZipper_vce_normalized set fileEntry offset 0
    const TByte* headBuf=fileHeaderBuf(self,fileIndex);
    return self->_fileDataOffsets[fileIndex]-30-readUInt16(headBuf+28)-readUInt16(headBuf+30);
}

// Assembly:
movq 0x80(%rdi), %rax
testq %rax, %rax
je 0x37b7d
movslq %esi, %rcx
movl (%rax,%rcx,4), %eax
retq
movq 0x50(%rdi), %rcx
movq 0x58(%rdi), %rax
movslq %esi, %rdx
movl (%rax,%rdx,4), %esi
movq 0x78(%rdi), %rax
movl (%rax,%rdx,4), %eax
movzwl 0x1c(%rcx,%rsi), %edx
movzwl 0x1e(%rcx,%rsi), %ecx
addl %edx, %ecx
subl %ecx, %eax
addl $-0x1e, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_fileData_copyTo
bool UnZipper_fileData_copyTo(UnZipper* self,int fileIndex,
                              const hpatch_TStreamOutput* outStream,hpatch_StreamPos_t writeToPos){
    ZipFilePos_t fileSavedSize=UnZipper_file_compressedSize(self,fileIndex);
    ZipFilePos_t fileDataOffset=UnZipper_fileData_offset(self,fileIndex);
    return UnZipper_dataStream_copyTo(self,self->stream,fileDataOffset,
                                      fileDataOffset+fileSavedSize,outStream,writeToPos);
}

// Assembly:
pushq %rax
movq %rcx, %r9
movq %rdx, %r8
movq (%rdi), %rax
movq 0x60(%rdi), %rcx
movslq %esi, %rsi
movq 0x78(%rdi), %rdx
movl (%rdx,%rsi,4), %edx
movl (%rcx,%rsi,4), %ecx
addl %edx, %ecx
movq %rax, %rsi
callq 0x37bcd
movb $0x1, %al
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_dataStream_copyTo
bool UnZipper_dataStream_copyTo(UnZipper* self,const hpatch_TStreamInput* dataStream,
                                hpatch_StreamPos_t data_begin,hpatch_StreamPos_t data_end,
                                const hpatch_TStreamOutput* outStream,hpatch_StreamPos_t writeToPos){
    TByte* buf=self->_buf;
    assert(data_begin<=data_end);
    assert(data_end<=dataStream->streamSize);
    while (data_begin<data_end) {
        ZipFilePos_t readLen=kBufSize;
        if (readLen>(data_end-data_begin)) readLen=(ZipFilePos_t)(data_end-data_begin);
        check(dataStream->read(dataStream,data_begin,buf,buf+readLen));
        check(outStream->write(outStream,writeToPos,buf,buf+readLen));
        writeToPos+=readLen;
        data_begin+=readLen;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
cmpq %rcx, %rdx
ja 0x37cb5
movq %rsi, %rax
cmpq %rcx, 0x8(%rsi)
jb 0x37cd4
movq %r9, %rbp
movq 0x90(%rdi), %r12
movq %rcx, 0x8(%rsp)
movq %rax, (%rsp)
movq %rcx, %r14
subq %rdx, %r14
jbe 0x37c66
movl $0x4000, %ecx           # imm = 0x4000
cmpq %rcx, %r14
cmovaeq %rcx, %r14
leaq (%r12,%r14), %r15
movq %rax, %rdi
movq %rdx, %rbx
movq %rdx, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq *0x10(%rax)
testl %eax, %eax
je 0x37c77
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %r13
movq %r12, %rdx
movq %r15, %rcx
callq *0x18(%rdi)
testl %eax, %eax
je 0x37c96
addq %r14, %rbp
movq %rbx, %rdx
addq %r14, %rdx
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
movq %r13, %r12
jmp 0x37c09
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x173d2(%rip), %rdi     # 0x4f050
leaq 0x1d6fc(%rip), %rsi     # 0x55381
leaq 0x1d99f(%rip), %rcx     # 0x5562b
movl $0x2a3, %edx            # imm = 0x2A3
callq 0x4230
leaq 0x173b3(%rip), %rdi     # 0x4f050
leaq 0x1d6dd(%rip), %rsi     # 0x55381
leaq 0x1d980(%rip), %rcx     # 0x5562b
movl $0x2a4, %edx            # imm = 0x2A4
callq 0x4230
leaq 0x1d95a(%rip), %rdi     # 0x55616
leaq 0x1d6be(%rip), %rsi     # 0x55381
leaq 0x1d961(%rip), %rcx     # 0x5562b
movl $0x29e, %edx            # imm = 0x29E
callq 0x4230
leaq 0x1d9f3(%rip), %rdi     # 0x556ce
leaq 0x1d69f(%rip), %rsi     # 0x55381
leaq 0x1d942(%rip), %rcx     # 0x5562b
movl $0x29f, %edx            # imm = 0x29F
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/../../HDiffPatch/decompress_plugin_demo.h
// Function: zlib_decompress_close_by(hpatch_TDecompress*, _zlib_TDecompress*)
static hpatch_BOOL _zlib_decompress_close_by(struct hpatch_TDecompress* decompressPlugin,
                                                 _zlib_TDecompress* self){
        hpatch_BOOL result=hpatch_TRUE;
        if (!self) return result;
        _dec_onDecErr_up();
        if (self->d_stream.state!=0){
            _dec_close_check(Z_OK==inflateEnd(&self->d_stream));
        }
        memset(self,0,sizeof(_zlib_TDecompress));
        return result;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x37f0f
movq %rsi, %rbx
movq %rdi, %r14
movl 0x9c(%rsi), %eax
testl %eax, %eax
je 0x37ee7
cmpl $0x0, 0x28(%r14)
jne 0x37ee7
movl %eax, 0x28(%r14)
pushq $0x1
popq %rbp
cmpq $0x0, 0x60(%rbx)
je 0x37efe
leaq 0x28(%rbx), %rdi
callq 0x469ed
testl %eax, %eax
jne 0x37f19
movl $0xa0, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x41f0
jmp 0x37f12
pushq $0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x3d0a8(%rip), %rax     # 0x74fc8
movq (%rax), %rcx
leaq 0x1642d(%rip), %rdi     # 0x4e357
pushq $0x2f
popq %rsi
pushq $0x1
popq %rdx
callq 0x4680
xorl %ebp, %ebp
cmpl $0x0, 0x28(%r14)
jne 0x37efe
movl $0x4, 0x28(%r14)
jmp 0x37efe
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: UnZipper_fileData_decompressTo
bool UnZipper_fileData_decompressTo(UnZipper* self,int fileIndex,
                                    const hpatch_TStreamOutput* outStream,hpatch_StreamPos_t writeToPos){
    if (!UnZipper_file_isCompressed(self,fileIndex)){
        return UnZipper_fileData_copyTo(self,fileIndex,outStream,writeToPos);
    }
    
    uint16_t compressType=_file_compressType(self,fileIndex);
    check(Z_DEFLATED==compressType);

    ZipFilePos_t file_offset=UnZipper_fileData_offset(self,fileIndex);
    ZipFilePos_t file_compressedSize=UnZipper_file_compressedSize(self,fileIndex);
    ZipFilePos_t file_data_size=UnZipper_file_uncompressedSize(self,fileIndex);
    
    return UnZipper_compressedData_decompressTo(self,self->stream,file_offset,file_offset+file_compressedSize,
                                                file_data_size,outStream,writeToPos);
}

// Assembly:
pushq %rax
movq %rdx, %r9
movq 0x50(%rdi), %rax
movq 0x58(%rdi), %rdx
movslq %esi, %r10
movl (%rdx,%r10,4), %r8d
movzwl 0xa(%rax,%r8), %edx
cmpl $0x8, %edx
je 0x37f74
testl %edx, %edx
jne 0x37f9e
movq %r9, %rdx
callq 0x37ba4
jmp 0x37f9a
movq 0x78(%rdi), %rdx
movl (%rdx,%r10,4), %edx
movq (%rdi), %rsi
movq 0x60(%rdi), %r11
movl 0x18(%rax,%r8), %r8d
movl (%r11,%r10,4), %eax
addl %edx, %eax
movq %rcx, (%rsp)
movq %rax, %rcx
callq 0x37cf3
movb $0x1, %al
popq %rcx
retq
leaq 0x170ab(%rip), %rdi     # 0x4f050
leaq 0x1d3d5(%rip), %rsi     # 0x55381
leaq 0x1d73c(%rip), %rcx     # 0x556ef
movl $0x2b3, %edx            # imm = 0x2B3
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: newThreadWork(unsigned long, unsigned long, unsigned long, int, int)
TZipThreadWork* newThreadWork(size_t _inputDataSize,size_t _codeSize,size_t _writePos,
                              int _compressLevel,int _compressMemLevel){
    TZipThreadWork* self=(TZipThreadWork*)malloc(sizeof(TZipThreadWork)+_inputDataSize+_codeSize);
    if (self==0) return 0;// error;
    self->inputData=(TByte*)self + sizeof(TZipThreadWork);
    self->inputDataSize=_inputDataSize;
    self->code=self->inputData+_inputDataSize;
    self->codeSize=_codeSize;
    self->writePos=_writePos;
    self->compressLevel=_compressLevel;
    self->compressMemLevel=_compressMemLevel;
    return self;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
addq %rsi, %rdi
addq $0x30, %rdi
callq 0x4430
testq %rax, %rax
je 0x38009
leaq 0x30(%rax), %rcx
movq %rcx, (%rax)
movq %r12, 0x10(%rax)
leaq (%rax,%r12), %rcx
addq $0x30, %rcx
movq %rcx, 0x8(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x20(%rax)
movl %ebp, 0x28(%rax)
movl %ebx, 0x2c(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_close
bool Zipper_close(Zipper* self){
#if (_IS_USED_MULTITHREAD)
    if (self->_append_stream.threadWork){
        freeThreadWork(self->_append_stream.threadWork);
        self->_append_stream.threadWork=0;
    }
    if (self->_threadWorks){
        self->_threadNum=1;
        delete self->_threadWorks;
        self->_threadWorks=0;
    }
#endif
    
    self->_stream=0;
    self->_fileEntryCount=0;
    if (self->_fileStream.m_file) { check(hpatch_TFileStreamOutput_close(&self->_fileStream)); }
    if (self->_append_stream.compressHandle!=0){
        void* compressHandle=self->_append_stream.compressHandle;
        self->_append_stream.compressHandle=0;
        check(self->_append_stream.compressor->closeCompressHandle(self->_append_stream.compressor,compressHandle));
    }
    if (self->_buf) { free(self->_buf); self->_buf=0; }
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xf8(%rdi), %rdi
testq %rdi, %rdi
je 0x3803e
callq 0x43d0
andq $0x0, 0xf8(%rbx)
movq 0x158(%rbx), %r14
testq %r14, %r14
je 0x3806f
movl $0x1, 0x154(%rbx)
movq %r14, %rdi
callq 0x3810e
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4340
andq $0x0, 0x158(%rbx)
andq $0x0, (%rbx)
andl $0x0, 0x60(%rbx)
cmpq $0x0, 0x28(%rbx)
je 0x3808b
leaq 0x8(%rbx), %rdi
callq 0x3f27c
testl %eax, %eax
je 0x380d0
movq 0x108(%rbx), %rsi
testq %rsi, %rsi
je 0x380ad
andq $0x0, 0x108(%rbx)
movq 0x100(%rbx), %rdi
callq *0x18(%rdi)
testb %al, %al
je 0x380ef
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x380c6
callq 0x43d0
andq $0x0, 0x138(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x16f79(%rip), %rdi     # 0x4f050
leaq 0x1d2a3(%rip), %rsi     # 0x55381
leaq 0x1d671(%rip), %rcx     # 0x55756
movl $0x374, %edx            # imm = 0x374
callq 0x4230
leaq 0x16f5a(%rip), %rdi     # 0x4f050
leaq 0x1d284(%rip), %rsi     # 0x55381
leaq 0x1d652(%rip), %rcx     # 0x55756
movl $0x378, %edx            # imm = 0x378
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_by_multi_thread
void Zipper_by_multi_thread(Zipper* self,int threadNum){
    assert(self->_fileEntryCount==0);
    assert(self->_threadNum<=1);
    assert(self->_threadWorks==0);
#if (_IS_USED_MULTITHREAD)
    threadNum=(threadNum<=self->_fileEntryMaxCount)?threadNum:self->_fileEntryMaxCount;
    self->_threadNum=(threadNum>=1)?threadNum:1;
    if (isUsedMT(self)){
        try {
            self->_threadWorks=new TZipThreadWorks(self,self->_threadNum-1);
            self->_threadWorks->start_threads(self->_threadNum-1,TZipThreadWorks::run,self->_threadWorks,false);
        } catch (...) {
            self->_threadNum=1; //close multi-thread
            if (self->_threadWorks){
                delete self->_threadWorks;
                self->_threadWorks=0;
            } 
        }
    }
#else
    self->_threadNum=1;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x0, 0x60(%rdi)
jne 0x383f1
movq %rdi, %rbx
cmpl $0x2, 0x154(%rdi)
jge 0x38410
cmpq $0x0, 0x158(%rbx)
jne 0x3842f
movl %esi, %r15d
movl 0x5c(%rbx), %eax
cmpl %esi, %eax
cmovll %eax, %r15d
pushq $0x1
popq %rbp
cmpl $0x2, %r15d
cmovll %ebp, %r15d
movl %r15d, 0x154(%rbx)
jl 0x384a7
pushq $0x40
popq %rdi
callq 0x4330
movq %rax, %r14
decl %r15d
movq %rax, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x3a3a4
movq %r14, 0x158(%rbx)
movl 0x154(%rbx), %r13d
cmpl $0x2, %r13d
cmovll %ebp, %r13d
decl %r13d
xorl %r15d, %r15d
leaq 0x2063(%rip), %r12      # 0x3a430
cmpl %r15d, %r13d
je 0x384a7
incq 0x20(%r14)
movl %ebp, %edi
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movl %r15d, %r8d
callq 0x3f3e2
incl %r15d
jmp 0x383cd
leaq 0x1d3fd(%rip), %rdi     # 0x557f5
leaq 0x1cf82(%rip), %rsi     # 0x55381
leaq 0x1d408(%rip), %rcx     # 0x5580e
movl $0x3b1, %edx            # imm = 0x3B1
callq 0x4230
leaq 0x1d422(%rip), %rdi     # 0x55839
leaq 0x1cf63(%rip), %rsi     # 0x55381
leaq 0x1d3e9(%rip), %rcx     # 0x5580e
movl $0x3b2, %edx            # imm = 0x3B2
callq 0x4230
leaq 0x1d417(%rip), %rdi     # 0x5584d
leaq 0x1cf44(%rip), %rsi     # 0x55381
leaq 0x1d3ca(%rip), %rcx     # 0x5580e
movl $0x3b3, %edx            # imm = 0x3B3
callq 0x4230
movq %rax, %r15
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4340
jmp 0x384cb
movq %rax, %rdi
callq 0x4130
decq 0x20(%r14)
movq 0x10(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x1b906
cmpb $0x0, 0x18(%r14)
je 0x3848b
leaq 0x8(%rsp), %rdi
callq 0x1bacc
jmp 0x384a2
movb $0x1, 0x18(%r14)
leaq 0x8(%rsp), %rdi
callq 0x1bacc
movq %r14, %rdi
callq 0x3a07a
callq 0x4550
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
callq 0x4550
jmp 0x384cb
movq %rax, %rdi
callq 0x84e7
movq %rax, %r15
movq %r15, %rdi
callq 0x4130
movl $0x1, 0x154(%rbx)
movq 0x158(%rbx), %r14
testq %r14, %r14
je 0x38504
movq %r14, %rdi
callq 0x3810e
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4340
andq $0x0, 0x158(%rbx)
callq 0x4550
jmp 0x384a7
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_openFile
bool Zipper_openFile(Zipper* self,const char* zipFileName,int fileEntryMaxCount,
                     int ZipAlignSize,int compressLevel,int compressMemLevel,
                     size_t normalizeSoPageAlign,bool pageAlignCompatible,TPageAlignState pageAlignState){
    assert(self->_fileStream.m_file==0);
    check(hpatch_TFileStreamOutput_open(&self->_fileStream,zipFileName,(hpatch_StreamPos_t)(-1)));
    hpatch_TFileStreamOutput_setRandomOut(&self->_fileStream,hpatch_TRUE);
    bool result=Zipper_openStream(self,&self->_fileStream.base,fileEntryMaxCount,
                                  ZipAlignSize,compressLevel,compressMemLevel,
                                  normalizeSoPageAlign,pageAlignCompatible,pageAlignState);
    if (!result){
        hpatch_TFileStreamOutput_close(&self->_fileStream);
        self->_fileStream.m_file=0;
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x28(%rdi)
jne 0x3858e
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rdi, %r12
leaq 0x8(%rdi), %r13
pushq $-0x1
popq %rdx
movq %r13, %rdi
callq 0x3ecc5
testl %eax, %eax
je 0x385ad
movl 0x50(%rsp), %eax
movb 0x48(%rsp), %cl
movq 0x40(%rsp), %r10
movl $0x1, 0x44(%r12)
subq $0x8, %rsp
movzbl %cl, %r11d
movq %r12, %rdi
movq %r13, %rsi
movl %r15d, %edx
movl %r14d, %ecx
movl %ebp, %r8d
movl %ebx, %r9d
pushq %rax
pushq %r11
pushq %r10
callq 0x38181
addq $0x20, %rsp
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d2ce(%rip), %rdi     # 0x55863
leaq 0x1cde5(%rip), %rsi     # 0x55381
leaq 0x1d2dc(%rip), %rcx     # 0x5587f
movl $0x3cb, %edx            # imm = 0x3CB
callq 0x4230
leaq 0x16a9c(%rip), %rdi     # 0x4f050
leaq 0x1cdc6(%rip), %rsi     # 0x55381
leaq 0x1d2bd(%rip), %rcx     # 0x5587f
movl $0x3cc, %edx            # imm = 0x3CC
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_compressData
size_t Zipper_compressData(const unsigned char* data,size_t dataSize,unsigned char* out_code,
                           size_t codeSize,int kCompressLevel,int kCompressMemLevel){
    const int kCodeBufSize=1024;
    TByte codeBuf[kCodeBufSize];
    hdiff_TStreamOutput stream;
    mem_as_hStreamOutput(&stream,out_code,out_code+codeSize);
    _zlib_TCompress* compressHandle=_zlib_compress_open_by(_zlib_compressPlugin,kCompressLevel,kCompressMemLevel,
                                                           &stream,codeBuf,kCodeBufSize);
    if (compressHandle==0) return 0;//error;
    int outStream_isCanceled=0;//false
    hpatch_StreamPos_t curWritedPos=0;
    int is_data_end=true;
    if (!_zlib_compress_part(compressHandle,data,data+dataSize,
                             is_data_end,&curWritedPos,&outStream_isCanceled)) return 0;//error
    if (!_zlib_compress_close_by(_zlib_compressPlugin,compressHandle)) return 0;//error
    return (size_t)curWritedPos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x430, %rsp            # imm = 0x430
movl %r9d, %ebp
movl %r8d, %r15d
movq %rsi, %rbx
movq %rdi, %r14
leaq (%rcx,%rdx), %rax
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x3a656
leaq 0x3c3f4(%rip), %rdi     # 0x74bc0
leaq 0x30(%rsp), %r8
movl $0x400, %r9d            # imm = 0x400
movl %r15d, %esi
movl %ebp, %edx
movq %r12, %rcx
callq 0x38838
testq %rax, %rax
je 0x38826
movq %rax, %r15
leaq 0xc(%rsp), %r9
andl $0x0, (%r9)
movq %rsp, %r8
andq $0x0, (%r8)
addq %r14, %rbx
pushq $0x1
popq %rcx
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x388eb
testl %eax, %eax
je 0x38826
movq %r15, %rdi
callq 0x38a5b
testl %eax, %eax
je 0x38826
movq (%rsp), %rax
jmp 0x38828
xorl %eax, %eax
addq $0x430, %rsp            # imm = 0x430
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/../../HDiffPatch/compress_plugin_demo.h
// Function: zlib_compress_open_by(hdiff_TCompress const*, int, int, hpatch_TStreamOutput const*, unsigned char*, unsigned long)
static _zlib_TCompress*  _zlib_compress_open_by(const hdiff_TCompress* compressPlugin,
                                                    int compressLevel,int compressMemLevel,
                                                    const hpatch_TStreamOutput* out_code,
                                                    unsigned char* _mem_buf,size_t _mem_buf_size){
        #define __MAX_TS(a,b)  ((a)>=(b)?(a):(b))
        const hpatch_size_t kZlibAlign=__MAX_TS(__MAX_TS(sizeof(hpatch_StreamPos_t),sizeof(void*)),sizeof(uLongf));
        #undef __MAX_TS
        unsigned char* _mem_buf_end=_mem_buf+_mem_buf_size;
        unsigned char* self_at=(unsigned char*)_hpatch_align_upper(_mem_buf,kZlibAlign);
        if (self_at>=_mem_buf_end) return 0;
        return _zlib_compress_open_at(compressPlugin,compressLevel,compressMemLevel,out_code,
                                      (_zlib_TCompress*)self_at,_mem_buf_end-self_at);
    }

// Assembly:
pushq %rbx
movq %r8, %rbx
addq %r8, %r9
addq $0x7, %rbx
andq $-0x8, %rbx
subq %rbx, %r9
jbe 0x388c8
cmpq $0x88, %r9
jbe 0x388cc
movl %edx, %r8d
leaq 0x18(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x38(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x68(%rbx)
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x18(%rbx)
leaq 0x88(%rbx), %rdx
movq %rdx, 0x8(%rbx)
addq $-0x88, %r9
movq %r9, 0x10(%rbx)
movq %rcx, (%rbx)
movq %rdx, 0x30(%rbx)
movl %r9d, 0x38(%rbx)
movsbl 0x30(%rdi), %ecx
movl 0x38(%rdi), %r9d
leaq 0x159e8(%rip), %r10     # 0x4e293
pushq $0x8
popq %rdx
movq %rax, %rdi
pushq $0x70
pushq %r10
callq 0x406aa
popq %rcx
popq %rdx
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmoveq %rbx, %rax
jmp 0x388ca
xorl %eax, %eax
popq %rbx
retq
leaq 0x158e8(%rip), %rdi     # 0x4e1bb
leaq 0x1d807(%rip), %rsi     # 0x560e1
leaq 0x1592e(%rip), %rcx     # 0x4e20f
movl $0x8d, %edx
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/../../HDiffPatch/compress_plugin_demo.h
// Function: zlib_compress_close_by(hdiff_TCompress const*, _zlib_TCompress*)
static hpatch_BOOL _zlib_compress_close_by(const hdiff_TCompress* compressPlugin,_zlib_TCompress* self){
        hpatch_BOOL result=hpatch_TRUE;
        if (!self) return result;
        if (self->c_stream.state!=0){
            int ret=deflateEnd(&self->c_stream);
            result=(Z_OK==ret)|(Z_DATA_ERROR==ret);
        }
        memset(self,0,sizeof(_zlib_TCompress));
        return result;
    }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x38a88
movq %rdi, %rbx
cmpq $0x0, 0x50(%rdi)
je 0x38a8d
leaq 0x18(%rbx), %rdi
callq 0x4095e
testl %eax, %eax
sete %cl
cmpl $-0x3, %eax
sete %al
orb %cl, %al
movzbl %al, %ebp
jmp 0x38a90
pushq $0x1
popq %rbp
jmp 0x38a9f
pushq $0x1
popq %rbp
movl $0x88, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x41f0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_file_append_stream::_append_part_input(hpatch_TStreamOutput const*, unsigned long long, unsigned char const*, unsigned char const*)
hpatch_BOOL Zipper_file_append_stream::_append_part_input(const hpatch_TStreamOutput* stream,hpatch_StreamPos_t pos,
                                                          const unsigned char *part_data,
                                                          const unsigned char *part_data_end){
    Zipper_file_append_stream* append_state=(Zipper_file_append_stream*)stream->streamImport;
    assert(append_state->inputPos==pos);
    size_t partSize=(size_t)(part_data_end-part_data);
    append_state->inputPos+=partSize;
    if (append_state->inputPos>append_state->streamSize) return hpatch_FALSE;//error
    int is_data_end=(append_state->inputPos==append_state->streamSize);
#if (_IS_USED_MULTITHREAD)
    if (append_state->threadWork){
        memcpy(append_state->threadWork->inputData+append_state->inputPos-partSize,part_data,partSize);
        return hpatch_TRUE;
    } else
#endif
    if (append_state->compressHandle){
        hpatch_StreamPos_t curWritedPos=append_state->outputPos;
        if(!append_state->compressor->compressPart(append_state->compressHandle,part_data,
                                part_data_end,is_data_end,&curWritedPos)) return hpatch_FALSE;//error
        assert(curWritedPos==append_state->outputPos);
        return hpatch_TRUE;
    }else{
        return _append_part_output(stream,append_state->outputPos,part_data,part_data_end);
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %rbx
cmpq %rsi, 0x20(%rbx)
jne 0x38b61
movq %rcx, %r8
subq %rdx, %r8
leaq (%r8,%rsi), %r9
movq %r9, 0x20(%rbx)
xorl %eax, %eax
cmpq 0x8(%rbx), %r9
ja 0x38af1
sete %r9b
movq 0x38(%rbx), %rax
testq %rax, %rax
je 0x38af7
addq (%rax), %rsi
movq %rsi, %rdi
movq %rdx, %rsi
movq %r8, %rdx
callq 0x42c0
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
movq 0x48(%rbx), %rax
testq %rax, %rax
je 0x38b56
movzbl %r9b, %r9d
movq 0x28(%rbx), %rsi
leaq 0x8(%rsp), %r8
movq %rsi, (%r8)
movq 0x40(%rbx), %r10
movq %rax, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movl %r9d, %ecx
callq *0x10(%r10)
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
je 0x38af1
movq 0x8(%rsp), %rax
cmpq 0x28(%rbx), %rax
je 0x38aee
leaq 0x1ce5e(%rip), %rdi     # 0x5599c
leaq 0x1c83c(%rip), %rsi     # 0x55381
leaq 0x1cdaf(%rip), %rcx     # 0x558fb
movl $0x511, %edx            # imm = 0x511
callq 0x4230
movq 0x28(%rbx), %rsi
callq 0x38b80
jmp 0x38aee
leaq 0x1cd77(%rip), %rdi     # 0x558df
leaq 0x1c812(%rip), %rsi     # 0x55381
leaq 0x1cd85(%rip), %rcx     # 0x558fb
movl $0x502, %edx            # imm = 0x502
callq 0x4230