// File: readmapping[P]alfalfa/src/mapper.cpp
// Function: calculateSeedsBothStrands(sparseSA const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, align_opt const&, std::vector<match_t, std::allocator<match_t>>&, std::vector<match_t, std::allocator<match_t>>&)
void calculateSeedsBothStrands(const sparseSA& sa, const string& P, const string& Prc, int min_len, const align_opt & alnOptions, vector<match_t>& matches, vector<match_t>& matchesRC){
    int maxBranchWidth = alnOptions.maxSeedCandidates;
    mum_t memType = alnOptions.memType;
    int sparseSkip = 1;
    if (sa.K >= 4) sparseSkip = max((min_len - 10) / (int)sa.K,1);
    else sparseSkip = max((min_len - 12) / (int)sa.K,1);
    if(alnOptions.noSparseQ) sparseSkip = 1;
    if(alnOptions.print >= 6) cerr << "min_len " << min_len << " and sparseSkip " << sparseSkip << endl;
    if(!alnOptions.noFW)
        executeSeedType(sa, P, min_len, memType, maxBranchWidth, sparseSkip, matches, alnOptions.maxSmemMemStart);
    if(!alnOptions.noRC)
        executeSeedType(sa, Prc, min_len, memType, maxBranchWidth, sparseSkip, matchesRC, alnOptions.maxSmemMemStart);
    if(alnOptions.rescue && matches.empty() && matchesRC.empty()){
        if(alnOptions.print >= 2) cerr << "#MEMRESCUE" << endl;
        int minLength = max(MIN_SEED_LENGTH, (int)sa.K+10);//requires some difference with sparseness
        if(!alnOptions.noFW)
            executeSeedType(sa, P, (minLength+min_len)/2, memType, 100000, 1, matches, alnOptions.maxSmemMemStart);
        if(!alnOptions.noRC)
            executeSeedType(sa, Prc, (minLength+min_len)/2, memType, 100000, 1, matchesRC, alnOptions.maxSmemMemStart);
        if(matches.empty() && matchesRC.empty()){
            if(!alnOptions.noFW)
                executeSeedType(sa, P, minLength, memType, 100000, 1, matches, alnOptions.maxSmemMemStart);
            if(!alnOptions.noRC)
                executeSeedType(sa, Prc, minLength, memType, 100000, 1, matchesRC, alnOptions.maxSmemMemStart);
        }
    }
    if(alnOptions.print >= 2){ 
        cerr << "#MEMF " << matches.size() << endl;
        cerr << "#MEMR " << matchesRC.size() << endl;
        if(alnOptions.print >= 6){
            cerr << "seeds fw: " << endl;
            for(size_t i = 0; i < matches.size(); i++)
                cerr << "q,r,l " << matches[i].query << "," << matches[i].ref << "," << matches[i].len << endl;
            cerr << "seeds rev: " << endl;
            for(size_t i = 0; i < matchesRC.size(); i++)
                cerr << "q,r,l " << matchesRC[i].query << "," << matchesRC[i].ref << "," << matchesRC[i].len << endl;
        }
    }
}

