// File: /workspace/github_cpp_makefile_star2_O3/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 0x1fc0c
movq %rdi, %r14
movq 0x8(%rdi), %r13
movq 0xc8(%rdi), %rbp
movq 0x8(%r13), %r15
subq %rbp, %r15
jb 0x1fc0c
movq %rsi, %r12
movq %r14, %rdi
callq 0x1d822
cmpq $0x2, %rax
jb 0x1fbea
movq %rax, %rbx
callq 0x48794
movq %rax, %r12
movq %rax, 0x18(%rsp)
callq 0x48794
movq %rax, %rcx
leaq (,%rbp,2), %rax
cmpq $0x400000, %rbp         # imm = 0x400000
movl $0x800000, %esi         # imm = 0x800000
cmovaeq %rax, %rsi
addq %rsi, %r15
movq %r15, %rax
xorl %edx, %edx
divq %rsi
cmpq %rax, %rbx
cmovaq %rbx, %rax
movq %rcx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
decq %rbx
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x15522
movq 0x90(%r14), %rax
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
xorl %r13d, %r13d
leaq 0x40(%rsp), %rbp
leaq 0x10(%rsp), %r15
leaq 0x38(%rsp), %r12
movq %r14, 0x40(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x116(%rip), %rsi       # 0x1fc61
movq %rbp, %rdx
movq %r15, %rcx
leaq 0x8(%rsp), %r8
movq %r12, %r9
callq 0x20618
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax,%r13,8)
jne 0x1fc1b
movq 0x48(%rsp), %rcx
movq %rcx, (%rax,%r13,8)
incq %r13
movq 0x8(%rsp), %rdx
addq 0xa8(%r14), %rdx
addq 0xb0(%r14), %rdx
movq %rdx, 0x8(%rsp)
cmpq %r13, %rbx
jne 0x1fb30
movq 0x10(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %rdi
callq 0x1f95a
xorl %r14d, %r14d
movq 0x50(%rsp), %rdi
addq %r14, %rdi
callq 0x4580
addq $0x8, %r14
decq %rbx
jne 0x1fbac
movq 0x10(%rsp), %rdi
callq *0x8(%rdi)
leaq 0x50(%rsp), %rdi
callq 0x15590
movq 0x20(%rsp), %rdi
callq 0x487b3
movq 0x18(%rsp), %rdi
callq 0x487b3
jmp 0x1fc0c
movq 0x90(%r14), %r8
movq $0x0, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %r9d, %r9d
callq 0x1e02e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x40b0
jmp 0x1fc36
jmp 0x1fc36
movq %rax, %rbx
jmp 0x1fc4f
movq %rax, %rbx
movq %r12, %rdi
callq 0x487b3
jmp 0x1fc59
movq %rax, %rdi
callq 0x9b7c
jmp 0x1fc42
jmp 0x1fc42
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x15590
leaq 0x18(%rsp), %rdi
callq 0x206ba
movq %rbx, %rdi
callq 0x45e0