// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/diagonalbandalign.c
// Function: evaluateallDBtabcolumns
static GtUword evaluateallDBtabcolumns(GtLinspaceManagement *spacemanager,
                                       GtDiagAlignentry *Diagcolumn,
                                       const GtScoreHandler *scorehandler,
                                       LinearAlignEdge edge,
                                       GtWord offset,
                                       const GtUchar *useq,
                                       GtUword ustart,
                                       GtUword ulen,
                                       const GtUchar *vseq,
                                       GtUword vstart,
                                       GtUword vlen,
                                       GtWord left_dist,
                                       GtWord right_dist)
{
  GtUword gapcost, colindex, rowindex, val, *EDtabcolumn, *Rtabcolumn,
          northwestEDtabentry, westEDtabentry = GT_UWORD_MAX,
          northwestRtabentry, westRtabentry = GT_UWORD_MAX,
          low_row, high_row; /*lowest and highest row between a diagonal band*/
  GtWord diag;
  bool last_row = false;

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

  EDtabcolumn = gt_linspace_management_get_valueTabspace(spacemanager);
  Rtabcolumn = gt_linspace_management_get_rTabspace(spacemanager);

  gapcost = gt_scorehandler_get_gapscore(scorehandler);
  diag = GT_DIV2(left_dist + right_dist);
  low_row = 0;
  high_row = -left_dist;

 /* first column */
  firstDBtabcolumn(EDtabcolumn, Rtabcolumn, Diagcolumn, edge, offset,
                   left_dist, right_dist, gapcost);
   if (high_row == ulen)
     last_row = true;
  /* next columns */
  for (colindex = 1; colindex <= vlen; colindex++)
  {
    northwestEDtabentry = EDtabcolumn[0];
    northwestRtabentry = Rtabcolumn[0];

    if (colindex > right_dist)
    {
      if (low_row != high_row)
      {
        westEDtabentry = EDtabcolumn[1];
        westRtabentry = Rtabcolumn[1];
      }
      low_row++;
    }
    else
    {
      westEDtabentry = EDtabcolumn[0];
      westRtabentry = Rtabcolumn[0];
    }
    if (high_row < ulen)
      high_row ++;
    if (!last_row && low_row == high_row)
    {/* prev is outside of diagonalband*/
      westEDtabentry = GT_UWORD_MAX;
      westRtabentry = GT_UWORD_MAX;
    }

    EDtabcolumn[0] = add_safe_umax(westEDtabentry, gapcost);
    edge = Linear_I;

    /* replacement possible for 0-entry */
    if (low_row > 0 )
    {
      val = add_safe_umax(northwestEDtabentry,
                         gt_scorehandler_get_replacement(scorehandler,
                         useq[ustart+low_row-1], vseq[vstart+colindex-1]));
      if (val <= EDtabcolumn[0])
      {
        edge = Linear_R;
        EDtabcolumn[0] = val;
      }
    }

    if (edge == Linear_R)
    {
      set_linear_DiagentryRtabentry(edge, diag, colindex, low_row, offset,
                                    &Diagcolumn[colindex],&Rtabcolumn[0],
                                    northwestRtabentry);
    } else
    {
      gt_assert(edge == Linear_I);
      set_linear_DiagentryRtabentry(edge, diag, colindex, low_row, offset,
                                    &Diagcolumn[colindex],&Rtabcolumn[0],
                                    westRtabentry);
    }

    for (rowindex = low_row + 1; rowindex <= high_row; rowindex++)
    {
      GtUword Rtabentry_from = 0;
      northwestEDtabentry = westEDtabentry;
      northwestRtabentry = westRtabentry;

      if (!last_row && rowindex == high_row)
      {/* prev is outside of diagonalband*/
        westEDtabentry = GT_UWORD_MAX;
        westRtabentry = GT_UWORD_MAX;
      }
      else if (low_row > 0)
      {/* shifted diagonalband*/
        westEDtabentry = EDtabcolumn[rowindex-low_row+1];
        westRtabentry = Rtabcolumn[rowindex-low_row+1];
      }
      else
      {/* normaly prev*/
        westEDtabentry = EDtabcolumn[rowindex-low_row];
        westRtabentry = Rtabcolumn[rowindex-low_row];
      }

      if (rowindex == ulen)
        last_row = true;
      /* insertion */
      EDtabcolumn[rowindex-low_row] = add_safe_umax(westEDtabentry, gapcost);
      edge = Linear_I;

      /* replacement */
      val = add_safe_umax(northwestEDtabentry,
                          gt_scorehandler_get_replacement(scorehandler,
                          useq[ustart+rowindex-1], vseq[vstart+colindex-1]));

      if (val <= EDtabcolumn[rowindex-low_row])
      {
        EDtabcolumn[rowindex-low_row] = val;
        edge = Linear_R;
      }
      /* deletion */
      if ((val = add_safe_umax(EDtabcolumn[rowindex-low_row-1], gapcost))
                                       < EDtabcolumn[rowindex-low_row])
      {
        EDtabcolumn[rowindex-low_row] = val;
        edge = Linear_D;
      }

      if (edge == Linear_R)
      {
        Rtabentry_from = northwestRtabentry;
      } else
      {
        if (edge == Linear_D)
        {
          Rtabentry_from = Rtabcolumn[rowindex-low_row-1];
        } else
        {
          gt_assert(edge == Linear_I);
          Rtabentry_from = westRtabentry;
        }
      }
      set_linear_DiagentryRtabentry(edge, diag, colindex, rowindex, offset,
                           &Diagcolumn[colindex],&Rtabcolumn[rowindex-low_row],
                           Rtabentry_from);
    }
  }
  return Rtabcolumn[high_row-low_row];
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq 0x150(%rsp), %rax
movq 0x148(%rsp), %rax
movq 0x140(%rsp), %rax
movq 0x138(%rsp), %rax
movq 0x130(%rsp), %rax
movq 0x128(%rsp), %rax
movq 0x120(%rsp), %rax
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movq %rdx, 0x100(%rsp)
movl %ecx, 0xfc(%rsp)
movq %r8, 0xf0(%rsp)
movq %r9, 0xe8(%rsp)
movq $-0x1, 0xa8(%rsp)
movq $-0x1, 0x98(%rsp)
movb $0x0, 0x7f(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x140(%rsp), %rcx
subq 0x128(%rsp), %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jge 0x150138
xorl %eax, %eax
movq %rax, 0x60(%rsp)
jmp 0x15014d
movq 0x140(%rsp), %rax
subq 0x128(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rcx
cmpq %rcx, %rax
jg 0x1501ad
movq 0x150(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x140(%rsp), %rcx
subq 0x128(%rsp), %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jle 0x150189
xorl %eax, %eax
movq %rax, 0x50(%rsp)
jmp 0x15019e
movq 0x140(%rsp), %rax
subq 0x128(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq %rcx, %rax
jge 0x1501e7
jmp 0x1501af
movq 0x4ebdea(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c5e53(%rip), %rsi    # 0x516013
leaq 0x408b9c(%rip), %rdx    # 0x558d63
leaq 0x3fd143(%rip), %rcx    # 0x54d311
leaq 0x3fcec7(%rip), %r8     # 0x54d09c
movl $0x203, %r9d            # imm = 0x203
movb $0x0, %al
callq 0x199f0
callq 0x19370
movq 0x110(%rsp), %rdi
callq 0x1a3720
movq %rax, 0xc0(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1a3750
movq %rax, 0xb8(%rsp)
movq 0x100(%rsp), %rdi
callq 0x1d11d0
movq %rax, 0xe0(%rsp)
movq 0x148(%rsp), %rax
addq 0x150(%rsp), %rax
sarq %rax
movq %rax, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
xorl %eax, %eax
subq 0x148(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0xc0(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0x108(%rsp), %rdx
movl 0xfc(%rsp), %ecx
movq 0xf0(%rsp), %r8
movq 0x148(%rsp), %r9
movq 0x150(%rsp), %r10
movq 0xe0(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x150e80
movq 0x88(%rsp), %rax
cmpq 0x128(%rsp), %rax
jne 0x1502c3
movb $0x1, 0x7f(%rsp)
movq $0x1, 0xd8(%rsp)
movq 0xd8(%rsp), %rax
cmpq 0x140(%rsp), %rax
ja 0x150a97
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xb0(%rsp)
movq 0xb8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xa0(%rsp)
movq 0xd8(%rsp), %rax
cmpq 0x150(%rsp), %rax
jbe 0x15036d
movq 0x90(%rsp), %rax
cmpq 0x88(%rsp), %rax
je 0x150357
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0xb8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x98(%rsp)
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
jmp 0x150393
movq 0xc0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0xb8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x98(%rsp)
movq 0x88(%rsp), %rax
cmpq 0x128(%rsp), %rax
jae 0x1503b9
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
testb $0x1, 0x7f(%rsp)
jne 0x1503ea
movq 0x90(%rsp), %rax
cmpq 0x88(%rsp), %rax
jne 0x1503ea
movq $-0x1, 0xa8(%rsp)
movq $-0x1, 0x98(%rsp)
cmpq $-0x1, 0xa8(%rsp)
je 0x15040c
movq 0xa8(%rsp), %rax
addq 0xe0(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x15041a
movq $-0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x15041a
movq 0x48(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, (%rax)
movl $0x2, 0xfc(%rsp)
cmpq $0x0, 0x90(%rsp)
jbe 0x15050d
cmpq $-0x1, 0xb0(%rsp)
je 0x1504bd
movq 0xb0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x100(%rsp), %rdi
movq 0xe8(%rsp), %rax
movq 0x120(%rsp), %rcx
addq 0x90(%rsp), %rcx
subq $0x1, %rcx
movb (%rax,%rcx), %dl
movq 0x130(%rsp), %rax
movq 0x138(%rsp), %rcx
addq 0xd8(%rsp), %rcx
subq $0x1, %rcx
movzbl %dl, %esi
movzbl (%rax,%rcx), %edx
callq 0x1d12c0
movq %rax, %rcx
movq 0x38(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x40(%rsp)
jmp 0x1504cb
movq $-0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x1504cb
movq 0x40(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rax
movq 0xc0(%rsp), %rcx
cmpq (%rcx), %rax
ja 0x15050b
movl $0x0, 0xfc(%rsp)
movq 0xc8(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, (%rax)
jmp 0x15050d
cmpl $0x0, 0xfc(%rsp)
jne 0x150575
movl 0xfc(%rsp), %edi
movq 0x80(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0xf0(%rsp), %r8
movq 0x108(%rsp), %r9
imulq $0x18, 0xd8(%rsp), %rax
addq %rax, %r9
movq 0xb8(%rsp), %r10
movq 0xa0(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x151020
jmp 0x150614
jmp 0x150577
cmpl $0x2, 0xfc(%rsp)
je 0x1505b9
movq 0x4eba18(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c5a81(%rip), %rsi    # 0x516013
leaq 0x3fcd90(%rip), %rdx    # 0x54d329
leaq 0x3fcd71(%rip), %rcx    # 0x54d311
leaq 0x3fcaf5(%rip), %r8     # 0x54d09c
movl $0x246, %r9d            # imm = 0x246
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1505bb
movl 0xfc(%rsp), %edi
movq 0x80(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0xf0(%rsp), %r8
movq 0x108(%rsp), %r9
imulq $0x18, 0xd8(%rsp), %rax
addq %rax, %r9
movq 0xb8(%rsp), %r10
movq 0x98(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x151020
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
cmpq 0x88(%rsp), %rax
ja 0x150a7c
movq $0x0, 0x70(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0xa0(%rsp)
testb $0x1, 0x7f(%rsp)
jne 0x15069d
movq 0xd0(%rsp), %rax
cmpq 0x88(%rsp), %rax
jne 0x15069d
movq $-0x1, 0xa8(%rsp)
movq $-0x1, 0x98(%rsp)
jmp 0x15073e
cmpq $0x0, 0x90(%rsp)
jbe 0x1506f4
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0xa8(%rsp)
movq 0xb8(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x98(%rsp)
jmp 0x15073c
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xa8(%rsp)
movq 0xb8(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x98(%rsp)
jmp 0x15073e
movq 0xd0(%rsp), %rax
cmpq 0x128(%rsp), %rax
jne 0x150755
movb $0x1, 0x7f(%rsp)
cmpq $-0x1, 0xa8(%rsp)
je 0x150777
movq 0xa8(%rsp), %rax
addq 0xe0(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x150785
movq $-0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x150785
movq 0x30(%rsp), %rdx
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x2, 0xfc(%rsp)
cmpq $-0x1, 0xb0(%rsp)
je 0x15082a
movq 0xb0(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x100(%rsp), %rdi
movq 0xe8(%rsp), %rax
movq 0x120(%rsp), %rcx
addq 0xd0(%rsp), %rcx
subq $0x1, %rcx
movb (%rax,%rcx), %dl
movq 0x130(%rsp), %rax
movq 0x138(%rsp), %rcx
addq 0xd8(%rsp), %rcx
subq $0x1, %rcx
movzbl %dl, %esi
movzbl (%rax,%rcx), %edx
callq 0x1d12c0
movq %rax, %rcx
movq 0x20(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x28(%rsp)
jmp 0x150838
movq $-0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x150838
movq 0x28(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rax
movq 0xc0(%rsp), %rcx
movq 0xd0(%rsp), %rdx
subq 0x90(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
ja 0x15089a
movq 0xc8(%rsp), %rdx
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, 0xfc(%rsp)
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
subq $0x1, %rcx
cmpq $-0x1, (%rax,%rcx,8)
je 0x1508ec
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
addq 0xe0(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x1508fa
movq $-0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x1508fa
movq 0x18(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0xc0(%rsp), %rcx
movq 0xd0(%rsp), %rdx
subq 0x90(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
jae 0x150954
movq 0xc8(%rsp), %rdx
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x1, 0xfc(%rsp)
cmpl $0x0, 0xfc(%rsp)
jne 0x150970
movq 0xa0(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x1509f6
cmpl $0x1, 0xfc(%rsp)
jne 0x1509a1
movq 0xb8(%rsp), %rax
movq 0xd0(%rsp), %rcx
subq 0x90(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x70(%rsp)
jmp 0x1509f4
jmp 0x1509a3
cmpl $0x2, 0xfc(%rsp)
je 0x1509e5
movq 0x4eb5ec(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c5655(%rip), %rsi    # 0x516013
leaq 0x3fc964(%rip), %rdx    # 0x54d329
leaq 0x3fc945(%rip), %rcx    # 0x54d311
leaq 0x3fc6c9(%rip), %r8     # 0x54d09c
movl $0x284, %r9d            # imm = 0x284
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1509e7
movq 0x98(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x1509f6
movl 0xfc(%rsp), %edi
movq 0x80(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movq 0xd0(%rsp), %rcx
movq 0xf0(%rsp), %r8
movq 0x108(%rsp), %r9
imulq $0x18, 0xd8(%rsp), %rax
addq %rax, %r9
movq 0xb8(%rsp), %r10
movq 0xd0(%rsp), %rax
subq 0x90(%rsp), %rax
shlq $0x3, %rax
addq %rax, %r10
movq 0x70(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x151020
movq 0xd0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xd0(%rsp)
jmp 0x150628
jmp 0x150a7e
movq 0xd8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xd8(%rsp)
jmp 0x1502cf
movq 0xb8(%rsp), %rax
movq 0x88(%rsp), %rcx
subq 0x90(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x118, %rsp            # imm = 0x118
retq
nopl (%rax,%rax)