// File: /workspace/github_c_makefile_star2_O0/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 %r14
pushq %rbx
subq $0xa8, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, 0xa7(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x1, 0x58(%rsp)
movq $0x1, 0x50(%rsp)
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rdx
movl $0xff, %esi
callq 0x197f0
cmpq $0x0, %rax
je 0x14defa
movq 0x4ee0c8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3ff269(%rip), %rsi    # 0x54d14b
leaq 0x3d50de(%rip), %rdx    # 0x522fc7
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0x88(%rsp), %rdi
movq 0x80(%rsp), %rdx
movl $0xff, %esi
callq 0x197f0
cmpq $0x0, %rax
je 0x14df43
movq 0x4ee07f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3ff244(%rip), %rsi    # 0x54d16f
leaq 0x3d5095(%rip), %rdx    # 0x522fc7
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0x80(%rsp), %rax
subq 0x90(%rsp), %rax
cmpq $0x0, %rax
jle 0x14df64
movq $0x0, 0x48(%rsp)
jmp 0x14df7d
movq 0x80(%rsp), %rax
subq 0x90(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0x80(%rsp), %rax
subq 0x90(%rsp), %rax
cmpq $0x0, %rax
jle 0x14dfae
movq 0x80(%rsp), %rax
subq 0x90(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x40(%rsp)
jmp 0x14dfb7
movq $0x0, 0x40(%rsp)
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0fb0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x1d10b0
movq 0x28(%rsp), %rdi
callq 0x1d1100
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rdx
movq 0x88(%rsp), %rcx
movq 0x80(%rsp), %r9
movq 0x48(%rsp), %r14
movq 0x40(%rsp), %rbx
movq 0x60(%rsp), %r11
movq 0x58(%rsp), %r10
movq 0x50(%rsp), %rax
xorl %esi, %esi
movl %esi, %r8d
movq %r8, %rsi
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x14e200
movq %rax, 0x78(%rsp)
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rdx
movq 0x88(%rsp), %rcx
movq 0x80(%rsp), %r9
movq 0x48(%rsp), %r14
movq 0x40(%rsp), %rbx
movq 0x60(%rsp), %r11
movq 0x58(%rsp), %r10
movq 0x50(%rsp), %rax
xorl %esi, %esi
movl %esi, %r8d
movq %r8, %rsi
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x14e9c0
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rax
cmpq 0x70(%rsp), %rax
je 0x14e0e6
movq 0x4ededf(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
leaq 0x3ff0be(%rip), %rsi    # 0x54d193
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movb $0x0, %al
callq 0x1a2fe0
movq %rax, 0x30(%rsp)
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x80(%rsp), %rcx
callq 0x129ec0
movq %rax, 0x38(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r9
movq 0x88(%rsp), %rbx
movq 0x80(%rsp), %r11
movq 0x48(%rsp), %r10
movq 0x40(%rsp), %rax
xorl %r8d, %r8d
movq %rbx, (%rsp)
movq $0x0, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x14d890
movq 0x38(%rsp), %rdi
movq 0x60(%rsp), %rdx
movq 0x58(%rsp), %rcx
movq 0x50(%rsp), %r8
movl $0x1, %esi
callq 0x12a9d0
movq %rax, 0x68(%rsp)
movq 0x70(%rsp), %rax
cmpq 0x68(%rsp), %rax
je 0x14e1d4
movq 0x4eddf1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x70(%rsp), %rdx
movq 0x68(%rsp), %rcx
leaq 0x3ff029(%rip), %rsi    # 0x54d1ec
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0x38(%rsp), %rdi
callq 0x12c3e0
movq 0x30(%rsp), %rdi
callq 0x1a3080
movq 0x28(%rsp), %rdi
callq 0x1d1150
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)