// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/diagonalbandalign_affinegapcost.c
// Function: gt_calc_diagonalbandaffinealign
static void gt_calc_diagonalbandaffinealign(GtLinspaceManagement *spacemanager,
                                            const GtScoreHandler *scorehandler,
                                            GtAlignment *align,
                                            const GtUchar *useq,
                                            GtUword ustart, GtUword ulen,
                                            const GtUchar *vseq,
                                            GtUword vstart, GtUword vlen,
                                            GtWord left_dist,
                                            GtWord right_dist)
{
  GtAffinealignDPentry *Atabcolumn;
  GtAffineAlignRtabentry *Rtabcolumn;
  GtAffineDiagAlignentry *Diagcolumn;
  GtAffineAlignRnode lastnode;
  GtUword idx, gap_extension;
  gt_assert(align && scorehandler);

  if ((left_dist > GT_MIN(0, (GtWord)vlen-(GtWord)ulen))||
      (right_dist < GT_MAX(0, (GtWord)vlen-(GtWord)ulen)))
  {
    gt_assert(false); /* no global alignment */
  }

  gt_linspace_management_set_ulen(spacemanager, ulen);
  gap_extension = gt_scorehandler_get_gapscore(scorehandler);

  if (ulen == 0UL)
  {
    (void) gt_reconstructalignment_trivial_insertion(align, vlen,
                                                     gap_extension);
    return;

  }
  else if (vlen == 0UL)
  {
    (void) gt_reconstructalignment_trivial_deletion(align, ulen,
                                                    gap_extension);
     return;
  }
  if (gt_linspace_management_checksquare(spacemanager, ulen, vlen,
                                         sizeof (*Atabcolumn),
                                         sizeof (*Rtabcolumn)))
  {
    (void) gt_diagonalbandalign_affinegapcost_in_square_space_generic(
                                                         spacemanager,
                                                         scorehandler, align,
                                                         useq, ustart, ulen,
                                                         vseq, vstart, vlen,
                                                         left_dist, right_dist);
    return;
  }
  gt_linspace_management_check(spacemanager, GT_MIN(right_dist-left_dist,ulen),
                               vlen, sizeof (*Atabcolumn), sizeof (*Rtabcolumn),
                               sizeof (*Diagcolumn));
  Diagcolumn = gt_linspace_management_get_crosspointTabspace(spacemanager);

  /* initialize Diagcolumn */
  for (idx = 0; idx <= vlen; idx++)
  {
    Diagcolumn[idx].val_R =
                      (GtDiagAlignentry) {GT_UWORD_MAX, GT_UWORD_MAX, Affine_X};
    Diagcolumn[idx].val_D =
                      (GtDiagAlignentry) {GT_UWORD_MAX, GT_UWORD_MAX, Affine_X};
    Diagcolumn[idx].val_I =
                      (GtDiagAlignentry) {GT_UWORD_MAX, GT_UWORD_MAX, Affine_X};
  }

  lastnode = evaluateaffineDBcrosspoints(spacemanager, Diagcolumn, scorehandler,
                                         Affine_X, Affine_X, Affine_X, 0, 0,
                                         useq, ustart, ulen, vseq, vstart, vlen,
                                         left_dist, right_dist);
  /* reconstruct alignment */
  gt_reconstructalignment_from_affineDtab(align, Diagcolumn, lastnode.edge,
                                          useq, ulen, vseq, vlen);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x140, %rsp            # imm = 0x140
movq 0x190(%rsp), %rax
movq 0x188(%rsp), %rax
movq 0x180(%rsp), %rax
movq 0x178(%rsp), %rax
movq 0x170(%rsp), %rax
movq %rdi, 0x138(%rsp)
movq %rsi, 0x130(%rsp)
movq %rdx, 0x128(%rsp)
movq %rcx, 0x120(%rsp)
movq %r8, 0x118(%rsp)
movq %r9, 0x110(%rsp)
cmpq $0x0, 0x128(%rsp)
je 0x15334e
cmpq $0x0, 0x130(%rsp)
jne 0x153386
movq 0x4e8c4b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c2cb4(%rip), %rsi    # 0x516013
leaq 0x3f9cef(%rip), %rdx    # 0x54d055
leaq 0x3fa263(%rip), %rcx    # 0x54d5d0
leaq 0x3fa028(%rip), %r8     # 0x54d39c
movl $0x566, %r9d            # imm = 0x566
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x153388
movq 0x188(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x180(%rsp), %rcx
subq 0x110(%rsp), %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jge 0x1533b5
xorl %eax, %eax
movq %rax, 0x70(%rsp)
jmp 0x1533ca
movq 0x180(%rsp), %rax
subq 0x110(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rax
movq 0x70(%rsp), %rcx
cmpq %rcx, %rax
jg 0x15342a
movq 0x190(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x180(%rsp), %rcx
subq 0x110(%rsp), %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jle 0x153406
xorl %eax, %eax
movq %rax, 0x60(%rsp)
jmp 0x15341b
movq 0x180(%rsp), %rax
subq 0x110(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rcx
cmpq %rcx, %rax
jge 0x153464
jmp 0x15342c
movq 0x4e8b6d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c2bd6(%rip), %rsi    # 0x516013
leaq 0x40591f(%rip), %rdx    # 0x558d63
leaq 0x3fa185(%rip), %rcx    # 0x54d5d0
leaq 0x3f9f4a(%rip), %r8     # 0x54d39c
movl $0x56b, %r9d            # imm = 0x56B
movb $0x0, %al
callq 0x199f0
callq 0x19370
movq 0x138(%rsp), %rdi
movq 0x110(%rsp), %rsi
callq 0x1a36b0
movq 0x130(%rsp), %rdi
callq 0x1d11d0
movq %rax, 0xd8(%rsp)
cmpq $0x0, 0x110(%rsp)
jne 0x1534bb
movq 0x128(%rsp), %rdi
movq 0x180(%rsp), %rsi
movq 0xd8(%rsp), %rdx
callq 0x1c67c0
jmp 0x153874
cmpq $0x0, 0x180(%rsp)
jne 0x1534e8
movq 0x128(%rsp), %rdi
movq 0x110(%rsp), %rsi
movq 0xd8(%rsp), %rdx
callq 0x1c6760
jmp 0x153874
jmp 0x1534ea
movq 0x138(%rsp), %rdi
movq 0x110(%rsp), %rsi
movq 0x180(%rsp), %rdx
movl $0x30, %r8d
movq %r8, %rcx
callq 0x1a3480
testb $0x1, %al
jne 0x153516
jmp 0x153590
movq 0x138(%rsp), %rdi
movq 0x130(%rsp), %rsi
movq 0x128(%rsp), %rdx
movq 0x120(%rsp), %rcx
movq 0x118(%rsp), %r8
movq 0x110(%rsp), %r9
movq 0x170(%rsp), %r14
movq 0x178(%rsp), %rbx
movq 0x180(%rsp), %r11
movq 0x188(%rsp), %r10
movq 0x190(%rsp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x1510b0
jmp 0x153874
movq 0x138(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x190(%rsp), %rax
subq 0x188(%rsp), %rax
cmpq 0x110(%rsp), %rax
jae 0x1535ce
movq 0x190(%rsp), %rax
subq 0x188(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x1535db
movq 0x110(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x180(%rsp), %rdx
movl $0x30, %r8d
movl $0x48, %r9d
movq %r8, %rcx
callq 0x1a3160
movq 0x138(%rsp), %rdi
callq 0x1a3780
movq %rax, 0xf8(%rsp)
movq $0x0, 0xe0(%rsp)
movq 0xe0(%rsp), %rax
cmpq 0x180(%rsp), %rax
ja 0x153761
movq 0xf8(%rsp), %rax
imulq $0x48, 0xe0(%rsp), %rcx
addq %rcx, %rax
movq $-0x1, 0xc0(%rsp)
movq $-0x1, 0xc8(%rsp)
movl $0x3, 0xd0(%rsp)
movq 0xc0(%rsp), %rcx
movq %rcx, (%rax)
movq 0xc8(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0xd0(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq 0xf8(%rsp), %rax
imulq $0x48, 0xe0(%rsp), %rcx
addq %rcx, %rax
movq $-0x1, 0xa8(%rsp)
movq $-0x1, 0xb0(%rsp)
movl $0x3, 0xb8(%rsp)
movq 0xa8(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq 0xb0(%rsp), %rcx
movq %rcx, 0x20(%rax)
movq 0xb8(%rsp), %rcx
movq %rcx, 0x28(%rax)
movq 0xf8(%rsp), %rax
imulq $0x48, 0xe0(%rsp), %rcx
addq %rcx, %rax
movq $-0x1, 0x90(%rsp)
movq $-0x1, 0x98(%rsp)
movl $0x3, 0xa0(%rsp)
movq 0x90(%rsp), %rcx
movq %rcx, 0x30(%rax)
movq 0x98(%rsp), %rcx
movq %rcx, 0x38(%rax)
movq 0xa0(%rsp), %rcx
movq %rcx, 0x40(%rax)
movq 0xe0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xe0(%rsp)
jmp 0x153622
movq 0x138(%rsp), %rdi
movq 0xf8(%rsp), %rsi
movq 0x130(%rsp), %rdx
movq 0x120(%rsp), %r13
movq 0x118(%rsp), %r12
movq 0x110(%rsp), %r15
movq 0x170(%rsp), %r14
movq 0x178(%rsp), %rbx
movq 0x180(%rsp), %r11
movq 0x188(%rsp), %r10
movq 0x190(%rsp), %rax
movl $0x3, %r9d
xorl %ecx, %ecx
movl %r9d, %ecx
movl %r9d, %r8d
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movq %r11, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
callq 0x154f60
movq %rax, 0x80(%rsp)
movl %edx, 0x88(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x128(%rsp), %rdi
movq 0xf8(%rsp), %rsi
movl 0xf0(%rsp), %edx
movq 0x120(%rsp), %rcx
movq 0x110(%rsp), %r8
movq 0x170(%rsp), %r9
movq 0x180(%rsp), %rax
movq %rax, (%rsp)
callq 0x1c75c0
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopw %cs:(%rax,%rax)