LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp
// Function: hdiff_private::TSuffixString::resetSuffixString(unsigned char const*, unsigned char const*, unsigned long)
void TSuffixString::resetSuffixString(const TChar* src_begin,const TChar* src_end,size_t threadNum){
    assert(src_begin<=src_end);
    m_src_begin=src_begin;
    m_src_end=src_end;
    if (isUseLargeSA()){
        _clearVector(m_SA_limit);
        _suffixString_create(m_src_begin,m_src_end,m_SA_large,threadNum);
    }else{
        assert(sizeof(TInt32)==4);
        _clearVector(m_SA_large);
        _suffixString_create(m_src_begin,m_src_end,m_SA_limit,threadNum);
    }
    build_cache(threadNum);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpq %rdx, %rsi
ja 0x1c295
movq %rcx, %rbx
movq %rdi, %r14
movq %rsi, (%rdi)
movq %rdx, 0x8(%rdi)
subq %rsi, %rdx
shrq $0x1f, %rdx
je 0x1c229
movq 0x10(%r14), %rdi
movq 0x20(%r14), %rsi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movq $0x0, 0x20(%r14)
testq %rdi, %rdi
je 0x1c1d1
subq %rdi, %rsi
callq 0x4300
movq (%r14), %r12
movq 0x8(%r14), %r15
leaq 0x28(%r14), %r13
movq %r15, %rsi
subq %r12, %rsi
movq %r13, %rdi
callq 0x1d074
subq %r12, %r15
je 0x1c281
movq (%r13), %rsi
movq %r12, %rdi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x26940
testl %eax, %eax
je 0x1c281
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x4085b(%rip), %rsi     # 0x5ca77
movq %rax, %rdi
callq 0x4110
jmp 0x1c2d0
movq 0x28(%r14), %rdi
movq 0x38(%r14), %rsi
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movq $0x0, 0x38(%r14)
testq %rdi, %rdi
je 0x1c24e
subq %rdi, %rsi
callq 0x4300
movq (%r14), %r12
movq 0x8(%r14), %r15
leaq 0x10(%r14), %r13
movq %r15, %rsi
subq %r12, %rsi
movq %r13, %rdi
callq 0x1d20e
subq %r12, %r15
je 0x1c281
movq (%r13), %rsi
movq %r12, %rdi
movl %r15d, %edx
movl %ebx, %ecx
callq 0x2c7b4
testl %eax, %eax
jne 0x1c2b4
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1c3b0
leaq 0x4072f(%rip), %rdi     # 0x5c9cb
leaq 0x4073b(%rip), %rsi     # 0x5c9de
leaq 0x40772(%rip), %rcx     # 0x5ca1c
movl $0x114, %edx            # imm = 0x114
callq 0x4200
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x407af(%rip), %rsi     # 0x5ca77
movq %rax, %rdi
callq 0x4110
movq 0x5fd11(%rip), %rsi     # 0x7bfe8
movq 0x5fcda(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
jmp 0x1c2e8
movq %rax, %r14
movq %rbx, %rdi
callq 0x4260
movq %r14, %rdi
callq 0x45e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp
// Function: hdiff_private::TSuffixString::clear()
void TSuffixString::clear(){
    clear_cache();
    m_src_begin=0;
    m_src_end=0;
    _clearVector(m_SA_limit);
    _clearVector(m_SA_large);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1c064
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
testq %rdi, %rdi
je 0x1c38b
subq %rdi, %rsi
callq 0x4300
xorps %xmm0, %xmm0
movq 0x28(%rbx), %rdi
movq 0x38(%rbx), %rsi
movups %xmm0, 0x28(%rbx)
movq $0x0, 0x38(%rbx)
testq %rdi, %rdi
je 0x1c3ad
subq %rdi, %rsi
popq %rbx
jmp 0x4300
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp
// Function: void hdiff_private::_filter_insert<true>(hdiff_private::TBloomFilter<unsigned int>*, unsigned char const*, unsigned char const*)
static void _filter_insert(TBloomFilter<TFastMatchForSString::THash>* filter,
                               const TChar* src_begin,const TChar* src_end){
        const TChar* cur = src_begin;
        TFastMatchForSString::THash h=TFastMatchForSString::getHash(cur);
        cur+=TFastMatchForSString::kFMMinStrSize;
        do {
    #if (_IS_USED_MULTITHREAD)
            if (isMT)
                filter->insert_MT(h);
            else
    #endif
                filter->insert(h);
            if (cur<src_end)
                h=TFastMatchForSString::rollHash(h,cur++);
            else
                break;
        } while (true);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x5, %edx
movl $0x1, %edi
callq 0x2678f
movl %eax, %esi
addq $0x5, %r14
leaq 0x5f66e(%rip), %rdi     # 0x7c4e8
movl %esi, %r8d
shrl $0x10, %r8d
movl %r8d, %r9d
xorl %esi, %r9d
movl %r9d, %ecx
andl 0x10(%r15), %ecx
movq (%r15), %rax
movl %ecx, %edx
movl $0x1, %r10d
shll %cl, %r10d
shrl $0x5, %edx
lock
orl %r10d, (%rax,%rdx,4)
movl %esi, %eax
shll $0x9, %eax
subl %esi, %eax
xorl %edx, %edx
divq 0x10(%r15)
movq %rdx, %rcx
movq (%r15), %rax
movl $0x1, %r10d
shll %cl, %r10d
shrl $0x5, %edx
lock
orl %r10d, (%rax,%rdx,4)
xorq $0x3d, %r9
leaq (%r9,%r9,8), %rax
movq %rax, %rcx
shrq $0x4, %rcx
xorq %rax, %rcx
imulq $0x27d4eb2d, %rcx, %rcx # imm = 0x27D4EB2D
movq %rcx, %rax
shrq $0xf, %rax
xorq %rcx, %rax
movq (%r15), %r9
movq 0x10(%r15), %rcx
decq %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %rcx
movq %rdx, %rax
shrq $0x5, %rax
movl $0x1, %edx
shll %cl, %edx
lock
orl %edx, (%r9,%rax,4)
cmpq %rbx, %r14
jae 0x1cf52
movzbl -0x5(%r14), %eax
movzbl (%r14), %ecx
movq (%rdi), %rdx
movzwl (%rdx,%rax,2), %eax
movzwl (%rdx,%rcx,2), %ecx
subl %eax, %esi
addl %ecx, %esi
imull $0xfffb, %eax, %eax     # imm = 0xFFFB
addl %esi, %r8d
addl %eax, %r8d
shll $0x10, %r8d
movzwl %si, %eax
leal (%r8,%rax), %esi
addl $0xffff0000, %esi       # imm = 0xFFFF0000
incq %r14
jmp 0x1ce7a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/bloom_filter.h
// Function: hdiff_private::TBitSet::clear(unsigned long)
void clear(size_t newBitSize){
        size_t count=bitSizeToCount(newBitSize);
        if (newBitSize==m_bitSize){
            if (count>0) memset(m_bits,0,count*sizeof(base_t));
        }else{
            m_bitSize=newBitSize;
            if (m_bits) { delete [] m_bits; m_bits=0; }
            if (count>0){
                m_bits=new base_t[count];
                memset(m_bits,0,count*sizeof(base_t));
            }
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x1f(%rsi), %r15
movq %r15, %rbx
shrq $0x5, %rbx
cmpq %rsi, 0x8(%rdi)
jne 0x1d02e
cmpq $0x20, %r15
jb 0x1d04c
movq (%r14), %rdi
shlq $0x2, %rbx
jmp 0x1d064
movq %rsi, 0x8(%r14)
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1d046
callq 0x43e0
movq $0x0, (%r14)
cmpq $0x20, %r15
jae 0x1d052
popq %rbx
popq %r14
popq %r15
retq
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x4030
movq %rax, (%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x41c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/bloom_filter.h
// Function: hdiff_private::TBloomFilter<unsigned int>::getMask(unsigned long, unsigned long)
static size_t getMask(size_t dataCount,size_t zoom){
        if (zoom<kZoomMin)
            throw std::runtime_error("TBloomFilter::getMask() zoom too small error!");
        size_t bitSize=dataCount*zoom;
        if ((bitSize/zoom)!=dataCount)
            throw std::runtime_error("TBloomFilter::getMask() bitSize too large error!");
        unsigned int bit=10;
        while ( (((size_t)1<<bit)<bitSize) && (bit<sizeof(size_t)*8-1) )
            ++bit;
        return ((size_t)1<<bit)-1;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x2, %rsi
jbe 0x1d3e3
movq %rsi, %rax
mulq %rdi
jo 0x1d401
movl $0xa, %ecx
movl $0x1, %edx
shlq %cl, %rdx
cmpq $0x3e, %rcx
ja 0x1d3d5
incq %rcx
cmpq %rax, %rdx
jb 0x1d3bf
decq %rdx
movq %rdx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x3f69d(%rip), %rsi     # 0x5ca94
movq %rax, %rdi
callq 0x4110
jmp 0x1d41d
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x3f6ad(%rip), %rsi     # 0x5cac2
movq %rax, %rdi
callq 0x4110
movq 0x5ebc4(%rip), %rsi     # 0x7bfe8
movq 0x5eb8d(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
jmp 0x1d435
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/compress_detect.cpp
// Function: hdiff_private::getRegionRleCost(unsigned char const*, unsigned long, unsigned char const*, unsigned char*, unsigned long*)
size_t getRegionRleCost(const unsigned char* d,size_t n,const unsigned char* sub,
                        unsigned char* out_nocompress,size_t* nocompressSize){
    assert((nocompressSize==0)||(*nocompressSize>=n));
    if (sub){
        if (out_nocompress)
            return _getRegionRleCost<true,true>(d,n,sub,out_nocompress,nocompressSize);
        else
            return _getRegionRleCost<true,false>(d,n,sub,0,nocompressSize);
    }else{
        if (out_nocompress)
            return _getRegionRleCost<false,true>(d,n,0,out_nocompress,nocompressSize);
        else
            return _getRegionRleCost<false,false>(d,n,0,0,nocompressSize);
    }
}

// Assembly:
testq %r8, %r8
je 0x1d482
cmpq %rsi, (%r8)
jb 0x1d4a9
testq %rdx, %rdx
je 0x1d497
testq %rcx, %rcx
jne 0x1d917
xorl %ecx, %ecx
jmp 0x1d9ea
xorl %edx, %edx
testq %rcx, %rcx
jne 0x1daa3
xorl %ecx, %ecx
jmp 0x1db3c
pushq %rax
leaq 0x3f6bf(%rip), %rdi     # 0x5cb70
leaq 0x3f6e2(%rip), %rsi     # 0x5cb9a
leaq 0x3f71b(%rip), %rcx     # 0x5cbda
movl $0x3e, %edx
callq 0x4200
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp
// Function: hdiff_private::TCompressDetect::TCompressDetect()
TCompressDetect::TCompressDetect():m_table(0){
    m_mem.realloc(sizeof(TCharConvTable)+kCacheSize);
    m_table=(TCharConvTable*)m_mem.data();
    m_lastChar=0; //for clear TCharConvTable
    clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
cmpq $0xc0408, 0x10(%rdi)    # imm = 0xC0408
jae 0x1d508
movl $0xc0408, %edi          # imm = 0xC0408
callq 0x4400
testq %rax, %rax
je 0x1d53c
movq %rax, (%rbx)
addq $0xc0408, %rax          # imm = 0xC0408
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
jmp 0x1d510
movq $0xc0408, 0x8(%rbx)     # imm = 0xC0408
movq (%rbx), %rdi
movq %rdi, 0x18(%rbx)
movl $0x0, 0x20(%rbx)
movl $0x40408, %edx          # imm = 0x40408
xorl %esi, %esi
callq 0x41c0
movsd 0x3f62e(%rip), %xmm0    # 0x5cb60
movups %xmm0, 0x20(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %r15
leaq 0x3edbf(%rip), %rsi     # 0x5c30f
movq %rax, %rdi
callq 0x4110
movq 0x5ea89(%rip), %rsi     # 0x7bfe8
movq 0x5ea52(%rip), %rdx     # 0x7bfb8
movq %r15, %rdi
callq 0x4590
movq %rax, %r14
jmp 0x1d57e
movq %rax, %r14
movq %r15, %rdi
callq 0x4260
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1d599
callq 0x43b0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %r14, %rdi
callq 0x45e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp
// Function: hdiff_private::TCompressDetect::clear()
void TCompressDetect::clear(){
    if (m_lastChar>=0)
        memset(m_table,0,sizeof(TCharConvTable));
    m_lastChar=-1;
    m_lastPopChar=-1;
    m_cacheBegin=0;
    m_cacheEnd=0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
js 0x1d5bc
movq 0x18(%rbx), %rdi
movl $0x40408, %edx          # imm = 0x40408
xorl %esi, %esi
callq 0x41c0
movsd 0x3f59c(%rip), %xmm0    # 0x5cb60
movups %xmm0, 0x20(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp
// Function: hdiff_private::TCompressDetect::_add_rle(unsigned char const*, unsigned long)
void TCompressDetect::_add_rle(const unsigned char* d,size_t n){
    if (m_lastChar<0){
        if (n==0) return;
        m_lastChar=d[0];
        ++m_table->sum1char[m_lastChar];
        ++d;
        --n;
    }
    for (size_t i=0;i<n;++i) {
        unsigned char cur=d[i];
        ++m_table->sum1char[cur];
        ++m_table->sum2char[m_lastChar*256+cur];
        m_lastChar=cur;
        
        if (m_table->sum==kCacheSize){
            --m_table->sum;
            unsigned char pop=m_table->cache[m_cacheBegin++];
            if (m_cacheBegin==kCacheSize) m_cacheBegin=0;
            --m_table->sum1char[pop];
            if (m_lastPopChar>=0){
                --m_table->sum2char[m_lastPopChar*256+pop];
            }
            m_lastPopChar=pop;
        }
        ++m_table->sum;
        m_table->cache[m_cacheEnd++]=cur;
        if (m_cacheEnd==kCacheSize) m_cacheEnd=0;
    }
}

// Assembly:
cmpl $0x0, 0x20(%rdi)
jns 0x1d60f
testq %rdx, %rdx
je 0x1d6d3
movzbl (%rsi), %eax
movl %eax, 0x20(%rdi)
movq 0x18(%rdi), %rcx
incl 0x4(%rcx,%rax,4)
incq %rsi
decq %rdx
testq %rdx, %rdx
je 0x1d6d3
xorl %eax, %eax
xorl %ecx, %ecx
movzbl (%rsi,%rcx), %r8d
movq 0x18(%rdi), %r9
leal (,%r8,4), %r10d
incl 0x4(%r9,%r10)
movslq 0x20(%rdi), %r11
shlq $0xa, %r11
orq %r10, %r11
incl 0x404(%r9,%r11)
movl %r8d, 0x20(%rdi)
movl (%r9), %r10d
cmpl $0x80000, %r10d         # imm = 0x80000
jne 0x1d6a0
decl %r10d
movl %r10d, (%r9)
movl 0x28(%rdi), %r10d
leal 0x1(%r10), %r11d
movl %r11d, 0x28(%rdi)
movzbl 0x40404(%r9,%r10), %r10d
cmpl $0x80000, %r11d         # imm = 0x80000
cmovel %eax, %r11d
movl %r11d, 0x28(%rdi)
decl 0x4(%r9,%r10,4)
movl 0x24(%rdi), %r11d
testl %r11d, %r11d
js 0x1d69c
shll $0x8, %r11d
orl %r10d, %r11d
decl 0x404(%r9,%r11,4)
movl %r10d, 0x24(%rdi)
incl (%r9)
movl 0x2c(%rdi), %r10d
leal 0x1(%r10), %r11d
movl %r11d, 0x2c(%rdi)
movb %r8b, 0x40404(%r9,%r10)
cmpl $0x80000, 0x2c(%rdi)    # imm = 0x80000
jne 0x1d6c7
movl $0x0, 0x2c(%rdi)
incq %rcx
cmpq %rcx, %rdx
jne 0x1d61c
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp
// Function: hdiff_private::TCompressDetect::_cost_rle(unsigned char const*, unsigned long) const
size_t TCompressDetect::_cost_rle(const unsigned char* d,size_t n)const{
    //assert(kCacheSize*2^(kCompressDetectMaxBit-1)<2^32);
    const unsigned int kCompressDetectDivBit=12;
    const unsigned int kCompressDetectMaxBit=12;
    if (n==0) return 0;
    if (m_lastChar<0) return n;
    size_t        codeSize=0;
    unsigned char last=m_lastChar;
    for (size_t i=0;i<n;++i) {
        unsigned char cur=d[i];
        size_t rab=m_table->sum2char[last*256+cur];
        size_t ra =1+m_table->sum1char[last];
        last=cur;
        if ((rab<<(kCompressDetectMaxBit-1))>ra){
            if ((rab<<8)<ra) { rab<<=8; codeSize+=8; }
            if ((rab<<4)<ra) { rab<<=4; codeSize+=4; }
            if ((rab<<2)<ra) { rab<<=2; codeSize+=2; }
            if ((rab<<1)<ra) { codeSize+=1; }
            ++codeSize;
        }else{
            codeSize+=kCompressDetectMaxBit;
        }
    }
    return (codeSize+((kCompressDetectDivBit>>1)+1))/kCompressDetectDivBit;
}

// Assembly:
testq %rdx, %rdx
je 0x1d79e
movl 0x20(%rdi), %r9d
testl %r9d, %r9d
js 0x1d7a0
pushq %r14
pushq %rbx
movq 0x18(%rdi), %rcx
xorl %edi, %edi
xorl %eax, %eax
movzbl (%rsi,%rdi), %r8d
movzbl %r9b, %r10d
movl 0x4(%rcx,%r10,4), %r9d
shll $0xa, %r10d
leal (%r10,%r8,4), %r10d
movl 0x404(%rcx,%r10), %r10d
incl %r9d
movq %r10, %r11
shlq $0xb, %r11
cmpq %r9, %r11
jbe 0x1d771
movq %r10, %r11
shlq $0x8, %r11
leaq 0x8(%rax), %rbx
cmpq %r9, %r11
cmovaeq %rax, %rbx
cmovaeq %r10, %r11
movq %r11, %r10
shlq $0x4, %r10
leaq 0x4(%rbx), %r14
cmpq %r9, %r10
cmovaeq %rbx, %r14
cmovaeq %r11, %r10
leaq (,%r10,4), %r11
leaq 0x2(%r14), %rax
cmpq %r9, %r11
cmovaeq %r14, %rax
cmovbq %r11, %r10
addq %r10, %r10
cmpq %r9, %r10
adcq $0x1, %rax
jmp 0x1d775
addq $0xc, %rax
incq %rdi
movl %r8d, %r9d
cmpq %rdi, %rdx
jne 0x1d6f5
addq $0x7, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq $0x3, %rdx
popq %rbx
popq %r14
jmp 0x1d7a0
xorl %edx, %edx
movq %rdx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp
// Function: hdiff_private::TCompressDetect::add_chars(unsigned char const*, unsigned long, unsigned char const*)
void TCompressDetect::add_chars(const unsigned char* d,size_t n,const unsigned char* sub){
    if (n>kCacheSize+sizeof(TCharConvTable)){
        clear();
        size_t skip_n=n-kCacheSize;
        n=kCacheSize;
        d+=skip_n;
        if (sub) sub+=skip_n;
    }
    by_step(this->_add_rle);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
cmpq $0xc0409, %rdx          # imm = 0xC0409
jb 0x1d80d
cmpl $0x0, 0x20(%r15)
js 0x1d7e1
movq 0x18(%r15), %rdi
movl $0x40408, %edx          # imm = 0x40408
xorl %esi, %esi
callq 0x41c0
movsd 0x3f377(%rip), %xmm0    # 0x5cb60
movups %xmm0, 0x20(%r15)
addq %r12, %r14
addq $-0x80000, %r14         # imm = 0xFFF80000
testq %rbx, %rbx
leaq -0x80000(%rbx,%r12), %rax
cmovneq %rax, %rbx
movl $0x80000, %r12d         # imm = 0x80000
testq %r12, %r12
je 0x1d866
leaq 0x10(%rsp), %r13
movl $0x400, %eax            # imm = 0x400
cmpq %rax, %r12
movl $0x400, %ebp            # imm = 0x400
cmovbq %r12, %rbp
movq %rbp, 0x8(%rsp)
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r13, %rcx
leaq 0x8(%rsp), %r8
callq 0x1d478
movq 0x8(%rsp), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x1d5ec
addq %rbp, %r14
leaq (%rbx,%rbp), %rax
testq %rbx, %rbx
cmovneq %rax, %rbx
subq %rbp, %r12
jne 0x1d817
addq $0x418, %rsp            # imm = 0x418
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/compress_detect.cpp
// Function: unsigned long hdiff_private::_getRegionRleCost<false, true>(unsigned char const*, unsigned long, unsigned char const*, unsigned char*, unsigned long*)
size_t _getRegionRleCost(const unsigned char* d,size_t n,const unsigned char* sub,
                             unsigned char* out_nocompress,size_t* nocompressSize){
        size_t bufi=0;
        size_t i=0;
        size_t cost=0;
        while ((i<n)&&(d[i]==(is_sub_on?sub[i]:0)))
            ++i;
        while(i<n){
            unsigned char v=(is_sub_on?(unsigned char)(d[i]-sub[i]):d[i]);
            size_t i0=i; ++i;
            while ((i<n)&&(v==(is_sub_on?(unsigned char)(d[i]-sub[i]):d[i])))
                ++i;
            if ((v==0)|(v==255)){
                ++cost;
            }else{
                cost+=(i-i0<=1)?1:2;
                if (is_out_on)
                    out_nocompress[bufi++]=v;
            }
        }
        if (nocompressSize) *nocompressSize=bufi;
        return cost;
    }

// Assembly:
xorl %edx, %edx
testq %rsi, %rsi
je 0x1dabb
cmpb $0x0, (%rdi,%rdx)
jne 0x1dabb
incq %rdx
cmpq %rdx, %rsi
jne 0x1daaa
movq %rsi, %rdx
cmpq %rsi, %rdx
jae 0x1db2e
pushq %r15
pushq %r14
pushq %rbx
xorl %r9d, %r9d
xorl %eax, %eax
movq %rdx, %r10
leaq 0x1(%rdx), %rbx
cmpq %rbx, %rsi
cmovaq %rsi, %rbx
movb (%rdi,%rdx), %r11b
leaq -0x1(%rbx), %r14
movq %rdx, %r15
cmpq %r15, %r14
je 0x1daf8
leaq 0x1(%r15), %rdx
cmpb 0x1(%rdi,%r15), %r11b
movq %rdx, %r15
je 0x1dae3
jmp 0x1dafb
movq %rbx, %rdx
leal 0x1(%r11), %ebx
cmpb $0x1, %bl
ja 0x1db09
incq %rax
jmp 0x1db22
movq %rdx, %rbx
subq %r10, %rbx
cmpq $0x2, %rbx
sbbq $0x0, %rax
addq $0x2, %rax
movb %r11b, (%rcx,%r9)
incq %r9
cmpq %rsi, %rdx
jb 0x1daca
popq %rbx
popq %r14
popq %r15
jmp 0x1db33
xorl %eax, %eax
xorl %r9d, %r9d
testq %r8, %r8
je 0x1db3b
movq %r9, (%r8)
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::TDigestMatcher::getSearchThreadNum() const
size_t TDigestMatcher::getSearchThreadNum()const{
#if (_IS_USED_MULTITHREAD)
    const size_t threadNum=m_mtsets.threadNumForSearch;
    hpatch_StreamPos_t size=m_newData->streamSize;
    if ((threadNum>1)&&(m_oldData->streamSize>=m_kMatchBlockSize)
      &&(size>=kMinParallelSize)&&(size/2>=m_kMatchBlockSize)) {
        const hpatch_StreamPos_t maxThreanNum=size/(kMinParallelSize/2);
        return (threadNum<=maxThreanNum)?threadNum:(size_t)maxThreanNum;
    }else
#endif
    {
        return 1;
    }
}

// Assembly:
movq 0x80(%rdi), %rcx
cmpq $0x2, %rcx
jb 0x1dcaa
movq (%rdi), %rax
movq 0xc8(%rdi), %rdx
cmpq %rdx, 0x8(%rax)
jb 0x1dcaa
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rax
cmpq $0x200000, %rax         # imm = 0x200000
jb 0x1dcaa
movq %rax, %rsi
shrq %rsi
cmpq %rdx, %rsi
jb 0x1dcaa
shrq $0x14, %rax
cmpq %rax, %rcx
cmovbq %rcx, %rax
retq
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::TDigestMatcher::_search_cover_thread(hpatch_TOutputCovers*, unsigned char*, void*)
void TDigestMatcher::_search_cover_thread(hpatch_TOutputCovers* out_covers,
                                          unsigned char* pmem,void* mt_data){
#if (_IS_USED_MULTITHREAD)
    const size_t kPartPepeatSize=m_kMatchBlockSize-1;
    mt_data_t& mt=*(mt_data_t*)mt_data;
    const uint_work workCount=mt.workCount;
    const hpatch_StreamPos_t rollCount=m_newData->streamSize-(m_kMatchBlockSize-1);
    std::atomic<uint_work>& workIndex=*(std::atomic<uint_work>*)&mt.workIndex;
    while (true){
        uint_work curWorkIndex=workIndex++;
        if (curWorkIndex>=workCount) break;
        hpatch_StreamPos_t new_begin=rollCount*curWorkIndex/workCount;
        hpatch_StreamPos_t new_end=(curWorkIndex+1<workCount)?rollCount*(curWorkIndex+1)/workCount:rollCount;
        assert(new_end+kPartPepeatSize<=m_newData->streamSize);
        TStreamInputClip newClip;
        TStreamInputClip_init(&newClip,m_newData,new_begin,new_end+kPartPepeatSize);
        _search_cover(&newClip.base,new_begin,out_covers,pmem,
                      mt.newDataLocker.locker,mt.dataLocker.locker);
    }
#endif 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %rbx
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x8(%rdi), %rax
movq %rdi, 0x28(%rsp)
movq 0xc8(%rdi), %rcx
decq %rcx
movq 0x10(%rbx), %r15
movq 0x8(%rax), %rax
movq %rcx, 0x30(%rsp)
subq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %r13
movl $0x1, %r14d
lock
xaddq %r14, 0x18(%rbx)
cmpq %r15, %r14
jae 0x1fa61
movq %r14, %rax
movq 0x10(%rsp), %rcx
imulq %rcx, %rax
xorl %edx, %edx
divq %r15
movq %rax, %rbp
leaq 0x1(%r14), %rax
cmpq %r15, %rax
jae 0x1fa16
imulq 0x10(%rsp), %rax
xorl %edx, %edx
divq %r15
movq %rax, %rcx
addq 0x30(%rsp), %rcx
movq 0x8(%r13), %rsi
cmpq 0x8(%rsi), %rcx
ja 0x1fa70
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rdx
callq 0x4434d
movq (%rbx), %r9
movq 0x8(%rbx), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %r8
callq 0x1e48a
cmpq %r15, %r14
jb 0x1f9da
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3d2d4(%rip), %rdi     # 0x5cd4b
leaq 0x3d1f6(%rip), %rsi     # 0x5cc74
leaq 0x3d2f5(%rip), %rcx     # 0x5cd7a
movl $0x2ce, %edx            # imm = 0x2CE
callq 0x4200
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: void hdiff_private::_filter_insert<true>(hdiff_private::TBloomFilter<unsigned long>*, unsigned long const*, unsigned long const*)
static void _filter_insert(TBloomFilter<adler_hash_t>* filter,const adler_uint_t* begin,const adler_uint_t* end){
    while (begin!=end){
        adler_hash_t h=adler_to_hash(*begin++);
#if (_IS_USED_MULTITHREAD)
        if (isMT)
            filter->insert_MT(h);
        else
#endif
            filter->insert(h);
    }
}

// Assembly:
cmpq %rdx, %rsi
je 0x1fd84
pushq %rbx
movq %rdx, %r8
movq (%rsi), %r9
movq %r9, %rcx
shrq $0x20, %rcx
xorq %r9, %rcx
andq 0x10(%rdi), %rcx
movq (%rdi), %rdx
movl $0x1, %r10d
movq %rcx, %r11
shll %cl, %r10d
movq %r9, %rax
shlq $0x11, %rax
subq %r9, %rax
shrq $0x5, %r11
movq %r9, %rbx
lock
orl %r10d, (%rdx,%r11,4)
xorl %edx, %edx
divq 0x10(%rdi)
movq %rdx, %rcx
notq %rbx
shlq $0x12, %r9
addq %rbx, %r9
movl $0x1, %eax
movq %r9, %rdx
shrq $0x1f, %rdx
xorq %r9, %rdx
movq (%rdi), %r9
leaq (%rdx,%rdx,4), %r10
leaq (%rdx,%r10,4), %rdx
movq %rcx, %r10
shll %cl, %eax
movq %rdx, %rcx
shrq $0xb, %rcx
xorq %rdx, %rcx
shrq $0x5, %r10
movq %rcx, %rdx
lock
orl %eax, (%r9,%r10,4)
shlq $0x6, %rdx
addq %rcx, %rdx
movq %rdx, %rax
shrq $0x16, %rax
xorq %rdx, %rax
movq (%rdi), %r9
movq 0x10(%rdi), %rcx
decq %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %rcx
movq %rdx, %rax
shrq $0x5, %rax
movl $0x1, %edx
shll %cl, %edx
addq $0x8, %rsi
lock
orl %edx, (%r9,%rax,4)
cmpq %r8, %rsi
jne 0x1fcc2
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/../qsort_parallel.h
// Function: void _sort_parallel_thread<unsigned long, hdiff_private::TIndex_comp, 137ul>(unsigned long*, unsigned long*, hdiff_private::TIndex_comp, unsigned long)
static void _sort_parallel_thread(TValue* begin,TValue* end,TCmp cmp,size_t threadNum){
        if (threadNum>1){
            const size_t rightWeight=(threadNum>>1);
            const size_t leftWeight=threadNum-rightWeight;
            TValue* mid;
            const bool _kIsPartitionNotMerge=true;
            if (_kIsPartitionNotMerge){ // partition
                //mid=begin+__index_by_ratio(size,leftWeight,threadNum); std::nth_element(begin,mid,end,cmp); //for test 
                //mid=std::_Partition_by_median_guess_unchecked(begin, end, cmp).first; //for test by vc
                mid=_sort_parallel_partition<TValue,TCmp,kSampleSize>(begin,end,cmp,leftWeight,rightWeight);
            }else{
                mid=begin+__index_by_ratio(end-begin,leftWeight,threadNum);
            }

            std::thread threadRight(_sort_parallel_thread<TValue,TCmp,kSampleSize>,
                                    mid,end,cmp,rightWeight);
            _sort_parallel_thread<TValue,TCmp,kSampleSize>(begin,mid,cmp,leftWeight);
            threadRight.join();
            
            if (!_kIsPartitionNotMerge){ //merge
                std::inplace_merge(begin,mid,end,cmp);
            }
        }else{
            std::sort(begin,end,cmp);
            //printf("parallel sort size: %" PRIu64 " \n",(hpatch_StreamPos_t)(end-begin));
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x80(%rsp), %r14
movq %rsi, 0x28(%rsp)
cmpq $0x2, %rdx
jb 0x1fe40
movq %rdx, %r12
movq %rdx, %rcx
shrq %rcx
leaq 0x30(%rsp), %r13
movq %rcx, (%r13)
subq %rcx, %r12
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1fecb
leaq 0x48(%rsp), %r15
movq %rax, (%r15)
leaq -0x6d(%rip), %rsi       # 0x1fd85
leaq 0x20(%rsp), %rdi
leaq 0x28(%rsp), %rcx
movq %r15, %rdx
movq %r14, %r8
movq %r13, %r9
callq 0x20dea
movq (%r15), %rsi
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1fd85
leaq 0x20(%rsp), %rdi
callq 0x4580
cmpq $0x0, 0x20(%rsp)
je 0x1fea8
jmp 0x1fec6
movq 0x10(%r14), %rax
movq %rax, 0x40(%rsp)
movups (%r14), %xmm0
movaps %xmm0, 0x30(%rsp)
cmpq %r15, %rbx
je 0x1fea8
movq %r15, %rax
subq %rbx, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21592
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x216bc
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpq $0x0, 0x20(%rsp)
jne 0x1fec6
movq %rax, %rdi
callq 0x45e0
callq 0x40b0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::tryLink(hpatch_TCover const&, hpatch_TCover&, hdiff_private::TOldStreamCache&, hdiff_private::TNewStreamCache&)
static void tryLink(const TCover& lastCover,TCover& matchCover,
                        TOldStreamCache& oldStream,TNewStreamCache& newStream){
        if (lastCover.length<=0) return;
        hpatch_StreamPos_t linkOldPos=matchCover.newPos+lastCover.oldPos-lastCover.newPos;
        if (linkOldPos==matchCover.oldPos) return;
        newStream.TBlockStreamCache::resetPos(matchCover.newPos);
        hpatch_StreamPos_t matchedOldPos=linkOldPos;
        hpatch_StreamPos_t curEqLen=getMatchLength(oldStream,newStream,&matchedOldPos,
                                                   newStream.kMatchBlockSize,lastCover);
        size_t unlinkCost=getOldPosCost(matchCover.oldPos,lastCover);
        size_t unlinkCost_link=getOldPosCost(matchedOldPos,lastCover);
        if ((curEqLen>=kMinMatchedLength)
            &&(curEqLen+unlinkCost>=matchCover.length+unlinkCost_link)){
            matchCover.length=curEqLen;
            matchCover.oldPos=matchedOldPos;
            matchCover.newPos=matchCover.newPos-(linkOldPos-matchedOldPos);
        }
    }

// Assembly:
cmpq $0x0, 0x10(%rdi)
je 0x203a5
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rdx
movq (%rdi), %rbp
addq %rdx, %rbp
subq 0x8(%rdi), %rbp
cmpq (%rsi), %rbp
je 0x20397
movq %rcx, %r15
movq 0x10(%rcx), %rax
movq 0x38(%rcx), %rsi
movq 0x40(%rcx), %rcx
leaq (%rcx,%rdx), %rdi
cmpq %rax, %rdi
ja 0x20337
movq 0x8(%r15), %rdi
addq %rsi, %rdi
cmpq %rdx, %rdi
ja 0x20337
subq %rax, %rdx
addq 0x28(%r15), %rdx
movq %rdx, 0x30(%r15)
jmp 0x2033f
movq %r15, %rdi
callq 0x20716
movq %rsp, %rdx
movq %rbp, (%rdx)
movq 0x40(%r15), %rcx
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %r8
callq 0x203a6
cmpq $0x10, %rax
jb 0x20397
movq %rax, %r15
movq (%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x204cf
movq %rax, %r13
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x204cf
addq %r15, %rax
addq 0x10(%rbx), %r13
cmpq %r13, %rax
jb 0x20397
movq %r15, 0x10(%rbx)
movq %r12, (%rbx)
subq %rbp, %r12
addq %r12, 0x8(%rbx)
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/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::getMatchLength(hdiff_private::TOldStreamCache&, hdiff_private::TNewStreamCache&, unsigned long long*, unsigned long, hpatch_TCover const&)
static hpatch_StreamPos_t getMatchLength(TOldStreamCache& oldStream,TNewStreamCache& newStream,
                                             hpatch_StreamPos_t* pOldPos,size_t kMatchBlockSize,
                                             const TCover& lastCover){
        if (oldStream.resetPos(*pOldPos)&&
            (0==memcmp(oldStream.data(),newStream.data(),kMatchBlockSize))){
            const hpatch_StreamPos_t newPos=newStream.pos();
            size_t feq_len=oldStream.forward_equal_length(newStream);
            if (newPos-feq_len<lastCover.newPos+lastCover.length)
                feq_len=(size_t)(newPos-(lastCover.newPos+lastCover.length));
            hpatch_StreamPos_t beq_len=oldStream.loop_backward_equal_length(newStream);
            *pOldPos=(*pOldPos)-feq_len;
            return feq_len+kMatchBlockSize+beq_len;
        }else{
            return 0;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdx), %rdx
movq 0x38(%rdi), %rsi
movq 0x40(%rdi), %rcx
leaq (%rcx,%rdx), %rdi
movq 0x8(%r12), %r8
movq 0x10(%r12), %rax
cmpq %rax, %rdi
setbe %r9b
leaq (%r8,%rsi), %r10
cmpq %rdx, %r10
setbe %r10b
testb %r10b, %r9b
jne 0x20424
movq 0x28(%r12), %r9
movq 0x48(%r12), %r10
subq %r10, %r9
addq %r9, 0x20(%r12)
movq %r10, 0x28(%r12)
movq %r10, 0x30(%r12)
movq %rax, %r9
subq %r8, %r9
movq %rax, %r11
subq %r10, %r11
cmpq %r10, %r9
cmovbeq %r8, %r11
movq %r11, 0x8(%r12)
cmpq %rax, %rdi
ja 0x20445
movq 0x8(%r12), %rdi
addq %rsi, %rdi
cmpq %rdx, %rdi
ja 0x20445
subq %rax, %rdx
addq 0x28(%r12), %rdx
movq %rdx, 0x30(%r12)
jmp 0x20451
movq %r12, %rdi
callq 0x20716
testb %al, %al
je 0x20472
movq 0x20(%r12), %rdi
addq 0x30(%r12), %rdi
movq 0x30(%r15), %r13
movq 0x20(%r15), %rsi
addq %r13, %rsi
movq %rbx, %rdx
callq 0x4310
testl %eax, %eax
je 0x20476
xorl %eax, %eax
jmp 0x204c0
movq %rbx, (%rsp)
movq %rbp, %rbx
movq 0x10(%r15), %rbp
subq 0x28(%r15), %rbp
addq %r13, %rbp
movq %r12, %rdi
movq %r15, %rsi
callq 0x22f38
movq %rbp, %rcx
subq %rax, %rcx
movq 0x10(%rbx), %rdx
addq 0x8(%rbx), %rdx
subq %rdx, %rbp
cmpq %rdx, %rcx
cmovaeq %rax, %rbp
movq %r12, %rdi
movq %r15, %rsi
callq 0x22f9e
subq %rbp, (%r14)
addq (%rsp), %rax
addq %rbp, %rax
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/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::TStreamCache::_resetPos_continue(unsigned long, unsigned long long, unsigned long)
bool _resetPos_continue(size_t kBackupCacheSize,hpatch_StreamPos_t streamPos,size_t kMinCacheDataSize){
        //stream:[...     |                |                   |                  |                      |      ...]
        //             readPos (streamPos-kBackupCacheSize) streamPos (streamPos+kMinCacheDataSize) (readPosEnd)
        //cache:     [    |                                    |                  |                      ]
        //           0                                   (init cachePos)                              cacheSize
        hpatch_StreamPos_t streamSize=stream->streamSize;
        if (streamPos+kMinCacheDataSize>streamSize) return false;
        hpatch_StreamPos_t readPos=(streamPos>=kBackupCacheSize)?(streamPos-kBackupCacheSize):0;
        size_t readLen=((streamSize-readPos)>=cacheSize)?cacheSize:(size_t)(streamSize-readPos);
#if (_IS_USED_MULTITHREAD)
        if (m_locker){
            CAutoLocker _autoLocker(m_locker);
            _resetPos_continue_read(readPos,readLen);
        }else
#endif
        {
            _resetPos_continue_read(readPos,readLen);
        }
        m_readPos=readPos;
        m_readPosEnd=readPos+readLen;
        cachePos=cacheSize-(size_t)(m_readPosEnd-streamPos);
        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq (%rdi), %rax
movq 0x8(%rax), %rbp
addq %rdx, %rbx
cmpq %rbp, %rbx
ja 0x207ea
movq %rdx, %r14
movq %rdi, %r15
xorl %r12d, %r12d
movq %rdx, %rax
subq %rsi, %rax
cmovaeq %rax, %r12
movq %rbp, %r13
subq %r12, %r13
movq 0x18(%rdi), %rax
movq 0x28(%rdi), %rcx
cmpq %rcx, %r13
cmovaeq %rcx, %r13
testq %rax, %rax
je 0x207c6
movq $0x0, 0x8(%rsp)
xorl %ecx, %ecx
movb %cl, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
movb %cl, 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 %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20816
leaq 0x8(%rsp), %rdi
callq 0x20984
jmp 0x207d4
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x20816
movq %r12, 0x8(%r15)
addq %r12, %r13
movq %r13, 0x10(%r15)
subq %r13, %r14
addq 0x28(%r15), %r14
movq %r14, 0x30(%r15)
cmpq %rbp, %rbx
setbe %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x20801
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20984
movq %rbx, %rdi
callq 0x45e0
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::TStreamCache::_resetPos_continue_read(unsigned long long, unsigned long)
void _resetPos_continue_read(hpatch_StreamPos_t readPos,size_t readLen){
        unsigned char* dst=cache+cacheSize-readLen;
        if ((m_readPosEnd>readPos)&&(m_readPos<=readPos)){
            size_t moveLen=(size_t)(m_readPosEnd-readPos);
            memmove(dst,cache+cacheSize-moveLen,moveLen);
            readStream(stream,readPos+moveLen,dst+moveLen,readLen-moveLen);
        }else if ((m_readPos<readPos+readLen)&&(m_readPosEnd>=readPos+readLen)){
            size_t moveLen=(size_t)(readPos+readLen-m_readPos);
            memmove(dst+readLen-moveLen,cachedData(),moveLen);
            readStream(stream,readPos,dst,readLen-moveLen);
        }else{
            readStream(stream,readPos,dst,readLen);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r15
movq 0x20(%rdi), %r12
addq 0x28(%rdi), %r12
movq %r12, %rbx
subq %rdx, %rbx
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdx
movq %rdx, %rbp
subq %r13, %rbp
setbe %al
cmpq %r13, %rsi
seta %cl
orb %al, %cl
je 0x208af
leaq (%r14,%r13), %rax
movq %rax, %rbp
subq %rsi, %rbp
setbe %cl
cmpq %rax, %rdx
setb %al
orb %cl, %al
je 0x208fc
testq %r14, %r14
je 0x2092b
movq (%r15), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r12, %rcx
callq *0x10(%rdi)
testl %eax, %eax
jne 0x2092b
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x3c542(%rip), %rsi     # 0x5cde4
movq %rax, %rdi
callq 0x4110
jmp 0x20956
movq %rdx, %r13
movq %r12, %rsi
subq %rbp, %rsi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x4510
cmpq %r14, %rbp
je 0x2092b
movq (%r15), %rdi
addq %rbp, %rbx
movq %r13, %rsi
movq %rbx, %rdx
movq %r12, %rcx
callq *0x10(%rdi)
testl %eax, %eax
jne 0x2092b
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x3c4f2(%rip), %rsi     # 0x5cde4
movq %rax, %rdi
callq 0x4110
jmp 0x20956
movq %r12, %rdi
subq %rbp, %rdi
subq %rdx, %rsi
addq %r12, %rsi
movq %rbp, %rdx
callq 0x4510
subq %rbp, %r14
je 0x2092b
movq (%r15), %rdi
addq %rbx, %r14
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq *0x10(%rdi)
testl %eax, %eax
je 0x2093a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x3c496(%rip), %rsi     # 0x5cde4
movq %rax, %rdi
callq 0x4110
movq 0x5b68b(%rip), %rsi     # 0x7bfe8
movq 0x5b654(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
jmp 0x20970
jmp 0x20970
movq %rax, %r14
movq %rbx, %rdi
callq 0x4260
movq %r14, %rdi
callq 0x45e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: bool hdiff_private::TIndex_comp::_cmp<unsigned int>(unsigned int, unsigned int, unsigned long, unsigned long, unsigned long const*)
static bool _cmp(TIndex x,TIndex y,size_t n,size_t kMaxDeep,
                     const adler_uint_t* blocks) {
        if (x!=y) {} else{ return false; }
        size_t deep=n-((x>y)?x:y);
        deep=(deep<=kMaxDeep)?deep:kMaxDeep;
        for (size_t i=0;i<deep;++i){
            adler_uint_t xd=blocks[x++];
            adler_uint_t yd=blocks[y++];
            if (xd!=yd)
                return xd<yd;
        }
        return x>y;
    }

// Assembly:
cmpl %esi, %edi
jne 0x222df
xorl %eax, %eax
jmp 0x22383
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %eax
cmoval %edi, %eax
subq %rax, %rdx
cmpq %rcx, %rdx
cmovaeq %rcx, %rdx
testq %rdx, %rdx
setne %bl
je 0x22366
movl %edi, %r9d
movq (%r8,%r9,8), %rax
movl %esi, %r11d
cmpq (%r8,%r11,8), %rax
setb %al
jne 0x22368
leal (%rdx,%rdi), %ecx
leal (%rdx,%rsi), %r10d
movl $0x1, %r14d
movq %r14, %rbx
cmpq %r14, %rdx
je 0x22359
leaq (%r11,%rbx), %r14
leaq (%r9,%rbx), %r15
movl %r15d, %r15d
movq (%r8,%r15,8), %r15
movl %r14d, %r12d
leaq 0x1(%rbx), %r14
xorl %ebp, %ebp
cmpq (%r8,%r12,8), %r15
setb %bpl
movzbl %al, %eax
cmovnel %ebp, %eax
je 0x2231e
addl %r14d, %esi
addl %r14d, %edi
movl %esi, %r10d
movl %edi, %ecx
cmpq %rdx, %rbx
setb %bl
movl %r10d, %esi
movl %ecx, %edi
jmp 0x2236c
jmp 0x2236c
incl %edi
incl %esi
xorl %ecx, %ecx
cmpl %esi, %edi
seta %cl
movzbl %al, %eax
testb %bl, %bl
cmovel %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
andb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::TNewStreamCache::roll()
inline bool roll(){
        //warning: after running _loop_backward_cache(),cache roll logic is failure
        if (dataLength()>kMatchBlockSize){
            const unsigned char* cur_datas=data();
            roll_digest=adler_roll(roll_digest,kMatchBlockSize,cur_datas[0],cur_datas[kMatchBlockSize]);
            ++cachePos;
            return true;
        }else{
            if (!TBlockStreamCache::resetPos(pos()+1)) return false;
            --cachePos;
            return roll();
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rbx), %rdx
movq 0x30(%rbx), %rax
movq %rdx, %rsi
subq %rax, %rsi
movq 0x40(%rbx), %rcx
cmpq %rcx, %rsi
ja 0x22aa3
movq %rax, %rdi
subq %rdx, %rdi
movq 0x10(%rbx), %r8
movq 0x38(%rbx), %rsi
leaq (%rdi,%r8), %rdx
incq %rdx
addq %r8, %rdi
addq %rcx, %rdi
incq %rdi
cmpq %r8, %rdi
ja 0x22a91
movq 0x8(%rbx), %rdi
addq %rsi, %rdi
cmpq %rdx, %rdi
ja 0x22a91
incq %rax
movq %rax, 0x30(%rbx)
jmp 0x22a9d
movq %rbx, %rdi
callq 0x20716
testb %al, %al
je 0x22af1
decq 0x30(%rbx)
jmp 0x22a42
movq 0x20(%rbx), %rsi
movq 0x48(%rbx), %rdx
movzbl (%rsi,%rax), %edi
addq %rax, %rsi
movzbl (%rcx,%rsi), %esi
leaq 0x59a33(%rip), %r8      # 0x7c4f0
movq (%r8), %r8
movl (%r8,%rdi,4), %edi
movq %rdx, %r9
shrq $0x20, %r9
subl %edi, %edx
addl (%r8,%rsi,4), %edx
imull %edi, %ecx
notl %ecx
addl %r9d, %ecx
addl %edx, %ecx
shlq $0x20, %rcx
orq %rdx, %rcx
movq %rcx, 0x48(%rbx)
incq %rax
movq %rax, 0x30(%rbx)
movb $0x1, %al
jmp 0x22af3
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TCompressedStream::TCompressedStream(hpatch_TStreamOutput const*, unsigned long long, unsigned long long)
TCompressedStream::TCompressedStream(const hpatch_TStreamOutput*  _out_code,
                                     hpatch_StreamPos_t _writePos,hpatch_StreamPos_t _kLimitOutCodeSize)
:out_code(_out_code),out_pos(_writePos),out_posLimitEnd(_writePos+_kLimitOutCodeSize),
_writeToPos_back(0),_is_overLimit(false){
    this->streamImport=this;
    this->streamSize=0;
    this->read_writed=0;
    this->write=_write_code;
}

// Assembly:
movq %rsi, 0x20(%rdi)
movq %rdx, 0x28(%rdi)
addq %rdx, %rcx
movq %rcx, 0x30(%rdi)
movq $0x0, 0x38(%rdi)
movb $0x0, 0x40(%rdi)
movq %rdi, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
leaq 0x6(%rip), %rax         # 0x23642
movq %rax, 0x18(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TCompressedStream::_write_code(hpatch_TStreamOutput const*, unsigned long long, unsigned char const*, unsigned char const*)
hpatch_BOOL TCompressedStream::_write_code(const hpatch_TStreamOutput* stream,hpatch_StreamPos_t writeToPos,
                                           const unsigned char* data,const unsigned char* data_end){
    assert(data<data_end);
    TCompressedStream* self=(TCompressedStream*)stream->streamImport;
    checki(self->_writeToPos_back==writeToPos,"TCompressedStream::write() writeToPos error!");
    size_t dataLen=(size_t)(data_end-data);
    self->_writeToPos_back=writeToPos+dataLen;
    
    if ((self->_is_overLimit)||(self->out_pos+dataLen>self->out_posLimitEnd)){
        self->_is_overLimit=true;
    }else{
        if (!self->out_code->write(self->out_code,self->out_pos,data,data_end)) return hpatch_FALSE;
        self->out_pos+=dataLen;
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq %rcx, %rdx
jae 0x2369b
movq (%rdi), %rbx
cmpq %rsi, 0x38(%rbx)
jne 0x236ba
movq %rcx, %r14
subq %rdx, %r14
addq %r14, %rsi
movq %rsi, 0x38(%rbx)
cmpb $0x0, 0x40(%rbx)
jne 0x23675
movq 0x28(%rbx), %rsi
leaq (%rsi,%r14), %rax
cmpq 0x30(%rbx), %rax
jbe 0x23686
movb $0x1, 0x40(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x20(%rbx), %rdi
callq *0x18(%rdi)
testl %eax, %eax
je 0x23697
addq %r14, 0x28(%rbx)
jmp 0x23679
xorl %eax, %eax
jmp 0x2367e
leaq 0x39bd1(%rip), %rdi     # 0x5d273
leaq 0x39bd8(%rip), %rsi     # 0x5d281
leaq 0x39c21(%rip), %rcx     # 0x5d2d1
movl $0x41, %edx
callq 0x4200
movl $0x10, %edi
callq 0x4190
movq %rax, %rbx
leaq 0x39ca4(%rip), %rsi     # 0x5d372
movq %rax, %rdi
callq 0x4110
movq 0x5890b(%rip), %rsi     # 0x7bfe8
movq 0x588d4(%rip), %rdx     # 0x7bfb8
movq %rbx, %rdi
callq 0x4590
movq %rax, %r14
movq %rbx, %rdi
callq 0x4260
movq %r14, %rdi
callq 0x45e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TCoversStream::TCoversStream(hdiff_private::TCovers const&, unsigned long long)
TCoversStream::TCoversStream(const TCovers& _covers,hpatch_StreamPos_t cover_buf_size)
:covers(_covers),curCodePos(0),curCodePos_end(0),
readedCoverCount(0),lastOldEnd(0),lastNewEnd(0),_readFromPos_back(0){
    assert(kCodeBufSize>=hpatch_kMaxPackedUIntBytes*3);
    _code_mem.realloc(kCodeBufSize);
    this->streamImport=this;
    this->streamSize=cover_buf_size;
    this->read=_read;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x48(%rdi)
movups %xmm0, 0x58(%rdi)
movq $0x0, 0x68(%rdi)
cmpq $0x80000, 0x38(%rdi)    # imm = 0x80000
jae 0x23757
movl $0x80000, %edi          # imm = 0x80000
callq 0x4400
testq %rax, %rax
je 0x23777
movq %rax, 0x28(%rbx)
addq $0x80000, %rax          # imm = 0x80000
movq %rax, 0x30(%rbx)
movq %rax, 0x38(%rbx)
jmp 0x2375f
movq $0x80000, 0x30(%rbx)    # imm = 0x80000
movq %rbx, (%rbx)
movq %r14, 0x8(%rbx)
leaq 0x73(%rip), %rax        # 0x237e0
movq %rax, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %r15
leaq 0x38b84(%rip), %rsi     # 0x5c30f
movq %rax, %rdi
callq 0x4110
movq 0x5884e(%rip), %rsi     # 0x7bfe8
movq 0x58817(%rip), %rdx     # 0x7bfb8
movq %r15, %rdi
callq 0x4590
movq %rax, %r14
jmp 0x237b9
movq %rax, %r14
movq %r15, %rdi
callq 0x4260
addq $0x28, %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x237d8
callq 0x43b0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
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.cpp
// Function: hdiff_private::TNewDataDiffStream::_init(unsigned long long)
void TNewDataDiffStream::_init(hpatch_StreamPos_t newDataDiff_size){
    curNewPos=0;
    curNewPos_end=0;
    lastNewEnd=0;
    readedCoverCount=0;
    _readFromPos_back=0;
    _coveri=0;
    _newDataPos=0;
    this->streamImport=this;
    this->streamSize=newDataDiff_size;
    this->read=_read;
    this->_private_reserved=0;
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x30(%rdi)
xorl %eax, %eax
movq %rax, 0x60(%rdi)
movq %rdi, (%rdi)
movq %rsi, 0x8(%rdi)
leaq 0x9(%rip), %rcx         # 0x23b60
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataDiffStream::_initByRange(unsigned long, unsigned long long, unsigned long long)
void TNewDataDiffStream::_initByRange(size_t coveri,hpatch_StreamPos_t newDataPos,hpatch_StreamPos_t newDataPosEnd){
    _init(getDataSizeByRange(covers,coveri,newDataPos,newDataPosEnd));
    _coveri=coveri;
    _newDataPos=newDataPos;

    readedCoverCount=_coveri;
    lastNewEnd=_newDataPos;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x20(%rdi), %rdi
callq 0x23d46
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r15)
movups %xmm0, 0x40(%r15)
movups %xmm0, 0x30(%r15)
movq %r15, (%r15)
movq %rax, 0x8(%r15)
leaq -0x1c3(%rip), %rax      # 0x23b60
movq %rax, 0x10(%r15)
movq $0x0, 0x18(%r15)
movq %r14, 0x58(%r15)
movq %rbx, 0x60(%r15)
movq %r14, 0x48(%r15)
movq %rbx, 0x40(%r15)
popq %rbx
popq %r14
popq %r15
retq
nop