// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/apps/parasail_aligner.cpp
// Function: process(unsigned long&, std::set<std::pair<int, int>, std::less<std::pair<int, int>>, std::allocator<std::pair<int, int>>>&, quad const&, int const*, unsigned char const*, int const*, std::vector<int, std::allocator<int>> const&, char const&, int const&)
inline static void process(
        unsigned long &count_generated,
        PairSet &pairs,
        const quad &q,
        const int * const restrict SA,
        const unsigned char * const restrict BWT,
        const int * const restrict SID,
        const vector<int> &DB,
        const char &sentinal,
        const int &cutoff)
{
    const size_t n_children = q.children.size();
    size_t child_index = 0;

    if (q.lcp < cutoff) return;

    if (n_children) {
        for (int i=q.lb; i<=q.rb; ++i) {
            int j = i+1;
            if (child_index < n_children) {
                if (i >= q.children[child_index].lb) {
                    j = q.children[child_index].rb+1;
                    if (i >= q.children[child_index].rb) {
                        ++child_index;
                    }
                }
            }
            for (/*nope*/; j<=q.rb; ++j) {
                pair_check(count_generated, pairs, i, j, SA, BWT, SID, DB, sentinal);
            }
        }
    }
    else {
        for (int i=q.lb; i<=q.rb; ++i) {
            for (int j=i+1; j<=q.rb; ++j) {
                pair_check(count_generated, pairs, i, j, SA, BWT, SID, DB, sentinal);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
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 -0x18(%rbp), %rdi
addq $0x10, %rdi
callq 0x2bb100
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq 0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x2b5418
jmp 0x2b559c
cmpq $0x0, -0x38(%rbp)
je 0x2b5520
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x2b551e
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x2b54be
movl -0x44(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
movq -0x40(%rbp), %rsi
callq 0x2bd2a0
movq %rax, %rcx
movl -0x54(%rbp), %eax
cmpl 0x4(%rcx), %eax
jl 0x2b54bc
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
movq -0x40(%rbp), %rsi
callq 0x2bd2a0
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
movq -0x40(%rbp), %rsi
callq 0x2bd2a0
movq %rax, %rcx
movl -0x58(%rbp), %eax
cmpl 0x8(%rcx), %eax
jl 0x2b54ba
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2b54bc
jmp 0x2b54be
jmp 0x2b54c0
movl -0x48(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x2b550e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
movq -0x30(%rbp), %r11
movq 0x10(%rbp), %r10
movq 0x18(%rbp), %rax
leaq -0x44(%rbp), %rdx
leaq -0x48(%rbp), %rcx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x2b6280
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x2b54c0
jmp 0x2b5510
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x2b542d
jmp 0x2b559c
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x2b559a
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x2b558d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
movq -0x30(%rbp), %r11
movq 0x10(%rbp), %r10
movq 0x18(%rbp), %rax
leaq -0x4c(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x2b6280
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2b553f
jmp 0x2b558f
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x2b552a
jmp 0x2b559c
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)