// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/diagonalbandalign_affinegapcost.c
// Function: firstaffineDBtabcolumn
static void firstaffineDBtabcolumn(GtAffinealignDPentry *Atabcolumn,
                                   GtAffineAlignRtabentry *Rtabcolumn,
                                   GtAffineDiagAlignentry *Diagcolumn,
                                   GtAffineAlignEdge edge,
                                   GtAffineAlignEdge from_edge,
                                   GtUword offset,
                                   GtWord left_dist,
                                   GtWord right_dist,
                                   GtUword gap_opening,
                                   GtUword gap_extension)
{
  GtUword rowindex, low_row, high_row;
  GtWord diag;

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

  Atabcolumn[low_row].Rvalue = GT_WORD_MAX;
  Atabcolumn[low_row].Dvalue = GT_WORD_MAX;
  Atabcolumn[low_row].Ivalue = GT_WORD_MAX;

  set_invalid_Diagentry(&Diagcolumn[0].val_R);
  set_invalid_Diagentry(&Diagcolumn[0].val_D);
  set_invalid_Diagentry(&Diagcolumn[0].val_I);

  set_invalid_Rnode(&Rtabcolumn[0].val_R);
  set_invalid_Rnode(&Rtabcolumn[0].val_D);
  set_invalid_Rnode(&Rtabcolumn[0].val_I);

  switch (edge) {
  case Affine_R:
    Atabcolumn[low_row].Rvalue = 0;
    Rtabcolumn[0].val_R.edge = from_edge;
    if (diag == 0)
    {
      Diagcolumn[0].val_R.currentrowindex = 0 + offset;
      Diagcolumn[0].val_R.last_type = from_edge;
      Rtabcolumn[0].val_R.idx = 0;
      Rtabcolumn[0].val_R.edge = Affine_R;
    }
    break;
  case Affine_D:
    Atabcolumn[low_row].Dvalue = 0;
    Rtabcolumn[0].val_D.edge = from_edge;
    if (diag == 0)
    {
      Diagcolumn[0].val_D.currentrowindex = 0 + offset;
      Diagcolumn[0].val_D.last_type = from_edge;
      Rtabcolumn[0].val_D.idx = 0;
      Rtabcolumn[0].val_D.edge = Affine_D;
    }
    break;
  case Affine_I:
    Atabcolumn[low_row].Ivalue = 0;
    Rtabcolumn[0].val_I.edge = from_edge;
    if (diag == 0)
    {
      Diagcolumn[0].val_I.currentrowindex = 0 + offset;
      Diagcolumn[0].val_I.last_type = from_edge;
      Rtabcolumn[0].val_I.idx = 0;
      Rtabcolumn[0].val_I.edge = Affine_I;
    }
    break;
  default:
    Atabcolumn[low_row].Rvalue = 0;
    Atabcolumn[low_row].Dvalue = gap_opening;
    Atabcolumn[low_row].Ivalue = gap_opening;
    Rtabcolumn[0].val_I.edge = from_edge;
    Rtabcolumn[0].val_R.edge = from_edge;
    Rtabcolumn[0].val_D.edge = from_edge;
    if (diag == 0)
    {
      Diagcolumn[0].val_R.currentrowindex = 0 + offset;
      Diagcolumn[0].val_D.currentrowindex = 0 + offset;
      Diagcolumn[0].val_I.currentrowindex = 0 + offset;

      Rtabcolumn[0].val_R.idx = 0;
      Rtabcolumn[0].val_R.edge = Affine_R;
      Rtabcolumn[0].val_D.idx = 0;
      Rtabcolumn[0].val_D.edge = Affine_D;
      Rtabcolumn[0].val_I.idx = 0;
      Rtabcolumn[0].val_I.edge = Affine_I;
    }
  }

  for (rowindex = low_row+1; rowindex <= high_row; rowindex++)
  {
    Atabcolumn[rowindex-low_row].Rvalue = GT_WORD_MAX;
    Atabcolumn[rowindex-low_row].Dvalue = add_safe_max(
                                          Atabcolumn[rowindex-low_row-1].Dvalue,
                                          gap_extension);
    Atabcolumn[rowindex-low_row].Ivalue = GT_WORD_MAX;

    if (diag == -(GtWord)rowindex)
    {
      Diagcolumn[0].val_D.last_type = from_edge;
      Diagcolumn[0].val_D.lastcpoint = GT_UWORD_MAX;
      Diagcolumn[0].val_D.currentrowindex = rowindex + offset;
      Rtabcolumn[rowindex-low_row].val_D.idx = 0;
      Rtabcolumn[rowindex-low_row].val_D.edge = Affine_D;
      set_invalid_Diagentry(&Diagcolumn[0].val_R);
      set_invalid_Diagentry(&Diagcolumn[0].val_I);
    }
    else
    {
      Rtabcolumn[rowindex-low_row] = Rtabcolumn[rowindex-low_row-1];
    }
  }

}

