// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/linearalign.c
// Function: gt_linearalign_check
void gt_linearalign_check(GT_UNUSED bool forward,
                          const GtUchar *useq,
                          GtUword ulen,
                          const GtUchar *vseq,
                          GtUword vlen)
{
  GtAlignment *align;
  GtUword edist1, edist2, edist3, edist4,
          matchcost = 0, mismatchcost = 1, gapcost = 1;
  GtLinspaceManagement *spacemanager;
  GtScoreHandler *scorehandler;
  const bool downcase = true;

  if (memchr(useq, LINEAR_EDIST_GAP,ulen) != NULL)
  {
    fprintf(stderr,"%s: sequence u contains gap symbol\n",__func__);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  if (memchr(vseq, LINEAR_EDIST_GAP,vlen) != NULL)
  {
    fprintf(stderr,"%s: sequence v contains gap symbol\n",__func__);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  scorehandler = gt_scorehandler_new(matchcost,  mismatchcost, 0, gapcost);
  gt_scorehandler_plain(scorehandler);
  gt_scorehandler_downcase(scorehandler);
  spacemanager = gt_linspace_management_new();
  align = gt_alignment_new_with_seqs(useq, ulen, vseq, vlen);
  edist1 = gt_calc_linearalign(spacemanager, scorehandler, align,
                               useq, 0, ulen,
                               vseq, 0, vlen);
  edist2 = gt_squarealign_global_distance_only(useq, 0, ulen, vseq, 0, vlen,
                                               scorehandler);

  if (edist1 != edist2)
  {
    fprintf(stderr,"gt_calc_linearalign = "GT_WU" != "GT_WU
            " = gt_squarealign_global_distance_only\n", edist1,edist2);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  edist3 = gt_alignment_eval_with_score(align, true, matchcost,
                                        mismatchcost, gapcost);

  if (edist2 != edist3)
  {
    fprintf(stderr,"gt_squarealign_global_distance_only = "GT_WU" != "GT_WU
            " = gt_alignment_eval_with_score\n", edist2,edist3);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  edist4 = gt_calc_linearedist(downcase,useq, ulen, vseq, vlen);
  if (edist3 != edist4)
  {
    fprintf(stderr,"gt_alignment_eval_with_score = "GT_WU" != "GT_WU
            " = gt_calc_linearedist\n", edist3, edist4);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  gt_linspace_management_delete(spacemanager);
  gt_scorehandler_delete(scorehandler);
  gt_alignment_delete(align);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbp
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %r14
movq %rsi, %rdi
movl $0xff, %esi
callq 0x17850
testq %rax, %rax
jne 0xf75a0
movq %r13, %rdi
movl $0xff, %esi
movq %rbp, %rdx
callq 0x17850
testq %rax, %rax
jne 0xf75b3
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %rcx, %rsi
xorl %edx, %edx
callq 0x1148f4
movq %rax, %rbx
movq %rax, %rdi
callq 0x114981
movq %rbx, %rdi
callq 0x1149c2
xorl %eax, %eax
callq 0xf9624
movq %rax, %r15
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xb4ea1
subq $0x8, %rsp
movq %r15, 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, 0x20(%rsp)
movq %rax, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
movq %r12, %r9
pushq %rbp
pushq $0x0
pushq %r13
callq 0xf6440
addq $0x20, %rsp
movq %rax, %r15
subq $0x8, %rsp
movq %r14, %rdi
xorl %esi, %esi
movq %r12, 0x10(%rsp)
movq %r12, %rdx
movq %r13, 0x8(%rsp)
movq %r13, %rcx
xorl %r8d, %r8d
movq %rbp, %r9
pushq %rbx
callq 0x11ed4e
addq $0x10, %rsp
cmpq %rax, %r15
jne 0xf75d4
movq %rbx, 0x20(%rsp)
pushq $0x1
popq %rsi
pushq $0x1
popq %rcx
movq 0x18(%rsp), %rdi
xorl %edx, %edx
movq %rcx, %r8
callq 0xb55cb
movq %r15, 0x10(%rsp)
cmpq %rax, %r15
jne 0xf75ea
leaq 0x22ee2f(%rip), %rdi    # 0x326279
leaq 0x22ee39(%rip), %rsi    # 0x32628a
xorl %r13d, %r13d
movq 0x8(%rsp), %r12
movl %r12d, %edx
movl %r12d, %ecx
movq %r14, %r8
movl %ebp, %r9d
xorl %eax, %eax
pushq (%rsp)
pushq %rbp
callq 0x17070
popq %rcx
popq %rdx
cmpq %rbp, %r12
movq %rbp, %rbx
cmovbq %r12, %rbx
leaq 0x8(,%rbx,8), %rdi
leaq 0x22eac9(%rip), %rsi    # 0x325f54
movl $0x209, %edx            # imm = 0x209
callq 0x93160
movq %rax, %r15
leaq 0x1(%rbx), %rax
cmpq %r13, %rax
je 0xf74aa
movq %r13, (%r15,%r13,8)
incq %r13
jmp 0xf749c
cmpq %rbp, %r12
movq (%rsp), %rax
movq %rax, %rcx
cmovaq %r14, %rcx
movq %rcx, 0x30(%rsp)
cmovaq %rax, %r14
cmovaq %r12, %rbp
pushq $0x1
popq %r12
movq %rbp, 0x8(%rsp)
cmpq %rbp, %r12
ja 0xf754e
movq 0x30(%rsp), %rax
movzbl -0x1(%rax,%r12), %edi
callq 0x17a80
movq %r12, %rcx
movl %eax, %r12d
movq (%r15), %r13
movq %rcx, (%rsp)
movq %rcx, (%r15)
pushq $0x1
popq %rbp
cmpq %rbx, %rbp
ja 0xf7540
movzbl -0x1(%r14,%rbp), %edi
callq 0x17a80
movq -0x8(%r15,%rbp,8), %rdx
movq (%r15,%rbp,8), %rcx
xorl %esi, %esi
movl %r12d, %edi
xorb %al, %dil
setne %sil
addq %rsi, %r13
incq %rdx
cmpq %r13, %rdx
cmovaeq %r13, %rdx
leaq 0x1(%rcx), %rax
cmpq %rdx, %rax
jb 0xf7534
movq %rdx, %rax
movq %rax, (%r15,%rbp,8)
incq %rbp
movq %rcx, %r13
jmp 0xf74f6
movq (%rsp), %r12
incq %r12
movq 0x8(%rsp), %rbp
jmp 0xf74ce
movq (%r15,%rbx,8), %rbx
leaq 0x22e9fb(%rip), %rsi    # 0x325f54
movq %r15, %rdi
movl $0x20e, %edx            # imm = 0x20E
callq 0x936f9
movq 0x10(%rsp), %rdx
cmpq %rbx, %rdx
jne 0xf7605
movq 0x28(%rsp), %rdi
callq 0xf9658
movq 0x20(%rsp), %rdi
callq 0x114a03
movq 0x18(%rsp), %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb647f
movq 0x3409c1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x223a69(%rip), %rsi    # 0x31b01a
jmp 0xf75c4
movq 0x3409ae(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x223a7a(%rip), %rsi    # 0x31b03e
leaq 0x1fa910(%rip), %rdx    # 0x2f1edb
xorl %eax, %eax
callq 0x17a50
jmp 0xf7620
movq 0x34098d(%rip), %rcx    # 0x437f68
movq (%rcx), %rdi
leaq 0x22ea18(%rip), %rsi    # 0x325ffd
movq %r15, %rdx
jmp 0xf7600
movq 0x340977(%rip), %rcx    # 0x437f68
movq (%rcx), %rdi
leaq 0x22ea4a(%rip), %rsi    # 0x326045
movq 0x10(%rsp), %rdx
movq %rax, %rcx
jmp 0xf7619
movq 0x34095c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x22ea80(%rip), %rsi    # 0x326096
movq %rbx, %rcx
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0