// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::TDigestMatcher::search_cover(hpatch_TOutputCovers*)
void TDigestMatcher::search_cover(hpatch_TOutputCovers* out_covers){
    if (m_blocks.empty()) return;
    if (m_newData->streamSize<m_kMatchBlockSize) return;
#if (_IS_USED_MULTITHREAD)
    size_t threadNum=getSearchThreadNum();
    if (threadNum>1){
        const hpatch_StreamPos_t rollCount=m_newData->streamSize-(m_kMatchBlockSize-1);
        size_t bestStep=(kBestParallelSize/2>m_kMatchBlockSize)?kBestParallelSize:2*m_kMatchBlockSize;
        hpatch_StreamPos_t workCount=(rollCount+bestStep-1)/bestStep;
        workCount=(threadNum>workCount)?threadNum:workCount;
        mt_data_t mt_data;
        mt_data.workCount=(uint_work)workCount;
        if ((sizeof(mt_data.workCount)<sizeof(workCount))&&(mt_data.workCount!=workCount))
            throw std::runtime_error("TDigestMatcher::search_cover() multi-thread workCount error!");
        mt_data.workIndex=0;
        const size_t threadCount=threadNum-1;
        std::vector<std::thread> threads(threadCount);
        unsigned char* pmem=m_mem.data();
        for (size_t i=0;i<threadCount;i++,pmem+=(m_newCacheSize+m_oldCacheSize))
            threads[i]=std::thread(__search_cover_mt,this,out_covers,pmem,&mt_data);
        __search_cover_mt(this,out_covers,pmem,&mt_data);
        for (size_t i=0;i<threadCount;i++)
            threads[i].join();
        out_covers->collate_covers(out_covers);
    }else
#endif
    {
        _search_cover(m_newData,0,out_covers,m_mem.data());
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, 0x10(%rsp)
movq 0x10(%rdi), %rax
cmpq 0x18(%rdi), %rax
je 0x1b032
movq %rdi, %r14
movq 0x8(%rdi), %rbx
movq 0xc8(%rdi), %rbp
movq 0x8(%rbx), %r13
subq %rbp, %r13
jb 0x1b032
movq %rsi, %r15
movq %r14, %rdi
callq 0x198c0
cmpq $0x2, %rax
jb 0x1afc8
movq %rax, %r12
leaq (,%rbp,2), %rax
cmpq $0x400000, %rbp         # imm = 0x400000
movl $0x800000, %ecx         # imm = 0x800000
cmovaeq %rax, %rcx
addq %rcx, %r13
movq %r13, %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r15
cmpq %rax, %r12
cmovaq %r12, %r15
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x1b764
movq %r15, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
decq %r12
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %r12, %rsi
callq 0x11f04
movq 0x90(%r14), %rdx
xorl %r15d, %r15d
leaq 0x60(%rsp), %r13
leaq 0x18(%rsp), %rbp
movq %r12, %rbx
movq %rdx, 0x8(%rsp)
subq $0x1, %rbx
jb 0x1afe9
movq %r14, 0x20(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r13, %rdi
leaq 0xe9(%rip), %rsi        # 0x1b069
leaq 0x20(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %rbp, %r9
callq 0x1b794
movq 0x28(%rsp), %rdi
addq %r15, %rdi
movq %r13, %rsi
callq 0x11f56
movq %r13, %rdi
callq 0x11f70
movq 0x8(%rsp), %rdx
addq 0xa8(%r14), %rdx
addq 0xb0(%r14), %rdx
addq $0x8, %r15
jmp 0x1af58
movq 0x90(%r14), %r8
andq $0x0, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r15, %rcx
xorl %r9d, %r9d
callq 0x19e6c
jmp 0x1b032
movq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rcx
movq %r14, %rdi
callq 0x1adac
xorl %ebx, %ebx
subq $0x1, %r12
jb 0x1b016
movq 0x28(%rsp), %rdi
addq %rbx, %rdi
callq 0x45a0
addq $0x8, %rbx
jmp 0x1affd
movq 0x10(%rsp), %rdi
callq *0x8(%rdi)
leaq 0x28(%rsp), %rdi
callq 0x11f7e
leaq 0x40(%rsp), %rdi
callq 0x1b830
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1b057
jmp 0x1b04a
jmp 0x1b04a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x11f7e
leaq 0x40(%rsp), %rdi
callq 0x1b830
movq %rbx, %rdi
callq 0x4600