LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4140
movq 0x50(%r14), %rcx
movq 0x58(%r14), %rdx
movslq %ebp, %rsi
movl (%rdx,%rsi,4), %edx
movzwl 0x1c(%rcx,%rdx), %esi
cmpl %eax, %esi
jge 0x3fe57
xorl %eax, %eax
jmp 0x3fe76
addq %rdx, %rcx
movl %esi, %edi
addq %rcx, %rdi
subq %rax, %rdi
addq $0x2e, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4310
testl %eax, %eax
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq $0x0, (%rdi)
movq 0x90(%rdi), %rdi
testq %rdi, %rdi
je 0x3ff4b
callq 0x43b0
movq $0x0, 0x90(%rbx)
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x3ff71
callq 0x43b0
movq $0x0, 0xa0(%rbx)
movl $0x0, 0xa8(%rbx)
cmpq $0x0, 0x28(%rbx)
je 0x3ff88
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x48caf
testl %eax, %eax
je 0x3ff8c
movb $0x1, %al
popq %rbx
retq
leaq 0x1a0bd(%rip), %rdi     # 0x5a050
leaq 0x202c7(%rip), %rsi     # 0x60261
leaq 0x2038f(%rip), %rcx     # 0x60330
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4026c
movq %rdi, %rbx
movl $0x4000, %edi           # imm = 0x4000
callq 0x4400
movq %rax, 0x90(%rbx)
testq %rax, %rax
je 0x4028b
movb $0x0, 0x89(%rbx)
popq %rbx
retq
leaq 0x1f75d(%rip), %rdi     # 0x5f9d0
leaq 0x1ffe7(%rip), %rsi     # 0x60261
leaq 0x20a7d(%rip), %rcx     # 0x60cfe
movl $0x1c7, %edx            # imm = 0x1C7
callq 0x4200
leaq 0x19dbe(%rip), %rdi     # 0x5a050
leaq 0x1ffc8(%rip), %rsi     # 0x60261
leaq 0x20a5e(%rip), %rcx     # 0x60cfe
movl $0x1c9, %edx            # imm = 0x1C9
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x18(%rsp)
movq (%rdi), %rax
movl 0x8(%rax), %ecx
movl $0x10016, %eax          # imm = 0x10016
cmpl %eax, %ecx
movl %ecx, 0x10(%rsp)
cmovbl %ecx, %eax
movl %eax, 0xc(%rsp)
movq %rdi, 0x20(%rsp)
movq 0x90(%rdi), %r15
xorl %eax, %eax
movl $0x4000, %edx           # imm = 0x4000
xorl %r13d, %r13d
movl $0x4000, %r14d          # imm = 0x4000
movl %eax, %esi
movl 0xc(%rsp), %eax
movl %eax, %ebx
subl %esi, %ebx
jbe 0x40386
cmpl %edx, %ebx
movl $0x4000, %ecx           # imm = 0x4000
cmovbl %ebx, %ecx
movq %rsi, %rbp
leal (%rcx,%rsi), %edx
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl 0x10(%rsp), %eax
movl %eax, %r12d
movl %edx, 0x14(%rsp)
subl %edx, %r12d
addq %r15, %rcx
movq %r12, %rsi
movq %r15, %rdx
callq *0x10(%rdi)
testl %eax, %eax
je 0x4039c
cmpl %r14d, %ebx
cmovael %r14d, %ebx
movl $0x4000, %edx           # imm = 0x4000
movq %rbp, %rsi
movq %rbx, %rax
testq %rbx, %rbx
jle 0x40379
leaq -0x1(%rax), %rbx
shll $0x8, %r13d
movzbl -0x1(%r15,%rax), %ecx
orl %ecx, %r13d
cmpl $0x6054b50, %r13d       # imm = 0x6054B50
jne 0x40346
addl %ebx, %r12d
movq 0x18(%rsp), %rcx
movl %r12d, (%rcx)
movl $0x6054b50, %r13d       # imm = 0x6054B50
testq %rax, %rax
movl 0x14(%rsp), %eax
jle 0x402f1
cmpl %esi, 0xc(%rsp)
seta %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19cad(%rip), %rdi     # 0x5a050
leaq 0x1feb7(%rip), %rsi     # 0x60261
leaq 0x20973(%rip), %rcx     # 0x60d24
movl $0x77, %edx
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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 0x40467
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 0x4400
movq %rax, 0xa0(%rbx)
testq %rax, %rax
je 0x40486
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
movq $0x0, 0x80(%rbx)
testb %bpl, %bpl
je 0x40453
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 0x1ff36(%rip), %rdi     # 0x603a4
leaq 0x1fdec(%rip), %rsi     # 0x60261
leaq 0x20949(%rip), %rcx     # 0x60dc5
movl $0x1cf, %edx            # imm = 0x1CF
callq 0x4200
leaq 0x19bc3(%rip), %rdi     # 0x5a050
leaq 0x1fdcd(%rip), %rsi     # 0x60261
leaq 0x2092a(%rip), %rcx     # 0x60dc5
movl $0x1d4, %edx            # imm = 0x1D4
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4023f
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x403bb
leaq 0x8(%r14), %rbx
movq 0xa0(%r14), %rsi
movl 0xa8(%r14), %edx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x4392d
movq %rbx, (%r14)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
xorl %eax, %eax
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
movq (%rdi), %rcx
movq 0x8(%rcx), %r15
movl %eax, 0xc(%rsp)
callq 0x402aa
testb %al, %al
je 0x4090f
subq %r14, %r15
movq (%rbx), %rdi
movl %r15d, %esi
leaq 0x8b(%rbx), %r8
leaq 0xc(%rsp), %r14
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x3f6d8
leaq 0x14(%rsp), %rdx
movl $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)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x404b5
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1973a(%rip), %rdi     # 0x5a050
leaq 0x1f944(%rip), %rsi     # 0x60261
leaq 0x1fad8(%rip), %rcx     # 0x603fc
movl $0x222, %edx            # imm = 0x222
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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 0x40986
cmpl $0x1, %ecx
jne 0x40989
addl $0xc, %eax
retq
addl $0x10, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x409a8
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
subl %edx, %eax
movzwl 0x1e(%rcx,%rsi), %ecx
subl %ecx, %eax
addl $-0x1e, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x409f8
movb $0x1, %al
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x40ae3
movq %rcx, %r15
movq %rsi, %rax
cmpq %rcx, 0x8(%rsi)
jb 0x40b02
movq %rdx, %r12
cmpq %r15, %rdx
jae 0x40a94
movq %r9, %rbx
movq 0x90(%rdi), %rbp
movq %r15, 0x8(%rsp)
movq %rax, (%rsp)
subq %r12, %r15
movl $0x4000, %ecx           # imm = 0x4000
cmpq %rcx, %r15
cmovaeq %rcx, %r15
leaq (%r15,%rbp), %r14
movq %rax, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq *0x10(%rax)
testl %eax, %eax
je 0x40aa5
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %r13
movq %rbp, %rdx
movq %r14, %rcx
callq *0x18(%rdi)
testl %eax, %eax
je 0x40ac4
addq %r15, %rbx
addq %r15, %r12
movq 0x8(%rsp), %r15
cmpq %r15, %r12
movq (%rsp), %rax
movq %r13, %rbp
jb 0x40a3f
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x195a4(%rip), %rdi     # 0x5a050
leaq 0x1f7ae(%rip), %rsi     # 0x60261
leaq 0x1fa51(%rip), %rcx     # 0x6050b
movl $0x2a3, %edx            # imm = 0x2A3
callq 0x4200
leaq 0x19585(%rip), %rdi     # 0x5a050
leaq 0x1f78f(%rip), %rsi     # 0x60261
leaq 0x1fa32(%rip), %rcx     # 0x6050b
movl $0x2a4, %edx            # imm = 0x2A4
callq 0x4200
leaq 0x1fa0c(%rip), %rdi     # 0x604f6
leaq 0x1f770(%rip), %rsi     # 0x60261
leaq 0x1fa13(%rip), %rcx     # 0x6050b
movl $0x29e, %edx            # imm = 0x29E
callq 0x4200
leaq 0x1faa5(%rip), %rdi     # 0x605ae
leaq 0x1f751(%rip), %rsi     # 0x60261
leaq 0x1f9f4(%rip), %rcx     # 0x6050b
movl $0x29f, %edx            # imm = 0x29F
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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 0x40d47
movq %rsi, %rbx
movq %rdi, %r14
movl 0x9c(%rsi), %eax
testl %eax, %eax
je 0x40d1d
cmpl $0x0, 0x28(%r14)
jne 0x40d1d
movl %eax, 0x28(%r14)
movl $0x1, %ebp
cmpq $0x0, 0x60(%rbx)
je 0x40d36
leaq 0x28(%rbx), %rdi
callq 0x50e9e
testl %eax, %eax
jne 0x40d53
movl $0xa0, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x41c0
jmp 0x40d4c
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq 0x3b26e(%rip), %rax     # 0x7bfc8
movq (%rax), %rcx
leaq 0x185f3(%rip), %rdi     # 0x59357
movl $0x2f, %esi
movl $0x1, %edx
callq 0x4660
xorl %ebp, %ebp
cmpl $0x0, 0x28(%r14)
jne 0x40d36
movl $0x4, 0x28(%r14)
jmp 0x40d36
// File: /workspace/github_cpp_makefile_star2_O1/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 %rcx, %rax
movq %rdx, %r9
movq 0x50(%rdi), %r8
movq 0x58(%rdi), %rdx
movslq %esi, %rcx
movl (%rdx,%rcx,4), %r10d
movzwl 0xa(%r8,%r10), %edx
cmpl $0x8, %edx
je 0x40dcc
testl %edx, %edx
jne 0x40df2
movq (%rdi), %rsi
movq 0x60(%rdi), %r8
movq 0x78(%rdi), %rdx
movl (%rdx,%rcx,4), %edx
movl (%r8,%rcx,4), %ecx
addl %edx, %ecx
movq %r9, %r8
movq %rax, %r9
callq 0x409f8
jmp 0x40dee
movq 0x78(%rdi), %rdx
movl (%rdx,%rcx,4), %edx
movq (%rdi), %rsi
movq 0x60(%rdi), %r11
movl 0x18(%r8,%r10), %r8d
movl (%r11,%rcx,4), %ecx
addl %edx, %ecx
movq %rax, (%rsp)
callq 0x40b21
movb $0x1, %al
popq %rcx
retq
leaq 0x19257(%rip), %rdi     # 0x5a050
leaq 0x1f461(%rip), %rsi     # 0x60261
leaq 0x1f7c8(%rip), %rcx     # 0x605cf
movl $0x2b3, %edx            # imm = 0x2B3
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4400
testq %rax, %rax
je 0x40e5f
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)
jmp 0x40e61
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x40e99
callq 0x43b0
movq $0x0, 0xf8(%rbx)
movq 0x158(%rbx), %r14
testq %r14, %r14
je 0x40ecf
movl $0x1, 0x154(%rbx)
movq %r14, %rdi
callq 0x40f7a
movl $0x40, %esi
movq %r14, %rdi
callq 0x4300
movq $0x0, 0x158(%rbx)
movq $0x0, (%rbx)
movl $0x0, 0x60(%rbx)
cmpq $0x0, 0x28(%rbx)
je 0x40ef1
leaq 0x8(%rbx), %rdi
callq 0x49335
testl %eax, %eax
je 0x40f3c
movq 0x108(%rbx), %rsi
testq %rsi, %rsi
je 0x40f16
movq $0x0, 0x108(%rbx)
movq 0x100(%rbx), %rdi
callq *0x18(%rdi)
testb %al, %al
je 0x40f5b
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x40f32
callq 0x43b0
movq $0x0, 0x138(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1910d(%rip), %rdi     # 0x5a050
leaq 0x1f317(%rip), %rsi     # 0x60261
leaq 0x1f6e5(%rip), %rcx     # 0x60636
movl $0x374, %edx            # imm = 0x374
callq 0x4200
leaq 0x190ee(%rip), %rdi     # 0x5a050
leaq 0x1f2f8(%rip), %rsi     # 0x60261
leaq 0x1f6c6(%rip), %rcx     # 0x60636
movl $0x378, %edx            # imm = 0x378
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
cmpl $0x0, 0x60(%rdi)
jne 0x41267
movq %rdi, %rbx
cmpl $0x2, 0x154(%rdi)
jge 0x41286
cmpq $0x0, 0x158(%rbx)
jne 0x412a5
movl 0x5c(%rbx), %eax
cmpl %esi, %eax
cmovll %eax, %esi
movl $0x1, %ebp
cmpl $0x2, %esi
cmovgel %esi, %ebp
movl %ebp, 0x154(%rbx)
jl 0x4125e
movl $0x40, %edi
callq 0x42f0
movq %rax, %r14
decl %ebp
movq %rax, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x4367a
movq %r14, 0x158(%rbx)
movl 0x154(%rbx), %r12d
cmpl $0x2, %r12d
jl 0x4125e
decl %r12d
xorl %ebp, %ebp
leaq 0x24d8(%rip), %r15      # 0x43716
incq 0x20(%r14)
movl $0x1, %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x494b3
incl %ebp
cmpl %ebp, %r12d
jne 0x4123e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f467(%rip), %rdi     # 0x606d5
leaq 0x1efec(%rip), %rsi     # 0x60261
leaq 0x1f472(%rip), %rcx     # 0x606ee
movl $0x3b1, %edx            # imm = 0x3B1
callq 0x4200
leaq 0x1f48c(%rip), %rdi     # 0x60719
leaq 0x1efcd(%rip), %rsi     # 0x60261
leaq 0x1f453(%rip), %rcx     # 0x606ee
movl $0x3b2, %edx            # imm = 0x3B2
callq 0x4200
leaq 0x1f481(%rip), %rdi     # 0x6072d
leaq 0x1efae(%rip), %rsi     # 0x60261
leaq 0x1f434(%rip), %rcx     # 0x606ee
movl $0x3b3, %edx            # imm = 0x3B3
callq 0x4200
movq %rax, %r15
movl $0x40, %esi
movq %r14, %rdi
callq 0x4300
jmp 0x41309
movq %rax, %rdi
callq 0x4120
decq 0x20(%r14)
movq %r14, %rdi
callq 0x432c4
callq 0x4520
jmp 0x4125e
movq %rax, %r15
callq 0x4520
jmp 0x41309
movq %rax, %rdi
callq 0x9db0
movq %rax, %r15
movq %r15, %rdi
callq 0x4120
movl $0x1, 0x154(%rbx)
movq 0x158(%rbx), %r14
testq %r14, %r14
je 0x41347
movq %r14, %rdi
callq 0x40f7a
movl $0x40, %esi
movq %r14, %rdi
callq 0x4300
movq $0x0, 0x158(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4520
// File: /workspace/github_cpp_makefile_star2_O1/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 0x413db
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rdi, %r12
leaq 0x8(%rdi), %r13
movq %r13, %rdi
movq $-0x1, %rdx
callq 0x48d2e
testl %eax, %eax
je 0x413fa
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 0x40ffb
addq $0x20, %rsp
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f361(%rip), %rdi     # 0x60743
leaq 0x1ee78(%rip), %rsi     # 0x60261
leaq 0x1f36f(%rip), %rcx     # 0x6075f
movl $0x3cb, %edx            # imm = 0x3CB
callq 0x4200
leaq 0x18c4f(%rip), %rdi     # 0x5a050
leaq 0x1ee59(%rip), %rsi     # 0x60261
leaq 0x1f350(%rip), %rcx     # 0x6075f
movl $0x3cc, %edx            # imm = 0x3CC
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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, %ebx
movl %r8d, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq (%rcx,%rdx), %rax
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x4397b
leaq 0x3a4e7(%rip), %rdi     # 0x7bbc0
leaq 0x30(%rsp), %r8
movl $0x400, %r9d            # imm = 0x400
movl %ebp, %esi
movl %ebx, %edx
movq %r12, %rcx
callq 0x41781
testq %rax, %rax
je 0x4174c
movq %rax, %rbx
leaq 0xc(%rsp), %r9
movl $0x0, (%r9)
movq %rsp, %r8
movq $0x0, (%r8)
addq %r15, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x1, %ecx
callq 0x4185c
testl %eax, %eax
je 0x4174c
cmpq $0x0, 0x50(%rbx)
je 0x41751
movq %rbx, %rdi
addq $0x18, %rdi
callq 0x4adf5
testl %eax, %eax
setne %cl
cmpl $-0x3, %eax
setne %bpl
andb %cl, %bpl
jmp 0x41753
xorl %r14d, %r14d
jmp 0x4176e
xorl %ebp, %ebp
xorl %r14d, %r14d
movl $0x88, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x41c0
testb %bpl, %bpl
jne 0x4176e
movq (%rsp), %r14
movq %r14, %rax
addq $0x430, %rsp            # imm = 0x430
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movq %r8, %rbx
addq %r8, %r12
addq $0x7, %rbx
andq $-0x8, %rbx
subq %rbx, %r12
jbe 0x41828
movl %edx, 0x4(%rsp)
cmpq $0x88, %r12
jbe 0x4183d
movq %rcx, %rbp
movl %esi, %r15d
movq %rdi, %r13
xorl %r14d, %r14d
movl $0x88, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x41c0
leaq 0x88(%rbx), %rax
movq %rax, 0x8(%rbx)
addq $-0x88, %r12
movq %r12, 0x10(%rbx)
movq %rbp, (%rbx)
leaq 0x18(%rbx), %rdi
movq %rax, 0x30(%rbx)
movl %r12d, 0x38(%rbx)
movsbl 0x30(%r13), %ecx
movl 0x38(%r13), %r9d
leaq 0x17a8c(%rip), %rax     # 0x59293
movl %r15d, %esi
movl $0x8, %edx
movl 0x4(%rsp), %r8d
pushq $0x70
pushq %rax
callq 0x4ab1f
addq $0x10, %rsp
testl %eax, %eax
cmoveq %rbx, %r14
jmp 0x4182b
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17977(%rip), %rdi     # 0x591bb
leaq 0x1f776(%rip), %rsi     # 0x60fc1
leaq 0x179bd(%rip), %rcx     # 0x5920f
movl $0x8d, %edx
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/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
movq 0x20(%rbx), %r9
cmpq %rsi, %r9
jne 0x41af3
movq %rcx, %r8
subq %rdx, %r8
leaq (%r9,%r8), %rsi
movq %rsi, 0x20(%rbx)
xorl %eax, %eax
cmpq 0x8(%rbx), %rsi
ja 0x41a7e
sete %sil
movq 0x38(%rbx), %rax
testq %rax, %rax
je 0x41a84
addq (%rax), %r9
movq %r9, %rdi
movq %rdx, %rsi
movq %r8, %rdx
callq 0x4290
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
retq
movq 0x48(%rbx), %rax
testq %rax, %rax
je 0x41ae8
movzbl %sil, %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 0x41a7e
movq 0x8(%rsp), %rcx
movl $0x1, %eax
cmpq 0x28(%rbx), %rcx
je 0x41a7e
leaq 0x1edac(%rip), %rdi     # 0x6087c
leaq 0x1e78a(%rip), %rsi     # 0x60261
leaq 0x1ecfd(%rip), %rcx     # 0x607db
movl $0x511, %edx            # imm = 0x511
callq 0x4200
movq 0x28(%rbx), %rsi
callq 0x41b12
jmp 0x41a79
leaq 0x1ecc5(%rip), %rdi     # 0x607bf
leaq 0x1e760(%rip), %rsi     # 0x60261
leaq 0x1ecd3(%rip), %rcx     # 0x607db
movl $0x502, %edx            # imm = 0x502
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_file_append_stream::_append_part_output(hpatch_TStreamOutput const*, unsigned long long, unsigned char const*, unsigned char const*)
hpatch_BOOL Zipper_file_append_stream::_append_part_output(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->outputPos==pos);
    size_t partSize=(size_t)(part_data_end-part_data);
    append_state->outputPos+=partSize;
    return _write(append_state->self,part_data,partSize);
}

// Assembly:
pushq %rax
movq (%rdi), %rax
movq 0x28(%rax), %rdi
cmpq %rsi, %rdi
jne 0x41b3f
subq %rdx, %rcx
addq %rcx, %rdi
movq %rdi, 0x28(%rax)
movq 0x30(%rax), %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x41b5e
movl $0x1, %eax
popq %rcx
retq
leaq 0x1ed5c(%rip), %rdi     # 0x608a2
leaq 0x1e714(%rip), %rsi     # 0x60261
leaq 0x1ed6b(%rip), %rcx     # 0x608bf
movl $0x51c, %edx            # imm = 0x51C
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: write(Zipper*, unsigned char const*, unsigned long)
static bool _write(Zipper* self,const TByte* data,size_t len){
    size_t curBufLen=self->_curBufLen;
    if (((curBufLen>0)||(len*2<=kBufSize)) && (curBufLen+len<=kBufSize)){//to buf
        memcpy(self->_buf+curBufLen,data,len);
        self->_curBufLen=curBufLen+len;
    }else{
        if (curBufLen>0)
            check(_writeFlush(self));
        check(self->_stream->write(self->_stream,self->_curFilePos-self->_curBufLen,data,data+len));
    }
    self->_curFilePos+=(ZipFilePos_t)len;
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x140(%rdi), %rdi
testq %rdi, %rdi
sete %al
leaq (%rdx,%rdx), %rcx
cmpq $0x4001, %rcx           # imm = 0x4001
setae %cl
testb %al, %cl
jne 0x41bb6
leaq (%rdi,%rbx), %r12
cmpq $0x4000, %r12           # imm = 0x4000
ja 0x41bb6
addq 0x138(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x4290
movq %r12, 0x140(%r14)
jmp 0x41bdf
testq %rdi, %rdi
je 0x41bc3
movq %r14, %rdi
callq 0x42e0c
movq (%r14), %rdi
movl 0x58(%r14), %esi
subq 0x140(%r14), %rsi
leaq (%r15,%rbx), %rcx
movq %r15, %rdx
callq *0x18(%rdi)
testl %eax, %eax
je 0x41bef
addl %ebx, 0x58(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1845a(%rip), %rdi     # 0x5a050
leaq 0x1e664(%rip), %rsi     # 0x60261
leaq 0x1f483(%rip), %rcx     # 0x61087
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: dispose_filishedThreadWork(Zipper*, bool)
static bool _dispose_filishedThreadWork(Zipper* self,bool isWait){
    while (true) {
        TZipThreadWork* work=self->_threadWorks->haveFinishWork(isWait);
        if (work){
            bool ret=(work->codeSize>0);
            if (ret) check(_writeBack(self,work->writePos,work->code,work->codeSize));
            freeThreadWork(work);
            if (!ret) 
                return false;
        }else{
            return true;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movzbl %sil, %ebp
movq 0x158(%rbx), %r12
cmpl $0x0, 0x38(%r12)
je 0x42a10
leaq 0x8(%r12), %rdi
movl %ebp, %esi
callq 0x4967e
movq %rax, %r15
testq %rax, %rax
je 0x42a13
decl 0x38(%r12)
jmp 0x42a13
xorl %r15d, %r15d
testq %r15, %r15
je 0x42a3c
movq 0x18(%r15), %rcx
testq %rcx, %rcx
setne %r12b
je 0x42a44
movq 0x8(%r15), %rdx
movq 0x20(%r15), %rsi
movq (%rbx), %rdi
addq %rdx, %rcx
callq *0x18(%rdi)
testl %eax, %eax
jne 0x42a47
jmp 0x42a64
movb $0x1, %r14b
xorl %r12d, %r12d
jmp 0x42a4f
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x43b0
testb %r12b, %r12b
jne 0x429e6
andb $0x1, %r14b
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x175e5(%rip), %rdi     # 0x5a050
leaq 0x1d7ef(%rip), %rsi     # 0x60261
leaq 0x1e76a(%rip), %rcx     # 0x611e3
movl $0x3f7, %edx            # imm = 0x3F7
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_file_append_copy
bool Zipper_file_append_copy(Zipper* self,UnZipper* srcZip,int srcFileIndex,bool isAlwaysReCompress){
    bool dataIsCompressed=isAlwaysReCompress?false:UnZipper_file_isCompressed(srcZip,srcFileIndex);
    check(Zipper_file_append_begin(self,srcZip,srcFileIndex,dataIsCompressed,
                                   UnZipper_file_uncompressedSize(srcZip,srcFileIndex),
                                   UnZipper_file_compressedSize(srcZip,srcFileIndex)));
    if (isAlwaysReCompress){
        check(UnZipper_fileData_decompressTo(srcZip,srcFileIndex,&self->_append_stream));
    }else{
        check(UnZipper_fileData_copyTo(srcZip,srcFileIndex,&self->_append_stream));
    }
    check(Zipper_file_append_end(self));
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movslq %edx, %r15
testl %ecx, %ecx
je 0x42b27
xorl %eax, %eax
jmp 0x42b3e
movq 0x50(%r14), %rax
movq 0x58(%r14), %rcx
movl (%rcx,%r15,4), %ecx
movb 0xa(%rax,%rcx), %dl
orb 0xb(%rax,%rcx), %dl
setne %al
movq 0x50(%r14), %rcx
movq 0x58(%r14), %rdx
movl (%rdx,%r15,4), %edx
movl 0x18(%rcx,%rdx), %r8d
movq 0x60(%r14), %rcx
movl (%rcx,%r15,4), %r9d
movl 0x94(%rbx), %r10d
movl 0x98(%rbx), %r11d
movzbl %al, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
pushq %r11
pushq %r10
callq 0x41c2a
addq $0x10, %rsp
testb %al, %al
je 0x42bd2
leaq 0xc0(%rbx), %r8
testb %r12b, %r12b
je 0x42b9f
movq %r14, %rdi
movl %ebp, %esi
movq %r8, %rdx
xorl %ecx, %ecx
callq 0x40d86
jmp 0x42bbf
movq (%r14), %rsi
movq 0x60(%r14), %rax
movq 0x78(%r14), %rcx
movl (%rcx,%r15,4), %edx
movl (%rax,%r15,4), %ecx
addl %edx, %ecx
movq %r14, %rdi
xorl %r9d, %r9d
callq 0x409f8
movq %rbx, %rdi
callq 0x4273b
movb $0x1, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17477(%rip), %rdi     # 0x5a050
leaq 0x1d681(%rip), %rsi     # 0x60261
leaq 0x1df06(%rip), %rcx     # 0x60aed
movl $0x5c8, %edx            # imm = 0x5C8
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_fileHeader_append
bool Zipper_fileHeader_append(Zipper* self,UnZipper* srcZip,int srcFileIndex){
    int curFileIndex=self->_fileHeaderCount;
    check(curFileIndex < self->_fileEntryCount);
    self->_fileHeaderCount=curFileIndex+1;
    if (curFileIndex==0)
        self->_centralDirectory_pos=self->_curFilePos;
    return _write_fileHeaderInfo(self,curFileIndex,srcZip,srcFileIndex,true);
}

// Assembly:
movl %edx, %ecx
movq %rsi, %rdx
movl 0x9c(%rdi), %esi
cmpl 0x60(%rdi), %esi
jge 0x42c42
leal 0x1(%rsi), %eax
movl %eax, 0x9c(%rdi)
testl %esi, %esi
jne 0x42c37
movl 0x58(%rdi), %eax
movl %eax, 0xa0(%rdi)
movl $0x1, %r8d
jmp 0x41fa2
pushq %rax
leaq 0x17406(%rip), %rdi     # 0x5a050
leaq 0x1d610(%rip), %rsi     # 0x60261
leaq 0x1ded3(%rip), %rcx     # 0x60b2b
movl $0x5da, %edx            # imm = 0x5DA
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: writeFlush(Zipper*)
static bool _writeFlush(Zipper* self){
    size_t curBufLen=self->_curBufLen;
    if (curBufLen>0){
        self->_curBufLen=0;
        check(self->_stream->write(self->_stream,self->_curFilePos-curBufLen,self->_buf,self->_buf+curBufLen));
    }
    return true;
}

// Assembly:
pushq %rax
movq 0x140(%rdi), %rcx
testq %rcx, %rcx
je 0x42e41
movq $0x0, 0x140(%rdi)
movq (%rdi), %rax
movl 0x58(%rdi), %esi
subq %rcx, %rsi
movq 0x138(%rdi), %rdx
addq %rdx, %rcx
movq %rax, %rdi
callq *0x18(%rax)
testl %eax, %eax
je 0x42e43
popq %rax
retq
leaq 0x17206(%rip), %rdi     # 0x5a050
leaq 0x1d410(%rip), %rsi     # 0x60261
leaq 0x1e409(%rip), %rcx     # 0x61261
movl $0x3dc, %edx            # imm = 0x3DC
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_file_append_set_new_crc32
bool Zipper_file_append_set_new_crc32(Zipper* self,uint32_t newCrc32){
    check(!self->_isUpdateCrc32);
    self->_isUpdateCrc32=true;
    self->_newCrc32=newCrc32;
    return true;
}

// Assembly:
cmpb $0x1, 0x148(%rdi)
je 0x42e7b
movb $0x1, 0x148(%rdi)
movl %esi, 0x14c(%rdi)
movb $0x1, %al
retq
pushq %rax
leaq 0x171cd(%rip), %rdi     # 0x5a050
leaq 0x1d3d7(%rip), %rsi     # 0x60261
leaq 0x1dd10(%rip), %rcx     # 0x60ba1
movl $0x5fd, %edx            # imm = 0x5FD
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_file_append_set_new_isCompress
bool Zipper_file_append_set_new_isCompress(Zipper* self,bool newIsCompress){
    check(!self->_isUpdateIsCompress);
    self->_isUpdateIsCompress=true;
    self->_newIsCompress=newIsCompress;
    return true;
}

// Assembly:
cmpb $0x1, 0x150(%rdi)
je 0x42eee
movb $0x1, 0x150(%rdi)
movb %sil, 0x151(%rdi)
movb $0x1, %al
retq
pushq %rax
leaq 0x1715a(%rip), %rdi     # 0x5a050
leaq 0x1d364(%rip), %rsi     # 0x60261
leaq 0x1dcd7(%rip), %rcx     # 0x60bdb
movl $0x609, %edx            # imm = 0x609
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/../../HDiffPatch/decompress_plugin_demo.h
// Function: _zlib_do_inflate(void*)
static hpatch_BOOL __zlib_do_inflate(hpatch_decompressHandle decompressHandle){
        _zlib_TDecompress* self=(_zlib_TDecompress*)decompressHandle;
        uInt avail_out_back,avail_in_back;
        int ret;
        hpatch_StreamPos_t codeLen=(self->code_end - self->code_begin);
        if ((self->d_stream.avail_in==0)&&(codeLen>0)) {
            size_t readLen=self->dec_buf_size;
            if (readLen>codeLen) readLen=(size_t)codeLen;
            self->d_stream.next_in=self->dec_buf;
            if (!self->codeStream->read(self->codeStream,self->code_begin,self->dec_buf,
                                        self->dec_buf+readLen)) return hpatch_FALSE;//error;
            self->d_stream.avail_in=(uInt)readLen;
            self->code_begin+=readLen;
            codeLen-=readLen;
        }
        
        avail_out_back=self->d_stream.avail_out;
        avail_in_back=self->d_stream.avail_in;
        ret=inflate(&self->d_stream,Z_NO_FLUSH);
        if (ret==Z_OK){
            if ((self->d_stream.avail_in==avail_in_back)&&(self->d_stream.avail_out==avail_out_back))
                _dec_onDecErr_rt();//error;
        }else if (ret==Z_STREAM_END){
            if (self->d_stream.avail_in+codeLen>0){ //next compress node!
                if (!_zlib_reset_for_next_node(&self->d_stream))
                    _dec_onDecErr_rt();//error;
            }else{//all end
                if (self->d_stream.avail_out!=0)
                    _dec_onDecErr_rt();//error;
            }
        }else{
            _dec_onDecErr_rt();//error;
        }
        return hpatch_TRUE;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x8(%rdi), %r15
subq %rsi, %r15
cmpl $0x0, 0x30(%rdi)
sete %al
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x431ed
movq 0x20(%rbx), %r14
cmpq %r15, %r14
cmovaeq %r15, %r14
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rdx
movq %rdx, 0x28(%rbx)
leaq (%rdx,%r14), %rcx
callq *0x10(%rdi)
testl %eax, %eax
je 0x431e9
movl %r14d, 0x30(%rbx)
addq %r14, (%rbx)
subq %r14, %r15
testl %eax, %eax
je 0x4322d
leaq 0x28(%rbx), %r14
movl 0x30(%rbx), %r12d
movl 0x48(%rbx), %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x4f4a6
cmpl $0x1, %eax
je 0x4321d
testl %eax, %eax
jne 0x4324c
movl $0x1, %eax
cmpl %r12d, 0x30(%rbx)
jne 0x43277
cmpl %ebp, 0x48(%rbx)
je 0x4324c
jmp 0x43277
movl 0x30(%rbx), %eax
addq %rax, %r15
jne 0x43231
cmpl $0x0, 0x48(%rbx)
jne 0x4324c
jmp 0x43272
xorl %eax, %eax
jmp 0x43277
movq 0x40(%rbx), %r15
movq 0x28(%rbx), %r12
movl 0x48(%rbx), %ebp
movl 0x30(%rbx), %r13d
movq %r14, %rdi
callq 0x4f27d
testl %eax, %eax
je 0x43263
xorl %eax, %eax
cmpl $0x0, 0x9c(%rbx)
jne 0x43277
movl $0x3, 0x9c(%rbx)
jmp 0x43277
movq %r15, 0x40(%rbx)
movq %r12, 0x28(%rbx)
movl %ebp, 0x48(%rbx)
movl %r13d, 0x30(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: (anonymous namespace)::TMt_base::on_error()
void on_error(){
        {
            CAutoLocker _auto_locker(_locker.locker);
            if (_is_on_error) return;
            _is_on_error=true;
        }
        closeAndClear();
    }

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq $0x0, (%rsp)
movb $0x0, 0x8(%rsp)
testq %rax, %rax
je 0x43317
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
callq 0x2099a
leaq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq (%rsp), %rcx
movq %rcx, (%rdi)
movq %rax, (%rsp)
movb 0x8(%rsp), %al
movb %al, 0x8(%rdi)
movb $0x1, 0x8(%rsp)
callq 0x20984
cmpb $0x0, 0x18(%rbx)
je 0x43327
movq %rsp, %rdi
callq 0x20984
jmp 0x4333b
movb $0x1, 0x18(%rbx)
movq %rsp, %rdi
callq 0x20984
movq %rbx, %rdi
callq 0x43286
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20984
movq %rbx, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: zlib_compressPart(void*, unsigned char const*, unsigned char const*, int, unsigned long long*)
static bool _zlib_compressPart(void* compressHandle,const unsigned char* part_data,const unsigned char* part_data_end,
                               int is_data_end,hpatch_StreamPos_t* curWritedPos){
    int outStream_isCanceled=0;
    int ret=_zlib_compress_part((_zlib_TCompress*)compressHandle,part_data,part_data_end,
                                     is_data_end,curWritedPos,&outStream_isCanceled);
    if (outStream_isCanceled) return false;
    return ret!=0;    
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rbx
movl $0x0, (%rbx)
movq %rbx, %r9
callq 0x4185c
cmpl $0x0, (%rbx)
sete %cl
testl %eax, %eax
setne %al
andb %cl, %al
addq $0x10, %rsp
popq %rbx
retq