// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::TDigestMatcher::getDigests()
void TDigestMatcher::getDigests(){
    if (m_blocks.empty()) return;
    
    const size_t blockCount=m_blocks.size();
    TStreamCache streamCache(m_oldData,m_mem.data(),m_newCacheSize+m_oldCacheSize,0);
    for (size_t i=0;i<blockCount;++i) {
        hpatch_StreamPos_t readPos=blockIndexToPos(i,m_kMatchBlockSize,m_oldData->streamSize);
        streamCache.resetPos(0,readPos,m_kMatchBlockSize);
        adler_uint_t adler=adler_start(streamCache.data(),m_kMatchBlockSize);
        m_blocks[i]=adler;
        if (m_isUseLargeSorted)
            m_sorted_larger[i]=i;
        else
            m_sorted_limit[i]=(uint32_t)i;
    }
    m_filter.init(blockCount);
    filter_insert_parallel(m_filter,m_blocks.data(),m_blocks.data()+blockCount,m_mtsets.threadNum);

    size_t kMaxCmpDeep= 1 + upperCount(kMinTrustMatchedLength,m_kMatchBlockSize);
    TIndex_comp comp(m_blocks.data(),m_blocks.size(),kMaxCmpDeep);
    if (m_isUseLargeSorted)
        __sort_indexs(std::vector<size_t>::value_type,m_sorted_larger,comp,m_mtsets.threadNum);
    else
        __sort_indexs(uint32_t,m_sorted_limit,comp,m_mtsets.threadNum);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
addq $0x10, %rdi
callq 0x424b0
testb $0x1, %al
jne 0x3eb49
jmp 0x3eb4e
jmp 0x3ef07
movq -0xb8(%rbp), %rdi
addq $0x10, %rdi
callq 0x424f0
movq -0xb8(%rbp), %rdi
movq %rax, -0x10(%rbp)
movq (%rdi), %rax
movq %rax, -0xc0(%rbp)
addq $0x90, %rdi
callq 0x29c40
movq -0xc0(%rbp), %rsi
movq %rax, %rdx
movq -0xb8(%rbp), %rax
movq 0xa8(%rax), %rcx
addq 0xb0(%rax), %rcx
leaq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r8d
callq 0x42510
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x3eccb
movq -0xb8(%rbp), %rax
movq -0x50(%rbp), %rdi
movq 0xc8(%rax), %rsi
movq (%rax), %rax
movq 0x8(%rax), %rdx
callq 0x3ef10
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0x58(%rbp)
movq -0x58(%rbp), %rdx
movq 0xc8(%rax), %rcx
leaq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x42570
leaq -0x48(%rbp), %rdi
callq 0x425f0
movq %rax, %rsi
movq -0xb8(%rbp), %rax
movq 0xc8(%rax), %rdx
movl $0x1, %edi
callq 0x51790
movq -0xb8(%rbp), %rdi
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xc8(%rbp)
addq $0x10, %rdi
movq -0x50(%rbp), %rsi
callq 0x42610
movq -0xc8(%rbp), %rdx
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rdx, (%rcx)
testb $0x1, 0x70(%rax)
je 0x3ec92
movq -0xb8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0xd0(%rbp)
addq $0x58, %rdi
movq -0x50(%rbp), %rsi
callq 0x42610
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x3ecb8
movq -0xb8(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, -0xd4(%rbp)
addq $0x40, %rdi
movq -0x50(%rbp), %rsi
callq 0x179f0
movl -0xd4(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x3ecba
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x3ebb4
movq -0xb8(%rbp), %rdi
addq $0x28, %rdi
movq -0x10(%rbp), %rsi
movl $0x20, %edx
callq 0x42630
movq -0xb8(%rbp), %rdi
movq %rdi, %rax
addq $0x28, %rax
movq %rax, -0xf0(%rbp)
addq $0x10, %rdi
callq 0x42680
movq -0xb8(%rbp), %rdi
movq %rax, -0xe8(%rbp)
addq $0x10, %rdi
callq 0x42680
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
movq %rax, %rdx
movq -0xb8(%rbp), %rax
movq -0x10(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rdx
movq 0x78(%rax), %rcx
callq 0x3ef50
movq -0xb8(%rbp), %rax
movq 0xc8(%rax), %rsi
movl $0x4000, %edi           # imm = 0x4000
callq 0x3eaf0
movq -0xb8(%rbp), %rdi
addq $0x1, %rax
movq %rax, -0x68(%rbp)
addq $0x10, %rdi
callq 0x42680
movq -0xb8(%rbp), %rdi
movq %rax, -0xe0(%rbp)
addq $0x10, %rdi
callq 0x424f0
movq -0xe0(%rbp), %rsi
movq %rax, %rdx
movq -0x68(%rbp), %rcx
leaq -0x80(%rbp), %rdi
callq 0x426a0
movq -0xb8(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x3ee60
movq -0xb8(%rbp), %rdi
addq $0x58, %rdi
callq 0x42680
movq -0xb8(%rbp), %rdi
movq %rax, -0xf8(%rbp)
addq $0x58, %rdi
callq 0x42680
movq -0xb8(%rbp), %rdi
movq %rax, -0x100(%rbp)
addq $0x58, %rdi
callq 0x424f0
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdi
movq %rax, %rcx
movq -0xb8(%rbp), %rax
shlq $0x3, %rcx
addq %rcx, %rsi
movq -0x80(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movq -0x78(%rbp), %rcx
movq %rcx, -0x90(%rbp)
movq -0x70(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movq 0x78(%rax), %rdx
leaq -0x98(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x3f1a0
jmp 0x3ef07
movq -0xb8(%rbp), %rdi
addq $0x40, %rdi
callq 0x14b30
movq -0xb8(%rbp), %rdi
movq %rax, -0x108(%rbp)
addq $0x40, %rdi
callq 0x14b30
movq -0xb8(%rbp), %rdi
movq %rax, -0x110(%rbp)
addq $0x40, %rdi
callq 0xc360
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movq -0xb8(%rbp), %rax
shlq $0x2, %rcx
addq %rcx, %rsi
movq -0x80(%rbp), %rcx
movq %rcx, -0xb0(%rbp)
movq -0x78(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movq -0x70(%rbp), %rcx
movq %rcx, -0xa0(%rbp)
movq 0x78(%rax), %rdx
leaq -0xb0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x3f2b0
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq