// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/linearalign_affinegapcost.c
// Function: gt_linearalign_affinegapcost_check_local
void gt_linearalign_affinegapcost_check_local(GT_UNUSED bool forward,
                                              const GtUchar *useq,
                                              GtUword ulen,
                                              const GtUchar *vseq,
                                              GtUword vlen)
{
  GtAlignment *align;
  GtWord affine_score1, affine_score2, affine_score3, affine_score4,
         matchscore = 6, mismatchscore = -3,
         gap_opening = -2, gap_extension = -1;
  GtScoreHandler *scorehandler;
  GtLinspaceManagement *spacemanager;

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

  scorehandler = gt_scorehandler_new(matchscore, mismatchscore,
                                     gap_opening, gap_extension);
  align = gt_alignment_new();
  spacemanager = gt_linspace_management_new();
  affine_score1 = gt_linearalign_affinegapcost_compute_local_generic(
                                                            spacemanager,
                                                            scorehandler, align,
                                                            useq, 0, ulen,
                                                            vseq,  0, vlen);
  gt_linspace_management_delete(spacemanager);
  gt_scorehandler_delete(scorehandler);

  affine_score2 = gt_alignment_eval_with_affine_score(align, true, matchscore,
                                    mismatchscore, gap_opening, gap_extension);

  if (affine_score1 != affine_score2)
  {
    fprintf(stderr,"gt_linearalign_affinegapcost_compute_local_generic ="
            " "GT_WD"!= "GT_WD
            " = gt_alignment_eval_with_affine_score\n", affine_score1,
                                                        affine_score2);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  gt_alignment_reset(align);
  affine_score3 = gt_affinealign_calculate_local(NULL, align, useq, 0,
                                                 ulen, vseq, 0, vlen,
                                                 matchscore, mismatchscore,
                                                 gap_opening, gap_extension);

  if (affine_score1 != affine_score3)
  {
    fprintf(stderr,"gt_calc_affinealign_linear_local = "GT_WD" != "GT_WD
            " = affinealign_in_square_space_local\n", affine_score1,
                                                        affine_score3);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  affine_score4 = gt_alignment_eval_with_affine_score(align, true, matchscore,
                                    mismatchscore, gap_opening, gap_extension);

  if (affine_score3 != affine_score4)
  {
    fprintf(stderr,"affinealign_in_square_space_local = "GT_WD" != "GT_WD
            " = gt_alignment_eval_generic_with_affine_score\n", affine_score3,
                                                        affine_score4);
    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 0x15baf8
movq %rcx, %r15
testq %rcx, %rcx
je 0x15baf8
movq %r8, %rbp
movq %rdx, %r14
movq %rsi, %r12
movq %rsi, %rdi
movl $0xff, %esi
callq 0x178a0
testq %rax, %rax
jne 0x15bafd
movq %r15, %rdi
movl $0xff, %esi
movq %rbp, %rdx
callq 0x178a0
testq %rax, %rax
movq %r15, 0x8(%rsp)
jne 0x15bb02
movl $0x6, %edi
movq $-0x3, %rsi
movq $-0x2, %rdx
movq $-0x1, %rcx
callq 0x17137c
movq %rax, %rbx
callq 0x120d2c
movq %rax, %r13
xorl %eax, %eax
callq 0x15bb80
movq %rax, %r15
subq $0x8, %rsp
movq %rax, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r14, %r9
pushq %rbp
pushq $0x0
pushq 0x20(%rsp)
callq 0x15af49
addq $0x20, %rsp
movq %rbp, 0x10(%rsp)
movq %rax, %rbp
movq %r15, %rdi
callq 0x15bbbb
movq %rbx, %rdi
callq 0x1713ff
movl $0x6, %edx
movq %r13, %rdi
movl $0x1, %esi
movq $-0x3, %rcx
movq $-0x2, %r8
movq $-0x1, %r9
callq 0x1213ca
cmpq %rax, %rbp
jne 0x15bb07
movq %r13, %rdi
callq 0x120f84
xorl %edi, %edi
movq %r13, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
movq %r14, %r8
movq 0x8(%rsp), %r9
pushq $-0x1
pushq $-0x2
pushq $-0x3
pushq $0x6
pushq 0x30(%rsp)
pushq $0x0
callq 0x2fa25e
addq $0x30, %rsp
cmpq %rax, %rbp
jne 0x15bb12
movl $0x6, %edx
movq %r13, %rdi
movl $0x1, %esi
movq $-0x3, %rcx
movq $-0x2, %r8
movq $-0x1, %r9
callq 0x1213ca
cmpq %rax, %rbp
jne 0x15bb1d
movq %r13, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x121e3c
callq 0x4ad20
callq 0x4ad59
callq 0x4ad81
movq %rbp, %rdi
movq %rax, %rsi
callq 0x4ada9
movq %rbp, %rdi
movq %rax, %rsi
callq 0x4add0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x4adf7