// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rdi
movq %rsi, 0x38(%rsp)
movl $0xff, %esi
callq 0x17850
testq %rax, %rax
jne 0xcc038
movq %r15, %rdi
movl $0xff, %esi
movq %r12, %rdx
callq 0x17850
testq %rax, %rax
jne 0xcc04b
movq %r13, %rax
negq %rax
movq %rax, %r14
movq %rax, 0x8(%rsp)
pushq $0x2
popq %rdx
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %rcx, %rsi
callq 0x1148f4
movq %rax, %rbx
movq %rax, %rdi
callq 0x114981
movq %rbx, %rdi
callq 0x1149c2
subq $0x8, %rsp
movq 0x40(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
movq %r12, %r9
pushq %rbx
pushq %r12
pushq %r14
callq 0xcb606
addq $0x20, %rsp
movq %rax, 0x20(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0xb4ea1
movq %rax, %r14
xorl %eax, %eax
callq 0xf9624
movq %r15, %r10
movq %rax, %r15
subq $0x8, %rsp
movq %rax, %rdi
movq %rbx, 0x38(%rsp)
movq %rbx, %rsi
movq 0x10(%rsp), %rbx
movq %r14, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
movq %r13, %r9
pushq %r12
pushq %rbx
pushq %r12
pushq $0x0
movq %r10, 0x90(%rsp)
pushq %r10
callq 0xcb8be
addq $0x30, %rsp
movq %r15, %rdi
callq 0xf9658
pushq $0x1
popq %rsi
movq %r14, 0x48(%rsp)
movq %r14, %rdi
xorl %edx, %edx
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
movq %rcx, %r9
callq 0xb5869
cmpq %rax, 0x20(%rsp)
jne 0xcc06f
movq %r12, %rcx
subq %r13, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
andq %rcx, %rdx
xorl %eax, %eax
testq %rcx, %rcx
cmovgq %rcx, %rax
cmpq %rbx, %rdx
jl 0xcc08a
cmpq %r12, %rax
jg 0xcc08a
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0xcc0b8
movq %rbx, %rdi
callq 0x114a29
movq %rax, %r14
movq %rbx, %rdi
callq 0x114a6a
movq %rax, 0x10(%rsp)
leaq (%r12,%r13), %rax
imulq $0x30, %rax, %rdi
addq $0x30, %rdi
leaq 0x24f4db(%rip), %rsi    # 0x31b25a
movl $0x1d6, %edx            # imm = 0x1D6
callq 0x93160
andq $0x0, (%rax)
movq %r14, 0x8(%rax)
movq %r14, 0x8(%rsp)
movq %r14, 0x10(%rax)
movq %rax, 0x28(%rsp)
addq $0x40, %rax
movq %r13, %rcx
movabsq $0x7fffffffffffffff, %rdi # imm = 0x7FFFFFFFFFFFFFFF
subq $0x1, %rcx
jb 0xcbdda
movq %rdi, -0x10(%rax)
movq -0x38(%rax), %rdx
movq 0x10(%rsp), %rsi
addq %rdx, %rsi
cmpq %rdi, %rdx
cmoveq %rdi, %rsi
movq %rsi, -0x8(%rax)
movq %rdi, (%rax)
addq $0x30, %rax
jmp 0xcbdb0
movq 0x10(%rsp), %rax
addq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
addq $0x40, %rax
movq %rax, 0x50(%rsp)
movq %r13, 0x18(%rsp)
pushq $0x1
popq %rbp
movq %r12, 0x60(%rsp)
movq %r13, 0x58(%rsp)
movabsq $0x7fffffffffffffff, %rbx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %r12, %rbp
ja 0xcbfcd
movq 0x28(%rsp), %rsi
movq (%rsi), %r11
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %r8
movq 0x18(%rsp), %rax
cmpq %r13, %rax
adcq $0x0, %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rcx
leaq (%r11,%rcx), %rax
movabsq $0x7fffffffffffffff, %r10 # imm = 0x7FFFFFFFFFFFFFFF
cmpq %r10, %r11
cmoveq %r10, %rax
addq %r15, %rcx
cmpq %r10, %r15
cmoveq %r10, %rcx
movq 0x10(%rsp), %rdx
addq %r8, %rdx
cmpq %r10, %r8
cmoveq %r10, %rdx
cmpq %rcx, %rax
cmovlq %rax, %rcx
cmpq %rdx, %rcx
cmovgeq %rdx, %rcx
movq %rcx, 0x10(%rsi)
movq %r10, (%rsi)
movq %r10, 0x8(%rsi)
movq 0x50(%rsp), %r13
pushq $0x1
popq %rsi
cmpq 0x18(%rsp), %rsi
ja 0xcbfbb
movq -0x10(%r13), %rcx
movq %rcx, 0x80(%rsp)
movq -0x8(%r13), %rdx
movq %rdx, 0x78(%rsp)
movq (%r13), %r10
movq %r10, 0x70(%rsp)
movq 0x8(%rsp), %r14
leaq (%rcx,%r14), %rax
cmpq %rbx, %rcx
cmoveq %rbx, %rax
leaq (%rdx,%r14), %rcx
cmpq %rbx, %rdx
cmoveq %rbx, %rcx
movq 0x10(%rsp), %rdx
addq %r10, %rdx
cmpq %rbx, %r10
cmoveq %rbx, %rdx
cmpq %rcx, %rax
cmovlq %rax, %rcx
cmpq %rdx, %rcx
cmovgeq %rdx, %rcx
movq %rcx, (%r13)
movq 0x38(%rsp), %rax
movq %rsi, 0x40(%rsp)
movq 0x40(%rsp), %rcx
movzbl -0x1(%rax,%rcx), %esi
movq 0x68(%rsp), %rax
movzbl -0x1(%rax,%rbp), %edx
movq 0x30(%rsp), %rdi
movq %r8, %r14
movq %r11, %r12
callq 0x114b2c
leaq (%rax,%r12), %rcx
cmpq %rbx, %r12
cmoveq %rbx, %rcx
leaq (%rax,%r15), %rdx
cmpq %rbx, %r15
cmoveq %rbx, %rdx
addq %r14, %rax
cmpq %rbx, %r14
cmoveq %rbx, %rax
cmpq %rdx, %rcx
cmovlq %rcx, %rdx
cmpq %rax, %rdx
cmovgeq %rax, %rdx
movq %rdx, -0x10(%r13)
movq -0x40(%r13), %rax
movq -0x38(%r13), %rcx
movq 0x8(%rsp), %rsi
leaq (%rax,%rsi), %rdx
cmpq %rbx, %rax
cmoveq %rbx, %rdx
movq 0x10(%rsp), %rax
addq %rcx, %rax
cmpq %rbx, %rcx
cmoveq %rbx, %rax
movq -0x30(%r13), %rcx
addq %rcx, %rsi
cmpq %rbx, %rcx
cmoveq %rbx, %rsi
cmpq %rax, %rdx
cmovlq %rdx, %rax
cmpq %rsi, %rax
cmovgeq %rsi, %rax
movq 0x40(%rsp), %rsi
movq %rax, -0x8(%r13)
incq %rsi
addq $0x30, %r13
movq 0x70(%rsp), %r8
movq 0x78(%rsp), %r15
movq 0x80(%rsp), %r11
jmp 0xcbe8c
incq %rbp
movq 0x60(%rsp), %r12
movq 0x58(%rsp), %r13
jmp 0xcbe0e
imulq $0x30, 0x18(%rsp), %rax
movq 0x28(%rsp), %rdi
movq (%rdi,%rax), %rcx
movq 0x8(%rdi,%rax), %rbx
cmpq %rbx, %rcx
cmovlq %rcx, %rbx
movq 0x10(%rdi,%rax), %rax
cmpq %rax, %rbx
cmovgeq %rax, %rbx
leaq 0x24f25f(%rip), %rsi    # 0x31b25a
movl $0x245, %edx            # imm = 0x245
callq 0x936f9
movq 0x20(%rsp), %rcx
cmpq %rcx, %rbx
jne 0xcc0f0
movq 0x30(%rsp), %rdi
callq 0x114a03
movq 0x48(%rsp), %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb647f
movq 0x36bf29(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x24efd1(%rip), %rsi    # 0x31b01a
jmp 0xcc05c
movq 0x36bf16(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x24efe2(%rip), %rsi    # 0x31b03e
leaq 0x225f0f(%rip), %rdx    # 0x2f1f72
xorl %eax, %eax
callq 0x17a50
jmp 0xcc10b
movq 0x36bef2(%rip), %rcx    # 0x437f68
movq (%rcx), %rdi
leaq 0x24f309(%rip), %rsi    # 0x31b389
movq 0x20(%rsp), %rdx
movq %rax, %rcx
jmp 0xcc104
movq 0x36bed7(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x218f78(%rip), %rsi    # 0x2e5013
leaq 0x25a94a(%rip), %rdx    # 0x3269ec
leaq 0x24f59a(%rip), %rcx    # 0x31b643
leaq 0x24f1aa(%rip), %r8     # 0x31b25a
movl $0x1cf, %r9d            # imm = 0x1CF
jmp 0xcc0e4
movq 0x36bea9(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x218f4a(%rip), %rsi    # 0x2e5013
leaq 0x263dd0(%rip), %rdx    # 0x32fea0
leaq 0x24f56c(%rip), %rcx    # 0x31b643
leaq 0x24f17c(%rip), %r8     # 0x31b25a
movl $0x1d1, %r9d            # imm = 0x1D1
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x36be71(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x24f2fd(%rip), %rsi    # 0x31b3fe
movq %rbx, %rdx
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0