// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/diagonalbandalign_affinegapcost.c
// Function: gt_diagonalbandalign_affinegapcost_check
void gt_diagonalbandalign_affinegapcost_check(GT_UNUSED bool forward,
                                              const GtUchar *useq, GtUword ulen,
                                              const GtUchar *vseq, GtUword vlen)
{
  GtUword affine_cost1, affine_cost2, affine_cost3,
          matchcost = 0, mismatchcost = 1,
          gap_opening = 2, gap_extension = 1;
  GtWord left_dist, right_dist;
  GtAlignment *align;
  GtScoreHandler *scorehandler;
  GtLinspaceManagement *spacemanager;

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

  left_dist = -ulen;
  right_dist = vlen;

  scorehandler = gt_scorehandler_new(matchcost, mismatchcost,
                                     gap_opening, gap_extension);
  gt_scorehandler_plain(scorehandler);
  gt_scorehandler_downcase(scorehandler);
  affine_cost1 = gt_diagonalbandalign_affinegapcost_square_space_distance_only(
                                           useq, 0, ulen, vseq, 0, vlen,
                                           left_dist, right_dist, scorehandler);

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

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

  gt_linspace_management_delete(spacemanager);
  affine_cost2 = gt_alignment_eval_with_affine_score(align, true, matchcost,
                                                     mismatchcost,
                                                     gap_opening,
                                                     gap_extension);
  if (affine_cost1 != affine_cost2)
  {
    fprintf(stderr,"gt_diagonalband_affinegapcost_square_space_distance_only = "
            GT_WU" != "GT_WU" = gt_alignment_eval_generic_with_affine_score\n",
            affine_cost1, affine_cost2);

    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  affine_cost3 = diagonalband_linear_affine(useq, 0, ulen, vseq, 0, vlen,
                                           left_dist, right_dist, scorehandler);
  if (affine_cost3 != affine_cost2)
  {
    fprintf(stderr,"diagonalband_linear_affine = "GT_WU
            " != "GT_WU" = gt_alignment_eval_generic_with_affine_score\n",
            affine_cost3, affine_cost2);

    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  gt_scorehandler_delete(scorehandler);
  gt_alignment_delete(align);
}

// Assembly:
pushq %rbx
subq $0xb0, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, 0xaf(%rsp)
movq %rsi, 0xa0(%rsp)
movq %rdx, 0x98(%rsp)
movq %rcx, 0x90(%rsp)
movq %r8, 0x88(%rsp)
movq $0x0, 0x68(%rsp)
movq $0x1, 0x60(%rsp)
movq $0x2, 0x58(%rsp)
movq $0x1, 0x50(%rsp)
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rdx
movl $0xff, %esi
callq 0x197f0
cmpq $0x0, %rax
je 0x153a41
movq 0x4e8581(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3f9722(%rip), %rsi    # 0x54d14b
leaq 0x3cf5b2(%rip), %rdx    # 0x522fe2
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rdx
movl $0xff, %esi
callq 0x197f0
cmpq $0x0, %rax
je 0x153a8a
movq 0x4e8538(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3f96fd(%rip), %rsi    # 0x54d16f
leaq 0x3cf569(%rip), %rdx    # 0x522fe2
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
xorl %eax, %eax
subq 0x98(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x50(%rsp), %rcx
callq 0x1d0fb0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0x1d10b0
movq 0x30(%rsp), %rdi
callq 0x1d1100
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x88(%rsp), %r9
movq 0x48(%rsp), %r11
movq 0x40(%rsp), %r10
movq 0x30(%rsp), %rax
xorl %esi, %esi
movl %esi, %r8d
movq %r8, %rsi
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x152c90
movq %rax, 0x80(%rsp)
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x88(%rsp), %rcx
callq 0x129ec0
movq %rax, 0x38(%rsp)
movb $0x0, %al
callq 0x1a2fe0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0xa0(%rsp), %rcx
movq 0x98(%rsp), %r9
movq 0x90(%rsp), %rbx
movq 0x88(%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 0x1532d0
movq 0x28(%rsp), %rdi
callq 0x1a3080
movq 0x38(%rsp), %rdi
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0x50(%rsp), %r9
movl $0x1, %esi
callq 0x12aeb0
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x153c2d
movq 0x4e839b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x80(%rsp), %rdx
movq 0x78(%rsp), %rcx
leaq 0x3f98af(%rip), %rsi    # 0x54d4cb
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x88(%rsp), %r9
movq 0x48(%rsp), %r11
movq 0x40(%rsp), %r10
movq 0x30(%rsp), %rax
xorl %esi, %esi
movl %esi, %r8d
movq %r8, %rsi
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x153ce0
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x153cb4
movq 0x4e8311(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x70(%rsp), %rdx
movq 0x78(%rsp), %rcx
leaq 0x3f989d(%rip), %rsi    # 0x54d540
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0x30(%rsp), %rdi
callq 0x1d1150
movq 0x38(%rsp), %rdi
callq 0x12c3e0
addq $0xb0, %rsp
popq %rbx
retq
nopw %cs:(%rax,%rax)