// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: (anonymous namespace)::TDiffResearchCover::doResearchCover(IDiffSearchCoverListener*, unsigned long, unsigned long long, unsigned long long, unsigned long long)
inline void doResearchCover(IDiffSearchCoverListener* listener,size_t limitCoverIndex,
                                hpatch_StreamPos_t endPosBack,hpatch_StreamPos_t hitPos,hpatch_StreamPos_t hitLen){
        if (limitCoverIndex_back!=limitCoverIndex)
            endResearchCover();
        limitCoverIndex_back=limitCoverIndex;
        limitCoverHitEndPos_back=hitPos+hitLen;
        
        const TOldCover& cover=covers[limitCoverIndex];
        TOldCover lastCover_back(0,0,0);
        if (endPosBack<hitPos){
            lastCover_back.oldPos=cover.oldPos+(TInt)endPosBack;
            lastCover_back.newPos=cover.newPos+(TInt)endPosBack;
            lastCover_back.length=(TInt)(hitPos-endPosBack);
            reCovers.push_back(lastCover_back);
        }else {
            assert(endPosBack==hitPos);
            if (limitCoverIndex>0)
                lastCover_back=covers[limitCoverIndex-1];
            if ((!reCovers.empty())&&(reCovers.back().newPos>lastCover_back.newPos))
                lastCover_back=reCovers.back();
        }

        TDiffLimit diffLimit={listener,cover.newPos+(size_t)hitPos,cover.newPos+(size_t)(hitPos+hitLen),
                              cover.oldPos+(size_t)hitPos,cover.oldPos+(size_t)(hitPos+hitLen),   
                              nocover_detect,cover_detect,lastCover_back,kMaxMatchDeep};
        _researchRange(&diffLimit);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq 0x58(%rax), %rax
cmpq -0x18(%rbp), %rax
je 0x25444
movq -0xb0(%rbp), %rdi
callq 0x25640
movq -0xb0(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0x28(%rbp), %rcx
addq -0x30(%rbp), %rcx
movq %rcx, 0x60(%rax)
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x1fb50
movq %rax, -0x38(%rbp)
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x1cc20
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x254d1
movq -0xb0(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
subq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0x28, %rdi
leaq -0x50(%rbp), %rsi
callq 0x23820
jmp 0x25589
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x254dd
jmp 0x254fc
leaq 0x8a024(%rip), %rdi     # 0xaf508
leaq 0x89897(%rip), %rsi     # 0xaed82
movl $0x36d, %edx            # imm = 0x36D
leaq 0x8a024(%rip), %rcx     # 0xaf51b
callq 0x4270
cmpq $0x0, -0x18(%rbp)
jbe 0x25532
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
subq $0x1, %rsi
callq 0x1fb50
movq (%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0xb0(%rbp), %rdi
addq $0x28, %rdi
callq 0x1cb70
testb $0x1, %al
jne 0x25587
movq -0xb0(%rbp), %rdi
addq $0x28, %rdi
callq 0x1cbb0
movq 0x8(%rax), %rax
cmpq -0x48(%rbp), %rax
jle 0x25587
movq -0xb0(%rbp), %rdi
addq $0x28, %rdi
callq 0x1cbb0
movq (%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x25589
movq -0xb0(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rcx
addq -0x28(%rbp), %rcx
movq %rcx, -0xa0(%rbp)
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x28(%rbp), %rdx
addq -0x30(%rbp), %rdx
addq %rdx, %rcx
movq %rcx, -0x98(%rbp)
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
addq -0x28(%rbp), %rcx
movq %rcx, -0x90(%rbp)
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
movq -0x28(%rbp), %rdx
addq -0x30(%rbp), %rdx
addq %rdx, %rcx
movq %rcx, -0x88(%rbp)
movq %rax, %rcx
addq $0x70, %rcx
movq %rcx, -0x80(%rbp)
addq $0xa0, %rax
movq %rax, -0x78(%rbp)
leaq -0xa8(%rbp), %rdi
addq $0x38, %rdi
leaq -0x50(%rbp), %rsi
callq 0x20e80
movq -0xb0(%rbp), %rdi
movl 0x24(%rdi), %eax
movl %eax, -0x58(%rbp)
leaq -0xa8(%rbp), %rsi
callq 0x256c0
addq $0xb0, %rsp
popq %rbp
retq
nop