// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: (anonymous namespace)::first_search_and_dispose_cover_MT(std::vector<(anonymous namespace)::TOldCover, std::allocator<(anonymous namespace)::TOldCover>>&, (anonymous namespace)::TDiffData const&, hdiff_private::TSuffixString const&, int, ICoverLinesListener*, unsigned long, bool)
static void first_search_and_dispose_cover_MT(std::vector<TOldCover>& covers,const TDiffData& diff,
                                              const TSuffixString& sstring,int kMinSingleMatchScore,
                                              ICoverLinesListener* listener,size_t threadNum,bool isCanExtendCover){
#if (_IS_USED_MULTITHREAD)
    const size_t kMinParallelSize=1024*1024*2;
    const size_t kBestParallelSize=1024*1024*8;
    size_t newSize=diff.newData_end-diff.newData;
    if ((threadNum>1)&&(diff.oldData!=diff.oldData_end)&&(newSize>=kMinParallelSize)){
        const size_t maxThreanNum=newSize/(kMinParallelSize/2);
        threadNum=(threadNum<=maxThreanNum)?threadNum:maxThreanNum;
        size_t workCount=(newSize+kBestParallelSize-1)/kBestParallelSize;
        workCount=(threadNum>workCount)?threadNum:workCount;

        const size_t threadCount=threadNum-1;
        std::vector<std::thread> threads(threadCount);
        std::vector<std::vector<TOldCover> > threadCovers(threadCount);
        mt_data_t mt_data;
        mt_data.diff=&diff;
        mt_data.sstring=&sstring;
        mt_data.listener=(listener&&listener->next_search_block_MT)?listener:0;
        mt_data.kMinSingleMatchScore=kMinSingleMatchScore;
        mt_data.workBlockSize=(newSize+workCount-1)/workCount;
        mt_data.workIndex=0;
        mt_data.isCanExtendCover=isCanExtendCover;
        if (mt_data.listener&&listener->begin_search_block)
            listener->begin_search_block(listener,newSize,mt_data.workBlockSize,kPartPepeatSize);
        for (size_t i=0;i<threadCount;i++)
            threads[i]=std::thread(_fsearch_and_dispose_cover_thread,&threadCovers[i],&mt_data);
        _fsearch_and_dispose_cover_thread(&covers,&mt_data);
        for (size_t i=0;i<threadCount;i++){
            threads[i].join();
            covers.insert(covers.end(),threadCovers[i].begin(),threadCovers[i].end());
            { std::vector<TOldCover> tmp; tmp.swap(threadCovers[i]); }
        }
        tm_collate_covers(covers);
    }else
#endif
    {
        first_search_and_dispose_cover(covers,diff,sstring,kMinSingleMatchScore,isCanExtendCover);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movb 0x10(%rbp), %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
movq $0x200000, -0x40(%rbp)  # imm = 0x200000
movq $0x800000, -0x48(%rbp)  # imm = 0x800000
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x50(%rbp)
cmpq $0x1, -0x30(%rbp)
jbe 0x1e300
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
je 0x1e300
cmpq $0x200000, -0x50(%rbp)  # imm = 0x200000
jb 0x1e300
movq -0x50(%rbp), %rax
shrq $0x14, %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x58(%rbp), %rax
ja 0x1dec2
movq -0x30(%rbp), %rax
movq %rax, -0x160(%rbp)
jmp 0x1decd
movq -0x58(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rax
addq $0x800000, %rax         # imm = 0x800000
subq $0x1, %rax
shrq $0x17, %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x60(%rbp), %rax
jbe 0x1df05
movq -0x30(%rbp), %rax
movq %rax, -0x168(%rbp)
jmp 0x1df10
movq -0x60(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
decq %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x29f40
movq -0x178(%rbp), %rsi
movq -0x170(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x29f60
jmp 0x1df5d
leaq -0x81(%rbp), %rdi
callq 0x29fd0
movq -0x68(%rbp), %rax
movq %rax, -0x188(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x1ea80
movq -0x188(%rbp), %rsi
movq -0x180(%rbp), %rdx
leaq -0xb0(%rbp), %rdi
callq 0x1eaa0
jmp 0x1dfa3
leaq -0xb1(%rbp), %rdi
callq 0x1eb10
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1dfe4
movq -0x28(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x1dfe4
movq -0x28(%rbp), %rax
movq %rax, -0x190(%rbp)
jmp 0x1dfef
xorl %eax, %eax
movq %rax, -0x190(%rbp)
jmp 0x1dfef
movq -0x190(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0xd8(%rbp)
movq -0x50(%rbp), %rax
addq -0x60(%rbp), %rax
subq $0x1, %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x60(%rbp)
movq %rax, -0xd0(%rbp)
leaq -0xf0(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x29ff0
movb -0x31(%rbp), %al
andb $0x1, %al
movb %al, -0xc8(%rbp)
cmpq $0x0, -0xe0(%rbp)
je 0x1e0e4
movq -0x28(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x1e0e4
movq -0x28(%rbp), %rdi
movq 0x28(%rdi), %rax
movq -0x50(%rbp), %rsi
movq -0xd0(%rbp), %rdx
movl $0x800, %ecx            # imm = 0x800
callq *%rax
jmp 0x1e079
jmp 0x1e0e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x81(%rbp), %rdi
callq 0x29fd0
jmp 0x1e329
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0xb1(%rbp), %rdi
callq 0x1eb10
jmp 0x1e2f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x1f2e0
jmp 0x1e2f5
movq $0x0, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
cmpq -0x68(%rbp), %rax
jae 0x1e18d
movq -0xf8(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x1ec50
movq %rax, -0x108(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq 0xa01(%rip), %rsi       # 0x1eb30
leaq -0x100(%rbp), %rdi
leaq -0x108(%rbp), %rdx
leaq -0x110(%rbp), %rcx
callq 0x1ec70
jmp 0x1e14b
movq -0xf8(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x2a090
movq %rax, %rdi
leaq -0x100(%rbp), %rsi
callq 0x2a0b0
leaq -0x100(%rbp), %rdi
callq 0x2a0f0
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x1e0ef
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x1eb30
jmp 0x1e19f
movq $0x0, -0x118(%rbp)
movq -0x118(%rbp), %rax
cmpq -0x68(%rbp), %rax
jae 0x1e2d3
movq -0x118(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x2a090
movq %rax, %rdi
callq 0x4620
jmp 0x1e1d5
movq -0x8(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x1edf0
movq %rax, -0x128(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x1ee20
movq -0x118(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x1ec50
movq %rax, %rdi
callq 0x1ee60
movq -0x1a8(%rbp), %rdi
movq %rax, -0x130(%rbp)
movq -0x118(%rbp), %rsi
callq 0x1ec50
movq %rax, %rdi
callq 0x1edf0
movq -0x1a0(%rbp), %rdi
movq %rax, -0x138(%rbp)
movq -0x120(%rbp), %rsi
movq -0x130(%rbp), %rdx
movq -0x138(%rbp), %rcx
callq 0x1ed40
movq %rax, -0x198(%rbp)
jmp 0x1e274
movq -0x198(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x18c60
movq -0x118(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x1ec50
movq %rax, %rsi
leaq -0x158(%rbp), %rdi
callq 0x1ee90
leaq -0x158(%rbp), %rdi
callq 0x19760
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x1e1aa
movq -0x8(%rbp), %rdi
callq 0x1eef0
jmp 0x1e2de
leaq -0xb0(%rbp), %rdi
callq 0x1f2e0
leaq -0x80(%rbp), %rdi
callq 0x2a120
jmp 0x1e320
leaq -0x80(%rbp), %rdi
callq 0x2a120
jmp 0x1e329
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movb -0x31(%rbp), %al
xorl %r8d, %r8d
andb $0x1, %al
movzbl %al, %r9d
callq 0x1f340
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x4680
nopw %cs:(%rax,%rax)