// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/linearalign_affinegapcost.c
// Function: gt_linearalign_affinegapcost_check
void gt_linearalign_affinegapcost_check(GT_UNUSED bool forward,
                                        const GtUchar *useq,
                                        GtUword ulen,
                                        const GtUchar *vseq,
                                        GtUword vlen)
{
  GtAlignment *align;
  GtUword affine_score1, affine_score2, affine_score3,
          matchcost = 0, mismatchcost = 4, gap_opening = 4, gap_extension = 1;
  GtLinspaceManagement *spacemanager;
  GtScoreHandler *scorehandler;

  gt_assert(useq && vseq);
  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);
  }

  /* affinealign (square) handles lower/upper cases  in another way*/
  scorehandler = gt_scorehandler_new(matchcost, mismatchcost,
                                     gap_opening, gap_extension);
  gt_scorehandler_plain(scorehandler);
  align = gt_alignment_new_with_seqs(useq, ulen, vseq, vlen);
  spacemanager = gt_linspace_management_new();

  affine_score1 = gt_calc_affinealign_linear(spacemanager, scorehandler, align,
                                             useq, 0, ulen,
                                             vseq, 0, vlen);
  gt_linspace_management_delete(spacemanager);
  affine_score2 = gt_alignment_eval_with_affine_score(align,  true,matchcost,
                                                      mismatchcost, gap_opening,
                                                      gap_extension);
  gt_alignment_delete(align);
  gt_scorehandler_delete(scorehandler);
  if (affine_score1 != affine_score2)
  {
    fprintf(stderr,"gt_calc_affinealign_linear = "GT_WU" != "GT_WU
            " = gt_alignment_eval_with_affine_score\n", affine_score1,
                                                        affine_score2);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  align = gt_affinealign(useq, ulen, vseq, vlen, matchcost,
                         mismatchcost, gap_opening, gap_extension);

  affine_score3 = gt_alignment_eval_with_affine_score(align,  true, matchcost,
                                                      mismatchcost, gap_opening,
                                                      gap_extension);

  if (affine_score1 != affine_score3)
  {
    fprintf(stderr,"gt_calc_affinealign_linear = "GT_WU" != "GT_WU
            " = gt_affinealign\n", affine_score1, affine_score3);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  gt_alignment_delete(align);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
je 0x15b959
movq %rcx, %r14
testq %rcx, %rcx
je 0x15b959
movq %r8, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rsi, %rdi
movl $0xff, %esi
callq 0x178a0
testq %rax, %rax
jne 0x15b95e
movq %r14, %rdi
movl $0xff, %esi
movq %rbx, %rdx
callq 0x178a0
testq %rax, %rax
jne 0x15b963
movl $0x4, %esi
movl $0x4, %edx
movl $0x1, %ecx
xorl %edi, %edi
callq 0x17137c
movq %rax, %rbp
movq %rax, %rdi
callq 0x1713df
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x120d76
movq %rax, %r13
xorl %eax, %eax
callq 0x15bb80
movq %rbx, %r10
movq %rax, %rbx
subq $0x8, %rsp
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r15, 0x10(%rsp)
movq %r15, %r9
movq %r10, 0x18(%rsp)
pushq %r10
pushq $0x0
pushq %r14
callq 0x159e73
addq $0x20, %rsp
movq %rax, %r15
movq %rbx, %rdi
callq 0x15bbbb
movl $0x4, %ecx
movl $0x4, %r8d
movl $0x1, %r9d
movq %r13, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1213ca
movq %rax, %rbx
movq %r13, %rdi
callq 0x121e3c
movq %rbp, %rdi
callq 0x1713ff
cmpq %rbx, %r15
jne 0x15b968
movl $0x4, %r9d
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
movq 0x10(%rsp), %rcx
xorl %r8d, %r8d
pushq $0x1
pushq $0x4
callq 0x2f92ba
addq $0x10, %rsp
movq %rax, %rbx
movl $0x4, %ecx
movl $0x4, %r8d
movl $0x1, %r9d
movq %rax, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1213ca
cmpq %rax, %r15
jne 0x15b973
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x121e3c
callq 0x4ac49
callq 0x4ac82
callq 0x4acaa
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4acd2
movq %r15, %rdi
movq %rax, %rsi
callq 0x4acf9