// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
testq %rsi, %rsi
je 0xf941d
movq %rcx, %rbx
testq %rcx, %rcx
je 0xf941d
movq %r8, %r14
movq %rdx, %r13
movq %rsi, %r15
movq %rsi, %rdi
movl $0xff, %esi
callq 0x17850
testq %rax, %rax
jne 0xf9455
movq %rbx, %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x17850
testq %rax, %rax
movq %r14, 0x38(%rsp)
jne 0xf9468
pushq $0x6
popq %rdi
pushq $-0x3
popq %rsi
pushq $-0x2
popq %rdx
pushq $-0x1
popq %rcx
callq 0x1148f4
movq %rax, %r14
callq 0xb4e60
movq %rax, %rbp
xorl %eax, %eax
callq 0xf9624
movq %rax, %r12
andq $0x0, 0x8(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbx, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
movq %r13, %r9
callq 0xf87de
movq %r13, 0x40(%rsp)
movq %rax, %r13
movq %r12, %rdi
callq 0xf9658
movq %r14, %rdi
callq 0x114a03
pushq $0x1
popq %rsi
movq %rbp, %rdi
pushq $0x6
popq %rdx
pushq $-0x3
popq %rcx
pushq $-0x2
popq %r8
pushq $-0x1
popq %r9
callq 0xb5869
cmpq %rax, %r13
jne 0xf9489
movq %rbp, %rdi
callq 0xb52f8
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
orq $-0x1, 0x28(%rsp)
movq $-0x2, 0x20(%rsp)
andq $0x0, (%rsp)
movq $-0x3, 0x18(%rsp)
movq $0x6, 0x10(%rsp)
xorl %edi, %edi
movq %rbp, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
movq 0x40(%rsp), %r8
movq %rbx, %r9
callq 0x295bae
cmpq %rax, %r13
jne 0xf949c
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
pushq $-0x3
popq %rcx
pushq $-0x2
popq %r8
pushq $-0x1
popq %r9
movq %rbp, %rdi
callq 0xb5869
cmpq %rax, %r13
jne 0xf94af
movq %rbp, %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb647f
movq 0x33eb44(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ebbe5(%rip), %rsi    # 0x2e5013
leaq 0x22cf29(%rip), %rdx    # 0x32635e
leaq 0x1f8af2(%rip), %rcx    # 0x2f1f2e
leaq 0x22cef2(%rip), %r8     # 0x326335
movl $0x48d, %r9d            # imm = 0x48D
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x33eb0c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x221bb4(%rip), %rsi    # 0x31b01a
jmp 0xf9479
movq 0x33eaf9(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x221bc5(%rip), %rsi    # 0x31b03e
leaq 0x1f8aae(%rip), %rdx    # 0x2f1f2e
xorl %eax, %eax
callq 0x17a50
jmp 0xf94cd
movq 0x33ead8(%rip), %rcx    # 0x437f68
movq (%rcx), %rdi
leaq 0x22cf5a(%rip), %rsi    # 0x3263f4
jmp 0xf94c0
movq 0x33eac5(%rip), %rcx    # 0x437f68
movq (%rcx), %rdi
leaq 0x22cfad(%rip), %rsi    # 0x32645a
jmp 0xf94c0
movq 0x33eab2(%rip), %rcx    # 0x437f68
movq (%rcx), %rdi
leaq 0x22cfed(%rip), %rsi    # 0x3264ad
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0