// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/linearalign.c
// Function: gt_linearalign_check_local
void gt_linearalign_check_local(GT_UNUSED bool forward,
                                const GtUchar *useq, GtUword ulen,
                                const GtUchar *vseq, GtUword vlen)
{
  GtAlignment *align;
  GtWord score1, score2, score3, score4,
         matchscore = 2, mismatchscore = -2, gapscore = -1;
  GtLinspaceManagement *spacemanager;
  GtScoreHandler *scorehandler;

  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, 0, gapscore);
  gt_scorehandler_plain(scorehandler);
  spacemanager = gt_linspace_management_new();
  align = gt_alignment_new();
  score1 = gt_linearalign_compute_local_generic(spacemanager, scorehandler,
                                                align, useq, 0, ulen,
                                                vseq, 0, vlen);

  score2 = gt_alignment_eval_with_score(align, true, matchscore,
                                        mismatchscore, gapscore);
  gt_linspace_management_delete(spacemanager);
  gt_scorehandler_delete(scorehandler);
  if (score1 != score2)
  {
    fprintf(stderr,"gt_linearalign_compute_local_generic = "GT_WD" != "GT_WD
            " = gt_alignment_eval_generic_with_score\n", score1, score2);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  gt_alignment_reset(align);
  score3 = gt_squarealign_calculate_local(NULL, align, useq, 0, ulen,
                                          vseq, 0, vlen, matchscore,
                                          mismatchscore, gapscore);

  if (score1 != score3)
  {
    fprintf(stderr,"gt_linearalign_compute_local_generic = "GT_WD" != "GT_WD
            " = gt_squarealign_calculate_local\n", score1, score3);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  score4 = gt_alignment_eval_with_score(align, true, matchscore,
                                        mismatchscore, gapscore);
  if (score3 != score4)
  {
    fprintf(stderr,"gt_squarealign_calculate_local = "GT_WD" != "GT_WD
            " = gt_alignment_eval_generic_with_score\n", score3, score4);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  gt_alignment_delete(align);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movq %rcx, %rbp
movq %rdx, %rbx
movq %rsi, %r12
movq %rsi, %rdi
movl $0xff, %esi
callq 0x178a0
testq %rax, %rax
jne 0x159d34
movq %rbx, 0x20(%rsp)
movq %rbp, %rdi
movl $0xff, %esi
movq %r15, %rdx
callq 0x178a0
testq %rax, %rax
jne 0x159d39
movl $0x2, %edi
movq $-0x2, %rsi
xorl %edx, %edx
movq $-0x1, %rcx
callq 0x17137c
movq %rax, %rbx
movq %rax, %rdi
callq 0x1713df
xorl %eax, %eax
callq 0x15bb80
movq %rax, %r14
callq 0x120d2c
movq %rax, %r13
subq $0x8, %rsp
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r12, 0x10(%rsp)
movq %r12, %rcx
xorl %r8d, %r8d
movq 0x28(%rsp), %r12
movq %r12, %r9
movq %r15, 0x20(%rsp)
pushq %r15
pushq $0x0
movq %rbp, 0x28(%rsp)
pushq %rbp
callq 0x159379
addq $0x20, %rsp
movq %rax, %rbp
movl $0x2, %edx
movq %r13, %rdi
movl $0x1, %esi
movq $-0x2, %rcx
movq $-0x1, %r8
callq 0x1211ad
movq %rax, %r15
movq %r14, %rdi
callq 0x15bbbb
movq %rbx, %rdi
callq 0x1713ff
cmpq %r15, %rbp
jne 0x159d3e
movq %r13, %rdi
callq 0x120f84
subq $0x8, %rsp
xorl %edi, %edi
movq %r13, %rsi
movq 0x10(%rsp), %rdx
xorl %ecx, %ecx
movq %r12, %r8
movq 0x18(%rsp), %r9
pushq $-0x1
pushq $-0x2
pushq $0x2
pushq 0x38(%rsp)
pushq $0x0
callq 0x17a16d
addq $0x30, %rsp
cmpq %rax, %rbp
jne 0x159d49
movl $0x2, %edx
movq %r13, %rdi
movl $0x1, %esi
movq $-0x2, %rcx
movq $-0x1, %r8
callq 0x1211ad
cmpq %rax, %rbp
jne 0x159d54
movq %r13, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x121e3c
callq 0x4aa34
callq 0x4aa5c
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4aa84
movq %rbp, %rdi
movq %rax, %rsi
callq 0x4aaab
movq %rbp, %rdi
movq %rax, %rsi
callq 0x4aad2