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

  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);
  }

  /* set valid left_dist and right_dist for this test*/
  if ((GtWord)vlen-(GtWord)ulen > 0)
    left_dist = 0;
  else
    left_dist = (GtWord)vlen-(GtWord)ulen-1;
  if ((GtWord)vlen-(GtWord)ulen > 0)
    right_dist = (GtWord)vlen-(GtWord)ulen+2;
  else
    right_dist = 0;

  scorehandler = gt_scorehandler_new(matchcost, mismatchcost, 0, gapcost);
  gt_scorehandler_plain(scorehandler);
  gt_scorehandler_downcase(scorehandler);
  edist1 = diagonalband_linear_distance_only(useq, 0, ulen, vseq, 0, vlen,
                                             left_dist, right_dist, matchcost,
                                             mismatchcost, gapcost);

  edist2 = diagonalband_squarespace_distance_only(useq, 0, ulen, vseq, 0, vlen,
                                                  left_dist, right_dist,
                                                  matchcost, mismatchcost,
                                                  gapcost);

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

  spacemanager = gt_linspace_management_new();
  align = gt_alignment_new_with_seqs(useq, ulen, vseq, vlen);

  gt_calc_diagonalbandalign(spacemanager, scorehandler, align,
                            useq, 0, ulen, vseq, 0, vlen,
                            left_dist, right_dist);

  edist3 = gt_alignment_eval_with_score(align, true, matchcost,
                                        mismatchcost, gapcost);
  if (edist2 != edist3)
  {
    fprintf(stderr,"diagonalband_squarespace_distance_only = "GT_WU" != "GT_WU
              " = gt_alignment_eval_with_score\n", edist2, edist3);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  gt_alignment_delete(align);
  gt_linspace_management_delete(spacemanager);
  gt_scorehandler_delete(scorehandler);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r8, %r12
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rsi, %rdi
movl $0xff, %esi
callq 0x17850
testq %rax, %rax
jne 0xc9ffd
movq %r15, 0x18(%rsp)
movq %rbx, 0x28(%rsp)
movq %rbx, %rdi
movl $0xff, %esi
movq %r12, %rdx
callq 0x17850
testq %rax, %rax
jne 0xca010
movq %r12, %rbx
movq %r14, 0x50(%rsp)
subq %r14, %rbx
leaq -0x1(%rbx), %rbp
leaq 0x2(%rbx), %r14
pushq $0x1
popq %r15
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x1148f4
movq %rax, %r13
movq %rax, %rdi
callq 0x114981
movq %r13, 0x68(%rsp)
movq %r13, %rdi
callq 0x1149c2
testq %rbx, %rbx
movl $0x0, %eax
cmovgq %rax, %rbp
cmovleq %rax, %r14
movl $0x0, %eax
cmovnsq %rax, %rbx
cmpq %rbp, %rbx
jl 0xca031
testq %r14, %r14
js 0xca031
movq %rbp, %rbx
movq %r14, 0x20(%rsp)
subq %rbp, %r14
leaq 0x8(,%r14,8), %rdi
leaq 0x2513d1(%rip), %rsi    # 0x31af6b
movl $0x15c, %edx            # imm = 0x15C
callq 0x93160
movq %rax, 0x8(%rsp)
andq $0x0, (%rax)
movq 0x50(%rsp), %r13
movq 0x8(%rsp), %rcx
leaq (%rbx,%r15), %rax
cmpq $0x1, %rax
je 0xc9bd2
movq -0x8(%rcx,%r15,8), %rax
incq %rax
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0xc9bb7
movq %rbx, 0x48(%rsp)
movq %rbx, %r15
negq %r15
cmpq %r13, %r15
sete %cl
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rdx
movq %rdx, 0x80(%rsp)
addq $0x10, %rax
movq %rax, 0x78(%rsp)
movq %r13, %rax
negq %rax
movq %rax, 0x70(%rsp)
pushq $0x1
popq %rax
pushq $-0x1
popq %rsi
xorl %edx, %edx
movq %rsi, %r8
movq %r12, 0x88(%rsp)
cmpq %r12, %rax
ja 0xc9e3e
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq (%rax), %rbx
movq %rdi, 0x30(%rsp)
cmpq 0x20(%rsp), %rdi
jbe 0xc9c51
cmpq %rdx, %r15
je 0xc9c49
movq 0x8(%rsp), %rax
movq 0x8(%rax), %r8
incq %rdx
movq %r8, %rax
jmp 0xc9c54
movq %rbx, %rax
xorl %r12d, %r12d
cmpq %r13, %r15
setb %r12b
leaq (%r15,%r12), %rdi
movq %rdi, 0x60(%rsp)
cmpq %rdi, %rdx
movq %rsi, %r8
cmovneq %rax, %r8
testb $0x1, %cl
cmovneq %rax, %r8
movq %r8, %r13
incq %r13
cmoveq %rsi, %r13
movq 0x8(%rsp), %rax
movq %r13, (%rax)
testq %rdx, %rdx
movq %rdx, 0x58(%rsp)
je 0xc9cee
cmpq $-0x1, %rbx
je 0xc9cee
movq 0x18(%rsp), %rax
movzbl -0x1(%rax,%rdx), %edi
movl %ecx, 0x10(%rsp)
movq %r8, %rbp
callq 0x17a80
movl %eax, %r14d
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl -0x1(%rax,%rcx), %edi
callq 0x17a80
movq %rbp, %r8
pushq $-0x1
popq %rsi
movq 0x58(%rsp), %rdx
xorl %ecx, %ecx
cmpl %eax, %r14d
setne %cl
addq %rcx, %rbx
movl 0x10(%rsp), %ecx
cmpq %r13, %rbx
jae 0xc9cee
movq 0x8(%rsp), %rax
movq %rbx, (%rax)
movq 0x80(%rsp), %rax
leaq (%rax,%rdx,8), %rdi
movq 0x70(%rsp), %rax
addq %rdx, %rax
movq %rax, 0x98(%rsp)
movq %rdx, %rax
subq %r15, %rax
subq %r12, %rax
movq %rax, 0x90(%rsp)
pushq $0x1
popq %r9
movq 0x78(%rsp), %rbx
movq 0x18(%rsp), %r15
leaq (%rdx,%r9), %rax
cmpq 0x60(%rsp), %rax
ja 0xc9e1f
testb $0x1, %cl
jne 0xc9d4d
movq 0x90(%rsp), %rax
movq %rsi, %r13
addq %r9, %rax
je 0xc9d5a
testq %rdx, %rdx
movq %rbx, %rax
cmoveq %rdi, %rax
movq (%rax), %r13
movq 0x98(%rsp), %rax
addq %r9, %rax
movzbl %cl, %ecx
pushq $0x1
popq %rax
cmovel %eax, %ecx
movq %r13, %r14
incq %r14
movq %r14, %r12
cmoveq %rsi, %r12
movq %r12, -0x8(%rbx)
movq %rsi, %rbp
cmpq $-0x1, %r8
je 0xc9de9
movq %rdi, 0x38(%rsp)
movzbl (%r15,%rdx), %edi
movl %ecx, 0x10(%rsp)
movq %r8, %rbp
movq %rbx, 0xa0(%rsp)
movq %r9, %rbx
callq 0x17a80
movl %eax, 0x44(%rsp)
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl -0x1(%rax,%rcx), %edi
callq 0x17a80
movq %rbx, %r9
movq 0xa0(%rsp), %rbx
movq 0x38(%rsp), %rdi
pushq $-0x1
popq %rsi
movq 0x58(%rsp), %rdx
xorl %ecx, %ecx
cmpl %eax, 0x44(%rsp)
setne %cl
addq %rcx, %rbp
movl 0x10(%rsp), %ecx
cmpq %r12, %rbp
ja 0xc9df5
movq %rbp, -0x8(%rbx)
movq %rbp, %r14
movq -0x10(%rbx), %rax
incq %rax
cmoveq %rsi, %rax
cmpq %r14, %rax
ja 0xc9e09
movq %rax, -0x8(%rbx)
incq %r15
addq $0x8, %rdi
addq $0x8, %rbx
incq %r9
movq %r13, %r8
jmp 0xc9d29
movq 0x30(%rsp), %rax
incq %rax
movq 0x60(%rsp), %r15
movq 0x88(%rsp), %r12
movq 0x50(%rsp), %r13
jmp 0xc9c1b
subq %rdx, %r15
movq 0x8(%rsp), %rdi
movq (%rdi,%r15,8), %rax
movq %rax, 0x10(%rsp)
leaq 0x251115(%rip), %r14    # 0x31af6b
movq %r14, %rsi
movl $0x1a0, %edx            # imm = 0x1A0
callq 0x936f9
leaq 0x1(%r13), %rbx
leaq 0x8(,%r13,8), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x82, %edx
callq 0x93160
movq %rax, %rbp
leaq 0x1(%r12), %r14
imulq %r14, %r15
movq %r15, %rdi
leaq 0x2510d6(%rip), %rsi    # 0x31af6b
movl $0x82, %edx
callq 0x93160
movq %rax, (%rbp)
pushq $0x1
popq %rax
shlq $0x3, %r14
cmpq %rbx, %rax
jae 0xc9ec1
movq -0x8(%rbp,%rax,8), %rcx
addq %r14, %rcx
movq %rcx, (%rbp,%rax,8)
incq %rax
jmp 0xc9eaa
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %rcx, %rsi
xorl %edx, %edx
callq 0x1148f4
movq %rax, %r15
movq %rax, %rdi
callq 0x114981
movq %r15, %rdi
callq 0x1149c2
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
xorl %edx, %edx
movq %r13, %rcx
movq 0x28(%rsp), %r14
movq %r14, %r8
xorl %r9d, %r9d
pushq %r15
pushq 0x28(%rsp)
pushq 0x58(%rsp)
pushq %r12
callq 0xc93b6
addq $0x20, %rsp
movq (%rbp,%r13,8), %rax
movq (%rax,%r12,8), %rbx
movq (%rbp), %rdi
leaq 0x251047(%rip), %rsi    # 0x31af6b
movl $0x8b, %edx
callq 0x936f9
movq %rbp, %rdi
leaq 0x251033(%rip), %rsi    # 0x31af6b
movl $0x8b, %edx
callq 0x936f9
movq %r15, %rdi
callq 0x114a03
cmpq %rbx, 0x10(%rsp)
jne 0xca069
xorl %eax, %eax
callq 0xf9624
movq %rax, %rbx
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0xb4ea1
movq %rax, %r15
subq $0x8, %rsp
movq %rbx, 0x40(%rsp)
movq %rbx, %rdi
movq %r14, %rax
movq 0x70(%rsp), %r14
movq %r14, %rsi
movq %r15, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
movq %r13, %r9
pushq 0x28(%rsp)
pushq 0x58(%rsp)
pushq %r12
pushq $0x0
pushq %rax
callq 0xc978b
addq $0x30, %rsp
pushq $0x1
popq %rsi
pushq $0x1
popq %rcx
movq %r15, %rdi
xorl %edx, %edx
movq %rcx, %r8
callq 0xb55cb
movq 0x10(%rsp), %rdx
cmpq %rax, %rdx
jne 0xca084
movq %r15, %rdi
callq 0xb647f
movq 0x38(%rsp), %rdi
callq 0xf9658
movq %r14, %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x114a03
movq 0x36df64(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x25100c(%rip), %rsi    # 0x31b01a
jmp 0xca021
movq 0x36df51(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x25101d(%rip), %rsi    # 0x31b03e
leaq 0x227f2f(%rip), %rdx    # 0x2f1f57
xorl %eax, %eax
callq 0x17a50
jmp 0xca09f
movq 0x36df30(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x21afd1(%rip), %rsi    # 0x2e5013
leaq 0x25c9a3(%rip), %rdx    # 0x3269ec
leaq 0x2511a8(%rip), %rcx    # 0x31b1f8
leaq 0x250f14(%rip), %r8     # 0x31af6b
movl $0x80, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x36def8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x250fe8(%rip), %rsi    # 0x31b062
movq 0x10(%rsp), %rdx
movq %rbx, %rcx
jmp 0xca098
movq 0x36dedd(%rip), %rcx    # 0x437f68
movq (%rcx), %rdi
leaq 0x251026(%rip), %rsi    # 0x31b0bb
movq %rax, %rcx
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0