// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/linearalign.c
// Function: gt_calc_linearalign
GtUword gt_calc_linearalign(GtLinspaceManagement *spacemanager,
                            const GtScoreHandler *scorehandler,
                            GtAlignment *align,
                            const GtUchar *useq,
                            GtUword ustart,
                            GtUword ulen,
                            const GtUchar *vseq,
                            GtUword vstart,
                            GtUword vlen)
{
  GtUword distance, gapcost, *Ctab, *EDtabcolumn, *Rtabcolumn, threadcount = 1;

  gt_assert(scorehandler);
  gt_linspace_management_set_ulen(spacemanager,ulen);
  gapcost = gt_scorehandler_get_gapscore(scorehandler);

  if (ulen == 0UL)
  {
    return gt_reconstructalignment_trivial_insertion(align, vlen, gapcost);
  }
  else if (vlen == 0UL)
  {
    return gt_reconstructalignment_trivial_deletion(align, ulen, gapcost);
  }
  else if (vlen == 1UL)
  {
    gt_linspace_management_check(spacemanager, (ulen+1)*(vlen+1)-1, ulen,
                                sizeof (*EDtabcolumn), sizeof (EDtabcolumn), 0);
    return gt_squarealign_calculate_generic(spacemanager, align,
                                            useq, ustart, ulen,
                                            vseq, vstart, vlen, scorehandler);
  }
  else if (gt_linspace_management_checksquare(spacemanager, ulen, vlen,
                                              sizeof (*EDtabcolumn),
                                              sizeof (*Rtabcolumn)))
  { /* call 2dim */
    return gt_squarealign_calculate_generic(spacemanager, align,
                                            useq, ustart, ulen,
                                            vseq, vstart, vlen, scorehandler);
  }

#ifdef GT_THREADS_ENABLED
  gt_linspace_management_check(spacemanager, ulen + GT_DIV2(vlen), vlen,
                               sizeof (*EDtabcolumn), sizeof (*Rtabcolumn),
                               sizeof (*Ctab));
#else
  gt_linspace_management_check(spacemanager, ulen, vlen, sizeof (*EDtabcolumn),
                               sizeof (*Rtabcolumn), sizeof (*Ctab));
#endif
  Ctab = gt_linspace_management_get_crosspointTabspace(spacemanager);

  Ctab[vlen] = ulen;
  distance = evaluatelinearcrosspoints(spacemanager, scorehandler,
                                       useq, ustart, ulen,
                                       vseq, vstart, vlen,
                                       Ctab, 0, 0, &threadcount);

  determineCtab0(Ctab, scorehandler, vseq[vstart], useq, ustart);
  gt_reconstructalignment_from_Ctab(align, Ctab, useq, ustart, vseq, vstart,
                                    vlen, scorehandler);

  return distance;
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
movq 0xc0(%rsp), %rax
movq 0xb8(%rsp), %rax
movq 0xb0(%rsp), %rax
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movq %r9, 0x68(%rsp)
movq $0x1, 0x38(%rsp)
cmpq $0x0, 0x88(%rsp)
jne 0x19be83
movq 0x4a014e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37a1b7(%rip), %rsi    # 0x516013
leaq 0x3c64f0(%rip), %rdx    # 0x562353
leaq 0x3bc476(%rip), %rcx    # 0x5582e0
leaq 0x3bc483(%rip), %r8     # 0x5582f4
movl $0x17b, %r9d            # imm = 0x17B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x19be85
movq 0x90(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x1a36b0
movq 0x88(%rsp), %rdi
callq 0x1d11d0
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x68(%rsp)
jne 0x19bed8
movq 0x80(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x1c67c0
movq %rax, 0x98(%rsp)
jmp 0x19c192
cmpq $0x0, 0xc0(%rsp)
jne 0x19bf07
movq 0x80(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x1c6760
movq %rax, 0x98(%rsp)
jmp 0x19c192
cmpq $0x1, 0xc0(%rsp)
jne 0x19bfb2
movq 0x90(%rsp), %rdi
movq 0x68(%rsp), %rsi
addq $0x1, %rsi
movq 0xc0(%rsp), %rax
addq $0x1, %rax
imulq %rax, %rsi
subq $0x1, %rsi
movq 0x68(%rsp), %rdx
movl $0x8, %r8d
xorl %eax, %eax
movl %eax, %r9d
movq %r8, %rcx
callq 0x1a3160
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0xb0(%rsp), %r9
movq 0xb8(%rsp), %r11
movq 0xc0(%rsp), %r10
movq 0x88(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1e0ac0
movq %rax, 0x98(%rsp)
jmp 0x19c192
movq 0x90(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movl $0x8, %r8d
movq %r8, %rcx
callq 0x1a3480
testb $0x1, %al
jne 0x19bfdb
jmp 0x19c03a
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0xb0(%rsp), %r9
movq 0xb8(%rsp), %r11
movq 0xc0(%rsp), %r10
movq 0x88(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1e0ac0
movq %rax, 0x98(%rsp)
jmp 0x19c192
jmp 0x19c03c
jmp 0x19c03e
jmp 0x19c040
movq 0x90(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0xc0(%rsp), %rax
shrq %rax
addq %rax, %rsi
movq 0xc0(%rsp), %rdx
movl $0x8, %r9d
movq %r9, %rcx
movq %r9, %r8
callq 0x1a3160
movq 0x90(%rsp), %rdi
callq 0x1a3780
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0xc0(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0xb0(%rsp), %r9
movq 0xb8(%rsp), %rbx
movq 0xc0(%rsp), %r11
movq 0x50(%rsp), %r10
xorl %eax, %eax
leaq 0x38(%rsp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x19c1b0
movq %rax, 0x60(%rsp)
movq 0x50(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rcx
movb (%rax,%rcx), %al
movq 0x78(%rsp), %rcx
movq 0x70(%rsp), %r8
movzbl %al, %edx
callq 0x19c8b0
movq 0x80(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
movq 0xb0(%rsp), %r8
movq 0xb8(%rsp), %r9
movq 0xc0(%rsp), %r10
movq 0x88(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1c6e80
movq 0x60(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
addq $0xa0, %rsp
popq %rbx
retq
nopw %cs:(%rax,%rax)