// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, %r14
movl %ecx, %r15d
movq %rdx, 0x18(%rsp)
movl 0x40(%r8), %r12d
movl 0x78(%r8), %ecx
movl 0x88(%r8), %eax
movl %eax, 0xc(%rsp)
movq %rdi, 0x10(%rsp)
movq 0xe8(%rdi), %rdi
xorl %eax, %eax
cmpq $0x4, %rdi
setge %al
leal (%r15,%rax,2), %eax
addl $-0xc, %eax
cltd
idivl %edi
movl %eax, %ebp
cmpl $0x2, %eax
pushq $0x1
popq %rax
cmovll %eax, %ebp
cmpb $0x0, 0x72(%r8)
movq %rsi, %r13
cmovnel %eax, %ebp
cmpl $0x6, %ecx
jl 0x1a954
movq 0x2f6cc(%rip), %rdi     # 0x49fe8
leaq 0x1c4e8(%rip), %rsi     # 0x36e0b
callq 0x72b0
movq %rax, %rdi
movl %r15d, %esi
callq 0x75c0
leaq 0x1c4da(%rip), %rsi     # 0x36e14
movq %rax, %rdi
callq 0x72b0
movq %rax, %rdi
movl %ebp, %esi
callq 0x75c0
movq %rax, %rdi
callq 0x7160
cmpb $0x0, 0x74(%r14)
jne 0x1a97d
movl 0x44(%r14), %eax
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movl %r15d, %edx
movl 0xc(%rsp), %ecx
movl %r12d, %r8d
movl %ebp, %r9d
pushq %rax
pushq %rbx
callq 0x21f89
popq %rax
popq %rcx
movq %r13, 0x20(%rsp)
movq 0x60(%rsp), %r13
cmpb $0x0, 0x75(%r14)
jne 0x1a9b3
movl 0x44(%r14), %eax
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %r15d, %edx
movl 0xc(%rsp), %ecx
movl %r12d, %r8d
movl %ebp, %r9d
pushq %rax
pushq %r13
callq 0x21f89
popq %rax
popq %rcx
cmpb $0x1, 0x71(%r14)
jne 0x1aaf9
movq (%rbx), %rax
cmpq 0x8(%rbx), %rax
jne 0x1aaf9
movq (%r13), %rax
cmpq 0x8(%r13), %rax
jne 0x1aaf9
cmpl $0x2, 0x78(%r14)
jl 0x1a9fb
movq 0x2f601(%rip), %rdi     # 0x49fe8
leaq 0x1c437(%rip), %rsi     # 0x36e25
callq 0x72b0
movq %rax, %rdi
callq 0x7160
movq 0x10(%rsp), %rax
movl 0xe8(%rax), %eax
cmpl $0xb, %eax
pushq $0xa
popq %r12
cmovgel %eax, %r12d
addl $0xa, %r12d
cmpb $0x0, 0x74(%r14)
pushq $0x2
popq %rbp
jne 0x1aa4e
leal (%r12,%r15), %eax
cltd
idivl %ebp
movl 0x44(%r14), %r10d
pushq $0x1
popq %r9
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %eax, %edx
movl 0xc(%rsp), %ecx
movl $0x186a0, %r8d          # imm = 0x186A0
pushq %r10
pushq %rbx
callq 0x21f89
popq %rax
popq %rcx
cmpb $0x0, 0x75(%r14)
jne 0x1aa87
addl %r12d, %r15d
movl %r15d, %eax
cltd
idivl %ebp
movl 0x44(%r14), %r10d
pushq $0x1
popq %r9
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %eax, %edx
movl 0xc(%rsp), %ecx
movl $0x186a0, %r8d          # imm = 0x186A0
pushq %r10
pushq %r13
callq 0x21f89
popq %rax
popq %rcx
movq (%rbx), %rax
cmpq 0x8(%rbx), %rax
jne 0x1aaf9
movq (%r13), %rax
cmpq 0x8(%r13), %rax
jne 0x1aaf9
cmpb $0x0, 0x74(%r14)
jne 0x1aac9
movl 0x44(%r14), %eax
pushq $0x1
popq %r9
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %r12d, %edx
movl 0xc(%rsp), %ecx
movl $0x186a0, %r8d          # imm = 0x186A0
pushq %rax
pushq %rbx
callq 0x21f89
popq %rax
popq %rcx
cmpb $0x0, 0x75(%r14)
jne 0x1aaf9
movl 0x44(%r14), %eax
pushq $0x1
popq %r9
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %r12d, %edx
movl 0xc(%rsp), %ecx
movl $0x186a0, %r8d          # imm = 0x186A0
pushq %rax
pushq %r13
callq 0x21f89
popq %rax
popq %rcx
cmpl $0x2, 0x78(%r14)
jl 0x1acb2
movq 0x2f4dd(%rip), %r15     # 0x49fe8
leaq 0x1c31e(%rip), %rsi     # 0x36e30
movq %r15, %rdi
callq 0x72b0
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x4, %rsi
movq %rax, %rdi
callq 0x71d0
movq %rax, %rdi
callq 0x7160
leaq 0x1c2fb(%rip), %rsi     # 0x36e37
movq %r15, %rdi
callq 0x72b0
movq 0x8(%r13), %rsi
subq (%r13), %rsi
sarq $0x4, %rsi
movq %rax, %rdi
callq 0x71d0
movq %rax, %rdi
callq 0x7160
cmpl $0x6, 0x78(%r14)
jl 0x1acb2
movq 0x2f476(%rip), %rdi     # 0x49fe8
leaq 0x1c2c5(%rip), %rsi     # 0x36e3e
callq 0x72b0
movq %rax, %rdi
callq 0x7160
xorl %ebp, %ebp
leaq 0x1c2ba(%rip), %r15     # 0x36e49
leaq 0x1c2ba(%rip), %r12     # 0x36e50
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x4, %rax
cmpq %rax, %r14
jae 0x1ac0c
movq 0x2f438(%rip), %rdi     # 0x49fe8
movq %r15, %rsi
callq 0x72b0
movq (%rbx), %rcx
movl 0x8(%rcx,%rbp), %esi
movq %rax, %rdi
callq 0x75c0
movq %rax, %rdi
movq %r12, %rsi
callq 0x72b0
movq (%rbx), %rcx
movq (%rcx,%rbp), %rsi
movq %rax, %rdi
callq 0x72a0
movq %rax, %rdi
movq %r12, %rsi
callq 0x72b0
movq (%rbx), %rcx
movl 0xc(%rcx,%rbp), %esi
movq %rax, %rdi
callq 0x75c0
movq %rax, %rdi
callq 0x7160
incq %r14
addq $0x10, %rbp
jmp 0x1ab99
movq 0x2f3d5(%rip), %rbx     # 0x49fe8
leaq 0x1c238(%rip), %rsi     # 0x36e52
movq %rbx, %rdi
callq 0x72b0
movq %rax, %rdi
callq 0x7160
xorl %r12d, %r12d
leaq 0x1c215(%rip), %r14     # 0x36e49
leaq 0x1c215(%rip), %r15     # 0x36e50
xorl %ebp, %ebp
movq 0x8(%r13), %rax
subq (%r13), %rax
sarq $0x4, %rax
cmpq %rax, %rbp
jae 0x1acb2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x72b0
movq (%r13), %rcx
movl 0x8(%rcx,%r12), %esi
movq %rax, %rdi
callq 0x75c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x72b0
movq (%r13), %rcx
movq (%rcx,%r12), %rsi
movq %rax, %rdi
callq 0x72a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x72b0
movq (%r13), %rcx
movl 0xc(%rcx,%r12), %esi
movq %rax, %rdi
callq 0x75c0
movq %rax, %rdi
callq 0x7160
incq %rbp
addq $0x10, %r12
jmp 0x1ac3d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq