LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: cache_old_StreamInput_read
static hpatch_BOOL _cache_old_StreamInput_read(const hpatch_TStreamInput* stream,
                                               hpatch_StreamPos_t readFromPos,
                                               unsigned char* out_data,unsigned char* out_data_end){
    _cache_old_TStreamInput* self=(_cache_old_TStreamInput*)stream->streamImport;
    hpatch_StreamPos_t dataLen=(hpatch_size_t)(self->readFromPosEnd-self->readFromPos);
    hpatch_size_t readLen;
    if (dataLen==0){//next cover
        hpatch_StreamPos_t oldPos;
        hpatch_size_t i=self->arrayCovers.cur_index++;
        if (i>=self->arrayCovers.coverCount) return _hpatch_FALSE;//error;
        oldPos=_arrayCovers_get_oldPos(&self->arrayCovers,i);
        dataLen=_arrayCovers_get_len(&self->arrayCovers,i);
        self->isInHitCache=(dataLen<=self->maxCachedLen);
        self->readFromPos=oldPos;
        self->readFromPosEnd=oldPos+dataLen;
    }
    readLen=out_data_end-out_data;
    if ((readLen>dataLen)||(self->readFromPos!=readFromPos)) return _hpatch_FALSE; //error
    self->readFromPos=readFromPos+readLen;
    if (self->isInHitCache){
        assert(readLen<=(hpatch_size_t)(self->cachesEnd-self->caches));
        memcpy(out_data,self->caches,readLen);
        self->caches+=readLen;
        return hpatch_TRUE;
    }else{
        return self->oldData->read(self->oldData,readFromPos,out_data,out_data_end);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq 0x58(%r14), %r9
subq 0x50(%r14), %r9
jne 0x47973
movq 0x28(%r14), %rdi
movq 0x30(%r14), %r8
leaq 0x1(%r8), %rax
movq %rax, 0x30(%r14)
xorl %eax, %eax
cmpq %rdi, %r8
jae 0x4792c
movl 0x38(%r14), %r9d
movq 0x20(%r14), %r10
movq %r8, %r11
testl %r9d, %r9d
je 0x47931
shlq $0x4, %r11
movl (%r10,%r11), %r10d
jmp 0x47939
xorl %r9d, %r9d
jmp 0x4796e
shlq $0x5, %r11
movq (%r10,%r11), %r10
movq 0x20(%r14), %r11
leaq 0x2(,%r8,4), %rbx
testl %r9d, %r9d
je 0x47950
movl (%r11,%rbx,4), %r9d
jmp 0x47954
movq (%r11,%rbx,8), %r9
xorl %r11d, %r11d
cmpq 0x48(%r14), %r9
setbe %r11b
movl %r11d, 0x40(%r14)
movq %r10, 0x50(%r14)
addq %r9, %r10
movq %r10, 0x58(%r14)
cmpq %rdi, %r8
jae 0x479b9
movq %rcx, %rbx
subq %rdx, %rbx
xorl %eax, %eax
cmpq %r9, %rbx
ja 0x479b9
cmpq %rsi, 0x50(%r14)
jne 0x479b9
leaq (%rbx,%rsi), %rax
movq %rax, 0x50(%r14)
cmpl $0x0, 0x40(%r14)
je 0x479c1
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rax
subq %rsi, %rax
cmpq %rax, %rbx
ja 0x479d2
movq %rdx, %rdi
movq %rbx, %rdx
callq 0x4290
addq %rbx, 0x60(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x70(%r14), %rdi
movq 0x10(%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
leaq 0x1a405(%rip), %rdi     # 0x61dde
leaq 0x1992e(%rip), %rsi     # 0x6130e
leaq 0x1a42e(%rip), %rcx     # 0x61e15
movl $0x6cc, %edx            # imm = 0x6CC
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: covers_read_cover
static  hpatch_BOOL _covers_read_cover(hpatch_TCovers* covers,hpatch_TCover* out_cover){
    _TCovers* self=(_TCovers*)covers;
    hpatch_StreamPos_t oldPosBack=self->oldPosBack;
    hpatch_StreamPos_t newPosBack=self->newPosBack;
    hpatch_StreamPos_t coverCount=self->coverCount;
    if (coverCount>0)
        self->coverCount=coverCount-1;
    else
        return _hpatch_FALSE;
    
    {
        hpatch_StreamPos_t copyLength,coverLength, oldPos,inc_oldPos;
        TByte inc_oldPos_sign;
        const TByte* pSign=_TStreamCacheClip_accessData(self->code_inc_oldPosClip,1);
        if (pSign)
            inc_oldPos_sign=(*pSign)>>(8-kSignTagBit);
        else
            return _hpatch_FALSE;
        _clip_unpackUIntWithTagTo(&inc_oldPos,self->code_inc_oldPosClip,kSignTagBit);
        oldPos=(inc_oldPos_sign==0)?(oldPosBack+inc_oldPos):(oldPosBack-inc_oldPos);
        _clip_unpackUIntTo(&copyLength,self->code_inc_newPosClip);
        _clip_unpackUIntTo(&coverLength,self->code_lengthsClip);
        newPosBack+=copyLength;
        oldPosBack=oldPos;
        oldPosBack+=(self->isOldPosBackNeedAddLength)?coverLength:0;
        
        out_cover->oldPos=oldPos;
        out_cover->newPos=newPosBack;
        out_cover->length=coverLength;
        newPosBack+=coverLength;
    }
    self->oldPosBack=oldPosBack;
    self->newPosBack=newPosBack;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x48255
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %r13
movq 0x30(%rdi), %r12
decq %rax
movq %rax, 0x20(%rdi)
movq 0x38(%rdi), %r15
movq 0x28(%r15), %rax
cmpq 0x20(%r15), %rax
jne 0x481a8
movq %r15, %rdi
callq 0x445b4
testl %eax, %eax
je 0x481a4
movq 0x28(%r15), %rax
cmpq 0x20(%r15), %rax
jne 0x481a8
xorl %eax, %eax
jmp 0x481b0
movq 0x18(%r15), %rax
addq 0x20(%r15), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0x48250
movb (%rax), %r15b
movq 0x38(%rbx), %rdi
leaq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x44699
testl %eax, %eax
je 0x48250
movq %r12, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, %r12
negq %r12
testb %r15b, %r15b
cmovnsq %rax, %r12
movq 0x40(%rbx), %rdi
leaq 0x20(%rsp), %rsi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x48259
movq 0x48(%rbx), %rdi
leaq 0x18(%rsp), %rsi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x48259
addq %r13, %r12
movq 0x8(%rsp), %rcx
addq 0x20(%rsp), %rcx
xorl %r13d, %r13d
cmpl $0x0, 0x50(%rbx)
movq 0x18(%rsp), %rax
cmovneq %rax, %r13
addq %r12, %r13
movq %r12, (%r14)
movq %rcx, %r12
movq %rcx, 0x8(%r14)
movq %rax, 0x10(%r14)
addq %rax, %r12
movb $0x1, %r15b
jmp 0x4825e
xorl %r15d, %r15d
jmp 0x4825e
xorl %ebp, %ebp
jmp 0x48270
movq 0x8(%rsp), %r12
testb %r15b, %r15b
je 0x48270
movq %r13, 0x28(%rbx)
movq %r12, 0x30(%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: covers_is_finish
static  hpatch_BOOL _covers_is_finish(const struct hpatch_TCovers* covers){
    _TCovers* self=(_TCovers*)covers;
    return _TStreamCacheClip_isFinish(self->code_lengthsClip)
        && _TStreamCacheClip_isFinish(self->code_inc_newPosClip)
        && _TStreamCacheClip_isFinish(self->code_inc_oldPosClip);
}

// Assembly:
movq 0x48(%rdi), %rax
movq 0x8(%rax), %rcx
movq 0x20(%rax), %rdx
subq (%rax), %rcx
subq 0x28(%rax), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
jne 0x482ce
movq 0x40(%rdi), %rcx
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
movq 0x20(%rcx), %rsi
subq 0x28(%rcx), %rsi
cmpq %rsi, %rdx
jne 0x482ce
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rcx
movq 0x20(%rax), %rdx
subq (%rax), %rcx
subq 0x28(%rax), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: compressedCovers_close
static hpatch_BOOL _compressedCovers_close(hpatch_TCovers* covers){
    hpatch_BOOL result=hpatch_TRUE;
    _TCompressedCovers* self=(_TCompressedCovers*)covers;
    if (self){
        if (self->decompresser.decompressHandle){
            result=self->decompresser.decompressPlugin->close(self->decompresser.decompressPlugin,
                                                              self->decompresser.decompressHandle);
            self->decompresser.decompressHandle=0;
        }
    }
    return result;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x482fb
movq %rdi, %rbx
movq 0xb0(%rdi), %rsi
testq %rsi, %rsi
je 0x482fb
movq 0xa8(%rbx), %rdi
callq *0x10(%rdi)
movq $0x0, 0xb0(%rbx)
jmp 0x48300
movl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_getTempPathName
hpatch_BOOL hpatch_getTempPathName(const char* path_utf8,char* out_tempPath_utf8,char* out_tempPath_end){
    //use tmpnam()?
#define _AddingLen 8
    size_t i;
    size_t len=strlen(path_utf8);
    if ((len>0)&&(path_utf8[len-1]==kPatch_dirSeparator)) --len; //without '/'
    if (len+(4+_AddingLen)>(size_t)(out_tempPath_end-out_tempPath_utf8)) { _set_errno_new(ENAMETOOLONG); return hpatch_FALSE; }
    memcpy(out_tempPath_utf8,path_utf8,len);
    out_tempPath_utf8+=len;
    for (i=1; i<1000; ++i) {
        hpatch_TPathType tmpPathType;
        char adding[_AddingLen]={'0','0','0','.','t','m','p','\0'};
        adding[2]+=i%10;    adding[1]+=(i/10)%10;   adding[0]+=(i/100)%10;
        memcpy(out_tempPath_utf8,adding,sizeof(adding));
        if (!_hpatch_getPathStat_noEndDirSeparator(out_tempPath_utf8,&tmpPathType,0,0)) return hpatch_FALSE;
        if (tmpPathType==kPathType_notExist)
            return hpatch_TRUE; //ok
    }
    return hpatch_FALSE;
#undef _AddingLen
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4140
testq %rax, %rax
je 0x484d2
movq %rax, %r15
xorl %eax, %eax
cmpb $0x2f, -0x1(%r14,%r15)
sete %al
subq %rax, %r15
jmp 0x484d5
xorl %r15d, %r15d
leaq 0xc(%r15), %rax
subq %rbx, %r12
cmpq %r12, %rax
jbe 0x484f1
callq 0x4050
movl $0x24, (%rax)
jmp 0x485d2
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4290
leaq (%rbx,%r15), %r14
leaq (%rbx,%r15), %r13
addq $0x3, %r13
movl $0x1, %r15d
movabsq $0x199999999999999a, %rbp # imm = 0x199999999999999A
leaq 0x4(%rsp), %r12
movq %r15, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
mulq %rcx
movq %rdx, %rcx
shrq $0x3, %rcx
leal (%rcx,%rcx), %eax
leal (%rax,%rax,4), %eax
movl %r15d, %edi
subl %eax, %edi
movq %rcx, %rax
mulq %rbp
addl %edx, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %ecx
movq %r15, %rax
shrq $0x2, %rax
movabsq $0x28f5c28f5c28f5c3, %rdx # imm = 0x28F5C28F5C28F5C3
mulq %rdx
movq %rdx, %rsi
shrq $0x2, %rsi
movq %rsi, %rax
mulq %rbp
orb $0x30, %cl
addl %edx, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %esi
orb $0x30, %sil
movb %sil, (%r14)
movb %cl, 0x1(%r14)
addb $0x30, %dil
movb %dil, 0x2(%r14)
movb $0x0, 0x4(%r13)
movl $0x706d742e, (%r13)     # imm = 0x706D742E
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x48315
movl 0x4(%rsp), %ecx
testl %ecx, %ecx
movl $0x1, %edx
cmovel %edx, %ebx
testl %eax, %eax
cmovel %eax, %ebx
je 0x485d4
testl %ecx, %ecx
je 0x485d4
incq %r15
cmpq $0x3e8, %r15            # imm = 0x3E8
jne 0x48520
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_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_renamePath
hpatch_BOOL hpatch_renamePath(const char* oldPath_utf8,const char* newPath_utf8){
    _path_noEndDirSeparator(oldPath,oldPath_utf8); {
        _path_noEndDirSeparator(newPath,newPath_utf8); {
#if (_IS_USED_WIN32_UTF8_WAPI)
            int     wsize;
            wchar_t oldPath_w[hpatch_kPathMaxSize];
            wchar_t newPath_w[hpatch_kPathMaxSize];
            wsize=_utf8FileName_to_w(oldPath,oldPath_w,hpatch_kPathMaxSize);
            if (wsize<=0) return hpatch_FALSE;
            wsize=_utf8FileName_to_w(newPath,newPath_w,hpatch_kPathMaxSize);
            if (wsize<=0) return hpatch_FALSE;
            return 0==_wrename(oldPath_w,newPath_w);
#else
            return 0==rename(oldPath,newPath);
#endif
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rsi, %rbx
movq %rdi, %r15
callq 0x4140
movq %rax, %r14
cmpq $0x1000, %rax           # imm = 0x1000
jae 0x48621
testq %r14, %r14
je 0x4862e
xorl %eax, %eax
cmpb $0x2f, -0x1(%r15,%r14)
sete %al
movq %r14, %r12
subq %rax, %r12
jmp 0x48631
callq 0x4050
movl $0x24, (%rax)
jmp 0x4864d
xorl %r12d, %r12d
leaq 0x1000(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4290
movb $0x0, 0x1000(%rsp,%r12)
xorl %eax, %eax
cmpq $0xfff, %r14            # imm = 0xFFF
ja 0x486ca
movq %rbx, %rdi
callq 0x4140
movq %rax, %r14
cmpq $0x1000, %rax           # imm = 0x1000
jae 0x48683
testq %r14, %r14
je 0x48690
xorl %eax, %eax
cmpb $0x2f, -0x1(%rbx,%r14)
sete %al
movq %r14, %r15
subq %rax, %r15
jmp 0x48693
callq 0x4050
movl $0x24, (%rax)
jmp 0x486a6
xorl %r15d, %r15d
movq %rsp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4290
movb $0x0, (%rsp,%r15)
xorl %eax, %eax
cmpq $0xfff, %r14            # imm = 0xFFF
ja 0x486ca
leaq 0x1000(%rsp), %rdi
movq %rsp, %rsi
callq 0x41f0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_removeFile
hpatch_BOOL hpatch_removeFile(const char* fileName_utf8){
    _path_noEndDirSeparator(fileName,fileName_utf8);{
#if (_IS_USED_WIN32_UTF8_WAPI)
        int     wsize;
        wchar_t path_w[hpatch_kPathMaxSize];
        wsize=_utf8FileName_to_w(fileName,path_w,hpatch_kPathMaxSize);
        if (wsize<=0) return hpatch_FALSE;
        return 0==_wremove(path_w);
#else
        return 0==remove(fileName);
#endif
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %r14
callq 0x4140
movq %rax, %rbx
cmpq $0x1000, %rax           # imm = 0x1000
jae 0x48710
testq %rbx, %rbx
je 0x4871d
xorl %eax, %eax
cmpb $0x2f, -0x1(%r14,%rbx)
sete %al
movq %rbx, %r15
subq %rax, %r15
jmp 0x48720
callq 0x4050
movl $0x24, (%rax)
jmp 0x48733
xorl %r15d, %r15d
movq %rsp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4290
movb $0x0, (%rsp,%r15)
xorl %eax, %eax
cmpq $0xfff, %rbx            # imm = 0xFFF
ja 0x4874f
movq %rsp, %rdi
callq 0x4600
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_removeDir
hpatch_BOOL hpatch_removeDir(const char* dirName_utf8){
    _path_noEndDirSeparator(dirName,dirName_utf8);{
#if (_IS_USED_WIN32_UTF8_WAPI)
        int     wsize;
        wchar_t path_w[hpatch_kPathMaxSize];
        wsize=_utf8FileName_to_w(dirName,path_w,hpatch_kPathMaxSize);
        if (wsize<=0) return hpatch_FALSE;
        return 0==_wrmdir(path_w);
#else
#   ifdef _MSC_VER
        return 0==_rmdir(dirName);
#   else
        return 0==rmdir(dirName);
#   endif
#endif
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %r14
callq 0x4140
movq %rax, %rbx
cmpq $0x1000, %rax           # imm = 0x1000
jae 0x48793
testq %rbx, %rbx
je 0x487a0
xorl %eax, %eax
cmpb $0x2f, -0x1(%r14,%rbx)
sete %al
movq %rbx, %r15
subq %rax, %r15
jmp 0x487a3
callq 0x4050
movl $0x24, (%rax)
jmp 0x487b6
xorl %r15d, %r15d
movq %rsp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4290
movb $0x0, (%rsp,%r15)
xorl %eax, %eax
cmpq $0xfff, %rbx            # imm = 0xFFF
ja 0x487d2
movq %rsp, %rdi
callq 0x4130
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_makeNewDir
hpatch_BOOL hpatch_makeNewDir(const char* dirName_utf8){
    hpatch_TPathType type;
    _path_noEndDirSeparator(path,dirName_utf8);
    if (!_hpatch_getPathStat_noEndDirSeparator(path,&type,0,0)) return hpatch_FALSE; //error
    switch (type) {
        case kPathType_dir :{ return hpatch_TRUE; } break; //exist
        case kPathType_file:{ _set_errno_new(EPERM); return hpatch_FALSE; } break; //error, not overwite
        case kPathType_notExist:{
#if (_IS_USED_WIN32_UTF8_WAPI)
            int     wsize;
            wchar_t path_w[hpatch_kPathMaxSize];
            wsize=_utf8FileName_to_w(path,path_w,hpatch_kPathMaxSize);
            if (wsize<=0) return hpatch_FALSE;
            return 0==_wmkdir(path_w);
#else
#   ifdef _MSC_VER
            return 0==_mkdir(path);
#   else
#       if defined(__MINGW32__) && defined(_WIN32)
            return 0==mkdir(path);
#       else
            const mode_t kDefalutMode=S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;//0755
            return 0==mkdir(path,kDefalutMode);
#       endif
#   endif
#endif
        } break;
    }
    return hpatch_FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1010, %rsp           # imm = 0x1010
movq %rdi, %rbx
callq 0x4140
movq %rax, %r14
cmpq $0x1000, %rax           # imm = 0x1000
jae 0x4881b
testq %r14, %r14
je 0x48828
xorl %eax, %eax
cmpb $0x2f, -0x1(%rbx,%r14)
sete %al
movq %r14, %r15
subq %rax, %r15
jmp 0x4882b
callq 0x4050
movl $0x24, (%rax)
jmp 0x48841
xorl %r15d, %r15d
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4290
movb $0x0, 0x10(%rsp,%r15)
xorl %ebx, %ebx
cmpq $0xfff, %r14            # imm = 0xFFF
ja 0x488a1
xorl %ebx, %ebx
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x48315
testl %eax, %eax
je 0x488a1
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0x4888b
cmpl $0x2, %eax
je 0x48884
cmpl $0x1, %eax
jne 0x488a1
callq 0x4050
movl $0x1, (%rax)
jmp 0x488a1
movl $0x1, %ebx
jmp 0x488a1
leaq 0x10(%rsp), %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x4160
xorl %ebx, %ebx
testl %eax, %eax
sete %bl
movl %ebx, %eax
addq $0x1010, %rsp           # imm = 0x1010
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_setIsExecuteFile
hpatch_BOOL hpatch_setIsExecuteFile(const char* fileName){
#ifdef _WIN32
    return hpatch_TRUE; // now, not need execute info
#else
    hpatch_TPathType type;
    size_t           st_mode=0;
    if (!_hpatch_getPathStat_noEndDirSeparator(fileName,&type,0,&st_mode)) return hpatch_FALSE;
    return 0==chmod(fileName,(mode_t)st_mode|S_IXUSR|S_IXGRP|S_IXOTH);
#endif
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
xorl %r14d, %r14d
leaq 0x14(%rsp), %rsi
xorl %edx, %edx
callq 0x48315
testl %eax, %eax
je 0x48936
movl 0x8(%rsp), %esi
orl $0x49, %esi
movq %rbx, %rdi
callq 0x42d0
xorl %r14d, %r14d
testl %eax, %eax
sete %r14b
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: import_fileRead
hpatch_BOOL _import_fileRead(hpatch_FileHandle file,TByte* buf,TByte* buf_end){
    while (buf<buf_end) {
        size_t readLen=(size_t)(buf_end-buf);
        if (readLen>hpatch_kFileIOBestMaxSize) readLen=hpatch_kFileIOBestMaxSize;
        if (readLen!=fread(buf,1,readLen,file)) return hpatch_FALSE;
        buf+=readLen;
    }
    return buf==buf_end;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rbx, %r14
jae 0x48999
movq %rbx, %r12
subq %r14, %r12
movl $0x100000, %eax         # imm = 0x100000
cmpq %rax, %r12
jb 0x4896d
movl $0x100000, %r12d        # imm = 0x100000
movl $0x1, %esi
movq %r14, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x44a0
movq %rax, %rcx
xorl %eax, %eax
movq %r12, %rdx
cmpq %rcx, %r12
je 0x4898f
xorl %edx, %edx
addq %rdx, %r14
cmpq %rcx, %r12
je 0x48952
jmp 0x4899f
sete %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: import_fileWrite
hpatch_BOOL _import_fileWrite(hpatch_FileHandle file,const TByte* data,const TByte* data_end){
    while (data<data_end) {
        size_t writeLen=(size_t)(data_end-data);
        if (writeLen>hpatch_kFileIOBestMaxSize) writeLen=hpatch_kFileIOBestMaxSize;
        if (writeLen!=fwrite(data,1,writeLen,file)) return hpatch_FALSE;
        data+=writeLen;
    }
    return data==data_end;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rbx, %r14
jae 0x48a03
movq %rbx, %r12
subq %r14, %r12
movl $0x100000, %eax         # imm = 0x100000
cmpq %rax, %r12
jb 0x489d7
movl $0x100000, %r12d        # imm = 0x100000
movl $0x1, %esi
movq %r14, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x4660
movq %rax, %rcx
xorl %eax, %eax
movq %r12, %rdx
cmpq %rcx, %r12
je 0x489f9
xorl %edx, %edx
addq %rdx, %r14
cmpq %rcx, %r12
je 0x489bc
jmp 0x48a09
sete %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: import_fileTruncate
hpatch_BOOL _import_fileTruncate(hpatch_FileHandle file,hpatch_StreamPos_t new_file_length){
#ifdef _MSC_VER
    int fno=_fileno(file);
    if (fno==-1) return hpatch_FALSE;
    if (_chsize_s(fno,new_file_length)!=0) return hpatch_FALSE;
#else
    int fno=fileno(file);
    if (fno==-1) return hpatch_FALSE;
    if (ftruncate(fno,new_file_length)!=0) return hpatch_FALSE;
#endif
    return hpatch_TRUE;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x4330
cmpl $-0x1, %eax
je 0x48a38
movl %eax, %edi
movq %rbx, %rsi
callq 0x4170
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
jmp 0x48a3a
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_TFileStreamInput_open
hpatch_BOOL hpatch_TFileStreamInput_open(hpatch_TFileStreamInput* self,const char* fileName_utf8){
    assert(self->m_file==0);
    self->fileError=hpatch_FALSE;
    if (self->m_file) _ferr_returnv(EINVAL);
    if (!_import_fileOpenRead(fileName_utf8,&self->m_file,&self->base.streamSize))
        _ferr_return();
    
    self->base.streamImport=self;
    self->base.read=_TFileStreamInput_read_file;
    self->m_fpos=0;
    self->m_offset=0;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x20(%rdi)
jne 0x48ae7
movq %rdi, %rbx
movl $0x0, 0x38(%rdi)
leaq 0x8(%rdi), %rdx
leaq 0x1998e(%rip), %rax     # 0x623ee
movq %rsi, %rdi
movq %rax, %rsi
callq 0x493b4
testq %rax, %rax
je 0x48a91
movq %rax, 0x20(%rbx)
movq %rbx, (%rbx)
leaq 0x88(%rip), %rax        # 0x48b06
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movl $0x1, %r14d
jmp 0x48aac
callq 0x4050
movl (%rax), %ebp
movl 0x38(%rbx), %eax
cmpl %ebp, %eax
sete %cl
testl %ebp, %ebp
sete %dl
xorl %r14d, %r14d
orb %cl, %dl
je 0x48ab4
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
testl %eax, %eax
jne 0x48abb
movl %ebp, 0x38(%rbx)
movq 0x33506(%rip), %rax     # 0x7bfc8
movq (%rax), %rbx
movl %ebp, %edi
callq 0x40d0
leaq 0x10823(%rip), %rsi     # 0x592f6
xorl %r14d, %r14d
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4450
jmp 0x48aac
leaq 0x19746(%rip), %rdi     # 0x62234
leaq 0x196a7(%rip), %rsi     # 0x6219c
leaq 0x19748(%rip), %rcx     # 0x62244
movl $0x24b, %edx            # imm = 0x24B
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: TFileStreamInput_read_file
static hpatch_BOOL _TFileStreamInput_read_file(const hpatch_TStreamInput* stream,hpatch_StreamPos_t readFromPos,
                                                   TByte* out_data,TByte* out_data_end){
        size_t readLen;
        hpatch_TFileStreamInput* self=(hpatch_TFileStreamInput*)stream->streamImport;
        assert(out_data<=out_data_end);
        readLen=(size_t)(out_data_end-out_data);
        if (readLen==0) return hpatch_TRUE;
        if ((readLen>self->base.streamSize)
            ||(readFromPos>self->base.streamSize-readLen)) _ferr_returnv(EFBIG);
        if (self->m_fpos!=readFromPos+self->m_offset){
            if (!_import_fileSeek64To(self->m_file,readFromPos+self->m_offset)) _rw_ferr_return();
        }
        if (!_import_fileRead(self->m_file,out_data,out_data+readLen)) _rw_ferr_return();
        self->m_fpos=readFromPos+self->m_offset+readLen;
        return hpatch_TRUE;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rcx, %rdx
ja 0x48c44
movq %rcx, %r14
movq %rdx, %r12
movl $0x1, %ebx
subq %rdx, %r14
je 0x48c00
movq %rsi, %r15
movq (%rdi), %r13
movq 0x8(%r13), %rax
subq %r14, %rax
setb %cl
notb %cl
cmpq %rsi, %rax
setae %al
testb %al, %cl
jne 0x48b7a
callq 0x4050
movl $0x1b, (%rax)
movl 0x38(%r13), %eax
xorl %ebx, %ebx
cmpl $0x1b, %eax
je 0x48c00
testl %eax, %eax
jne 0x48b70
movl $0x1b, 0x38(%r13)
callq 0x4a4c
jmp 0x48c00
movq 0x30(%r13), %rsi
addq %r15, %rsi
cmpq %rsi, 0x28(%r13)
je 0x48bb7
movq 0x20(%r13), %rdi
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x4540
testl %eax, %eax
je 0x48bb7
movq $-0x1, 0x28(%r13)
callq 0x4050
movl (%rax), %ebp
movl 0x38(%r13), %eax
cmpl %ebp, %eax
sete %cl
testl %ebp, %ebp
sete %dl
jmp 0x48bfc
movq 0x20(%r13), %rdi
leaq (%r12,%r14), %rdx
movq %r12, %rsi
callq 0x48941
testl %eax, %eax
je 0x48bdd
addq %r15, %r14
addq 0x30(%r13), %r14
movq %r14, 0x28(%r13)
movl $0x1, %ebx
jmp 0x48c00
movq $-0x1, 0x28(%r13)
callq 0x4050
movl (%rax), %ebp
movl 0x38(%r13), %eax
cmpl %ebp, %eax
sete %cl
testl %ebp, %ebp
sete %dl
xorl %ebx, %ebx
orb %cl, %dl
je 0x48c11
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x48c19
movl %ebp, 0x38(%r13)
movq 0x333a8(%rip), %rax     # 0x7bfc8
movq (%rax), %r14
movl %ebp, %edi
callq 0x40d0
leaq 0x106c5(%rip), %rsi     # 0x592f6
xorl %ebx, %ebx
movq %r14, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4450
jmp 0x48c00
leaq 0x197a6(%rip), %rdi     # 0x623f1
leaq 0x1954a(%rip), %rsi     # 0x6219c
leaq 0x197af(%rip), %rcx     # 0x62408
movl $0x23d, %edx            # imm = 0x23D
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_TFileStreamInput_setOffset
hpatch_BOOL hpatch_TFileStreamInput_setOffset(hpatch_TFileStreamInput* self,hpatch_StreamPos_t offset){
    if (self->base.streamSize<offset)
        _ferr_returnv(EFBIG);
    self->m_offset+=offset;
    self->base.streamSize-=offset;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
subq %rsi, %rax
jae 0x48c99
callq 0x4050
movl $0x1b, (%rax)
movl 0x38(%rbx), %eax
xorl %ebp, %ebp
cmpl $0x1b, %eax
je 0x48ca6
testl %eax, %eax
jne 0x48c92
movl $0x1b, 0x38(%rbx)
callq 0x4a7f
jmp 0x48ca6
addq %rsi, 0x30(%rbx)
movq %rax, 0x8(%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_TFileStreamOutput_open
hpatch_BOOL hpatch_TFileStreamOutput_open(hpatch_TFileStreamOutput* self,const char* fileName_utf8,
                                          hpatch_StreamPos_t max_file_length){
    assert(self->m_file==0);
    self->fileError=hpatch_FALSE;
    if (self->m_file) _ferr_returnv(EINVAL);
    if (!_import_fileOpenCreateOrReWrite(fileName_utf8,&self->m_file))
        _ferr_return();
    
    self->base.streamImport=self;
    self->base.streamSize=max_file_length;
    self->base.read_writed=_hpatch_TFileStreamOutput_read_file;
    self->base.write=_TFileStreamOutput_write_file;
    self->m_fpos=0;
    self->m_offset=0;
    self->is_in_readModel=hpatch_FALSE;
    self->is_random_out=hpatch_FALSE;
    self->out_length=0;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x20(%rdi)
jne 0x48df1
movq %rdx, %r14
movq %rdi, %rbx
movl $0x0, 0x38(%rdi)
leaq 0x19722(%rip), %rax     # 0x62473
movq %rsi, %rdi
movq %rax, %rsi
callq 0x4340
testq %rax, %rax
je 0x48d9b
movq %rax, 0x20(%rbx)
movq %rbx, (%rbx)
movq %r14, 0x8(%rbx)
leaq 0x9d(%rip), %rax        # 0x48e10
movq %rax, 0x10(%rbx)
leaq 0x14d(%rip), %rax       # 0x48ecb
movq %rax, 0x18(%rbx)
xorl %eax, %eax
movq %rax, 0x3c(%rbx)
movq %rax, 0x48(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movl $0x1, %r14d
jmp 0x48db6
callq 0x4050
movl (%rax), %ebp
movl 0x38(%rbx), %eax
cmpl %ebp, %eax
sete %cl
testl %ebp, %ebp
sete %dl
xorl %r14d, %r14d
orb %cl, %dl
je 0x48dbe
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
testl %eax, %eax
jne 0x48dc5
movl %ebp, 0x38(%rbx)
movq 0x331fc(%rip), %rax     # 0x7bfc8
movq (%rax), %rbx
movl %ebp, %edi
callq 0x40d0
leaq 0x10519(%rip), %rsi     # 0x592f6
xorl %r14d, %r14d
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4450
jmp 0x48db6
leaq 0x1943c(%rip), %rdi     # 0x62234
leaq 0x1939d(%rip), %rsi     # 0x6219c
leaq 0x19490(%rip), %rcx     # 0x62296
movl $0x291, %edx            # imm = 0x291
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_TFileStreamOutput_read_file
static hpatch_BOOL _hpatch_TFileStreamOutput_read_file(const hpatch_TStreamOutput* stream,
                                                           hpatch_StreamPos_t readFromPos,
                                                           TByte* out_data,TByte* out_data_end){
         //hpatch_TFileStreamOutput is A hpatch_TFileStreamInput !
        hpatch_TFileStreamOutput* self=(hpatch_TFileStreamOutput*)stream->streamImport;
        const hpatch_TStreamInput* in_stream=(const hpatch_TStreamInput*)stream;
        if (!self->is_in_readModel){
            if (!hpatch_TFileStreamOutput_flush(self)) _rw_ferr_return();
            self->is_in_readModel=hpatch_TRUE;
            self->m_fpos=hpatch_kNullStreamPos;
        }
        return _TFileStreamInput_read_file(in_stream,readFromPos,out_data,out_data_end);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq (%rdi), %rbx
cmpl $0x0, 0x40(%rbx)
jne 0x48e4b
movq %rbx, %rdi
callq 0x492c7
testl %eax, %eax
je 0x48e6a
movl $0x1, 0x40(%rbx)
movq $-0x1, 0x28(%rbx)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x48b06
movq $-0x1, 0x28(%rbx)
callq 0x4050
movl (%rax), %ebp
movl 0x38(%rbx), %eax
cmpl %ebp, %eax
sete %cl
testl %ebp, %ebp
sete %dl
orb %cl, %dl
je 0x48e9b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x48ea2
movl %ebp, 0x38(%rbx)
movq 0x3311f(%rip), %rax     # 0x7bfc8
movq (%rax), %rbx
movl %ebp, %edi
callq 0x40d0
leaq 0x1043c(%rip), %rsi     # 0x592f6
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4450
jmp 0x48e8a
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_TFileStreamOutput_reopen
hpatch_BOOL hpatch_TFileStreamOutput_reopen(hpatch_TFileStreamOutput* self,const char* fileName_utf8,
                                            hpatch_StreamPos_t max_file_length){
    hpatch_StreamPos_t curFileWritePos=0;
    assert(self->m_file==0);
    self->fileError=hpatch_FALSE;
    if (self->m_file) _ferr_returnv(EINVAL);
    if (!_import_fileReopenWrite(fileName_utf8,&self->m_file,&curFileWritePos))
       _ferr_return();
    if (curFileWritePos>max_file_length){
        //note: now not support reset file length to max_file_length
        _import_fileClose(&self->m_file);
        _ferr_returnv(EFBIG);
    }
    self->base.streamImport=self;
    self->base.streamSize=max_file_length;
    self->base.read_writed=_hpatch_TFileStreamOutput_read_file;
    self->base.write=_TFileStreamOutput_write_file;
    self->m_fpos=curFileWritePos;
    self->m_offset=0;
    self->is_in_readModel=hpatch_FALSE;
    self->is_random_out=hpatch_FALSE;
    self->out_length=curFileWritePos;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x0, 0x20(%rdi)
jne 0x49238
movq %rdx, %r14
movq %rdi, %rbx
movl $0x0, 0x38(%rdi)
leaq 0x10(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x1941b(%rip), %rax     # 0x62512
movq %rsi, %rdi
movq %rax, %rsi
callq 0x493b4
movb $0x1, %bpl
testq %rax, %rax
je 0x4914b
movq %rax, %r12
movq 0x10(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4540
testl %eax, %eax
je 0x49150
movq %r14, 0x8(%rsp)
callq 0x4050
movq %rax, %r13
movl (%rax), %r14d
movq %r12, %rdi
callq 0x42e0
testl %r14d, %r14d
je 0x49144
movl %r14d, (%r13)
movq 0x8(%rsp), %r14
jmp 0x49156
xorl %r15d, %r15d
jmp 0x49156
movq %r12, 0x20(%rbx)
xorl %ebp, %ebp
testb %bpl, %bpl
je 0x491b1
callq 0x4050
movl (%rax), %r14d
movl 0x38(%rbx), %eax
cmpl %r14d, %eax
sete %cl
testl %r14d, %r14d
sete %dl
xorl %ebp, %ebp
orb %cl, %dl
jne 0x49227
testl %eax, %eax
jne 0x49184
movl %r14d, 0x38(%rbx)
movq 0x32e3d(%rip), %rax     # 0x7bfc8
movq (%rax), %rbx
movl %r14d, %edi
callq 0x40d0
leaq 0x10159(%rip), %rsi     # 0x592f6
xorl %ebp, %ebp
movq %rbx, %rdi
movl %r14d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4450
jmp 0x49227
cmpq %r14, %r15
jbe 0x491f3
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x491cc
movq $0x0, 0x20(%rbx)
callq 0x42e0
callq 0x4050
movl $0x1b, (%rax)
movl 0x38(%rbx), %eax
xorl %ebp, %ebp
cmpl $0x1b, %eax
je 0x49227
testl %eax, %eax
jne 0x491ec
movl $0x1b, 0x38(%rbx)
callq 0x4b18
jmp 0x49227
movq %rbx, (%rbx)
movq %r14, 0x8(%rbx)
leaq -0x3f1(%rip), %rax      # 0x48e10
movq %rax, 0x10(%rbx)
leaq -0x341(%rip), %rax      # 0x48ecb
movq %rax, 0x18(%rbx)
movq %r15, 0x28(%rbx)
xorl %eax, %eax
movq %rax, 0x30(%rbx)
movq %rax, 0x3c(%rbx)
movq %r15, 0x48(%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18ff5(%rip), %rdi     # 0x62234
leaq 0x18f56(%rip), %rsi     # 0x6219c
leaq 0x190b1(%rip), %rcx     # 0x622fe
movl $0x2a5, %edx            # imm = 0x2A5
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: import_fileOpenWithSize
static hpatch_FileHandle _import_fileOpenWithSize(const char* fileName_utf8,_FileModeType mode,hpatch_StreamPos_t* out_fileSize){
    hpatch_FileHandle file=0;
    file=_import_fileOpen(fileName_utf8,mode);
    if ((out_fileSize==0)||(file==0)) return file;
    
    if (_import_fileSeek64(file,0,SEEK_END)){
        if (_import_fileTell64(file,out_fileSize)){
            if (_import_fileSeek64(file,0,SEEK_SET)){
                return file;
            }
        }
    }

    //error clear
    _import_fileClose(&file);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
callq 0x4340
movq %rax, %rbx
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x493f0
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x4540
testl %eax, %eax
je 0x493fb
movq %rbx, %rdi
callq 0x42e0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x44b0
movq %rax, (%r14)
testq %rax, %rax
js 0x493e6
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4540
testl %eax, %eax
jne 0x493e6
jmp 0x493f0
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libParallel/parallel_import.cpp
// Function: thread_parallel(int, void (*)(int, void*), void*, int, int)
void thread_parallel(int threadCount,TThreadRunCallBackProc threadProc,void* workData,
                     int isUseThisThread,int threadIndexOffset){
    for (int i=0; i<threadCount; ++i) {
        if ((i==threadCount-1)&&(isUseThisThread)){
            threadProc(i+threadIndexOffset,workData);
        }else{
            _TThreadProc tp={threadProc,i+threadIndexOffset,workData};
            std::thread t(tp);
            t.detach();
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testl %edi, %edi
jle 0x49524
movl %r8d, %ebx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r12d
leaq 0x8(%rsp), %r13
testl %ebp, %ebp
sete %al
cmpl $0x1, %r12d
setne %cl
orb %al, %cl
jne 0x494f2
movl %ebx, %edi
movq %r14, %rsi
callq *%r15
jmp 0x4951d
movq %r15, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0x49548
movq %r13, %rdi
callq 0x45d0
cmpq $0x0, 0x8(%rsp)
jne 0x49543
incl %ebx
decl %r12d
jne 0x494d8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x8(%rsp)
jne 0x49543
movq %rax, %rdi
callq 0x45e0
callq 0x40b0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libParallel/parallel_channel.cpp
// Function: CChannel_import::~_CChannel_import()
~_CChannel_import(){
        close();
        while (true) { //wait all thread exit
            {
                CAutoLocker locker(_locker);
                if (_waitingCount==0) break;
            }
            this_thread_yield(); //todo:优化?
        }
        locker_delete(_locker);
        assert(_dataList.empty()); // why? if saved resource then leaks
        condvar_delete(_acceptCond);
        condvar_delete(_sendCond);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0x49808
leaq 0x8(%rsp), %r14
leaq 0x18(%rsp), %r15
movq (%rbx), %rax
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
testq %rax, %rax
je 0x49778
movq %rax, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movq %r15, %rdi
callq 0x2099a
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x8(%rsp)
movb 0x10(%rsp), %al
movb %al, 0x20(%rsp)
movb $0x1, 0x10(%rsp)
movq %r15, %rdi
callq 0x20984
movq 0x70(%rbx), %r12
movq %r14, %rdi
callq 0x20984
testq %r12, %r12
je 0x49790
callq 0x494ae
jmp 0x49727
movq (%rbx), %rdi
callq 0x4943f
movq 0x48(%rbx), %rax
cmpq 0x28(%rbx), %rax
jne 0x497cc
movq 0x10(%rbx), %rdi
callq 0x49482
movq 0x8(%rbx), %rdi
callq 0x49482
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x49e22
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x18d87(%rip), %rdi     # 0x6255a
leaq 0x18d92(%rip), %rsi     # 0x6256c
leaq 0x18db7(%rip), %rcx     # 0x62598
movl $0x34, %edx
callq 0x4200
jmp 0x497fc
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20984
jmp 0x497ff
movq %rax, %rbx
movq %rbx, %rdi
callq 0x9db0
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libParallel/parallel_channel.cpp
// Function: CChannel_import::close()
void close(){
        if (_isClosed) return;
        {
            CAutoLocker locker(_locker);
            if (_isClosed) return;
            _isClosed=true;
            condvar_broadcast(_sendCond);
            condvar_broadcast(_acceptCond);
        }
    }

// Assembly:
pushq %rbx
subq $0x20, %rsp
cmpb $0x0, 0x78(%rdi)
jne 0x49884
movq %rdi, %rbx
movq (%rdi), %rax
movq $0x0, (%rsp)
movb $0x0, 0x8(%rsp)
testq %rax, %rax
je 0x49860
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, 0x78(%rbx)
jne 0x4987c
movb $0x1, 0x78(%rbx)
movq 0x8(%rbx), %rdi
callq 0x494a9
movq 0x10(%rbx), %rdi
callq 0x494a9
movq %rsp, %rdi
callq 0x20984
addq $0x20, %rsp
popq %rbx
retq
jmp 0x4988c
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20984
movq %rbx, %rdi
callq 0x45e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libParallel/parallel_channel.cpp
// Function: CChannel_import::is_can_fast_send(bool)
bool is_can_fast_send(bool isWait){
        if (_maxDataCount<0) return true;
        if (_maxDataCount==0) return false;

        CAutoLocker locker(_locker);
        while (true) {
            if (_isClosed) return false;
            if (_dataList.size()<(size_t)_maxDataCount) {
                return true;
            }else if(!isWait){
                return false;
            }//else wait
            ++_waitingCount;
            condvar_wait(_sendCond,&locker);
            --_waitingCount;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq 0x68(%rdi), %rax
testq %rax, %rax
js 0x4998e
je 0x49993
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
testq %rax, %rax
je 0x4990f
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
callq 0x2099a
leaq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rdi)
movq %rax, 0x8(%rsp)
movb 0x10(%rsp), %al
movb %al, 0x8(%rdi)
movb $0x1, 0x10(%rsp)
callq 0x20984
cmpb $0x0, 0x78(%r14)
jne 0x49980
xorb $0x1, %bl
leaq 0x8(%rsp), %r15
movq 0x60(%r14), %rax
movq %rax, %rcx
subq 0x40(%r14), %rcx
shrq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
shlq $0x6, %rcx
movq 0x38(%r14), %rax
movq 0x48(%r14), %rdx
subq 0x50(%r14), %rdx
sarq $0x3, %rdx
subq 0x28(%r14), %rax
sarq $0x3, %rax
addq %rdx, %rax
addq %rcx, %rax
cmpq 0x68(%r14), %rax
setb %bpl
movl %ebp, %eax
orb %bl, %al
jne 0x49982
incq 0x70(%r14)
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x4949f
decq 0x70(%r14)
cmpb $0x0, 0x78(%r14)
je 0x4991e
xorl %ebp, %ebp
leaq 0x8(%rsp), %rdi
callq 0x20984
jmp 0x49995
movb $0x1, %bpl
jmp 0x49995
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x499a4
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20984
movq %rbx, %rdi
callq 0x45e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libParallel/parallel_channel.cpp
// Function: CChannel_import::accept(bool)
TChanData accept(bool isWait){
        CAutoLocker locker(_locker);
        while (true) {
            if (!_dataList.empty()) {
                TChanData result=_dataList.front();
                _dataList.pop_front();
                if (!_isClosed)
                    condvar_signal(_sendCond);
                return result; //ok
            }else if(_isClosed){
                return 0;
            }else if(!isWait){
                return 0;
            }//else wait
            ++_waitingCount;
            condvar_wait(_acceptCond,&locker);
            --_waitingCount;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
testq %rax, %rax
je 0x49c24
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
callq 0x2099a
leaq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rdi)
movq %rax, 0x8(%rsp)
movb 0x10(%rsp), %al
movb %al, 0x8(%rdi)
movb $0x1, 0x10(%rsp)
callq 0x20984
movq 0x28(%rbx), %rax
cmpq %rax, 0x48(%rbx)
jne 0x49c60
xorb $0x1, %bpl
xorl %r14d, %r14d
leaq 0x8(%rsp), %r15
movb 0x78(%rbx), %al
orb %bpl, %al
jne 0x49c7b
incq 0x70(%rbx)
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x4949f
decq 0x70(%rbx)
movq 0x28(%rbx), %rax
cmpq %rax, 0x48(%rbx)
je 0x49c3a
leaq 0x18(%rbx), %rdi
movq (%rax), %r14
callq 0x4a086
cmpb $0x0, 0x78(%rbx)
jne 0x49c7b
movq 0x8(%rbx), %rdi
callq 0x494a4
leaq 0x8(%rsp), %rdi
callq 0x20984
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x49c97
jmp 0x49c97
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20984
movq %rbx, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/zlib1.3.1/adler32.c
// Function: adler32_combine_
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) {
    unsigned long sum1;
    unsigned long sum2;
    unsigned rem;

    /* for negative len, return invalid adler32 as a clue for debugging */
    if (len2 < 0)
        return 0xffffffffUL;

    /* the derivation of this formula is left as an exercise for the reader */
    MOD63(len2);                /* assumes len2 >= 0 */
    rem = (unsigned)len2;
    sum1 = adler1 & 0xffff;
    sum2 = rem * sum1;
    MOD(sum2);
    sum1 += (adler2 & 0xffff) + BASE - 1;
    sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
    if (sum1 >= BASE) sum1 -= BASE;
    if (sum1 >= BASE) sum1 -= BASE;
    if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1);
    if (sum2 >= BASE) sum2 -= BASE;
    return sum1 | (sum2 << 16);
}

// Assembly:
testq %rdx, %rdx
js 0x4a4de
movq %rdx, %rcx
movabsq $0xf00e10d2fc5cd, %rdx  # imm = 0xF00E10D2FC5CD
movq %rcx, %rax
mulq %rdx
movq %rcx, %rax
subq %rdx, %rax
shrq %rax
addq %rdx, %rax
shrq $0xf, %rax
imulq $0xfff1, %rax, %rax     # imm = 0xFFF1
subq %rax, %rcx
movl $0xffff, %r9d           # imm = 0xFFFF
movq %rdi, %r10
andq %r9, %r10
movq %rcx, %r8
imulq %r10, %r8
movabsq $0x1000f00e10d30, %rdx  # imm = 0x1000F00E10D30
movq %r8, %rax
mulq %rdx
imulq $0xfff1, %rdx, %rax     # imm = 0xFFF1
subq %rax, %r8
andq %rsi, %r9
leaq (%r10,%r9), %rax
addl $0xfff0, %eax           # imm = 0xFFF0
shrl $0x10, %edi
shrl $0x10, %esi
addq %rdi, %rsi
subq %rcx, %rsi
addq %r8, %rsi
movl $0xfff1, %ecx           # imm = 0xFFF1
leaq (%rsi,%rcx), %rdx
cmpl $0xfff1, %eax           # imm = 0xFFF1
leaq -0x1(%r10,%r9), %rax
movl $0xfff0, %edi           # imm = 0xFFF0
cmovaeq %rax, %rdi
movq $-0xfff1, %rax          # imm = 0xFFFF000F
leaq (%rdi,%rax), %r8
cmpq %rcx, %rdi
cmovbq %rdi, %r8
addq %rax, %rsi
cmpq $0x1ffe2, %rdx          # imm = 0x1FFE2
cmovbq %rdx, %rsi
movq %rsi, %rdx
shlq $0x10, %rdx
movabsq $-0xfff10000, %rax      # imm = 0xFFFFFFFF000F0000
addq %rdx, %rax
cmpq %rcx, %rsi
cmovbq %rdx, %rax
orq %r8, %rax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/zlib1.3.1/compress.c
// Function: compress2
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
                      uLong sourceLen, int level) {
    z_stream stream;
    int err;
    const uInt max = (uInt)-1;
    uLong left;

    left = *destLen;
    *destLen = 0;

    stream.zalloc = (alloc_func)0;
    stream.zfree = (free_func)0;
    stream.opaque = (voidpf)0;

    err = deflateInit(&stream, level);
    if (err != Z_OK) return err;

    stream.next_out = dest;
    stream.avail_out = 0;
    stream.next_in = (z_const Bytef *)source;
    stream.avail_in = 0;

    do {
        if (stream.avail_out == 0) {
            stream.avail_out = left > (uLong)max ? max : (uInt)left;
            left -= stream.avail_out;
        }
        if (stream.avail_in == 0) {
            stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
            sourceLen -= stream.avail_in;
        }
        err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
    } while (err == Z_OK);

    *destLen = stream.total_out;
    deflateEnd(&stream);
    return err == Z_STREAM_END ? Z_OK : err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r13
movq (%rsi), %r12
xorl %ebp, %ebp
movq %rbp, (%rsi)
leaq 0x8(%rsp), %rdi
movq %rbp, 0x50(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
leaq 0xed6e(%rip), %rdx      # 0x59293
movl %r8d, %esi
movl $0x70, %ecx
callq 0x4aaf8
testl %eax, %eax
jne 0x4a5be
movq %r15, %rax
leaq 0x8(%rsp), %r15
movq %r13, 0x18(%r15)
movl %ebp, 0x20(%r15)
movq %rax, (%r15)
movl %ebp, 0x8(%r15)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $0x0, 0x28(%rsp)
jne 0x4a571
cmpq %r13, %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovbq %r12, %rax
movl %eax, 0x28(%rsp)
subq %rax, %r12
cmpl $0x0, 0x10(%rsp)
jne 0x4a58b
cmpq %r13, %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovbq %r14, %rax
movl %eax, 0x10(%rsp)
subq %rax, %r14
xorl %esi, %esi
testq %r14, %r14
sete %sil
shll $0x2, %esi
movq %r15, %rdi
callq 0x4b75d
testl %eax, %eax
je 0x4a557
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
movq 0x28(%rdi), %rax
movq %rax, (%rbx)
callq 0x4adf5
xorl %eax, %eax
cmpl $0x1, %ebp
cmovnel %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/zlib1.3.1/crc32.c
// Function: crc32_combine64
uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) {
#ifdef DYNAMIC_CRC_TABLE
    once(&made, make_crc_table);
#endif /* DYNAMIC_CRC_TABLE */
    return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x4aa27
xorl %ecx, %ecx
movl $0x80000000, %edx       # imm = 0x80000000
testl %eax, %edx
je 0x4a9fd
xorl %r14d, %ecx
leal -0x1(%rdx), %esi
testl %eax, %esi
je 0x4aa18
shrl %edx
movl %r14d, %esi
shrl %esi
movl %esi, %edi
xorl $0xedb88320, %edi       # imm = 0xEDB88320
testb $0x1, %r14b
cmovel %esi, %edi
movl %edi, %r14d
jmp 0x4a9ef
movl %ecx, %ecx
movl %ebx, %eax
xorq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq