// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/diagonalbandalign.c
// Function: gt_calc_diagonalbandalign
static void gt_calc_diagonalbandalign(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)
{
  GtDiagAlignentry *Diagcolumn;
  GtUword idx, gapcost, *EDtabcolumn, *Rtabcolumn;

  gt_assert(align && spacemanager && 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);
  gapcost = gt_scorehandler_get_gapscore(scorehandler);
  if (ulen == 0UL)
  {
    (void) gt_reconstructalignment_trivial_insertion(align, vlen, gapcost);
    return;
  }
  else if (vlen == 0UL)
  {
    (void) gt_reconstructalignment_trivial_deletion(align, ulen, gapcost);
    return;
  }
  else if (gt_linspace_management_checksquare(spacemanager, ulen, vlen,
                                              sizeof (*EDtabcolumn),
                                              sizeof (*Rtabcolumn)))
  {
    (void) gt_diagonalbandalignment_in_square_space_generic(spacemanager,align,
                                                            useq, ustart, ulen,
                                                            vseq, vstart, vlen,
                                                            left_dist,
                                                            right_dist,
                                                            scorehandler);
    return;
  }

  gt_linspace_management_check(spacemanager, GT_MIN(right_dist-left_dist,ulen),
                               vlen,
                               sizeof (*EDtabcolumn),
                               sizeof (*Rtabcolumn),
                               sizeof (*Diagcolumn));

  Diagcolumn = gt_linspace_management_get_crosspointTabspace(spacemanager);
  /* initialize Diagcolumn */
  for (idx = 0; idx <= vlen; idx++)
  {
    Diagcolumn[idx].lastcpoint = GT_UWORD_MAX;
    Diagcolumn[idx].currentrowindex = GT_UWORD_MAX;
  }

  evaluateDBcrosspoints(spacemanager, Diagcolumn, scorehandler,
                        Linear_X, 0, 0,  useq, ustart, ulen,
                        vseq, vstart, vlen, left_dist, right_dist);

  gt_reconstructalignment_from_Dtab(align, Diagcolumn, ulen, vlen);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq 0x120(%rsp), %rax
movq 0x118(%rsp), %rax
movq 0x110(%rsp), %rax
movq 0x108(%rsp), %rax
movq 0x100(%rsp), %rax
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movq %rdx, 0xb8(%rsp)
movq %rcx, 0xb0(%rsp)
movq %r8, 0xa8(%rsp)
movq %r9, 0xa0(%rsp)
cmpq $0x0, 0xb8(%rsp)
je 0x14d919
cmpq $0x0, 0xc8(%rsp)
je 0x14d919
cmpq $0x0, 0xc0(%rsp)
jne 0x14d951
movq 0x4ee680(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c86e9(%rip), %rsi    # 0x516013
leaq 0x3ff79c(%rip), %rdx    # 0x54d0cd
leaq 0x3ff94b(%rip), %rcx    # 0x54d283
leaq 0x3ff75d(%rip), %r8     # 0x54d09c
movl $0x367, %r9d            # imm = 0x367
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x14d953
movq 0x118(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x110(%rsp), %rcx
subq 0xa0(%rsp), %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jge 0x14d980
xorl %eax, %eax
movq %rax, 0x68(%rsp)
jmp 0x14d995
movq 0x110(%rsp), %rax
subq 0xa0(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x70(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq %rcx, %rax
jg 0x14d9f5
movq 0x120(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x110(%rsp), %rcx
subq 0xa0(%rsp), %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jle 0x14d9d1
xorl %eax, %eax
movq %rax, 0x58(%rsp)
jmp 0x14d9e6
movq 0x110(%rsp), %rax
subq 0xa0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq %rcx, %rax
jge 0x14da2f
jmp 0x14d9f7
movq 0x4ee5a2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c860b(%rip), %rsi    # 0x516013
leaq 0x40b354(%rip), %rdx    # 0x558d63
leaq 0x3ff86d(%rip), %rcx    # 0x54d283
leaq 0x3ff67f(%rip), %r8     # 0x54d09c
movl $0x36c, %r9d            # imm = 0x36C
movb $0x0, %al
callq 0x199f0
callq 0x19370
movq 0xc8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
callq 0x1a36b0
movq 0xc0(%rsp), %rdi
callq 0x1d11d0
movq %rax, 0x88(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x14da86
movq 0xb8(%rsp), %rdi
movq 0x110(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x1c67c0
jmp 0x14dd05
cmpq $0x0, 0x110(%rsp)
jne 0x14dab3
movq 0xb8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x1c6760
jmp 0x14dd05
movq 0xc8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x110(%rsp), %rdx
movl $0x8, %r8d
movq %r8, %rcx
callq 0x1a3480
testb $0x1, %al
jne 0x14dadf
jmp 0x14db59
movq 0xc8(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movq 0xa8(%rsp), %rcx
movq 0xa0(%rsp), %r8
movq 0x100(%rsp), %r9
movq 0x108(%rsp), %r14
movq 0x110(%rsp), %rbx
movq 0x118(%rsp), %r11
movq 0x120(%rsp), %r10
movq 0xc0(%rsp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x14ccf0
jmp 0x14dd05
jmp 0x14db5b
jmp 0x14db5d
movq 0xc8(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x120(%rsp), %rax
subq 0x118(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jae 0x14db9b
movq 0x120(%rsp), %rax
subq 0x118(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x14dba8
movq 0xa0(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x110(%rsp), %rdx
movl $0x8, %r8d
movl $0x18, %r9d
movq %r8, %rcx
callq 0x1a3160
movq 0xc8(%rsp), %rdi
callq 0x1a3780
movq %rax, 0x98(%rsp)
movq $0x0, 0x90(%rsp)
movq 0x90(%rsp), %rax
cmpq 0x110(%rsp), %rax
ja 0x14dc4e
movq 0x98(%rsp), %rax
imulq $0x18, 0x90(%rsp), %rcx
addq %rcx, %rax
movq $-0x1, (%rax)
movq 0x98(%rsp), %rax
imulq $0x18, 0x90(%rsp), %rcx
addq %rcx, %rax
movq $-0x1, 0x8(%rax)
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
jmp 0x14dbef
movq 0xc8(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq 0xb0(%rsp), %r13
movq 0xa8(%rsp), %r12
movq 0xa0(%rsp), %r15
movq 0x100(%rsp), %r14
movq 0x108(%rsp), %rbx
movq 0x110(%rsp), %r11
movq 0x118(%rsp), %r10
movq 0x120(%rsp), %rax
movl $0x3, %ecx
xorl %r8d, %r8d
movl %r8d, %r9d
movq %r9, %r8
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x14ec90
movq 0xb8(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x110(%rsp), %rcx
callq 0x1c7210
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopw %cs:(%rax,%rax)