// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/apps/parasail_aligner.cpp
// Function: output_trace(_IO_FILE*, bool, long, unsigned char*, parasail_matrix const*, std::vector<long, std::allocator<long>> const&, std::vector<long, std::allocator<long>> const&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>> const&, std::vector<parasail_result*, std::allocator<parasail_result*>> const&, long long, long long, bool, char const*)
inline static void output_trace(
        FILE *fop,
        bool has_query,
        long sid_crossover,
        unsigned char *T,
        const parasail_matrix_t *matrix,
        const vector<long> &BEG,
        const vector<long> &END,
        const PairVec &vpairs,
        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;
        long i_beg = BEG[i];
        long i_end = END[i];
        long i_len = i_end-i_beg;
        long j_beg = BEG[j];
        long j_end = END[j];
        long j_len = j_end-j_beg;
        parasail_cigar_t *cigar = NULL;
        char *cigar_string = NULL;

        if (has_query) {
            i = i - sid_crossover;
        }

        if (parasail_result_is_saturated(result)) {
            if (has_query) {
                fprintf(stderr, "query %d and ref %d saturated\n", i, j);
            } else {
                fprintf(stderr, "seq %d and seq %d saturated\n", i, j);
            }
            continue;
        }

        cigar = parasail_result_get_cigar_extra(
                result,
                (const char*)&T[i_beg], i_len,
                (const char*)&T[j_beg], j_len,
                matrix,
                case_sensitive,
                alphabet_aliases);
        cigar_string = parasail_cigar_decode(cigar);
        eprintf(fop, "%d,%d,%ld,%ld,%d,%d,%d,%s\n",
                i,
                j,
                i_len,
                j_len,
                parasail_result_get_score(result),
                parasail_result_get_end_query(result),
                parasail_result_get_end_ref(result),
                cigar_string);
        parasail_cigar_free(cigar);
        free(cigar_string);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xd8, %rsp
movq 0x40(%rbp), %rax
movb 0x38(%rbp), %al
movq 0x30(%rbp), %r10
movq 0x28(%rbp), %r10
movq 0x20(%rbp), %r10
movq 0x18(%rbp), %r10
movq 0x10(%rbp), %r10
movq %rdi, -0x10(%rbp)
andb $0x1, %sil
movb %sil, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
andb $0x1, %al
movb %al, -0x39(%rbp)
movq 0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq 0x30(%rbp), %rax
jge 0x2b7cf1
movq 0x20(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x2bdca0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq 0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x2bdcc0
movl (%rax), %eax
movl %eax, -0x54(%rbp)
movq 0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x2bdcc0
movl 0x4(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x2bdce0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq 0x10(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x2bdce0
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
subq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x58(%rbp), %rsi
callq 0x2bdce0
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq 0x10(%rbp), %rdi
movslq -0x58(%rbp), %rsi
callq 0x2bdce0
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
subq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
testb $0x1, -0x11(%rbp)
je 0x2b7b69
movslq -0x54(%rbp), %rax
subq -0x20(%rbp), %rax
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2daa80
cmpl $0x0, %eax
je 0x2b7bc0
testb $0x1, -0x11(%rbp)
je 0x2b7b9d
movq 0xcc344c(%rip), %rax    # 0xf7afd0
movq (%rax), %rdi
movl -0x54(%rbp), %edx
movl -0x58(%rbp), %ecx
leaq 0xaf7c5a(%rip), %rsi    # 0xdaf7ee
movb $0x0, %al
callq 0x2af440
jmp 0x2b7bbb
movq 0xcc342c(%rip), %rax    # 0xf7afd0
movq (%rax), %rdi
movl -0x54(%rbp), %edx
movl -0x58(%rbp), %ecx
leaq 0xaf7be4(%rip), %rsi    # 0xdaf798
movb $0x0, %al
callq 0x2af440
jmp 0x2b7ce0
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq -0x60(%rbp), %rsi
movq -0x70(%rbp), %rax
movl %eax, %edx
movq -0x28(%rbp), %rcx
addq -0x78(%rbp), %rcx
movq -0x88(%rbp), %rax
movl %eax, %r8d
movq -0x30(%rbp), %r9
movb -0x39(%rbp), %al
andb $0x1, %al
movzbl %al, %r10d
movq 0x40(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2cb950
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
callq 0x2cb800
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0xb8(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0xb4(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2daf60
movl %eax, %ebx
movq -0x50(%rbp), %rdi
callq 0x2dafc0
movl %eax, -0x9c(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2db020
movq -0xc0(%rbp), %rdi
movl -0xb8(%rbp), %edx
movl -0xb4(%rbp), %ecx
movq -0xb0(%rbp), %r8
movq -0xa8(%rbp), %r9
movl -0x9c(%rbp), %r11d
movl %eax, %r10d
movq -0x98(%rbp), %rax
leaq 0xaf7ceb(%rip), %rsi    # 0xdaf99a
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x2af440
movq -0x90(%rbp), %rdi
callq 0x2cb780
movq -0x98(%rbp), %rdi
callq 0x2af3a0
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2b7a90
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax,%rax)