LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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
cmpq %rsi, 0x28(%rax)
jne 0x38ba8
subq %rdx, %rcx
addq %rcx, %rsi
movq %rsi, 0x28(%rax)
movq 0x30(%rax), %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x38bc7
pushq $0x1
popq %rax
popq %rcx
retq
leaq 0x1ce13(%rip), %rdi     # 0x559c2
leaq 0x1c7cb(%rip), %rsi     # 0x55381
leaq 0x1ce22(%rip), %rcx     # 0x559df
movl $0x51c, %edx            # imm = 0x51C
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/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 0x38c35
leaq (%rdi,%rbx), %r12
cmpq $0x4000, %r12           # imm = 0x4000
ja 0x38c1f
addq 0x138(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x42c0
movq %r12, 0x140(%r14)
jmp 0x38c4f
testq %rdi, %rdi
je 0x38c35
movq %r14, %rdi
callq 0x39c30
movq 0x140(%r14), %rax
jmp 0x38c37
xorl %eax, %eax
movq (%r14), %rdi
movl 0x58(%r14), %esi
subq %rax, %rsi
leaq (%r15,%rbx), %rcx
movq %r15, %rdx
callq *0x18(%rdi)
testl %eax, %eax
je 0x38c5f
addl %ebx, 0x58(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x163ea(%rip), %rdi     # 0x4f050
leaq 0x1c714(%rip), %rsi     # 0x55381
leaq 0x1d533(%rip), %rcx     # 0x561a7
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
movq %rdi, %rbx
movzbl %sil, %ebp
movq 0x158(%rbx), %rdi
movl %ebp, %esi
callq 0x3a4de
movq %rax, %r14
testq %rax, %rax
je 0x39905
movq 0x18(%r14), %rcx
testq %rcx, %rcx
je 0x398fd
movq 0x8(%r14), %rdx
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x3a374
movq %r14, %rdi
callq 0x43d0
jmp 0x398c4
movq %r14, %rdi
callq 0x43d0
testq %r14, %r14
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x50(%rsi), %rax
movq 0x58(%rsi), %rcx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
testl %r15d, %r15d
je 0x399bf
xorl %esi, %esi
jmp 0x399c9
cmpw $0x0, 0xa(%rax,%rcx)
setne %sil
movl 0x18(%rax,%rcx), %r8d
movq 0x60(%r14), %rax
movl (%rax,%rdx,4), %r9d
movzbl %sil, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x38c7e
testb %al, %al
je 0x39a1d
leaq 0xc0(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
testb %r15b, %r15b
je 0x39a03
callq 0x37f48
jmp 0x39a08
callq 0x37ba4
movq %rbx, %rdi
callq 0x39649
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1562c(%rip), %rdi     # 0x4f050
leaq 0x1b956(%rip), %rsi     # 0x55381
leaq 0x1c1db(%rip), %rcx     # 0x55c0d
movl $0x5c8, %edx            # imm = 0x5C8
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/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 0x39a8b
leal 0x1(%rsi), %eax
movl %eax, 0x9c(%rdi)
testl %esi, %esi
jne 0x39a82
movl 0x58(%rdi), %eax
movl %eax, 0xa0(%rdi)
pushq $0x1
popq %r8
jmp 0x38fde
pushq %rax
leaq 0x155bd(%rip), %rdi     # 0x4f050
leaq 0x1b8e7(%rip), %rsi     # 0x55381
leaq 0x1c1aa(%rip), %rcx     # 0x55c4b
movl $0x5da, %edx            # imm = 0x5DA
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_endCentralDirectory_append
bool Zipper_endCentralDirectory_append(Zipper* self,UnZipper* srcZip){
    check(self->_fileEntryCount==self->_fileHeaderCount);
    check(!self->_isUpdateCrc32);
    check(!self->_isUpdateIsCompress);
    const TByte* endBuf=srcZip->_endCentralDirectory;
    ZipFilePos_t centralDirectory_size=self->_curFilePos-self->_centralDirectory_pos;
    
    check(_write(self,endBuf+0,8-0));//固定魔法值--Central Directory的开始分卷号;
    check(_writeUInt16(self,self->_fileEntryCount));
    check(_writeUInt16(self,self->_fileEntryCount));
    check(_writeUInt32(self,centralDirectory_size));
    check(_writeUInt32(self,self->_centralDirectory_pos));
    uint16_t endCommentLen=readUInt16(srcZip->_endCentralDirectory+20); //Zip文件注释长度;
    check(_writeUInt16(self,endCommentLen));
    check(_write(self,srcZip->_endCentralDirectory+22,endCommentLen));//Zip文件注释;
    check(_writeFlush(self));
#if (_IS_USED_MULTITHREAD)
    if (isUsedMT(self)){
        self->_threadWorks->finishDispatchWork();
        check(_dispose_filishedThreadWork(self,true));
    }
#endif
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x60(%rdi), %eax
cmpl 0x9c(%rdi), %eax
jne 0x39b89
movq %rdi, %rbx
cmpb $0x1, 0x148(%rdi)
je 0x39ba8
cmpb $0x1, 0x150(%rbx)
je 0x39bc7
movq %rsi, %r14
movq 0x48(%rsi), %rsi
movl 0x58(%rbx), %ebp
subl 0xa0(%rbx), %ebp
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x38bc7
movzwl 0x60(%rbx), %esi
movq %rbx, %rdi
callq 0x39c05
movzwl 0x60(%rbx), %esi
movq %rbx, %rdi
callq 0x39c05
movq %rbx, %rdi
movl %ebp, %esi
callq 0x39c1b
movl 0xa0(%rbx), %esi
movq %rbx, %rdi
callq 0x39c1b
movq 0x48(%r14), %rax
movzwl 0x14(%rax), %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x39c05
movq 0x48(%r14), %rsi
addq $0x16, %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x38bc7
movq %rbx, %rdi
callq 0x39c30
cmpl $0x2, 0x154(%rbx)
jl 0x39b7c
movq 0x158(%rbx), %rdi
callq 0x3f59c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x398b9
testb %al, %al
je 0x39be6
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x154c0(%rip), %rdi     # 0x4f050
leaq 0x1b7ea(%rip), %rsi     # 0x55381
leaq 0x1c0e6(%rip), %rcx     # 0x55c84
movl $0x5e2, %edx            # imm = 0x5E2
callq 0x4230
leaq 0x154a1(%rip), %rdi     # 0x4f050
leaq 0x1b7cb(%rip), %rsi     # 0x55381
leaq 0x1c0c7(%rip), %rcx     # 0x55c84
movl $0x5e3, %edx            # imm = 0x5E3
callq 0x4230
leaq 0x15482(%rip), %rdi     # 0x4f050
leaq 0x1b7ac(%rip), %rsi     # 0x55381
leaq 0x1c0a8(%rip), %rcx     # 0x55c84
movl $0x5e4, %edx            # imm = 0x5E4
callq 0x4230
leaq 0x15463(%rip), %rdi     # 0x4f050
leaq 0x1b78d(%rip), %rsi     # 0x55381
leaq 0x1c089(%rip), %rcx     # 0x55c84
movl $0x5f4, %edx            # imm = 0x5F4
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/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 0x39c62
andq $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 0x39c64
popq %rax
retq
leaq 0x153e5(%rip), %rdi     # 0x4f050
leaq 0x1b70f(%rip), %rsi     # 0x55381
leaq 0x1c708(%rip), %rcx     # 0x56381
movl $0x3dc, %edx            # imm = 0x3DC
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/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 0x39c9c
movb $0x1, 0x148(%rdi)
movl %esi, 0x14c(%rdi)
movb $0x1, %al
retq
pushq %rax
leaq 0x153ac(%rip), %rdi     # 0x4f050
leaq 0x1b6d6(%rip), %rsi     # 0x55381
leaq 0x1c00f(%rip), %rcx     # 0x55cc1
movl $0x5fd, %edx            # imm = 0x5FD
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/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 0x39ce0
movb $0x1, 0x150(%rdi)
movb %sil, 0x151(%rdi)
movb $0x1, %al
retq
pushq %rax
leaq 0x15368(%rip), %rdi     # 0x4f050
leaq 0x1b692(%rip), %rsi     # 0x55381
leaq 0x1c005(%rip), %rcx     # 0x55cfb
movl $0x609, %edx            # imm = 0x609
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/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
movl 0x30(%rdi), %r12d
testl %r12d, %r12d
sete %al
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x39feb
movq 0x20(%rbx), %r12
cmpq %r15, %r12
cmovaeq %r15, %r12
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rdx
movq %rdx, 0x28(%rbx)
leaq (%rdx,%r12), %rcx
callq *0x10(%rdi)
testl %eax, %eax
je 0x3a026
movl %r12d, 0x30(%rbx)
addq %r12, (%rbx)
subq %r12, %r15
leaq 0x28(%rbx), %r14
movl 0x48(%rbx), %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x44d05
cmpl $0x1, %eax
je 0x3a015
testl %eax, %eax
jne 0x3a041
pushq $0x1
popq %rax
cmpl %r12d, 0x30(%rbx)
jne 0x3a06a
cmpl %ebp, 0x48(%rbx)
je 0x3a041
jmp 0x3a06a
movl 0x30(%rbx), %r12d
addq %r12, %r15
jne 0x3a02a
cmpl $0x0, 0x48(%rbx)
jne 0x3a041
jmp 0x3a067
xorl %eax, %eax
jmp 0x3a06a
movq 0x28(%rbx), %r15
movq 0x40(%rbx), %r13
movl 0x48(%rbx), %ebp
movq %r14, %rdi
callq 0x44b16
testl %eax, %eax
je 0x3a058
xorl %eax, %eax
cmpl $0x0, 0x9c(%rbx)
jne 0x3a06a
movl $0x3, 0x9c(%rbx)
jmp 0x3a06a
movq %r13, 0x40(%rbx)
movq %r15, 0x28(%rbx)
movl %ebp, 0x48(%rbx)
movl %r12d, 0x30(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: writeAlignSkip(Zipper*, unsigned long)
inline static bool _writeAlignSkip(Zipper* self,size_t alignSkipLen){
    const size_t bufSize =16;
    const TByte _alignSkipBuf[bufSize]={0};
    while (alignSkipLen>0) {
        size_t wlen=alignSkipLen;
        if (wlen>bufSize) wlen=bufSize;
        check(_write(self,_alignSkipBuf,wlen));
        alignSkipLen-=wlen;
    }
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
pushq $0x10
popq %r13
testq %rbx, %rbx
je 0x3a319
cmpq $0x10, %rbx
movq %r13, %r12
cmovbq %rbx, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x38bc7
subq %r12, %rbx
jmp 0x3a2f6
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
andl $0x0, (%rbx)
movq %rbx, %r9
callq 0x388eb
cmpl $0x0, (%rbx)
sete %cl
testl %eax, %eax
setne %al
andb %cl, %al
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: TZipThreadWorks::run(int, void*)
static void run(int threadIndex,void* workData){
        TZipThreadWorks* self=(TZipThreadWorks*)workData;
        _auto_thread_end_t _thread_end(*self);
        while (TZipThreadWork* work=self->getWork()){
            self->doWork(work);
            self->endWork(work);
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsi, (%rsp)
movq %rbx, %rdi
callq 0x3a498
movq %rax, %r14
testq %rax, %rax
je 0x3a460
movq %r14, %rdi
callq 0x3a4a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3a4d2
jmp 0x3a43b
movq %rsp, %rdi
callq 0x3a0b8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3a0b8
movq %rbx, %rdi
callq 0x4600
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: TZipThreadWorks::doWork(TZipThreadWork*)
inline static void doWork(TZipThreadWork* work){
        size_t rsize=Zipper_compressData(work->inputData,work->inputDataSize,work->code,work->codeSize,
                                         work->compressLevel,work->compressMemLevel);
        if ((rsize==0)||(rsize!=work->codeSize))
            work->codeSize=0; //error or code size overflow
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rsi
movq (%rdi), %rdi
movq 0x8(%rbx), %rdx
movq 0x18(%rbx), %rcx
movl 0x28(%rbx), %r8d
movl 0x2c(%rbx), %r9d
callq 0x38793
testq %rax, %rax
je 0x3a4cb
cmpq 0x18(%rbx), %rax
je 0x3a4d0
andq $0x0, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: hpatch_packUIntWithTag
hpatch_BOOL hpatch_packUIntWithTag(TByte** out_code,TByte* out_code_end,
                                   hpatch_StreamPos_t uValue,hpatch_uint highTag,
                                   const hpatch_uint kTagBit){//写入整数并前进指针.
    TByte*          pcode=*out_code;
    const hpatch_StreamPos_t kMaxValueWithTag=((hpatch_StreamPos_t)1<<(7-kTagBit))-1;
    TByte           codeBuf[hpatch_kMaxPackedUIntBytes];
    TByte*          codeEnd=codeBuf;
#ifdef __RUN_MEM_SAFE_CHECK
    //static const hpatch_uint kPackMaxTagBit=7;
    //assert((0<=kTagBit)&&(kTagBit<=kPackMaxTagBit));
    //assert((highTag>>kTagBit)==0);
#endif
    while (uValue>kMaxValueWithTag) {
        *codeEnd=uValue&((1<<7)-1); ++codeEnd;
        uValue>>=7;
    }
#ifdef __RUN_MEM_SAFE_CHECK
    if ((out_code_end-pcode)<(1+(codeEnd-codeBuf))) return _hpatch_FALSE;
#endif
    *pcode=(TByte)( (TByte)uValue | (highTag<<(8-kTagBit))
                   | (((codeBuf!=codeEnd)?1:0)<<(7-kTagBit))  );
    ++pcode;
    while (codeBuf!=codeEnd) {
        --codeEnd;
        *pcode=(*codeEnd) | (TByte)(((codeBuf!=codeEnd)?1:0)<<7);
        ++pcode;
    }
    *out_code=pcode;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbx
movl %ecx, %r10d
movq (%rdi), %r11
movl $0x7, %r9d
subl %r8d, %r9d
xorl %ebx, %ebx
movq %rdx, %rax
movl %r9d, %ecx
shrq %cl, %rax
testq %rax, %rax
je 0x3a539
movl %edx, %eax
andb $0x7f, %al
movb %al, -0xb(%rsp,%rbx)
shrq $0x7, %rdx
incq %rbx
jmp 0x3a51a
subq %r11, %rsi
xorl %eax, %eax
cmpq %rbx, %rsi
jle 0x3a58a
movb $0x8, %cl
subb %r8b, %cl
shll %cl, %r10d
orl %edx, %r10d
xorl %eax, %eax
testq %rbx, %rbx
setne %al
movl %r9d, %ecx
shll %cl, %eax
orl %r10d, %eax
movb %al, (%r11)
incq %r11
testq %rbx, %rbx
je 0x3a582
cmpq $0x1, %rbx
setne %al
shlb $0x7, %al
orb -0xc(%rsp,%rbx), %al
movb %al, (%r11)
incq %r11
decq %rbx
jmp 0x3a564
movq %r11, (%rdi)
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: hpatch_packUIntWithTag_size
hpatch_uint hpatch_packUIntWithTag_size(hpatch_StreamPos_t uValue,const hpatch_uint kTagBit){
    const hpatch_StreamPos_t kMaxValueWithTag=((hpatch_StreamPos_t)1<<(7-kTagBit))-1;
    hpatch_uint size=0;
    while (uValue>kMaxValueWithTag) {
        ++size;
        uValue>>=7;
    }
    ++size;
    return size;
}

// Assembly:
pushq $0x7
popq %rcx
subl %esi, %ecx
pushq $0x1
popq %rax
movq %rdi, %rdx
shrq %cl, %rdx
testq %rdx, %rdx
je 0x3a5a7
shrq $0x7, %rdi
incl %eax
jmp 0x3a594
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: hpatch_unpackUIntWithTag
hpatch_BOOL hpatch_unpackUIntWithTag(const TByte** src_code,const TByte* src_code_end,
                                     hpatch_StreamPos_t* result,const hpatch_uint kTagBit){//读出整数并前进指针.
#ifdef __RUN_MEM_SAFE_CHECK
    //const hpatch_uint kPackMaxTagBit=7;
#endif
    hpatch_StreamPos_t  value;
    TByte               code;
    const TByte*        pcode=*src_code;
    
#ifdef __RUN_MEM_SAFE_CHECK
    //assert(kTagBit<=kPackMaxTagBit);
    if (src_code_end<=pcode) return _hpatch_FALSE;
#endif
    code=*pcode; ++pcode;
    value=code&((1<<(7-kTagBit))-1);
    if ((code&(1<<(7-kTagBit)))!=0){
        do {
#ifdef __RUN_MEM_SAFE_CHECK
            if ((value>>(sizeof(value)*8-7))!=0) return _hpatch_FALSE;//cannot save 7bit
            if (src_code_end==pcode) return _hpatch_FALSE;
#endif
            code=*pcode; ++pcode;
            value=(value<<7) | (code&((1<<7)-1));
        } while ((code&(1<<7))!=0);
    }
    (*src_code)=pcode;
    *result=value;
    return hpatch_TRUE;
}

// Assembly:
movq (%rdi), %r9
cmpq %rsi, %r9
jae 0x3a607
movzbl (%r9), %r11d
incq %r9
movb $0x7, %r8b
subb %cl, %r8b
pushq $0x1
popq %rax
movl %eax, %r10d
movl %r8d, %ecx
shll %cl, %r10d
decl %r10d
andl %r11d, %r10d
movzbl %r8b, %ecx
btl %ecx, %r11d
jae 0x3a600
movq %r10, %rcx
shrq $0x39, %rcx
jne 0x3a607
cmpq %rsi, %r9
je 0x3a607
movzbl (%r9), %ecx
incq %r9
shlq $0x7, %r10
movl %ecx, %r8d
andl $0x7f, %r8d
orq %r8, %r10
testb %cl, %cl
js 0x3a5d9
movq %r9, (%rdi)
movq %r10, (%rdx)
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: mem_as_hStreamInput
const hpatch_TStreamInput* mem_as_hStreamInput(hpatch_TStreamInput* out_stream,
                                               const unsigned char* mem,const unsigned char* mem_end){
    out_stream->streamImport=(void*)mem;
    out_stream->streamSize=mem_end-mem;
    out_stream->read=_read_mem_stream;
    return out_stream;
}

// Assembly:
movq %rdi, %rax
movq %rsi, (%rdi)
subq %rsi, %rdx
movq %rdx, 0x8(%rdi)
leaq 0x5(%rip), %rcx         # 0x3a623
movq %rcx, 0x10(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: mem_as_hStreamOutput
const hpatch_TStreamOutput* mem_as_hStreamOutput(hpatch_TStreamOutput* out_stream,
                                                 unsigned char* mem,unsigned char* mem_end){
    out_stream->streamImport=mem;
    out_stream->streamSize=mem_end-mem;
    out_stream->read_writed=(_read_mem_stream_t)_read_mem_stream;
    out_stream->write=_write_mem_stream;
    return out_stream;
}

// Assembly:
movq %rdi, %rax
movq %rsi, (%rdi)
subq %rsi, %rdx
movq %rdx, 0x8(%rdi)
leaq -0x47(%rip), %rcx       # 0x3a623
movq %rcx, 0x10(%rdi)
leaq 0x5(%rip), %rcx         # 0x3a67a
movq %rcx, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: hpatch_deccompress_mem
hpatch_BOOL hpatch_deccompress_mem(hpatch_TDecompress* decompressPlugin,
                                   const unsigned char* code,const unsigned char* code_end,
                                   unsigned char* out_data,unsigned char* out_data_end){
    hpatch_decompressHandle dec=0;
    hpatch_BOOL result,colose_rt;
    hpatch_TStreamInput  codeStream;
    mem_as_hStreamInput(&codeStream,code,code_end);
    dec=decompressPlugin->open(decompressPlugin,(out_data_end-out_data),
                               &codeStream,0,codeStream.streamSize);
    if (dec==0) return _hpatch_FALSE;
    result=decompressPlugin->decompress_part(dec,out_data,out_data_end);
    colose_rt=decompressPlugin->close(decompressPlugin,dec);
    assert(colose_rt);
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r8
movq %rdi, %rbx
movq %rsp, %rdx
movq %rsi, (%rdx)
subq %rsi, %r8
movq %r8, 0x8(%rdx)
leaq -0xba(%rip), %rax       # 0x3a623
movq %rax, 0x10(%rdx)
movq %r14, %rsi
subq %rcx, %rsi
xorl %r12d, %r12d
xorl %ecx, %ecx
callq *0x8(%rdi)
testq %rax, %rax
je 0x3a713
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq *0x18(%rbx)
movl %eax, %r12d
movq %rbx, %rdi
movq %r13, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x3a724
movl %r12d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1bcf9(%rip), %rdi     # 0x56424
leaq 0x1bcfc(%rip), %rsi     # 0x5642e
leaq 0x1bd1d(%rip), %rcx     # 0x56456
movl $0xbd, %edx
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TStreamInputClip_init
void TStreamInputClip_init(TStreamInputClip* self,const hpatch_TStreamInput*  srcStream,
                           hpatch_StreamPos_t clipBeginPos,hpatch_StreamPos_t clipEndPos){
    assert(self!=0);
    assert(srcStream!=0);
    assert(clipBeginPos<=clipEndPos);
    assert(clipEndPos<=srcStream->streamSize);
    self->srcStream=srcStream;
    self->clipBeginPos=clipBeginPos;
    self->base.streamImport=self;
    self->base.streamSize=clipEndPos-clipBeginPos;
    self->base.read=_TStreamInputClip_read;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x3ac67
testq %rsi, %rsi
je 0x3ac86
movq %rcx, %rax
subq %rdx, %rax
jb 0x3aca5
cmpq %rcx, 0x8(%rsi)
jb 0x3acc4
movq %rsi, 0x20(%rdi)
movq %rdx, 0x28(%rdi)
movq %rdi, (%rdi)
movq %rax, 0x8(%rdi)
leaq 0x82(%rip), %rax        # 0x3ace3
movq %rax, 0x10(%rdi)
popq %rax
retq
leaq 0x1b911(%rip), %rdi     # 0x5657f
leaq 0x1b7b9(%rip), %rsi     # 0x5642e
leaq 0x1b90b(%rip), %rcx     # 0x56587
movl $0x18f, %edx            # imm = 0x18F
callq 0x4230
leaq 0x1b96e(%rip), %rdi     # 0x565fb
leaq 0x1b79a(%rip), %rsi     # 0x5642e
leaq 0x1b8ec(%rip), %rcx     # 0x56587
movl $0x190, %edx            # imm = 0x190
callq 0x4230
leaq 0x18163(%rip), %rdi     # 0x52e0f
leaq 0x1b77b(%rip), %rsi     # 0x5642e
leaq 0x1b8cd(%rip), %rcx     # 0x56587
movl $0x191, %edx            # imm = 0x191
callq 0x4230
leaq 0x1b93d(%rip), %rdi     # 0x56608
leaq 0x1b75c(%rip), %rsi     # 0x5642e
leaq 0x1b8ae(%rip), %rcx     # 0x56587
movl $0x192, %edx            # imm = 0x192
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TStreamOutputClip_init
void TStreamOutputClip_init(TStreamOutputClip* self,const hpatch_TStreamOutput*  srcStream,
                            hpatch_StreamPos_t clipBeginPos,hpatch_StreamPos_t clipEndPos){
    assert(self!=0);
    assert(srcStream!=0);
    assert(clipBeginPos<=clipEndPos);
    assert(clipEndPos<=srcStream->streamSize);
    self->srcStream=srcStream;
    self->clipBeginPos=clipBeginPos;
    self->base.streamImport=self;
    self->base.streamSize=clipEndPos-clipBeginPos;
    ((TStreamInputClip*)self)->base.read=_TStreamInputClip_read;
    self->base.write=_TStreamOutputClip_write;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x3ad4b
testq %rsi, %rsi
je 0x3ad6a
movq %rcx, %rax
subq %rdx, %rax
jb 0x3ad89
cmpq %rcx, 0x8(%rsi)
jb 0x3ada8
movq %rsi, 0x20(%rdi)
movq %rdx, 0x28(%rdi)
movq %rdi, (%rdi)
movq %rax, 0x8(%rdi)
leaq -0x57(%rip), %rax       # 0x3ace3
movq %rax, 0x10(%rdi)
leaq 0x82(%rip), %rax        # 0x3adc7
movq %rax, 0x18(%rdi)
popq %rax
retq
leaq 0x1b82d(%rip), %rdi     # 0x5657f
leaq 0x1b6d5(%rip), %rsi     # 0x5642e
leaq 0x1b8ca(%rip), %rcx     # 0x5662a
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x4230
leaq 0x1b88a(%rip), %rdi     # 0x565fb
leaq 0x1b6b6(%rip), %rsi     # 0x5642e
leaq 0x1b8ab(%rip), %rcx     # 0x5662a
movl $0x1a7, %edx            # imm = 0x1A7
callq 0x4230
leaq 0x1807f(%rip), %rdi     # 0x52e0f
leaq 0x1b697(%rip), %rsi     # 0x5642e
leaq 0x1b88c(%rip), %rcx     # 0x5662a
movl $0x1a8, %edx            # imm = 0x1A8
callq 0x4230
leaq 0x1b859(%rip), %rdi     # 0x56608
leaq 0x1b678(%rip), %rsi     # 0x5642e
leaq 0x1b86d(%rip), %rcx     # 0x5662a
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TStreamCacheClip_readType_end
hpatch_BOOL _TStreamCacheClip_readType_end(TStreamCacheClip* sclip,TByte endTag,
                                           char out_type[hpatch_kMaxPluginTypeLength+1]){
    const TByte* type_begin;
    hpatch_size_t i;
    hpatch_size_t readLen=hpatch_kMaxPluginTypeLength+1;
    if (readLen>_TStreamCacheClip_leaveSize(sclip))
        readLen=(hpatch_size_t)_TStreamCacheClip_leaveSize(sclip);
    type_begin=_TStreamCacheClip_accessData(sclip,readLen);
    if (type_begin==0) return _hpatch_FALSE;//not found
    for (i=0; i<readLen; ++i) {
        if (type_begin[i]!=endTag)
            continue;
        else{
            memcpy(out_type,type_begin,i);  out_type[i]='\0';
            _TStreamCacheClip_skipData_noCheck(sclip,i+1);
            return hpatch_TRUE;
        }
    }
    return _hpatch_FALSE;//not found
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %r15
addq 0x28(%rdi), %r15
movq (%rdi), %rax
addq 0x20(%rdi), %rax
subq %rax, %r15
movl $0x104, %eax            # imm = 0x104
cmpq %rax, %r15
cmovaeq %rax, %r15
movq %r15, %rsi
callq 0x3ae6c
testq %rax, %rax
je 0x3ae3e
movq %rax, %rsi
xorl %eax, %eax
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x3ae63
cmpb %bpl, (%rsi,%r12)
je 0x3ae42
incq %r12
jmp 0x3ae2e
xorl %eax, %eax
jmp 0x3ae63
movq %r14, %rdi
movq %r12, %rdx
callq 0x42c0
movb $0x0, (%r14,%r12)
movq 0x20(%rbx), %rax
addq %r12, %rax
incq %rax
movq %rax, 0x20(%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch_private.h
// Function: TStreamCacheClip_accessData
hpatch_inline static //error return 0
unsigned char* _TStreamCacheClip_accessData(TStreamCacheClip* sclip,hpatch_size_t readSize){
    //assert(readSize<=sclip->cacheEnd);
    if (readSize>_TStreamCacheClip_cachedSize(sclip)){
        if (!_TStreamCacheClip_updateCache(sclip)) return 0;
        if (readSize>_TStreamCacheClip_cachedSize(sclip)) return 0;
    }
    return &sclip->cacheBuf[sclip->cacheBegin];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %rcx
subq %rax, %rcx
cmpq %rsi, %rcx
jae 0x3aea6
movq %rsi, %r14
movq %rbx, %rdi
callq 0x3aeb2
testl %eax, %eax
je 0x3aea2
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
subq %rax, %rcx
cmpq %r14, %rcx
jae 0x3aea6
xorl %eax, %eax
jmp 0x3aeaa
addq 0x18(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TStreamCacheClip_updateCache
hpatch_BOOL _TStreamCacheClip_updateCache(TStreamCacheClip* sclip){
    TByte* buf0=&sclip->cacheBuf[0];
    const hpatch_StreamPos_t streamSize=sclip->streamPos_end-sclip->streamPos;
    hpatch_size_t readSize=sclip->cacheBegin;
    if (readSize>streamSize)
        readSize=(hpatch_size_t)streamSize;
    if (readSize==0) return hpatch_TRUE;
    if (!_TStreamCacheClip_isCacheEmpty(sclip)){
        memmove(buf0+(hpatch_size_t)(sclip->cacheBegin-readSize),
                buf0+sclip->cacheBegin,_TStreamCacheClip_cachedSize(sclip));
    }
    if (!sclip->srcStream->read(sclip->srcStream,sclip->streamPos,
                                buf0+(sclip->cacheEnd-readSize),buf0+sclip->cacheEnd))
        return _hpatch_FALSE;//read error
    sclip->cacheBegin-=readSize;
    sclip->streamPos+=readSize;
    return hpatch_TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rsi
movq 0x8(%rdi), %r12
subq %rsi, %r12
movq 0x20(%rdi), %rdi
cmpq %r12, %rdi
cmovbq %rdi, %r12
pushq $0x1
popq %rbx
testq %r12, %r12
je 0x3af25
movq 0x18(%r14), %r15
movq 0x28(%r14), %rdx
subq %rdi, %rdx
je 0x3aefd
leaq (%r15,%rdi), %rsi
subq %r12, %rdi
addq %r15, %rdi
callq 0x4540
movq (%r14), %rsi
movq 0x28(%r14), %rdi
movq 0x10(%r14), %rax
movq %rdi, %rdx
subq %r12, %rdx
addq %r15, %rdx
addq %rdi, %r15
movq %rax, %rdi
movq %r15, %rcx
callq *0x10(%rax)
testl %eax, %eax
je 0x3af23
subq %r12, 0x20(%r14)
addq %r12, (%r14)
jmp 0x3af25
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TStreamCacheClip_skipData
hpatch_BOOL _TStreamCacheClip_skipData(TStreamCacheClip* sclip,hpatch_StreamPos_t skipLongSize){
    while (skipLongSize>0) {
        hpatch_size_t len=sclip->cacheEnd;
        if (len>skipLongSize)
            len=(hpatch_size_t)skipLongSize;
        if (_TStreamCacheClip_accessData(sclip,len)){
            _TStreamCacheClip_skipData_noCheck(sclip,len);
            skipLongSize-=len;
        }else{
            return _hpatch_FALSE;
        }
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x3af6f
movq 0x28(%r15), %r12
cmpq %r14, %r12
cmovaeq %r14, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3ae6c
testq %rax, %rax
je 0x3af6d
addq %r12, 0x20(%r15)
subq %r12, %r14
jmp 0x3af44
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TStreamCacheClip_unpackUIntWithTag
hpatch_BOOL _TStreamCacheClip_unpackUIntWithTag(TStreamCacheClip* sclip,hpatch_StreamPos_t* result,const hpatch_uint kTagBit){
    TByte* curCode,*codeBegin;
    hpatch_size_t readSize=hpatch_kMaxPackedUIntBytes;
    const hpatch_StreamPos_t dataSize=_TStreamCacheClip_leaveSize(sclip);
    if (readSize>dataSize)
        readSize=(hpatch_size_t)dataSize;
    codeBegin=_TStreamCacheClip_accessData(sclip,readSize);
    if (codeBegin==0) return _hpatch_FALSE;
    curCode=codeBegin;
    _SAFE_CHECK_DO(hpatch_unpackUIntWithTag((const TByte**)&curCode,codeBegin+readSize,result,kTagBit));
    _TStreamCacheClip_skipData_noCheck(sclip,(hpatch_size_t)(curCode-codeBegin));
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
addq 0x28(%rdi), %rax
movq (%rdi), %rcx
addq 0x20(%rdi), %rcx
subq %rcx, %rax
cmpq $0xb, %rax
pushq $0xb
popq %r13
cmovbq %rax, %r13
movq %r13, %rsi
callq 0x3ae6c
xorl %r15d, %r15d
testq %rax, %rax
je 0x3afea
movq %rax, %r12
movq %rsp, %rdi
movq %rax, (%rdi)
addq %rax, %r13
movq %r13, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3a5a8
testl %eax, %eax
je 0x3afea
movq (%rsp), %rax
subq %r12, %rax
addq %rax, 0x20(%rbx)
pushq $0x1
popq %r15
movl %r15d, %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/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TStreamCacheClip_readDataTo
hpatch_BOOL _TStreamCacheClip_readDataTo(TStreamCacheClip* sclip,TByte* out_buf,TByte* bufEnd){
    hpatch_size_t readLen=_TStreamCacheClip_cachedSize(sclip);
    hpatch_size_t outLen=bufEnd-out_buf;
    if (readLen>=outLen)
        readLen=outLen;
    memcpy(out_buf,&sclip->cacheBuf[sclip->cacheBegin],readLen);
    sclip->cacheBegin+=readLen;
    outLen-=readLen;
    if (outLen){
        out_buf += readLen;
        if (outLen<(sclip->cacheEnd>>1)){
            if (!_TStreamCacheClip_updateCache(sclip)) return _hpatch_FALSE;
#ifdef __RUN_MEM_SAFE_CHECK
            if (outLen>_TStreamCacheClip_cachedSize(sclip)) return _hpatch_FALSE;
#endif
            return _TStreamCacheClip_readDataTo(sclip, out_buf, bufEnd);
        }else{
            if (!sclip->srcStream->read(sclip->srcStream,sclip->streamPos,
                                        out_buf,bufEnd)) return _hpatch_FALSE;
            sclip->streamPos+=outLen;
        }
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x20(%rdi), %rsi
movq 0x28(%rdi), %rbp
subq %rsi, %rbp
movq %r14, %r13
subq %r15, %r13
cmpq %r13, %rbp
movq %r13, %r12
cmovbq %rbp, %r12
addq 0x18(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x42c0
addq %r12, 0x20(%rbx)
cmpq %rbp, %r13
jbe 0x3b091
subq %r12, %r13
addq %r12, %r15
movq 0x28(%rbx), %rax
shrq %rax
cmpq %rax, %r13
jae 0x3b07a
movq %rbx, %rdi
callq 0x3aeb2
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
je 0x3b094
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rbp
movq %rbp, %rcx
subq %rsi, %rcx
cmpq %rcx, %r13
jbe 0x3b018
jmp 0x3b094
movq (%rbx), %rsi
movq 0x10(%rbx), %rdi
movq %r15, %rdx
movq %r14, %rcx
callq *0x10(%rdi)
testl %eax, %eax
je 0x3b0a3
addq %r13, (%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x3b094
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TStreamCacheClip_addDataTo
hpatch_BOOL _TStreamCacheClip_addDataTo(TStreamCacheClip* self,unsigned char* dst,hpatch_size_t addLen){
    const unsigned char* src=_TStreamCacheClip_readData(self,addLen);
    if (src==0) return _hpatch_FALSE;
    addData(dst,src,addLen);
    return hpatch_TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdx, %rsi
callq 0x3b0db
testq %rax, %rax
je 0x3b0d1
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x3ac1f
pushq $0x1
popq %rax
jmp 0x3b0d3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch_private.h
// Function: TStreamCacheClip_init
hpatch_inline static
void _TStreamCacheClip_init(TStreamCacheClip* sclip,const hpatch_TStreamInput* srcStream,
                            hpatch_StreamPos_t streamPos,hpatch_StreamPos_t streamPos_end,
                            unsigned char* aCache,hpatch_size_t cacheSize){
    assert((streamPos<=streamPos_end)&&(streamPos_end<=(srcStream?srcStream->streamSize:0)));
    sclip->streamPos=streamPos;
    sclip->streamPos_end=streamPos_end;
    sclip->srcStream=srcStream;
    sclip->cacheBuf=aCache;
    sclip->cacheBegin=cacheSize;
    sclip->cacheEnd=cacheSize;
}

// Assembly:
cmpq %rcx, %rdx
ja 0x3b22a
testq %rsi, %rsi
je 0x3b20b
movq 0x8(%rsi), %rax
jmp 0x3b20d
xorl %eax, %eax
cmpq %rcx, %rax
jb 0x3b22a
movq %rdx, (%rdi)
movq %rcx, 0x8(%rdi)
movq %rsi, 0x10(%rdi)
movq %r8, 0x18(%rdi)
movq %r9, 0x20(%rdi)
movq %r9, 0x28(%rdi)
retq
pushq %rax
leaq 0x1b98d(%rip), %rdi     # 0x56bbf
leaq 0x1b9d7(%rip), %rsi     # 0x56c10
leaq 0x1ba00(%rip), %rcx     # 0x56c40
pushq $0x55
popq %rdx
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TOutStreamCache_flush
hpatch_BOOL _TOutStreamCache_flush(_TOutStreamCache* self){
    hpatch_size_t curSize=self->cacheCur;
    if (curSize>0){
        if (!__TOutStreamCache_writeStream(self,self->cacheBuf,curSize))
            return _hpatch_FALSE;
        self->cacheCur=0;
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x18(%rdi), %rdx
pushq $0x1
popq %rbx
testq %rdx, %rdx
je 0x3b288
movq %rdi, %r14
movq 0x10(%rdi), %rsi
callq 0x3b292
testl %eax, %eax
je 0x3b286
andq $0x0, 0x18(%r14)
jmp 0x3b288
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TOutStreamCache_write
hpatch_BOOL _TOutStreamCache_write(_TOutStreamCache* self,const TByte* data,hpatch_size_t dataSize){
    while (dataSize>0) {
        hpatch_size_t copyLen;
        hpatch_size_t curSize=self->cacheCur;
        if ((dataSize>=self->cacheEnd)&&(curSize==0)){
            return __TOutStreamCache_writeStream(self,data,dataSize);
        }
        copyLen=self->cacheEnd-curSize;
        copyLen=(copyLen<=dataSize)?copyLen:dataSize;
        memcpy(self->cacheBuf+curSize,data,copyLen);
        self->cacheCur=curSize+copyLen;
        data+=copyLen;
        dataSize-=copyLen;
        if (self->cacheCur==self->cacheEnd){
            if (!_TOutStreamCache_flush(self))
                return _hpatch_FALSE;
        }
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x3b33c
movq 0x18(%r12), %rbp
movq 0x20(%r12), %r13
cmpq %r13, %r14
setae %al
testq %rbp, %rbp
sete %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x3b34d
subq %rbp, %r13
cmpq %r14, %r13
cmovaeq %r14, %r13
movq 0x10(%r12), %rdi
addq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x42c0
addq %r13, %rbp
movq %rbp, 0x18(%r12)
addq %r13, %r15
subq %r13, %r14
cmpq 0x20(%r12), %rbp
jne 0x3b2da
movq %r12, %rdi
callq 0x3b25f
testl %eax, %eax
jne 0x3b2da
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3b292
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TOutStreamCache_fill
hpatch_BOOL _TOutStreamCache_fill(_TOutStreamCache* self,hpatch_byte fillValue,hpatch_StreamPos_t fillLength){
    while (fillLength>0){
        hpatch_size_t curSize=self->cacheCur;
        hpatch_size_t runStep=self->cacheEnd-curSize;
        runStep=(runStep<=fillLength)?runStep:(hpatch_size_t)fillLength;
        memset(self->cacheBuf+curSize,fillValue,runStep);
        self->cacheCur=curSize+runStep;
        fillLength-=runStep;
        if (self->cacheCur==self->cacheEnd){
            if (!_TOutStreamCache_flush(self))
                return _hpatch_FALSE;
        }
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %r15
pushq $0x1
popq %rbx
movzbl %sil, %ebp
testq %r14, %r14
je 0x3b3c7
movq 0x18(%r15), %r13
movq 0x20(%r15), %r12
subq %r13, %r12
cmpq %r14, %r12
cmovaeq %r14, %r12
movq 0x10(%r15), %rdi
addq %r13, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x41f0
addq %r12, %r13
movq %r13, 0x18(%r15)
subq %r12, %r14
cmpq 0x20(%r15), %r13
jne 0x3b381
movq %r15, %rdi
callq 0x3b25f
testl %eax, %eax
jne 0x3b381
xorl %ebx, %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/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TOutStreamCache_copyFromStream
hpatch_BOOL _TOutStreamCache_copyFromStream(_TOutStreamCache* self,const hpatch_TStreamInput* src,
                                            hpatch_StreamPos_t srcPos,hpatch_StreamPos_t copyLength){
    while (copyLength>0){
        hpatch_size_t curSize=self->cacheCur;
        hpatch_size_t runStep=self->cacheEnd-curSize;
        hpatch_byte* buf=self->cacheBuf+curSize;
        runStep=(runStep<=copyLength)?runStep:(hpatch_size_t)copyLength;
        if (!src->read(src,srcPos,buf,buf+runStep))
             return _hpatch_FALSE;
        srcPos+=runStep;
        self->cacheCur=curSize+runStep;
        copyLength-=runStep;
        if (self->cacheCur==self->cacheEnd){
            if (!_TOutStreamCache_flush(self))
                return _hpatch_FALSE;
        }
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, (%rsp)
movq %rdi, %r12
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x3b448
movq 0x18(%r12), %r13
movq 0x20(%r12), %r15
subq %r13, %r15
movq 0x10(%r12), %rdx
addq %r13, %rdx
cmpq %rbx, %r15
cmovaeq %rbx, %r15
leaq (%rdx,%r15), %rcx
movq (%rsp), %rdi
movq %r14, %rsi
callq *0x10(%rdi)
testl %eax, %eax
je 0x3b44b
addq %r15, %r14
addq %r15, %r13
movq %r13, 0x18(%r12)
subq %r15, %rbx
cmpq 0x20(%r12), %r13
jne 0x3b3f2
movq %r12, %rdi
callq 0x3b25f
testl %eax, %eax
jne 0x3b3f2
jmp 0x3b44b
pushq $0x1
popq %rbp
movl %ebp, %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/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TOutStreamCache_copyFromClip
hpatch_BOOL _TOutStreamCache_copyFromClip(_TOutStreamCache* self,TStreamCacheClip* src,hpatch_StreamPos_t copyLength){
    while (copyLength>0){
        const TByte* data;
        hpatch_size_t runStep=(src->cacheEnd<=copyLength)?src->cacheEnd:(hpatch_size_t)copyLength;
        data=_TStreamCacheClip_readData(src,runStep);
        if (data==0) return
            _hpatch_FALSE;
        if (!_TOutStreamCache_write(self,data,runStep))
            return _hpatch_FALSE;
        copyLength-=runStep;
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %r13
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x3b4ad
movq 0x28(%r14), %r12
cmpq %rbx, %r12
cmovaeq %rbx, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x3b0db
testq %rax, %rax
je 0x3b4b0
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x3b2c3
subq %r12, %rbx
testl %eax, %eax
jne 0x3b476
jmp 0x3b4b0
movl %r13d, %ebp
movl %ebp, %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/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: getCompressedDiffInfo
hpatch_BOOL getCompressedDiffInfo(hpatch_compressedDiffInfo* out_diffInfo,
                                  const hpatch_TStreamInput* compressedDiff){
    _THDiffzHead head;
    assert(out_diffInfo!=0);
    assert(compressedDiff!=0);
    assert(compressedDiff->read!=0);
    return read_diffz_head(out_diffInfo,&head,compressedDiff);
}

// Assembly:
subq $0x68, %rsp
testq %rdi, %rdi
je 0x3b8ab
movq %rsi, %rdx
testq %rsi, %rsi
je 0x3b8ca
cmpq $0x0, 0x10(%rdx)
je 0x3b8e9
movq %rsp, %rsi
callq 0x3b682
addq $0x68, %rsp
retq
leaq 0x1ae63(%rip), %rdi     # 0x56715
leaq 0x1ab75(%rip), %rsi     # 0x5642e
leaq 0x1ae65(%rip), %rcx     # 0x56725
movl $0x4d2, %edx            # imm = 0x4D2
callq 0x4230
leaq 0x1aeb0(%rip), %rdi     # 0x56781
leaq 0x1ab56(%rip), %rsi     # 0x5642e
leaq 0x1ae46(%rip), %rcx     # 0x56725
movl $0x4d3, %edx            # imm = 0x4D3
callq 0x4230
leaq 0x1aea3(%rip), %rdi     # 0x56793
leaq 0x1ab37(%rip), %rsi     # 0x5642e
leaq 0x1ae27(%rip), %rcx     # 0x56725
movl $0x4d4, %edx            # imm = 0x4D4
callq 0x4230