// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_show_seedext.c
// Function: gt_querymatch_optimal_alignment
void gt_querymatch_optimal_alignment(const GtQuerymatch *querymatchptr,
                                     const GtSequencepairbuffer *seqpairbuf,
                                     GtLinspaceManagement
                                       *linspace_spacemanager,
                                     GtScoreHandler *linspace_scorehandler,
                                     GtAlignment *alignment,
                                     GtUchar *alignment_show_buffer,
                                     const GtSeedExtendDisplayFlag
                                       *out_display_flag,
                                     const GtUchar *characters,
                                     GtUchar wildcardshow)
{
  GtUword edist;
  const GtUword distance = gt_querymatch_distance(querymatchptr),
                alignmentwidth = gt_querymatch_display_alignmentwidth(
                                        out_display_flag);

  edist = gt_linearalign_compute_generic(linspace_spacemanager,
                                         linspace_scorehandler,
                                         alignment,
                                         seqpairbuf->a_sequence,
                                         0,
                                         seqpairbuf->a_len,
                                         seqpairbuf->b_sequence,
                                         0,
                                         seqpairbuf->b_len);
  if (edist < distance)
  {
    printf("# edist=" GT_WU " (smaller by " GT_WU ")\n",
           edist,distance - edist);
  }
  gt_assert(edist <= distance);
  if (alignmentwidth > 0)
  {
    const bool downcase = false;

    gt_alignment_show_generic(alignment_show_buffer,
                              downcase,
                              alignment,
                              stdout,
                              alignmentwidth,
                              characters,
                              wildcardshow);
    gt_alignment_reset(alignment);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, 0x30(%rsp)
movq %r8, %rbx
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movb 0x80(%rsp), %al
movb %al, 0x27(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %r12
callq 0x16a0ba
movq %rax, %r13
movq %r12, %rdi
callq 0x169216
movq %rax, %r12
movq 0x20(%r15), %r9
movq (%r15), %rcx
movq 0x8(%r15), %rax
movq 0x28(%r15), %rdx
andq $0x0, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %rax, (%rsp)
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0xf6c6f
movq %rax, %rbp
movq %r13, %rdx
subq %rax, %rdx
jbe 0x4cb57
leaq 0x2ad8ab(%rip), %rdi    # 0x2fa3f8
movq %rbp, %rsi
xorl %eax, %eax
callq 0x17070
cmpq %rbp, %r13
jb 0x4cbaf
testq %r12, %r12
je 0x4cba0
movq 0x3eb348(%rip), %rax    # 0x437eb0
movq (%rax), %rcx
movzbl 0x27(%rsp), %eax
movl %eax, (%rsp)
movq 0x30(%rsp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
movl %r12d, %r8d
movq 0x28(%rsp), %r9
callq 0xb5b91
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb52f8
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3eb3b2(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x298453(%rip), %rsi    # 0x2e5013
leaq 0x2ad84f(%rip), %rdx    # 0x2fa416
leaq 0x2ad85a(%rip), %rcx    # 0x2fa428
leaq 0x2ad873(%rip), %r8     # 0x2fa448
movl $0xae, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390