// Assembly:
subq $0xc8, %rsp
movq 0xd0(%rsp), %rax
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq %rdx, 0xb0(%rsp)
movl %ecx, 0xac(%rsp)
movq %r8, 0xa0(%rsp)
movq %r9, 0x98(%rsp)
movq 0xa0(%rsp), %rax
movl 0x40(%rax), %eax
movl %eax, 0x94(%rsp)
movq 0xa0(%rsp), %rax
movl 0x88(%rax), %eax
movl %eax, 0x90(%rsp)
movl $0x1, 0x8c(%rsp)
movq 0xc0(%rsp), %rax
cmpq $0x4, 0xe8(%rax)
jl 0x3d4c0
movl 0xac(%rsp), %eax
subl $0xa, %eax
movq 0xc0(%rsp), %rcx
movq 0xe8(%rcx), %rcx
cltd
idivl %ecx
movl %eax, 0x88(%rsp)
movl $0x1, 0x84(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x84(%rsp), %rsi
callq 0x14d40
movl (%rax), %eax
movl %eax, 0x8c(%rsp)
jmp 0x3d506
movl 0xac(%rsp), %eax
subl $0xc, %eax
movq 0xc0(%rsp), %rcx
movq 0xe8(%rcx), %rcx
cltd
idivl %ecx
movl %eax, 0x80(%rsp)
movl $0x1, 0x7c(%rsp)
leaq 0x80(%rsp), %rdi
leaq 0x7c(%rsp), %rsi
callq 0x14d40
movl (%rax), %eax
movl %eax, 0x8c(%rsp)
movq 0xa0(%rsp), %rax
testb $0x1, 0x72(%rax)
je 0x3d51f
movl $0x1, 0x8c(%rsp)
movq 0xa0(%rsp), %rax
cmpl $0x6, 0x78(%rax)
jl 0x3d57c
movq 0x59abc(%rip), %rdi     # 0x96ff0
leaq 0x40770(%rip), %rsi     # 0x7dcab
callq 0x8360
movq %rax, %rdi
movl 0xac(%rsp), %esi
callq 0x8710
movq %rax, %rdi
leaq 0x4075b(%rip), %rsi     # 0x7dcb4
callq 0x8360
movq %rax, %rdi
movl 0x8c(%rsp), %esi
callq 0x8710
movq %rax, %rdi
movq 0x59a39(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0xa0(%rsp), %rax
testb $0x1, 0x74(%rax)
jne 0x3d5d8
movq 0xc0(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl 0xac(%rsp), %edx
movl 0x90(%rsp), %ecx
movl 0x94(%rsp), %r8d
movl 0x8c(%rsp), %r9d
movq 0x98(%rsp), %r10
movq 0xa0(%rsp), %rax
movl 0x44(%rax), %eax
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x4c3c0
movq 0xa0(%rsp), %rax
testb $0x1, 0x75(%rax)
jne 0x3d634
movq 0xc0(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movl 0xac(%rsp), %edx
movl 0x90(%rsp), %ecx
movl 0x94(%rsp), %r8d
movl 0x8c(%rsp), %r9d
movq 0xd0(%rsp), %r10
movq 0xa0(%rsp), %rax
movl 0x44(%rax), %eax
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x4c3c0
movq 0xa0(%rsp), %rax
testb $0x1, 0x71(%rax)
je 0x3d875
movq 0x98(%rsp), %rdi
callq 0x4c370
testb $0x1, %al
jne 0x3d65c
jmp 0x3d875
movq 0xd0(%rsp), %rdi
callq 0x4c370
testb $0x1, %al
jne 0x3d672
jmp 0x3d875
movq 0xa0(%rsp), %rax
cmpl $0x2, 0x78(%rax)
jl 0x3d6a2
movq 0x59969(%rip), %rdi     # 0x96ff0
leaq 0x40637(%rip), %rsi     # 0x7dcc5
callq 0x8360
movq %rax, %rdi
movq 0x59913(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0xc0(%rsp), %rax
movq 0xe8(%rax), %rax
addl $0xa, %eax
movl %eax, 0x74(%rsp)
leaq 0x411e5(%rip), %rdi     # 0x7e8a4
leaq 0x74(%rsp), %rsi
callq 0x14d40
movl (%rax), %eax
movl %eax, 0x78(%rsp)
movq 0xa0(%rsp), %rax
testb $0x1, 0x74(%rax)
jne 0x3d735
movq 0xc0(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl 0x78(%rsp), %eax
addl 0xac(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movl 0x90(%rsp), %ecx
movq 0x98(%rsp), %r10
movq 0xa0(%rsp), %rax
movl 0x44(%rax), %eax
movl $0x186a0, %r8d          # imm = 0x186A0
movl $0x1, %r9d
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x4c3c0
movq 0xa0(%rsp), %rax
testb $0x1, 0x75(%rax)
jne 0x3d79b
movq 0xc0(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movl 0x78(%rsp), %eax
addl 0xac(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movl 0x90(%rsp), %ecx
movq 0xd0(%rsp), %r10
movq 0xa0(%rsp), %rax
movl 0x44(%rax), %eax
movl $0x186a0, %r8d          # imm = 0x186A0
movl $0x1, %r9d
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x4c3c0
movq 0x98(%rsp), %rdi
callq 0x4c370
testb $0x1, %al
jne 0x3d7b1
jmp 0x3d873
movq 0xd0(%rsp), %rdi
callq 0x4c370
testb $0x1, %al
jne 0x3d7c7
jmp 0x3d873
movq 0xa0(%rsp), %rax
testb $0x1, 0x74(%rax)
jne 0x3d81c
movq 0xc0(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl 0x78(%rsp), %edx
movl 0x90(%rsp), %ecx
movq 0x98(%rsp), %r10
movq 0xa0(%rsp), %rax
movl 0x44(%rax), %eax
movl $0x186a0, %r8d          # imm = 0x186A0
movl $0x1, %r9d
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x4c3c0
movq 0xa0(%rsp), %rax
testb $0x1, 0x75(%rax)
jne 0x3d871
movq 0xc0(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movl 0x78(%rsp), %edx
movl 0x90(%rsp), %ecx
movq 0xd0(%rsp), %r10
movq 0xa0(%rsp), %rax
movl 0x44(%rax), %eax
movl $0x186a0, %r8d          # imm = 0x186A0
movl $0x1, %r9d
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x4c3c0
jmp 0x3d873
jmp 0x3d875
movq 0xa0(%rsp), %rax
cmpl $0x2, 0x78(%rax)
jl 0x3db43
movq 0x59762(%rip), %rdi     # 0x96ff0
leaq 0x4043b(%rip), %rsi     # 0x7dcd0
callq 0x8360
movq %rax, 0x50(%rsp)
movq 0x98(%rsp), %rdi
callq 0x23440
movq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0x8100
movq %rax, %rdi
movq 0x596ed(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0x59721(%rip), %rdi     # 0x96ff0
leaq 0x40401(%rip), %rsi     # 0x7dcd7
callq 0x8360
movq %rax, 0x58(%rsp)
movq 0xd0(%rsp), %rdi
callq 0x23440
movq 0x58(%rsp), %rdi
movq %rax, %rsi
callq 0x8100
movq %rax, %rdi
movq 0x596ac(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0xa0(%rsp), %rax
cmpl $0x6, 0x78(%rax)
jl 0x3db41
movq 0x596ce(%rip), %rdi     # 0x96ff0
leaq 0x403b5(%rip), %rsi     # 0x7dcde
callq 0x8360
movq %rax, %rdi
movq 0x59678(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq $0x0, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x98(%rsp), %rdi
callq 0x23440
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jae 0x3da2d
movq 0x5967b(%rip), %rdi     # 0x96ff0
leaq 0x4036d(%rip), %rsi     # 0x7dce9
callq 0x8360
movq %rax, 0x30(%rsp)
movq 0x98(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x4c200
movq 0x30(%rsp), %rdi
movl 0x8(%rax), %esi
callq 0x8710
movq %rax, %rdi
leaq 0x40341(%rip), %rsi     # 0x7dcf0
callq 0x8360
movq %rax, 0x38(%rsp)
movq 0x98(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x4c200
movq 0x38(%rsp), %rdi
movq (%rax), %rsi
callq 0x8790
movq %rax, %rdi
leaq 0x4030e(%rip), %rsi     # 0x7dcf0
callq 0x8360
movq %rax, 0x40(%rsp)
movq 0x98(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x4c200
movq 0x40(%rsp), %rdi
movl 0xc(%rax), %esi
callq 0x8710
movq %rax, %rdi
movq 0x5959b(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x3d946
movq 0x595bc(%rip), %rdi     # 0x96ff0
leaq 0x402b7(%rip), %rsi     # 0x7dcf2
callq 0x8360
movq %rax, %rdi
movq 0x59566(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xd0(%rsp), %rdi
callq 0x23440
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0x3db3f
movq 0x59569(%rip), %rdi     # 0x96ff0
leaq 0x4025b(%rip), %rsi     # 0x7dce9
callq 0x8360
movq %rax, 0x10(%rsp)
movq 0xd0(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x4c200
movq 0x10(%rsp), %rdi
movl 0x8(%rax), %esi
callq 0x8710
movq %rax, %rdi
leaq 0x4022f(%rip), %rsi     # 0x7dcf0
callq 0x8360
movq %rax, 0x18(%rsp)
movq 0xd0(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x4c200
movq 0x18(%rsp), %rdi
movq (%rax), %rsi
callq 0x8790
movq %rax, %rdi
leaq 0x401fc(%rip), %rsi     # 0x7dcf0
callq 0x8360
movq %rax, 0x20(%rsp)
movq 0xd0(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x4c200
movq 0x20(%rsp), %rdi
movl 0xc(%rax), %esi
callq 0x8710
movq %rax, %rdi
movq 0x59489(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x3da58
jmp 0x3db41
jmp 0x3db43
addq $0xc8, %rsp
retq
nopl (%rax,%rax)