// File: /workspace/github_c_makefile_star2_O1/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 0x163864
movq %rcx, %r15
testq %rcx, %rcx
je 0x163864
movq %r8, %rbp
movq %rdx, %r14
movq %rsi, %r12
movq %rsi, %rdi
movl $0xff, %esi
callq 0x178a0
testq %rax, %rax
jne 0x163869
movq %r15, %rdi
movl $0xff, %esi
movq %rbp, %rdx
callq 0x178a0
testq %rax, %rax
movq %r15, 0x8(%rsp)
jne 0x16386e
movl $0x6, %edi
movq $-0x3, %rsi
movq $-0x2, %rdx
movq $-0x1, %rcx
callq 0x179740
movq %rax, %rbx
callq 0x126b24
movq %rax, %r13
xorl %eax, %eax
callq 0x1638ec
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 0x162bf9
addq $0x20, %rsp
movq %rbp, 0x10(%rsp)
movq %rax, %rbp
movq %r15, %rdi
callq 0x163927
movq %rbx, %rdi
callq 0x1797c3
movl $0x6, %edx
movq %r13, %rdi
movl $0x1, %esi
movq $-0x3, %rcx
movq $-0x2, %r8
movq $-0x1, %r9
callq 0x1271c2
cmpq %rax, %rbp
jne 0x163873
movq %r13, %rdi
callq 0x126d7c
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 0x303f06
addq $0x30, %rsp
movq %rax, %rbx
cmpq %rax, %rbp
jne 0x16387e
movl $0x6, %edx
movq %r13, %rdi
movl $0x1, %esi
movq $-0x3, %rcx
movq $-0x2, %r8
movq $-0x1, %r9
callq 0x1271c2
cmpq %rax, %rbx
jne 0x163889
movq %r13, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x127c25
callq 0x4bb33
callq 0x4bb6c
callq 0x4bb94
movq %rbp, %rdi
movq %rax, %rsi
callq 0x4bbbc
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4bbe3
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4bc0a