// Assembly:
subq $0x58, %rsp
movq 0x78(%rsp), %rax
movq 0x70(%rsp), %rax
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rax
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movl %ecx, 0x3c(%rsp)
movl %r8d, 0x38(%rsp)
movq %r9, 0x30(%rsp)
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
addq %rcx, %rax
sarq %rax
movq %rax, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x60(%rsp), %rax
negq %rax
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
movq %rdx, (%rax,%rcx)
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq %rdx, 0x8(%rax,%rcx)
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq %rdx, 0x10(%rax,%rcx)
movq 0x40(%rsp), %rdi
callq 0x159620
movq 0x40(%rsp), %rdi
addq $0x18, %rdi
callq 0x159620
movq 0x40(%rsp), %rdi
addq $0x30, %rdi
callq 0x159620
movq 0x48(%rsp), %rdi
callq 0x159790
movq 0x48(%rsp), %rdi
addq $0x10, %rdi
callq 0x159790
movq 0x48(%rsp), %rdi
addq $0x20, %rdi
callq 0x159790
movl 0x3c(%rsp), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x159225
jmp 0x159208
movl 0xc(%rsp), %eax
subl $0x1, %eax
je 0x159289
jmp 0x159213
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x1592ef
jmp 0x159355
movq 0x50(%rsp), %rax
imulq $0x30, 0x20(%rsp), %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movl 0x38(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x8(%rax)
cmpq $0x0, 0x10(%rsp)
jne 0x159284
movq 0x30(%rsp), %rcx
addq $0x0, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
movl 0x38(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x48(%rsp), %rax
movq $0x0, (%rax)
movq 0x48(%rsp), %rax
movl $0x0, 0x8(%rax)
jmp 0x15944a
movq 0x50(%rsp), %rax
imulq $0x30, 0x20(%rsp), %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movl 0x38(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x18(%rax)
cmpq $0x0, 0x10(%rsp)
jne 0x1592ea
movq 0x30(%rsp), %rcx
addq $0x0, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x20(%rax)
movl 0x38(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x28(%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x48(%rsp), %rax
movl $0x1, 0x18(%rax)
jmp 0x15944a
movq 0x50(%rsp), %rax
imulq $0x30, 0x20(%rsp), %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movl 0x38(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x28(%rax)
cmpq $0x0, 0x10(%rsp)
jne 0x159350
movq 0x30(%rsp), %rcx
addq $0x0, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x38(%rax)
movl 0x38(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x40(%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x48(%rsp), %rax
movl $0x2, 0x28(%rax)
jmp 0x15944a
movq 0x50(%rsp), %rax
imulq $0x30, 0x20(%rsp), %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq 0x70(%rsp), %rcx
movq 0x50(%rsp), %rax
imulq $0x30, 0x20(%rsp), %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq 0x70(%rsp), %rcx
movq 0x50(%rsp), %rax
imulq $0x30, 0x20(%rsp), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl 0x38(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x28(%rax)
movl 0x38(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x38(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x18(%rax)
cmpq $0x0, 0x10(%rsp)
jne 0x159448
movq 0x30(%rsp), %rcx
addq $0x0, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rcx
addq $0x0, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x30(%rsp), %rcx
addq $0x0, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x48(%rsp), %rax
movq $0x0, (%rax)
movq 0x48(%rsp), %rax
movl $0x0, 0x8(%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x48(%rsp), %rax
movl $0x1, 0x18(%rax)
movq 0x48(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x48(%rsp), %rax
movl $0x2, 0x28(%rax)
jmp 0x15944a
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x18(%rsp), %rax
ja 0x159615
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
subq 0x20(%rsp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movq %rcx, (%rax)
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
subq 0x20(%rsp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, 0x8(%rax)
je 0x1594de
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
subq 0x20(%rsp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
addq 0x78(%rsp), %rax
movq %rax, (%rsp)
jmp 0x1594ee
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, (%rsp)
jmp 0x1594ee
movq (%rsp), %rcx
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rdx
subq 0x20(%rsp), %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
subq 0x20(%rsp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
subq 0x28(%rsp), %rcx
cmpq %rcx, %rax
jne 0x1595c6
movl 0x38(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x28(%rax)
movq 0x40(%rsp), %rax
movq $-0x1, 0x18(%rax)
movq 0x28(%rsp), %rcx
addq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x48(%rsp), %rax
movq 0x28(%rsp), %rcx
subq 0x20(%rsp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movq 0x48(%rsp), %rax
movq 0x28(%rsp), %rcx
subq 0x20(%rsp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x18(%rax)
movq 0x40(%rsp), %rdi
callq 0x159620
movq 0x40(%rsp), %rdi
addq $0x30, %rdi
callq 0x159620
jmp 0x159600
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq 0x48(%rsp), %rsi
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
subq $0x1, %rax
imulq $0x30, %rax, %rax
addq %rax, %rsi
movl $0x30, %edx
callq 0x19610
jmp 0x159602
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x159458
addq $0x58, %rsp
retq
nopw (%rax,%rax)