// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %rbx
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movb 0x60(%rsp), %al
movb %al, 0x7(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %r12
callq 0x1c39de
movq %rax, %r13
movq %r12, %rdi
callq 0x1c2d72
movq %rax, %r12
movq 0x20(%r15), %r9
movq (%r15), %rcx
subq $0x8, %rsp
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
pushq 0x28(%r15)
pushq $0x0
pushq 0x8(%r15)
callq 0x160f56
addq $0x20, %rsp
movq %rax, %rbp
movq %r13, %rdx
subq %rax, %rdx
jbe 0xca24b
leaq 0x299253(%rip), %rdi    # 0x363494
movq %rbp, %rsi
xorl %eax, %eax
callq 0x17070
cmpq %rbp, %r13
jb 0xca2a9
testq %r12, %r12
je 0xca29a
movq 0x3f9c8c(%rip), %rax    # 0x4c3ee8
movq (%rax), %rcx
subq $0x8, %rsp
movzbl 0xf(%rsp), %eax
movq 0x18(%rsp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
movl %r12d, %r8d
movq 0x10(%rsp), %r9
pushq %rax
callq 0x127468
addq $0x10, %rsp
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x126d7c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x20350