// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/apps/parasail_aligner.cpp
// Function: output_ssw(_IO_FILE*, bool, long, parasail_matrix const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>> const&, parasail_sequences*, parasail_sequences*, std::vector<parasail_result*, std::allocator<parasail_result*>> const&, long long, long long, bool, char const*)
inline static void output_ssw(
        FILE *fop,
        bool has_query,
        long sid_crossover,
        const parasail_matrix_t *matrix,
        const PairVec &vpairs,
        parasail_sequences_t *queries,
        parasail_sequences_t *sequences,
        const vector<parasail_result_t*> &results,
        long long start,
        long long stop,
        bool case_sensitive,
        const char *alphabet_aliases)
{
    for (long long index=start; index<stop; ++index) {
        parasail_result_t *result = results[index];
        int i = vpairs[index].first;
        int j = vpairs[index].second;
        parasail_cigar_t *cigar = NULL;

        if (has_query) {
            i = i - sid_crossover;
            if (parasail_result_is_saturated(result)) {
                fprintf(stderr, "query %d (%s) and ref %d (%s) saturated\n",
                        i, queries->seqs[i].name.s,
                        j, sequences->seqs[j].name.s);
                continue;
            }
            fprintf(fop, "target_name: %s\n", sequences->seqs[j].name.s);
            fprintf(fop, "query_name: %s\n", queries->seqs[i].name.s);
            cigar = parasail_result_get_cigar_extra(result,
                    queries->seqs[i].seq.s,
                    queries->seqs[i].seq.l,
                    sequences->seqs[j].seq.s,
                    sequences->seqs[j].seq.l,
                    matrix,
                    case_sensitive,
                    alphabet_aliases);
        }
        else {
            if (parasail_result_is_saturated(result)) {
                fprintf(stderr, "seq %d (%s) and seq %d (%s) saturated\n",
                        i, sequences->seqs[i].name.s,
                        j, sequences->seqs[j].name.s);
                continue;
            }
            fprintf(fop, "target_name: %s\n", sequences->seqs[j].name.s);
            fprintf(fop, "query_name: %s\n", sequences->seqs[i].name.s);
            cigar = parasail_result_get_cigar_extra(result,
                    sequences->seqs[i].seq.s,
                    sequences->seqs[i].seq.l,
                    sequences->seqs[j].seq.s,
                    sequences->seqs[j].seq.l,
                    matrix,
                    case_sensitive,
                    alphabet_aliases);
        }

        fprintf(fop, "optimal_alignment_score: %d"
                "\tstrand: +"
                "\ttarget_begin: %d"
                "\ttarget_end: %d"
                "\tquery_begin: %d"
                "\tquery_end: %d\n",
                result->score,
                cigar->beg_ref+1,
                parasail_result_get_end_ref(result)+1,
                cigar->beg_query+1,
                parasail_result_get_end_query(result)+1);

        /* we only needed the cigar for beginning locations */
        parasail_cigar_free(cigar);

        if (has_query) {
            parasail_traceback_generic_extra2(
                    queries->seqs[i].seq.s,
                    queries->seqs[i].seq.l,
                    sequences->seqs[j].seq.s,
                    sequences->seqs[j].seq.l,
                    "Query:",
                    "Target:",
                    matrix,
                    result,
                    '|', '*', '*',
                    60,
                    10,
                    0,
                    7,
                    fop,
                    case_sensitive,
                    alphabet_aliases);
        }
        else {
            parasail_traceback_generic_extra2(
                    sequences->seqs[i].seq.s,
                    sequences->seqs[i].seq.l,
                    sequences->seqs[j].seq.s,
                    sequences->seqs[j].seq.l,
                    "Query:",
                    "Target:",
                    matrix,
                    result,
                    '|', '*', '*',
                    60,
                    10,
                    0,
                    7,
                    fop,
                    case_sensitive,
                    alphabet_aliases);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq 0x38(%rbp), %rax
movb 0x30(%rbp), %al
movq 0x28(%rbp), %r10
movq 0x20(%rbp), %r10
movq 0x18(%rbp), %r10
movq 0x10(%rbp), %r10
movq %rdi, -0x20(%rbp)
andb $0x1, %sil
movb %sil, -0x21(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movq %r8, -0x40(%rbp)
movq %r9, -0x48(%rbp)
andb $0x1, %al
movb %al, -0x49(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq 0x28(%rbp), %rax
jge 0x2b744d
movq 0x18(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2bdca0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x40(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2bdcc0
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x40(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2bdcc0
movl 0x4(%rax), %eax
movl %eax, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
testb $0x1, -0x21(%rbp)
je 0x2b70cb
movslq -0x64(%rbp), %rax
subq -0x30(%rbp), %rax
movl %eax, -0x64(%rbp)
movq -0x60(%rbp), %rdi
callq 0x2daa80
cmpl $0x0, %eax
je 0x2b6ff2
movq 0xcc4027(%rip), %rax    # 0xf7afd0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movl -0x68(%rbp), %r8d
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rsi
shlq $0x6, %rsi
addq %rsi, %rax
movq 0x8(%rax), %r9
leaq 0xaf8858(%rip), %rsi    # 0xdaf83e
movb $0x0, %al
callq 0x2af440
jmp 0x2b743c
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
leaq 0xaf887b(%rip), %rsi    # 0xdaf88e
movb $0x0, %al
callq 0x2af440
movq -0x20(%rbp), %rdi
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
leaq 0xaf8864(%rip), %rsi    # 0xdaf89f
movb $0x0, %al
callq 0x2af440
movq -0x60(%rbp), %rdi
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rsi
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movl %eax, %edx
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rcx
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %r8
shlq $0x6, %r8
addq %r8, %rax
movq 0x20(%rax), %rax
movl %eax, %r8d
movq -0x38(%rbp), %r9
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %r10d
movq 0x38(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2cb950
movq %rax, -0x70(%rbp)
jmp 0x2b71fd
movq -0x60(%rbp), %rdi
callq 0x2daa80
cmpl $0x0, %eax
je 0x2b7129
movq 0xcc3ef0(%rip), %rax    # 0xf7afd0
movq (%rax), %rdi
movl -0x64(%rbp), %edx
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movl -0x68(%rbp), %r8d
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rsi
shlq $0x6, %rsi
addq %rsi, %rax
movq 0x8(%rax), %r9
leaq 0xaf874a(%rip), %rsi    # 0xdaf867
movb $0x0, %al
callq 0x2af440
jmp 0x2b743c
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
leaq 0xaf8744(%rip), %rsi    # 0xdaf88e
movb $0x0, %al
callq 0x2af440
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
leaq 0xaf872d(%rip), %rsi    # 0xdaf89f
movb $0x0, %al
callq 0x2af440
movq -0x60(%rbp), %rdi
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rsi
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movl %eax, %edx
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rcx
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %r8
shlq $0x6, %r8
addq %r8, %rax
movq 0x20(%rax), %rax
movl %eax, %r8d
movq -0x38(%rbp), %r9
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %r10d
movq 0x38(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2cb950
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x60(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x80(%rbp)
movq -0x70(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movq -0x60(%rbp), %rdi
callq 0x2db020
addl $0x1, %eax
movl %eax, -0x78(%rbp)
movq -0x70(%rbp), %rax
movl 0xc(%rax), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
movq -0x60(%rbp), %rdi
callq 0x2dafc0
movq -0x88(%rbp), %rdi
movl -0x80(%rbp), %edx
movl -0x7c(%rbp), %ecx
movl -0x78(%rbp), %r8d
movl -0x74(%rbp), %r9d
addl $0x1, %eax
leaq 0xaf864d(%rip), %rsi    # 0xdaf8af
movl %eax, (%rsp)
movb $0x0, %al
callq 0x2af440
movq -0x70(%rbp), %rdi
callq 0x2cb780
testb $0x1, -0x21(%rbp)
je 0x2b735f
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rdi
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movl %eax, %esi
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rdx
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movl %eax, %ecx
movq -0x38(%rbp), %r14
movq -0x60(%rbp), %rbx
movq -0x20(%rbp), %r11
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %r10d
movq 0x38(%rbp), %rax
leaq 0xaf8619(%rip), %r8     # 0xdaf914
leaq 0xaf8619(%rip), %r9     # 0xdaf91b
xorl %r15d, %r15d
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movl $0x7c, 0x10(%rsp)
movl $0x2a, 0x18(%rsp)
movl $0x2a, 0x20(%rsp)
movl $0x3c, 0x28(%rsp)
movl $0xa, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movl $0x7, 0x40(%rsp)
movq %r11, 0x48(%rsp)
movl %r10d, 0x50(%rsp)
movq %rax, 0x58(%rsp)
callq 0x3af940
jmp 0x2b743a
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rdi
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x64(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movl %eax, %esi
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rdx
movq 0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x68(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movl %eax, %ecx
movq -0x38(%rbp), %r14
movq -0x60(%rbp), %rbx
movq -0x20(%rbp), %r11
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %r10d
movq 0x38(%rbp), %rax
leaq 0xaf8539(%rip), %r8     # 0xdaf914
leaq 0xaf8539(%rip), %r9     # 0xdaf91b
xorl %r15d, %r15d
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movl $0x7c, 0x10(%rsp)
movl $0x2a, 0x18(%rsp)
movl $0x2a, 0x20(%rsp)
movl $0x3c, 0x28(%rsp)
movl $0xa, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movl $0x7, 0x40(%rsp)
movq %r11, 0x48(%rsp)
movl %r10d, 0x50(%rsp)
movq %rax, 0x58(%rsp)
callq 0x3af940
jmp 0x2b743c
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2b6f30
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)