LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_compressed_diff(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TDecompress*)
bool check_compressed_diff(const hpatch_TStreamInput*  newData,
                           const hpatch_TStreamInput*  oldData,
                           const hpatch_TStreamInput*  compressed_diff,
                           hpatch_TDecompress* decompressPlugin){
    const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
    TAutoMem _cache(kACacheBufSize*(1+6));
    _TCheckOutNewDataStream out_newData(newData,_cache.data(),kACacheBufSize);
    _test_rt(patch_decompress_with_cache(&out_newData,oldData,compressed_diff,decompressPlugin,
                                         _cache.data()+kACacheBufSize,_cache.data_end()));
    _test_rt(out_newData.isWriteFinish());
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movl $0x380000, %edi         # imm = 0x380000
callq 0x4400
testq %rax, %rax
je 0xfd30
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movl $0x80000, %ecx          # imm = 0x80000
movq %r13, %rsi
movq %rax, %rdx
callq 0x2605e
leaq 0x380000(%rbx), %r9
movq %rbx, %r8
addq $0x80000, %r8           # imm = 0x80000
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x4606c
testl %eax, %eax
je 0xfd20
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movb $0x1, %bpl
cmpq 0x8(%rax), %rcx
jne 0xfd27
movq %rbx, %rdi
callq 0x43b0
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4770
jmp 0xfd2c
callq 0x474e
xorl %ebp, %ebp
jmp 0xfd07
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x4c5cb(%rip), %rsi     # 0x5c30f
movq %rax, %rdi
callq 0x4110
movq 0x6c295(%rip), %rsi     # 0x7bfe8
movq 0x6c25e(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
movq %rax, %r14
movq %rbx, %rdi
callq 0x4260
jmp 0xfd7a
movq %rax, %r14
movq %rbx, %rdi
callq 0x43b0
movq %r14, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_single_compressed_diff(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TDecompress*)
bool check_single_compressed_diff(const hpatch_TStreamInput* newData,
                                  const hpatch_TStreamInput* oldData,
                                  const hpatch_TStreamInput* diff,
                                  hpatch_TDecompress* decompressPlugin){
    sspatch_listener_t listener={0};
    listener.import=decompressPlugin;
    listener.onDiffInfo=_check_single_onDiffInfo;
    listener.onPatchFinish=_check_single_onPatchFinish;
        
    const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
    TAutoMem _cache(kACacheBufSize*1);
    _TCheckOutNewDataStream out_newData(newData,_cache.data(),kACacheBufSize);

    _test_rt(patch_single_stream(&listener,&out_newData,oldData,diff,0,0));
    _test_rt(out_newData.isWriteFinish());
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq %rcx, (%rsp)
leaq 0x11f(%rip), %rax       # 0xff40
movq %rax, 0x8(%rsp)
leaq 0x172(%rip), %rax       # 0xff9f
movq %rax, 0x10(%rsp)
movl $0x80000, %edi          # imm = 0x80000
callq 0x4400
testq %rax, %rax
je 0xfeb0
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
movl $0x80000, %ecx          # imm = 0x80000
movq %r12, %rsi
movq %rax, %rdx
callq 0x2605e
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x476c8
testl %eax, %eax
je 0xfea0
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movb $0x1, %bpl
cmpq 0x8(%rax), %rcx
jne 0xfea7
movq %rbx, %rdi
callq 0x43b0
movl %ebp, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x47b6
jmp 0xfeac
callq 0x4794
xorl %ebp, %ebp
jmp 0xfe89
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x4c44b(%rip), %rsi     # 0x5c30f
movq %rax, %rdi
callq 0x4110
movq 0x6c115(%rip), %rsi     # 0x7bfe8
movq 0x6c0de(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
movq %rax, %r14
movq %rbx, %rdi
callq 0x4260
jmp 0xfefa
movq %rax, %r14
movq %rbx, %rdi
callq 0x43b0
movq %r14, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_single_onDiffInfo(sspatch_listener_t*, hpatch_singleCompressedDiffInfo const*, hpatch_TDecompress**, unsigned char**, unsigned char**)
static hpatch_BOOL _check_single_onDiffInfo(struct sspatch_listener_t* listener,
                                                const hpatch_singleCompressedDiffInfo* info,
                                                hpatch_TDecompress** out_decompressPlugin,
                                                unsigned char** out_temp_cache,
                                                unsigned char** out_temp_cacheEnd){
        size_t memSize=(size_t)(info->stepMemSize+hdiff_kFileIOBufBestSize*3);
        *out_temp_cache=(unsigned char*)malloc(memSize);
        *out_temp_cacheEnd=(*out_temp_cache)+memSize;   
        *out_decompressPlugin=(info->compressType[0]=='\0')?0:(hpatch_TDecompress*)listener->import;
        return hpatch_TRUE;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movq 0x30(%rsi), %rbp
leaq 0x180000(%rbp), %rdi
callq 0x4400
movq %rax, (%r12)
addq %rbp, %rax
addq $0x180000, %rax         # imm = 0x180000
movq %rax, (%r15)
cmpb $0x0, 0x38(%r13)
je 0xff86
movq (%r14), %rax
jmp 0xff88
xorl %eax, %eax
movq %rax, (%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: _hdiff_private__create_compressed_diff(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char>>&, hdiff_TCompress const*, int, hdiff_private::TSuffixString const*)
void __hdiff_private__create_compressed_diff(const TByte* newData,const TByte* newData_end,
                                             const TByte* oldData,const TByte* oldData_end,
                                             std::vector<TByte>& out_diff,
                                             const hdiff_TCompress* compressPlugin,int kMinSingleMatchScore,
                                             const TSuffixString* sstring){
    TDiffData diff;
    std::vector<TOldCover> covers;
    get_diff(newData,newData_end,oldData,oldData_end,diff,covers,
             kMinSingleMatchScore,false,0,sstring,1);
    serialize_compressed_diff(diff,covers,out_diff,compressPlugin);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, %r14
movl 0x50(%rsp), %eax
movq 0x58(%rsp), %r10
xorl %r11d, %r11d
movq %rsp, %r9
movq %r11, 0x10(%r9)
xorps %xmm0, %xmm0
movaps %xmm0, (%r9)
leaq 0x18(%rsp), %r8
pushq $0x1
pushq $0x1
pushq %r10
pushq %r11
pushq $0x0
pushq %rax
callq 0xdb51
addq $0x30, %rsp
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xe891
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x10016
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x10037
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: get_match_covers_by_block(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, hpatch_TOutputCovers*, unsigned long, unsigned long)
void get_match_covers_by_block(const unsigned char* newData,const unsigned char* newData_end,
                               const unsigned char* oldData,const unsigned char* oldData_end,
                               hpatch_TOutputCovers* out_covers,size_t kMatchBlockSize,size_t threadNum){
    hdiff_TStreamInput oldData_stream;
    mem_as_hStreamInput(&oldData_stream,oldData,oldData_end);
    hdiff_TStreamInput newData_stream;
    mem_as_hStreamInput(&newData_stream,newData,newData_end);
    hdiff_TMTSets_s mtsets={threadNum,threadNum,true,true,false};
    get_match_covers_by_block(&newData_stream,&oldData_stream,out_covers,kMatchBlockSize,&mtsets);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x90(%rsp), %r13
movq %rsp, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x4392d
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4392d
leaq 0x20(%rsp), %r8
movq %r13, (%r8)
movq %r13, 0x8(%r8)
movw $0x101, 0x10(%r8)       # imm = 0x101
movb $0x0, 0x12(%r8)
movq %rbp, %rdi
movq %rsp, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xfa32
addq $0x58, %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/HDiff/diff.cpp
// Function: get_match_covers_by_sstring(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, std::vector<hpatch_TCover_sz, std::allocator<hpatch_TCover_sz>>&, int, bool, ICoverLinesListener*, unsigned long, bool)
void get_match_covers_by_sstring(const unsigned char* newData,const unsigned char* newData_end,
                                 const unsigned char* oldData,const unsigned char* oldData_end,
                                 std::vector<hpatch_TCover_sz>& out_covers,int kMinSingleMatchScore,
                                 bool isUseBigCacheMatch,ICoverLinesListener* listener,
                                 size_t threadNum,bool isCanExtendCover){
    TDiffData diff;
    std::vector<TOldCover> covers;
    assert(sizeof(TOldCover)==sizeof(hpatch_TCover_sz));
    { std::vector<hpatch_TCover_sz> tmp; tmp.swap(out_covers); }
    get_diff(newData,newData_end,oldData,oldData_end,diff,covers,
             kMinSingleMatchScore,isUseBigCacheMatch,listener,0,threadNum,isCanExtendCover);
    void* pcovers=&covers;
    out_covers.swap(*(std::vector<hpatch_TCover_sz>*)pcovers);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %r14d
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movb 0x88(%rsp), %cl
movq 0x78(%rsp), %r11
movb 0x70(%rsp), %dl
xorl %eax, %eax
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq (%r8), %rdi
movq 0x10(%r8), %rsi
movups %xmm0, (%r8)
movq %rax, 0x10(%r8)
testq %rdi, %rdi
je 0x10124
subq %rdi, %rsi
callq 0x4300
movb 0x70(%rsp), %dl
movb 0x88(%rsp), %cl
movq 0x78(%rsp), %r11
movzbl %cl, %eax
movzbl %dl, %r10d
leaq 0x18(%rsp), %r8
movq %rsp, %r9
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
pushq %rax
pushq 0x88(%rsp)
pushq $0x0
pushq %r11
pushq %r10
pushq %r14
callq 0xdb51
addq $0x30, %rsp
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rsi
movq (%rsp), %rcx
movq %rcx, (%rbx)
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rbx)
movq 0x10(%rsp), %rcx
movq %rcx, 0x10(%rbx)
movq %rdi, (%rsp)
movq %rax, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
testq %rdi, %rdi
je 0x10197
subq %rdi, %rsi
callq 0x4300
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x101bf
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: get_match_covers_by_sstring(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, hpatch_TOutputCovers*, int, bool, ICoverLinesListener*, unsigned long, bool)
void get_match_covers_by_sstring(const unsigned char* newData,const unsigned char* newData_end,
                                 const unsigned char* oldData,const unsigned char* oldData_end,
                                 hpatch_TOutputCovers* out_covers,int kMinSingleMatchScore,
                                 bool isUseBigCacheMatch,ICoverLinesListener* listener,
                                 size_t threadNum,bool isCanExtendCover){
    std::vector<hpatch_TCover_sz> covers;
    get_match_covers_by_sstring(newData,newData_end,oldData,oldData_end,covers,
                                kMinSingleMatchScore,isUseBigCacheMatch,listener,threadNum,isCanExtendCover);
    const hpatch_TCover_sz* pcovers=covers.data();
    for (size_t i=0;i<covers.size();++i,++pcovers){
        if (sizeof(*pcovers)==sizeof(hpatch_TCover)){
            out_covers->push_cover(out_covers,(const hpatch_TCover*)pcovers);
        }else{
            hpatch_TCover cover; 
            cover.oldPos=pcovers->oldPos;
            cover.newPos=pcovers->newPos;
            cover.length=pcovers->length;
            out_covers->push_cover(out_covers,&cover);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbx
movb 0x60(%rsp), %al
movups 0x68(%rsp), %xmm0
movb 0x78(%rsp), %r10b
xorps %xmm1, %xmm1
leaq 0x20(%rsp), %r8
movaps %xmm1, (%r8)
movq $0x0, 0x10(%r8)
movzbl %r10b, %r10d
movl %r10d, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
movzbl %al, %eax
movl %eax, (%rsp)
callq 0x100ba
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %rax
subq %r14, %rax
je 0x1024d
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r12
cmpq $0x1, %r12
adcq $0x0, %r12
movq %r14, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq *(%rbx)
addq $0x18, %r15
decq %r12
jne 0x1023c
testq %r14, %r14
je 0x1026d
movq 0x30(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4300
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x1027b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x10295
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: void (anonymous namespace)::_outType<hdiff_TCompress const>(std::vector<unsigned char, std::allocator<unsigned char>>&, hdiff_TCompress const*, char const*)
static void _outType(std::vector<TByte>& out_data,T* compressPlugin,const char* versionType=kHDiffVersionType){
        //type version
        pushCStr(out_data,versionType);
        pushCStr(out_data,"&");
        {//compressType
            const char* compressType="";
            if (compressPlugin)
                compressType=compressPlugin->compressType();
            size_t compressTypeLen=strlen(compressType);
            check(compressTypeLen<=hpatch_kMaxPluginTypeLength);
            check(0==strchr(compressType,'&'));
            pushCStr(out_data,compressType);
        }
        const TByte _cstrEndTag='\0';//c string end tag
        pushBack(out_data,&_cstrEndTag,(&_cstrEndTag)+1);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x4140
leaq (%rax,%r15), %rcx
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xa064
movq 0x8(%rbx), %rsi
leaq 0x49761(%rip), %rdx     # 0x5a3fe
leaq 0x4975b(%rip), %rcx     # 0x5a3ff
movq %rbx, %rdi
callq 0xa064
testq %r14, %r14
je 0x10cb9
callq *(%r14)
movq %rax, %r14
jmp 0x10cc0
leaq 0x49fb9(%rip), %r14     # 0x5ac79
movq %r14, %rdi
callq 0x4140
cmpq $0x104, %rax            # imm = 0x104
jae 0x10d1e
movq %rax, %r15
movq %r14, %rdi
movl $0x26, %esi
callq 0x4100
testq %rax, %rax
jne 0x10d3c
addq %r14, %r15
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0xa064
leaq 0x10(%rsp), %rcx
movb $0x0, -0x1(%rcx)
movq 0x8(%rbx), %rsi
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0xa064
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x4b709(%rip), %rsi     # 0x5c43b
movq %rax, %rdi
callq 0x4110
jmp 0x10d58
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x4b725(%rip), %rsi     # 0x5c475
movq %rax, %rdi
callq 0x4110
movq 0x6b289(%rip), %rsi     # 0x7bfe8
movq 0x6b252(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
jmp 0x10d70
movq %rax, %r14
movq %rbx, %rdi
callq 0x4260
movq %r14, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_lite_diff_open(unsigned char const*, unsigned char const*, hpi_compressType*)
bool check_lite_diff_open(const hpi_byte* lite_diff,const hpi_byte* lite_diff_end,
                          hpi_compressType* out_compress_type){
    TPatchiListener listener;
    listener.diffData_cur=lite_diff;
    listener.diffData_end=lite_diff_end;
    hpi_pos_t saved_newSize;
    hpi_pos_t saved_uncompressSize;
    if (!_try_open_hpatchi_and_inplace(listener,out_compress_type,
                                       &saved_newSize,&saved_uncompressSize)) return false;
    return true;
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
xorl %ecx, %ecx
leaq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq %rcx, 0x90(%rax)
movq %rdi, 0x30(%rax)
movq %rsi, 0x38(%rax)
leaq 0x4(%rsp), %r8
movq %rsp, %rcx
movq %rax, %rdi
movq %rdx, %rsi
movq %r8, %rdx
callq 0x11a45
movl %eax, %ebx
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x11a13
movq 0x30(%rsp), %rdi
callq *0x10(%rdi)
movl %ebx, %eax
addq $0xa0, %rsp
popq %rbx
retq
jmp 0x11a3d
movq %rax, %rbx
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x11a35
movq 0x30(%rsp), %rdi
callq *0x10(%rdi)
movq %rbx, %rdi
callq 0x45e0
movq %rax, %rdi
callq 0x9db0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: try_open_hpatchi_and_inplace((anonymous namespace)::TPatchiListener&, hpi_compressType*, unsigned int*, unsigned int*)
static
bool _try_open_hpatchi_and_inplace(TPatchiListener& listener,hpi_compressType* out_compress_type,
                                   hpi_pos_t* out_newSize,hpi_pos_t* out_uncompressSize){
    listener.isInplacePatch=false;
    listener.extraSafeSize=0;
    const hpi_byte* diffData_cur_bck=listener.diffData_cur;
    if (hpatch_lite_open(&listener,listener._read_diff,out_compress_type,out_newSize,out_uncompressSize))
        return true;
    listener.diffData_cur=diffData_cur_bck;//reread diffData from 0 pos
    if (hpatchi_inplace_open(&listener,listener._read_diff,out_compress_type,out_newSize,out_uncompressSize,&listener.extraSafeSize)){
        listener.isInplacePatch=true;
        return true;
    }
    return false;
}

// 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, %rbx
movb $0x0, 0x88(%rdi)
movl $0x0, 0x8c(%rdi)
movq 0x30(%rdi), %r13
leaq 0x2b6(%rip), %rsi       # 0x11d2e
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0xcbd0
movb $0x1, %bpl
testl %eax, %eax
jne 0x11abf
leaq 0x8c(%rbx), %r9
movq %r13, 0x30(%rbx)
leaq 0x28f(%rip), %rsi       # 0x11d2e
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0xcfe4
testl %eax, %eax
je 0x11abd
movb $0x1, 0x88(%rbx)
jmp 0x11abf
xorl %ebp, %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_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: (anonymous namespace)::TPatchiListener::_read_diff_dec(void*, unsigned char*, unsigned int*)
static hpi_BOOL _read_diff_dec(hpi_TInputStreamHandle inputStream,hpi_byte* out_data,hpi_size_t* data_size){
        TPatchiListener& self=*(TPatchiListener*)inputStream;
        hpi_size_t r_size=*data_size;
        if (r_size>self.uncompressSize){
            r_size=(hpi_size_t)self.uncompressSize;
            *data_size=(hpi_size_t)self.uncompressSize;
        }
        if (!self.decompressPlugin->decompress_part(self.decompresser,out_data,out_data+r_size))
            return hpi_FALSE;
        self.uncompressSize-=r_size;
        return hpi_TRUE;
    }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdx), %ebp
movl 0x60(%rdi), %eax
cmpl %eax, %ebp
jbe 0x11d07
movl %eax, (%rdx)
movl %eax, %ebp
movq 0x20(%rbx), %rdi
movq 0x28(%rbx), %rax
movl %ebp, %edx
addq %rsi, %rdx
callq *0x18(%rax)
testl %eax, %eax
je 0x11d25
subl %ebp, 0x60(%rbx)
movl $0x1, %eax
jmp 0x11d27
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: (anonymous namespace)::TPatchiListener::_read_diff(void*, unsigned char*, unsigned int*)
static hpi_BOOL _read_diff(hpi_TInputStreamHandle inputStream,hpi_byte* out_data,hpi_size_t* data_size){
        TPatchiListener& self=*(TPatchiListener*)inputStream;
        const hpi_byte* cur=self.diffData_cur;
        size_t d_size=self.diffData_end-cur;
        size_t r_size=*data_size;
        if (r_size>d_size){
            r_size=d_size;
            *data_size=(hpi_size_t)r_size;
        }
        memcpy(out_data,cur,r_size);
        self.diffData_cur=cur+r_size;
        return hpi_TRUE;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %r14
movq 0x38(%rdi), %rax
subq %r14, %rax
movl (%rdx), %r15d
cmpq %r15, %rax
jae 0x11d4e
movl %eax, (%rdx)
movq %rax, %r15
movq %rsi, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4290
addq %r15, %r14
movq %r14, 0x30(%rbx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: (anonymous namespace)::TPatchiListener::_write_new(hpatchi_listener_t*, unsigned char const*, unsigned int)
static hpi_BOOL _write_new(struct hpatchi_listener_t* listener,const hpi_byte* data,hpi_size_t data_size){
        TPatchiListener& self=*(TPatchiListener*)listener;
        if (data_size>(size_t)(self.newData_end-self.newData_cur)) 
            return hpi_FALSE;
        if (0!=memcmp(self.newData_cur,data,data_size))
            return hpi_FALSE;
        self.newData_cur+=data_size;
        self.newData_cur_pos+=data_size;
        return hpi_TRUE;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq 0x68(%rdi), %r15
movq 0x70(%rdi), %rax
subq %r15, %rax
xorl %ebp, %ebp
cmpq %r14, %rax
jb 0x11daf
movq %rdi, %rbx
movq %r15, %rdi
movq %r14, %rdx
callq 0x4310
testl %eax, %eax
jne 0x11daf
addq %r14, %r15
movq %r15, 0x68(%rbx)
addq %r14, 0x90(%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: (anonymous namespace)::TPatchiListener::_read_old(hpatchi_listener_t*, unsigned int, unsigned char*, unsigned int)
static hpi_BOOL _read_old(struct hpatchi_listener_t* listener,hpi_pos_t read_from_pos,hpi_byte* out_data,hpi_size_t data_size){
        TPatchiListener& self=*(TPatchiListener*)listener;
        size_t dsize=self.oldData_end-self.oldData;
        if ((read_from_pos>dsize)|(data_size>(size_t)(dsize-read_from_pos))) return hpi_FALSE;
        memcpy(out_data,self.oldData+(size_t)read_from_pos,data_size);
        if (self.isInplacePatch){
            if (read_from_pos<self.newData_cur_pos)
                return hpi_FALSE;
        }
        return hpi_TRUE;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %eax
movq %rdi, %rbx
movq 0x78(%rdi), %rsi
movq 0x80(%rdi), %rdi
subq %rsi, %rdi
movl %eax, %r14d
subq %r14, %rdi
setb %r8b
movl %ecx, %eax
cmpq %rax, %rdi
setb %cl
xorl %ebp, %ebp
orb %r8b, %cl
jne 0x11e11
addq %r14, %rsi
movq %rdx, %rdi
movq %rax, %rdx
callq 0x4290
cmpb $0x1, 0x88(%rbx)
jne 0x11e0c
cmpq %r14, 0x90(%rbx)
ja 0x11e11
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: hdiff_streamDataIsEqual
hpatch_BOOL hdiff_streamDataIsEqual(const hpatch_TStreamInput* x,const hpatch_TStreamInput* y){
    const hpatch_StreamPos_t ssize=x->streamSize;
    if (ssize!=y->streamSize) return hpatch_FALSE;
    const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
    hdiff_private::TAutoMem _cache(kACacheBufSize*2);
    hpatch_byte* bufx=_cache.data();
    hpatch_byte* bufy=bufx+kACacheBufSize;
    for (hpatch_StreamPos_t i=0; i<ssize; ){
        const hpatch_StreamPos_t maxdSize=ssize-i;
        size_t dataSize=(size_t)(kACacheBufSize<=maxdSize?kACacheBufSize:maxdSize);
        check(x->read(x,i,bufx,bufx+dataSize));
        check(y->read(y,i,bufy,bufy+dataSize));
        if (0!=memcmp(bufx,bufy,dataSize))
            return hpatch_FALSE;
        i+=dataSize;
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
xorl %ebp, %ebp
movq %rax, (%rsp)
cmpq 0x8(%rsi), %rax
jne 0x11ece
movq %rsi, %r14
movq %rdi, %r15
movl $0x100000, %edi         # imm = 0x100000
callq 0x4400
testq %rax, %rax
je 0x11f2f
movq %rax, %rbx
leaq 0x80000(%rax), %r12
xorl %ebp, %ebp
movq %rbp, %r13
movq (%rsp), %rbp
subq %r13, %rbp
jbe 0x11ebc
movl $0x80000, %eax          # imm = 0x80000
cmpq %rax, %rbp
jb 0x11e77
movl $0x80000, %ebp          # imm = 0x80000
leaq (%rbx,%rbp), %rcx
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq *0x10(%r15)
testl %eax, %eax
je 0x11efd
leaq (%r12,%rbp), %rcx
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq *0x10(%r14)
testl %eax, %eax
je 0x11edf
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x4310
testl %eax, %eax
je 0x11eb5
xorl %ebp, %ebp
addq %r13, %rbp
testl %eax, %eax
je 0x11e5c
xorl %ebp, %ebp
cmpq %r13, (%rsp)
setbe %bpl
movq %rbx, %rdi
callq 0x43b0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %r15
leaq 0x49d48(%rip), %rsi     # 0x5bc3b
movq %rax, %rdi
callq 0x4110
jmp 0x11f19
movl $0x10, %edi
callq 0x4190
movq %rax, %r15
leaq 0x49cfd(%rip), %rsi     # 0x5bc0e
movq %rax, %rdi
callq 0x4110
movq 0x6a0c8(%rip), %rsi     # 0x7bfe8
movq 0x6a091(%rip), %rdx     # 0x7bfb8
movq %r15, %rdi
callq 0x4590
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x4a3cc(%rip), %rsi     # 0x5c30f
movq %rax, %rdi
callq 0x4110
movq 0x6a096(%rip), %rsi     # 0x7bfe8
movq 0x6a05f(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
movq %rax, %r14
movq %rbx, %rdi
callq 0x4260
jmp 0x11f8a
jmp 0x11f70
movq %rax, %r14
movq %r15, %rdi
callq 0x4260
jmp 0x11f82
jmp 0x11f7f
movq %rax, %r14
movq %rbx, %rdi
callq 0x43b0
movq %r14, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: (anonymous namespace)::_fsearch_and_dispose_cover_thread(std::vector<(anonymous namespace)::TOldCover, std::allocator<(anonymous namespace)::TOldCover>>*, (anonymous namespace)::mt_data_t*)
static void _fsearch_and_dispose_cover_thread(std::vector<TOldCover>* _covers,mt_data_t* mt){
        std::vector<TOldCover>& covers=*_covers;
        const TDiffData& diff=*mt->diff;
        hdiff_TRange newRange;
        while (mt->nextBlock(&newRange)){
            TDiffData diff_part=diff;
            diff_part.newData=diff.newData+(size_t)newRange.beginPos;
            diff_part.newData_end=diff.newData+(size_t)newRange.endPos;
            size_t coverCountBack=covers.size();
            first_search_and_dispose_cover(covers,diff_part,*mt->sstring,mt->kMinSingleMatchScore,mt->isCanExtendCover);
            for (size_t i=coverCountBack;i<covers.size();++i)
                covers[i].newPos+=(TInt)newRange.beginPos;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r13
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
leaq 0x10(%rsp), %r15
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x124b8
movq %rsp, %rsi
callq *0x30(%rdi)
testl %eax, %eax
setne %sil
jmp 0x124fa
movq (%rbx), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
movl $0x1, %ecx
lock
xaddq %rcx, 0x30(%rbx)
movq 0x20(%rbx), %rdx
imulq %rdx, %rcx
cmpq %rax, %rcx
setb %sil
jae 0x124fa
movq %rcx, (%rsp)
addq %rdx, %rcx
addq $0x800, %rcx            # imm = 0x800
cmpq %rax, %rcx
cmovbq %rcx, %rax
movq %rax, 0x8(%rsp)
jmp 0x12503
testb %sil, %sil
je 0x12596
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movaps %xmm1, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq (%r13), %rax
movq (%rsp), %rcx
addq %rax, %rcx
movq %rcx, 0x10(%rsp)
addq 0x8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%r14), %r12
subq (%r14), %r12
sarq $0x3, %r12
imulq %rbp, %r12
movq 0x8(%rbx), %rdx
movl 0x18(%rbx), %ecx
movzbl 0x28(%rbx), %r9d
movq %r14, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
callq 0x128c9
movq (%r14), %rdx
movq 0x8(%r14), %rax
subq %rdx, %rax
sarq $0x3, %rax
imulq %rbp, %rax
subq %r12, %rax
jbe 0x124a1
movq (%rsp), %rcx
leaq (%r12,%r12,2), %rsi
leaq (%rdx,%rsi,8), %rdx
addq $0x8, %rdx
addq %rcx, (%rdx)
addq $0x18, %rdx
decq %rax
jne 0x12585
jmp 0x124a1
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: (anonymous namespace)::select_cover(std::vector<(anonymous namespace)::TOldCover, std::allocator<(anonymous namespace)::TOldCover>>&, unsigned long, (anonymous namespace)::TDiffData const&, int, (anonymous namespace)::TDiffLimit*, bool)
static void select_cover(std::vector<TOldCover>& covers,size_t cover_begin,const TDiffData& diff,
                         int kMinSingleMatchScore,TDiffLimit* diffLimit,bool isCanExtendCover){
    if (diffLimit==0){
        TCompressDetect  nocover_detect;
        TCompressDetect  cover_detect;
        _select_cover(covers,cover_begin,diff,kMinSingleMatchScore,nocover_detect,cover_detect,0,isCanExtendCover);
    }else{
        _select_cover(covers,cover_begin,diff,kMinSingleMatchScore,diffLimit->nocover_detect,
                      diffLimit->cover_detect,diffLimit,isCanExtendCover);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %r9d, %ebp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
testq %r8, %r8
je 0x14021
movq %r8, %rax
movq 0x28(%r8), %r8
movq 0x30(%rax), %r9
movzbl %bpl, %r10d
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
pushq %r10
pushq %rax
callq 0x1413f
addq $0x70, %rsp
jmp 0x1406c
leaq 0x30(%rsp), %rdi
callq 0x1d4ca
movq %rsp, %rdi
callq 0x1d4ca
movzbl %bpl, %eax
leaq 0x30(%rsp), %r8
movq %rsp, %r9
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
pushq %rax
pushq $0x0
callq 0x1413f
addq $0x10, %rsp
movq %rsp, %rdi
callq 0x1d5ca
leaq 0x30(%rsp), %rdi
callq 0x1d5ca
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1d5ca
jmp 0x14085
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1d5ca
movq %rbx, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: (anonymous namespace)::getCanExtendLength(long, long, int, long, long, (anonymous namespace)::TDiffData const&, unsigned long)
static TInt getCanExtendLength(TInt oldPos,TInt newPos,int inc,TInt newPos_min,TInt lastNewEnd,
                                   const TDiffData& diff,const TFixedFloatSmooth kExtendMinSameRatio){
        static const unsigned int kSmoothLength=4;

        TFixedFloatSmooth curBestSameRatio=0;
        TInt curBestLength=0;
        TUInt curSameCount=0;
        const TFixedFloatSmooth kLimitSameCount=(~(TFixedFloatSmooth)0)/kFixedFloatSmooth_base;
        for (TUInt length=1; (oldPos>=0)&&(oldPos<(diff.oldData_end-diff.oldData))
             &&(newPos>=newPos_min)&&(newPos<lastNewEnd); ++length,oldPos+=inc,newPos+=inc) {
            if (diff.oldData[oldPos]==diff.newData[newPos]){
                ++curSameCount;
                
                if (curSameCount>= kLimitSameCount) break; //for curSameCount*kFixedFloatSmooth_base
                const TFixedFloatSmooth curSameRatio= (curSameCount*kFixedFloatSmooth_base)
                                                      /(length+kSmoothLength);
                if (curSameRatio>=curBestSameRatio){
                    curBestSameRatio=curSameRatio;
                    curBestLength=length;
                }
            }
        }
        if ((curBestSameRatio<kExtendMinSameRatio)||(curBestLength<=2)){
            curBestLength=0;
        }
        
        return curBestLength;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
js 0x14118
movq 0x18(%r9), %rbx
movq (%r9), %r14
movq 0x10(%r9), %r15
subq %r15, %rbx
movslq %edx, %r12
movl $0x5, %r13d
xorl %ebp, %ebp
movabsq $0x3ffffffffffffe, %r10 # imm = 0x3FFFFFFFFFFFFE
xorl %r9d, %r9d
xorl %r11d, %r11d
cmpq %rbx, %rdi
jge 0x1411e
cmpq %rcx, %rsi
jl 0x1411e
cmpq %r8, %rsi
jge 0x1411e
movb (%r15,%rdi), %al
cmpb (%r14,%rsi), %al
jne 0x1410b
incq %rbp
cmpq %r10, %rbp
ja 0x1411e
movq %rbp, %rax
shlq $0xa, %rax
xorl %edx, %edx
divq %r13
cmpq %r11, %rax
cmovaq %rax, %r11
leaq -0x4(%r13), %rax
cmovaeq %rax, %r9
addq %r12, %rsi
incq %r13
addq %r12, %rdi
jns 0x140cf
jmp 0x1411e
xorl %r11d, %r11d
xorl %r9d, %r9d
xorl %eax, %eax
cmpq $0x3, %r9
cmovlq %rax, %r9
cmpq 0x38(%rsp), %r11
cmovbq %rax, %r9
movq %r9, %rax
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/HDiff/private_diff/pack_uint.h
// Function: hdiff_private::pushBack(std::vector<unsigned char, std::allocator<unsigned char>>&, hpatch_TStreamInput const*)
static void pushBack(std::vector<unsigned char>& out_buf,const hpatch_TStreamInput* data){
    const size_t kStepSize=hpatch_kStreamCacheSize*2;
    unsigned char buf[kStepSize];
    out_buf.reserve(out_buf.size()+(size_t)data->streamSize);
    hpatch_StreamPos_t curPos=0;
    while (curPos<data->streamSize){
        size_t len=kStepSize;
        if (curPos+len>data->streamSize)
            len=(size_t)(data->streamSize-curPos);
        if (!data->read(data,curPos,buf,buf+len))
            throw std::runtime_error("pushBack() data->read() error!");
        pushBack(out_buf,buf,len);
        curPos+=len;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
addq 0x8(%rbx), %rsi
callq 0x1597c
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1563d
xorl %r15d, %r15d
movq %rsp, %r12
movl $0x2000, %edx           # imm = 0x2000
leaq (%r15,%rdx), %rcx
movq %rax, %rbp
subq %r15, %rbp
cmpq %rax, %rcx
cmovbeq %rdx, %rbp
leaq (%rsp,%rbp), %r13
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq *0x10(%rbx)
testl %eax, %eax
je 0x1564f
movq 0x8(%r14), %rsi
movq %r14, %rdi
movq %r12, %rdx
movq %r13, %rcx
callq 0xa064
addq %rbp, %r15
movq 0x8(%rbx), %rax
cmpq %rax, %r15
jb 0x155f2
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x46b10(%rip), %rsi     # 0x5c173
movq %rax, %rdi
callq 0x4110
movq 0x66976(%rip), %rsi     # 0x7bfe8
movq 0x6693f(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
movq %rax, %r14
movq %rbx, %rdi
callq 0x4260
movq %r14, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.h
// Function: hdiff_private::TVectorAsStreamOutput::_read(hpatch_TStreamOutput const*, unsigned long long, unsigned char*, unsigned char*)
static hpatch_BOOL _read(const struct hpatch_TStreamOutput* stream,hpatch_StreamPos_t readFromPos,
                             unsigned char* out_data,unsigned char* out_data_end){
        const TVectorAsStreamOutput* self=(const TVectorAsStreamOutput*)stream->streamImport;
        const std::vector<unsigned char>& src=self->dst;
        size_t readLen=out_data_end-out_data;
        if (readFromPos+readLen>src.size()) return hpatch_FALSE;
        memcpy(out_data,src.data()+(size_t)readFromPos,readLen);
        return hpatch_TRUE;
    }

// Assembly:
movq (%rdi), %rax
movq 0x20(%rax), %rax
subq %rdx, %rcx
leaq (%rcx,%rsi), %rdi
movq (%rax), %r8
movq 0x8(%rax), %r9
subq %r8, %r9
xorl %eax, %eax
cmpq %r9, %rdi
ja 0x15a48
pushq %rax
addq %rsi, %r8
movq %rdx, %rdi
movq %r8, %rsi
movq %rcx, %rdx
callq 0x4290
movl $0x1, %eax
addq $0x8, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.h
// Function: hdiff_private::TVectorAsStreamOutput::_write(hpatch_TStreamOutput const*, unsigned long long, unsigned char const*, unsigned char const*)
static hpatch_BOOL _write(const hpatch_TStreamOutput* stream,
                            const hpatch_StreamPos_t writeToPos,
                            const unsigned char* data,const unsigned char* data_end){
        TVectorAsStreamOutput* self=(TVectorAsStreamOutput*)stream->streamImport;
        std::vector<unsigned char>& dst=self->dst;
        size_t writeLen=(size_t)(data_end-data);
        if (writeToPos>dst.size()) return hpatch_FALSE;
        if  (dst.size()==writeToPos){
            dst.insert(dst.end(),data,data_end);
        }else{
            if (writeToPos+writeLen!=(size_t)(writeToPos+writeLen)) return hpatch_FALSE;
            if (dst.size()<writeToPos+writeLen)
                dst.resize((size_t)(writeToPos+writeLen));
            memcpy(&dst[(size_t)writeToPos],data,writeLen);
        }
        return hpatch_TRUE;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdi), %rax
movq 0x20(%rax), %r15
movq %rcx, %r12
subq %rdx, %r12
movq (%r15), %rsi
movq 0x8(%r15), %rdx
subq %rsi, %rdx
xorl %eax, %eax
cmpq %r14, %rdx
jb 0x15aaf
jne 0x15a88
addq %rdx, %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0xa064
jmp 0x15aaa
leaq (%r12,%r14), %rsi
cmpq %rsi, %rdx
jae 0x15a99
movq %r15, %rdi
callq 0x9d84
addq (%r15), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x4290
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/covers.h
// Function: hdiff_private::TCoversBuf::_push_cover(hpatch_TOutputCovers*, hpatch_TCover const*)
static hpatch_BOOL _push_cover(struct hpatch_TOutputCovers* out_covers,const TCover* cover){
        TCoversBuf* self=(TCoversBuf*)out_covers;
        if (self->_isCover32) {
            hpatch_TCover32 c32;
            c32.oldPos=(hpatch_uint32_t)cover->oldPos;
            c32.newPos=(hpatch_uint32_t)cover->newPos;
            c32.length=(hpatch_uint32_t)cover->length;
            self->m_covers_limit.push_back(c32);
            self->_update(self->m_covers_limit);
        }else{
            self->m_covers_larger.push_back(*cover);
            self->_update(self->m_covers_larger);
        }
        return hpatch_TRUE;
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
cmpb $0x1, 0x20(%rdi)
jne 0x15bb9
movl (%rdx), %eax
movl %eax, 0x4(%rsp)
movl 0x8(%rdx), %eax
movl %eax, 0x8(%rsp)
movl 0x10(%rdx), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x15bd8
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x4(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x30(%rbx)
jmp 0x15be6
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0x15bfb
movq 0x10(%rdx), %rax
movq %rax, 0x10(%rsi)
movups (%rdx), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0x48(%rbx)
jmp 0x15c04
leaq 0x28(%rbx), %rdi
leaq 0x4(%rsp), %rdx
callq 0x15f02
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rcx
movq %rax, 0x10(%rbx)
subq %rax, %rcx
sarq $0x2, %rcx
jmp 0x15c17
leaq 0x40(%rbx), %rdi
callq 0x16078
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
movq %rax, 0x10(%rbx)
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movq %rax, 0x18(%rbx)
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp
// Function: hdiff_private::doPackData(unsigned char*, unsigned char*, std::vector<hpatch_TCover, std::allocator<hpatch_TCover>> const&)
static unsigned char* doPackData(unsigned char* data,unsigned char* data_end,
                                     const std::vector<TPackedCover>& packedCovers){
        unsigned char* dst=data;
        for (size_t i=0;i<packedCovers.size();++i){
            const TPackedCover& cv=packedCovers[i];
            assert(dst==data+cv.newPos);
            memmove(data+cv.newPos,data+cv.oldPos,(size_t)cv.length);
            dst=data+cv.newPos+cv.length;
        }
        return dst;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %r15
cmpq %r15, 0x8(%rsi)
je 0x17655
movq %rsi, %r14
movl $0x10, %r12d
xorl %r13d, %r13d
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
movq %rbx, %rax
movq -0x8(%r15,%r12), %rdi
addq %rbx, %rdi
cmpq %rdi, %rax
jne 0x17667
movq -0x10(%r15,%r12), %rsi
addq %rbx, %rsi
movq (%r15,%r12), %rdx
callq 0x4510
movq -0x8(%r15,%r12), %rax
addq %rbx, %rax
addq (%r15,%r12), %rax
incq %r13
movq (%r14), %r15
movq 0x8(%r14), %rcx
subq %r15, %rcx
sarq $0x3, %rcx
imulq %rbp, %rcx
addq $0x18, %r12
cmpq %rcx, %r13
jb 0x1760b
jmp 0x17658
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x44f34(%rip), %rdi     # 0x5c5a2
leaq 0x44f41(%rip), %rsi     # 0x5c5b6
leaq 0x44f69(%rip), %rcx     # 0x5c5e5
movl $0x6f, %edx
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp
// Function: hdiff_private::doUnpackData(unsigned char*, unsigned char*, std::vector<hpatch_TCover, std::allocator<hpatch_TCover>> const&)
static void doUnpackData(unsigned char* data,unsigned char* data_end,
                             const std::vector<TPackedCover>& packedCovers){
        unsigned char* lastEnd=data_end;
        for (size_t i=packedCovers.size();i>0;--i){
            const TPackedCover& cv=packedCovers[i-1];
            unsigned char* dst=data+cv.oldPos;
            memmove(dst,data+cv.newPos,(size_t)cv.length);
            unsigned char* dstEnd=dst+cv.length;
            memset(dstEnd,0,lastEnd-dstEnd);
            lastEnd=dst;
        }
        memset(data+0,0,lastEnd-data);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdx), %r13
subq (%rdx), %r13
je 0x180f2
movq %r13, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rbp
addq $-0x8, %r13
movq %rdx, (%rsp)
movq (%rdx), %r14
movq -0x10(%r14,%r13), %r12
addq %rbx, %r12
movq -0x8(%r14,%r13), %rsi
addq %rbx, %rsi
movq (%r14,%r13), %rdx
movq %r12, %rdi
callq 0x4510
movq (%r14,%r13), %rdi
addq %r12, %rdi
subq %rdi, %r15
xorl %esi, %esi
movq %r15, %rdx
callq 0x41c0
movq (%rsp), %rdx
addq $-0x18, %r13
movq %r12, %r15
decq %rbp
jne 0x180ad
jmp 0x180f5
movq %r15, %r12
subq %rbx, %r12
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x41c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp
// Function: hdiff_private::TCoversOptim::_insert_cover(ICoverLinesListener*, IDiffInsertCover*, void*, unsigned long, bool, unsigned long long*, unsigned long long*)
void TCoversOptim::_insert_cover(ICoverLinesListener* listener,IDiffInsertCover* diffi,void* pcovers,size_t coverCount,bool isCover32,
                                    hpatch_StreamPos_t* newSize,hpatch_StreamPos_t* oldSize){
    TCoversOptim* self=(TCoversOptim*)listener;
    if (self->matchBlock!=0){
        _check((hpatch_StreamPos_t)(self->matchBlock->newData_end_cur-self->matchBlock->newData)==*newSize,"unpackData error!");
        _check((hpatch_StreamPos_t)(self->matchBlock->oldData_end_cur-self->matchBlock->oldData)==*oldSize,"unpackData error!");
        self->matchBlock->unpackData(diffi,pcovers,coverCount,isCover32);
        *newSize=self->matchBlock->newData_end_cur-self->matchBlock->newData;
        *oldSize=self->matchBlock->oldData_end_cur-self->matchBlock->oldData;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x40(%rdi), %rdi
testq %rdi, %rdi
je 0x18168
movq %r9, %rbx
movq 0x10(%rdi), %rax
subq (%rdi), %rax
cmpq (%r9), %rax
jne 0x1816e
movq 0x20(%rsp), %r15
movq 0x28(%rdi), %rax
subq 0x18(%rdi), %rax
cmpq (%r15), %rax
jne 0x1818c
movzbl %r8b, %r8d
callq 0x17686
movq 0x40(%r14), %rax
movq 0x10(%rax), %rcx
subq (%rax), %rcx
movq %rcx, (%rbx)
movq 0x28(%rax), %rcx
subq 0x18(%rax), %rcx
movq %rcx, (%r15)
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x443b3(%rip), %rsi     # 0x5c535
movq %rax, %rdi
callq 0x4110
jmp 0x181a8
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x44395(%rip), %rsi     # 0x5c535
movq %rax, %rdi
callq 0x4110
movq 0x63e39(%rip), %rsi     # 0x7bfe8
movq 0x63e02(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
jmp 0x181c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4260
movq %r14, %rdi
callq 0x45e0