// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/linearalign.c
// Function: gt_linearalign_check
void gt_linearalign_check(GT_UNUSED bool forward,
                          const GtUchar *useq,
                          GtUword ulen,
                          const GtUchar *vseq,
                          GtUword vlen)
{
  GtAlignment *align;
  GtUword edist1, edist2, edist3, edist4,
          matchcost = 0, mismatchcost = 1, gapcost = 1;
  GtLinspaceManagement *spacemanager;
  GtScoreHandler *scorehandler;
  const bool downcase = true;

  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(matchcost,  mismatchcost, 0, gapcost);
  gt_scorehandler_plain(scorehandler);
  gt_scorehandler_downcase(scorehandler);
  spacemanager = gt_linspace_management_new();
  align = gt_alignment_new_with_seqs(useq, ulen, vseq, vlen);
  edist1 = gt_calc_linearalign(spacemanager, scorehandler, align,
                               useq, 0, ulen,
                               vseq, 0, vlen);
  edist2 = gt_squarealign_global_distance_only(useq, 0, ulen, vseq, 0, vlen,
                                               scorehandler);

  if (edist1 != edist2)
  {
    fprintf(stderr,"gt_calc_linearalign = "GT_WU" != "GT_WU
            " = gt_squarealign_global_distance_only\n", edist1,edist2);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  edist3 = gt_alignment_eval_with_score(align, true, matchcost,
                                        mismatchcost, gapcost);

  if (edist2 != edist3)
  {
    fprintf(stderr,"gt_squarealign_global_distance_only = "GT_WU" != "GT_WU
            " = gt_alignment_eval_with_score\n", edist2,edist3);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }

  edist4 = gt_calc_linearedist(downcase,useq, ulen, vseq, vlen);
  if (edist3 != edist4)
  {
    fprintf(stderr,"gt_alignment_eval_with_score = "GT_WU" != "GT_WU
            " = gt_calc_linearedist\n", edist3, edist4);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
  gt_linspace_management_delete(spacemanager);
  gt_scorehandler_delete(scorehandler);
  gt_alignment_delete(align);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r13
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %rdi
movq %rsi, (%rsp)
movl $0xff, %esi
callq 0x178a0
testq %rax, %rax
jne 0x159b9d
movq %r12, %rdi
movl $0xff, %esi
movq %r13, %rdx
callq 0x178a0
testq %rax, %rax
jne 0x159ba2
movl $0x1, %esi
movl $0x1, %ecx
xorl %edi, %edi
xorl %edx, %edx
callq 0x17137c
movq %rax, %r14
movq %rax, %rdi
callq 0x1713df
movq %r14, %rdi
callq 0x1713ef
xorl %eax, %eax
callq 0x15bb80
movq %rax, %r15
movq (%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x120d76
subq $0x8, %rsp
movq %r15, 0x30(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %rax, 0x20(%rsp)
movq %rax, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
movq %rbp, %r9
pushq %r13
pushq $0x0
pushq %r12
callq 0x1589a8
addq $0x20, %rsp
movq %rax, %r15
subq $0x8, %rsp
movq %rbx, %rdi
xorl %esi, %esi
movq %rbp, 0x10(%rsp)
movq %rbp, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movq %r13, %r9
movq %r14, 0x38(%rsp)
pushq %r14
callq 0x179a33
addq $0x10, %rsp
cmpq %rax, %r15
jne 0x159ba7
movq %r12, %rbx
movq %r13, %rbp
movl $0x1, %ecx
movl $0x1, %r8d
movq 0x18(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1211ad
movq %r15, 0x10(%rsp)
cmpq %rax, %r15
jne 0x159bb2
leaq 0x22c4f7(%rip), %rdi    # 0x385e69
leaq 0x22c501(%rip), %rsi    # 0x385e7a
xorl %r15d, %r15d
movq 0x8(%rsp), %r14
movl %r14d, %edx
movl %r14d, %ecx
movq (%rsp), %r8
movl %ebp, %r9d
xorl %eax, %eax
movq %rbx, %r12
pushq %rbx
pushq %rbp
callq 0x17070
addq $0x10, %rsp
cmpq %rbp, %r14
movq %rbp, %rbx
cmovbq %r14, %rbx
leaq 0x8(,%rbx,8), %rdi
leaq 0x22c18d(%rip), %rsi    # 0x385b44
movl $0x209, %edx            # imm = 0x209
callq 0x104226
movq %rax, %r13
leaq 0x1(%rbx), %r14
cmpq $0x1, %r14
movq %rbx, 0x20(%rsp)
adcq $0x1, %rbx
leaq 0x1(%rbx), %rax
andq $-0x2, %rax
decq %rbx
movq %rbx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x1ff02e(%rip), %xmm1   # 0x358a20
movdqa 0x1ff036(%rip), %xmm2   # 0x358a30
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x1ff036(%rip), %xmm4   # 0x358a40
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %ecx
notl %ecx
testb $0x1, %cl
je 0x159a40
movq %r15, (%r13,%r15,8)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %ecx
testb $0x1, %cl
je 0x159a57
leaq 0x1(%r15), %rcx
movq %rcx, 0x8(%r13,%r15,8)
addq $0x2, %r15
paddq %xmm4, %xmm1
cmpq %r15, %rax
jne 0x159a0a
movq 0x8(%rsp), %rax
cmpq %rbp, %rax
movq %r12, %rcx
cmovaq (%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq %rbp, %rcx
cmovaq %rax, %rcx
testq %rcx, %rcx
je 0x159b49
movq %rcx, %rdx
cmpq %rbp, %rax
movq (%rsp), %rax
cmovaq %r12, %rax
movq %rax, (%rsp)
cmpq $0x3, %r14
movl $0x2, %eax
cmovbq %rax, %r14
incq %rdx
cmpq $0x3, %rdx
cmovbq %rax, %rdx
movq %rdx, 0x38(%rsp)
movq (%r13), %r15
decq %r14
movl $0x1, %ebx
movq 0x40(%rsp), %rax
movzbl -0x1(%rax,%rbx), %edi
callq 0x17ae0
movq %rbx, 0x8(%rsp)
movq %rbx, (%r13)
cmpq $0x0, 0x20(%rsp)
je 0x159b30
movl %eax, %ebp
xorl %ebx, %ebx
movq %r15, %r12
movq (%rsp), %rax
movzbl (%rax,%rbx), %edi
callq 0x17ae0
movq (%r13,%rbx,8), %rcx
movq 0x8(%r13,%rbx,8), %r15
xorl %edx, %edx
xorb %bpl, %al
setne %dl
addq %r12, %rdx
incq %rcx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
leaq 0x1(%r15), %rax
cmpq %rcx, %rax
jb 0x159b23
movq %rcx, %rax
movq %rax, 0x8(%r13,%rbx,8)
incq %rbx
cmpq %rbx, %r14
jne 0x159ae8
movq 0x8(%rsp), %rax
movq %rax, %r15
incq %rax
movq %rax, %rbx
cmpq 0x38(%rsp), %rax
jne 0x159ac4
movq 0x20(%rsp), %rax
movq (%r13,%rax,8), %rbx
leaq 0x22bfea(%rip), %rsi    # 0x385b44
movq %r13, %rdi
movl $0x20e, %edx            # imm = 0x20E
callq 0x1045eb
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x159bbf
movq 0x28(%rsp), %rdi
callq 0x15bbbb
movq 0x30(%rsp), %rdi
callq 0x1713ff
movq 0x18(%rsp), %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x121e3c
callq 0x4a96f
callq 0x4a997
movq %r15, %rdi
movq %rax, %rsi
callq 0x4a9bf
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x4a9e6
movq %rbx, %rsi
callq 0x4aa0d