// 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(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 0x1fc59
movq %rdi, %r14
movq 0x8(%rdi), %r13
movq 0xc8(%rdi), %rbp
movq 0x8(%r13), %r15
subq %rbp, %r15
jb 0x1fc59
movq %rsi, %r12
movq %r14, %rdi
callq 0x1dc66
cmpq $0x2, %rax
jb 0x1fc37
movq %rax, %rbx
xorl %r12d, %r12d
movq %r12, 0x18(%rsp)
callq 0x49420
movq %rax, 0x18(%rsp)
movq %r12, 0x20(%rsp)
callq 0x49420
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 0x1585c
movq 0x90(%r14), %rdx
movq %rdx, 0x8(%rsp)
testq %rbx, %rbx
je 0x1fbdf
xorl %r13d, %r13d
leaq 0x10(%rsp), %rbp
leaq 0x8(%rsp), %r15
leaq 0x38(%rsp), %r12
movq %r14, 0x40(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x11d(%rip), %rsi       # 0x1fcb0
leaq 0x40(%rsp), %rdx
movq %rbp, %rcx
movq %r15, %r8
movq %r12, %r9
callq 0x20642
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax,%r13,8)
jne 0x1fc68
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 0x1fb78
movq 0x10(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %rdi
callq 0x1f992
testq %rbx, %rbx
je 0x1fc0f
xorl %r14d, %r14d
movq 0x50(%rsp), %rdi
addq %r14, %rdi
callq 0x4580
addq $0x8, %r14
decq %rbx
jne 0x1fbf9
movq 0x10(%rsp), %rdi
callq *0x8(%rdi)
leaq 0x50(%rsp), %rdi
callq 0x158d4
movq 0x20(%rsp), %rdi
callq 0x4943f
movq 0x18(%rsp), %rdi
callq 0x4943f
jmp 0x1fc59
movq 0x90(%r14), %r8
movq $0x0, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %r9d, %r9d
callq 0x1e48a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x40b0
jmp 0x1fc85
jmp 0x1fc85
movq %rax, %rbx
jmp 0x1fc9e
movq %rax, %rbx
movq 0x18(%rsp), %rdi
callq 0x4943f
jmp 0x1fca8
movq %rax, %rdi
callq 0x9db0
jmp 0x1fc91
jmp 0x1fc91
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x158d4
leaq 0x18(%rsp), %rdi
callq 0x206f4
movq %rbx, %rdi
callq 0x45e0