// File: /workspace/github_c_makefile_star2_O2/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 0xf91f7
movq %rcx, %r14
testq %rcx, %rcx
je 0xf91f7
movq %r8, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rsi, %rdi
movl $0xff, %esi
callq 0x17850
testq %rax, %rax
jne 0xf922f
movq %r14, %rdi
movl $0xff, %esi
movq %rbx, %rdx
callq 0x17850
testq %rax, %rax
jne 0xf9242
pushq $0x4
popq %rdx
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %rdx, %rsi
callq 0x1148f4
movq %rax, %rbp
movq %rax, %rdi
callq 0x114981
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xb4ea1
movq %rax, %r13
xorl %eax, %eax
callq 0xf9624
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 0xf7921
addq $0x20, %rsp
movq %rax, %r15
movq %rbx, %rdi
callq 0xf9658
pushq $0x1
popq %rsi
movq %r13, %rdi
xorl %edx, %edx
pushq $0x4
popq %rcx
movq %rcx, %r8
pushq $0x1
popq %r9
callq 0xb5869
movq %rax, %rbx
movq %r13, %rdi
callq 0xb647f
movq %rbp, %rdi
callq 0x114a03
cmpq %rbx, %r15
jne 0xf9263
pushq $0x4
popq %r13
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
movq 0x10(%rsp), %rcx
xorl %r8d, %r8d
movq %r13, %r9
pushq $0x1
pushq $0x4
callq 0x29491f
popq %rcx
popq %rdx
movq %rax, %rbx
pushq $0x1
popq %rsi
pushq $0x1
popq %r9
movq %rax, %rdi
xorl %edx, %edx
movq %r13, %rcx
movq %r13, %r8
callq 0xb5869
cmpq %rax, %r15
jne 0xf927c
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb647f
movq 0x33ed6a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ebe0b(%rip), %rsi    # 0x2e5013
leaq 0x22d14f(%rip), %rdx    # 0x32635e
leaq 0x1f8cf5(%rip), %rcx    # 0x2f1f0b
leaq 0x22d118(%rip), %r8     # 0x326335
movl $0x44c, %r9d            # imm = 0x44C
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x33ed32(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x221dda(%rip), %rsi    # 0x31b01a
jmp 0xf9253
movq 0x33ed1f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x221deb(%rip), %rsi    # 0x31b03e
leaq 0x1f8cb1(%rip), %rdx    # 0x2f1f0b
xorl %eax, %eax
callq 0x17a50
jmp 0xf929a
movq 0x33ecfe(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x22d0f7(%rip), %rsi    # 0x32636b
movq %r15, %rdx
movq %rbx, %rcx
jmp 0xf9293
movq 0x33ece5(%rip), %rcx    # 0x437f68
movq (%rcx), %rdi
leaq 0x22d12d(%rip), %rsi    # 0x3263ba
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0