// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/linearalign_affinegapcost.c
// Function: gt_calc_affinealign_linear
GtUword gt_calc_affinealign_linear(GtLinspaceManagement *spacemanager,
                                   const GtScoreHandler *scorehandler,
                                   GtAlignment *align,
                                   const GtUchar *useq,
                                   GtUword ustart,
                                   GtUword ulen,
                                   const GtUchar *vseq,
                                   GtUword vstart,
                                   GtUword vlen)
{
  GtUword distance, *Ctab, threadcount = 1;
  GtWord gap_extension, gap_opening;
  GtAffinealignDPentry *Atabcolumn;
  GtAffineAlignRtabentry *Rtabcolumn;

  gt_linspace_management_set_ulen(spacemanager, ulen);
  gap_extension = gt_scorehandler_get_gapscore(scorehandler);
  gap_opening = gt_scorehandler_get_gap_opening(scorehandler);
  if (ulen == 0UL)
  {
      distance = gt_reconstructalignment_trivial_insertion(align, vlen,
                                                           gap_extension);
      distance += gap_opening;
      return distance;
  }
  else if (vlen == 0UL)
  {
      distance = gt_reconstructalignment_trivial_deletion(align, ulen,
                                                          gap_extension);
      distance += gap_opening;
      return distance;
  }
  else if (vlen == 1UL)
  {
     gt_linspace_management_check(spacemanager, (ulen+1)*(vlen+1)-1, ulen,
                                  sizeof (*Atabcolumn), sizeof (Atabcolumn), 0);
    return gt_affinealign_with_Management(spacemanager, scorehandler, align,
                                   useq+ustart, ulen, vseq+vstart, vlen);
  }
  if (gt_linspace_management_checksquare(spacemanager, ulen, vlen,
                                         sizeof (*Atabcolumn),
                                         sizeof (*Rtabcolumn)))
  {
    return gt_affinealign_with_Management(spacemanager, scorehandler, align,
                                   useq+ustart, ulen, vseq+vstart, vlen);
  }
  else
  {
    gt_linspace_management_check(spacemanager, ulen, vlen, sizeof (*Atabcolumn),
                                 sizeof (*Rtabcolumn), sizeof (*Ctab));
    Ctab = gt_linspace_management_get_crosspointTabspace(spacemanager);
    Ctab[vlen] = ulen;
    distance = evaluateaffinecrosspoints(spacemanager, scorehandler,
                                         useq, ustart, ulen,
                                         vseq, vstart, vlen,
                                         Ctab, 0, Affine_X,
                                         Affine_X, &threadcount);

    affine_determineCtab0(Ctab, spacemanager, scorehandler,
                          useq, ustart, vseq, vstart);

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

  }
  return distance;
}

// Assembly:
pushq %rbx
subq $0xb0, %rsp
movq 0xd0(%rsp), %rax
movq 0xc8(%rsp), %rax
movq 0xc0(%rsp), %rax
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq %r9, 0x78(%rsp)
movq $0x1, 0x60(%rsp)
movq 0xa0(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x1a36b0
movq 0x98(%rsp), %rdi
callq 0x1d11d0
movq %rax, 0x58(%rsp)
movq 0x98(%rsp), %rdi
callq 0x1d1180
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x78(%rsp)
jne 0x19e9e4
movq 0x90(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x1c67c0
movq %rax, 0x70(%rsp)
movq 0x50(%rsp), %rax
addq 0x70(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0xa8(%rsp)
jmp 0x19ecc3
cmpq $0x0, 0xd0(%rsp)
jne 0x19ea2c
movq 0x90(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x1c6760
movq %rax, 0x70(%rsp)
movq 0x50(%rsp), %rax
addq 0x70(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0xa8(%rsp)
jmp 0x19ecc3
cmpq $0x1, 0xd0(%rsp)
jne 0x19ead5
movq 0xa0(%rsp), %rdi
movq 0x78(%rsp), %rsi
addq $0x1, %rsi
movq 0xd0(%rsp), %rax
addq $0x1, %rax
imulq %rax, %rsi
subq $0x1, %rsi
movq 0x78(%rsp), %rdx
movl $0x30, %ecx
movl $0x8, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x1a3160
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x88(%rsp), %rcx
addq 0x80(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0xc0(%rsp), %r9
addq 0xc8(%rsp), %r9
movq 0xd0(%rsp), %rax
movq %rax, (%rsp)
callq 0x485100
movq %rax, 0xa8(%rsp)
jmp 0x19ecc3
jmp 0x19ead7
jmp 0x19ead9
movq 0xa0(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movl $0x30, %r8d
movq %r8, %rcx
callq 0x1a3480
testb $0x1, %al
jne 0x19eb02
jmp 0x19eb5d
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x88(%rsp), %rcx
addq 0x80(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0xc0(%rsp), %r9
addq 0xc8(%rsp), %r9
movq 0xd0(%rsp), %rax
movq %rax, (%rsp)
callq 0x485100
movq %rax, 0xa8(%rsp)
jmp 0x19ecc3
movq 0xa0(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movl $0x30, %r8d
movl $0x8, %r9d
movq %r8, %rcx
callq 0x1a3160
movq 0xa0(%rsp), %rdi
callq 0x1a3780
movq %rax, 0x68(%rsp)
movq 0x78(%rsp), %rdx
movq 0x68(%rsp), %rax
movq 0xd0(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0xc0(%rsp), %r9
movq 0xc8(%rsp), %rbx
movq 0xd0(%rsp), %r11
movq 0x68(%rsp), %r10
xorl %eax, %eax
leaq 0x60(%rsp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x3, 0x20(%rsp)
movl $0x3, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x19ece0
movq %rax, 0x70(%rsp)
movq 0x68(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x88(%rsp), %rcx
movq 0x80(%rsp), %r8
movq 0xc0(%rsp), %r9
movq 0xc8(%rsp), %rax
movq %rax, (%rsp)
callq 0x19f970
movq 0x90(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0xc0(%rsp), %r8
movq 0xc8(%rsp), %r9
movq 0xd0(%rsp), %r10
movq 0x98(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1c6e80
movq 0x70(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
addq $0xb0, %rsp
popq %rbx
retq
nopw %cs:(%rax,%rax)