// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/diagonalbandalign_affinegapcost.c
// Function: evaluate_affineDBcrosspoints_from_2dimtab
static GtAffineAlignRnode evaluate_affineDBcrosspoints_from_2dimtab(
                                              GtAffineDiagAlignentry *Dtab,
                                              GtAffinealignDPentry **Atabcolumn,
                                              GtUword ulen, GtUword vlen,
                                              GtUword gap_opening,
                                              GtUword rowoffset,
                                              GtAffineAlignEdge from_edge,
                                              GtAffineAlignEdge edge)
{
  GtUword i, j;
  GtAffineAlignRnode rnode;
  GtDiagAlignentry *tempnode;
  gt_assert(Atabcolumn != NULL);

  i = ulen;
  j = vlen;

  edge = gt_linearalign_affinegapcost_minAdditionalCosts(&Atabcolumn[i][j],
                                                         edge, gap_opening);

  switch (edge)
  {
    case Affine_I:
      tempnode = &Dtab[vlen].val_I;
      rnode = (GtAffineAlignRnode) {vlen, Affine_I};
      break;
    case Affine_D:
      tempnode = &Dtab[vlen].val_D;
      rnode = (GtAffineAlignRnode) {vlen, Affine_D};
      break;
    default:
      tempnode = &Dtab[vlen].val_R;
      rnode = (GtAffineAlignRnode) {vlen, Affine_R};
  }

  while (i > 0 || j > 0) {
    if (j == vlen)
      rnode.edge = edge;
    switch (edge) {
      case Affine_R:
        gt_assert(Atabcolumn[i][j].Rvalue != GT_WORD_MAX);
        Dtab[j].val_R.currentrowindex = i + rowoffset;
        edge = Atabcolumn[i][j].Redge;
        tempnode->last_type = Affine_R;
        tempnode = &Dtab[j].val_R;
        gt_assert(i > 0 && j > 0);
        i--;
        j--;
        break;
      case Affine_D:
        edge = Atabcolumn[i][j].Dedge;
        gt_assert(i);
        i--;
        break;
      case Affine_I:
        Dtab[j].val_I.currentrowindex = i + rowoffset;
        edge = Atabcolumn[i][j].Iedge;
        tempnode->last_type = Affine_I;
        tempnode = &Dtab[j].val_I;
        gt_assert(j);
        j--;
        break;
      default:
        gt_assert(false);
    }
  }
  tempnode->last_type = edge;
  /* special case for first crosspoint */
  Dtab[0].val_R = (GtDiagAlignentry) {GT_UWORD_MAX, rowoffset, from_edge};
  Dtab[0].val_D = (GtDiagAlignentry) {GT_UWORD_MAX, rowoffset, from_edge};
  Dtab[0].val_I = (GtDiagAlignentry) {GT_UWORD_MAX, rowoffset, from_edge};

  return rnode;
}

// Assembly:
subq $0xe8, %rsp
movl 0xf8(%rsp), %eax
movl 0xf0(%rsp), %eax
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq %rdx, 0xc0(%rsp)
movq %rcx, 0xb8(%rsp)
movq %r8, 0xb0(%rsp)
movq %r9, 0xa8(%rsp)
cmpq $0x0, 0xc8(%rsp)
jne 0x158b18
movq 0x4e34b9(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bd522(%rip), %rsi    # 0x516013
leaq 0x3f4ba0(%rip), %rdx    # 0x54d698
leaq 0x3f4bac(%rip), %rcx    # 0x54d6ab
leaq 0x3f4896(%rip), %r8     # 0x54d39c
movl $0x148, %r9d            # imm = 0x148
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x158b1a
movq 0xc0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0xc8(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x98(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq %rax, %rdi
movl 0xf8(%rsp), %esi
movq 0xb0(%rsp), %rdx
callq 0x19e760
movl %eax, 0xf8(%rsp)
movl 0xf8(%rsp), %eax
movl %eax, 0x14(%rsp)
subl $0x1, %eax
je 0x158bfd
jmp 0x158b8e
movl 0x14(%rsp), %eax
subl $0x2, %eax
jne 0x158c4e
jmp 0x158b9d
movq 0xd0(%rsp), %rax
imulq $0x48, 0xb8(%rsp), %rcx
addq %rcx, %rax
addq $0x30, %rax
movq %rax, 0x90(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x80(%rsp)
movl $0x2, 0x88(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0xe0(%rsp)
jmp 0x158c99
movq 0xd0(%rsp), %rax
imulq $0x48, 0xb8(%rsp), %rcx
addq %rcx, %rax
addq $0x18, %rax
movq %rax, 0x90(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x70(%rsp)
movl $0x1, 0x78(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0xe0(%rsp)
jmp 0x158c99
movq 0xd0(%rsp), %rax
imulq $0x48, 0xb8(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x60(%rsp)
movl $0x0, 0x68(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0xe0(%rsp)
jmp 0x158c9b
movb $0x1, %al
cmpq $0x0, 0xa0(%rsp)
movb %al, 0x13(%rsp)
ja 0x158cbc
cmpq $0x0, 0x98(%rsp)
seta %al
movb %al, 0x13(%rsp)
movb 0x13(%rsp), %al
testb $0x1, %al
jne 0x158cc9
jmp 0x159023
movq 0x98(%rsp), %rax
cmpq 0xb8(%rsp), %rax
jne 0x158ce9
movl 0xf8(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl 0xf8(%rsp), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x158d1b
jmp 0x158cfa
movl 0xc(%rsp), %eax
subl $0x1, %eax
je 0x158e80
jmp 0x158d09
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x158f08
jmp 0x158fe4
jmp 0x158d1d
movq 0xc8(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x98(%rsp), %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, (%rax)
jne 0x158d84
movq 0x4e324d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bd2b6(%rip), %rsi    # 0x516013
leaq 0x3f4971(%rip), %rdx    # 0x54d6d5
leaq 0x3f4940(%rip), %rcx    # 0x54d6ab
leaq 0x3f462a(%rip), %r8     # 0x54d39c
movl $0x164, %r9d            # imm = 0x164
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x158d86
movq 0xa0(%rsp), %rcx
addq 0xa8(%rsp), %rcx
movq 0xd0(%rsp), %rax
imulq $0x48, 0x98(%rsp), %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq 0xc8(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x98(%rsp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
movl %eax, 0xf8(%rsp)
movq 0x90(%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0xd0(%rsp), %rax
imulq $0x48, 0x98(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
cmpq $0x0, 0xa0(%rsp)
jbe 0x158e19
cmpq $0x0, 0x98(%rsp)
ja 0x158e51
movq 0x4e3180(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bd1e9(%rip), %rsi    # 0x516013
leaq 0x3f48cb(%rip), %rdx    # 0x54d6fc
leaq 0x3f4873(%rip), %rcx    # 0x54d6ab
leaq 0x3f455d(%rip), %r8     # 0x54d39c
movl $0x169, %r9d            # imm = 0x169
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x158e53
movq 0xa0(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0xa0(%rsp)
movq 0x98(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x15901e
movq 0xc8(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x98(%rsp), %rcx
addq %rcx, %rax
movl 0x24(%rax), %eax
movl %eax, 0xf8(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x158eed
movq 0x4e30e4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bd14d(%rip), %rsi    # 0x516013
leaq 0x3e76ce(%rip), %rdx    # 0x54059b
leaq 0x3f47d7(%rip), %rcx    # 0x54d6ab
leaq 0x3f44c1(%rip), %r8     # 0x54d39c
movl $0x16f, %r9d            # imm = 0x16F
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x158eef
movq 0xa0(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0xa0(%rsp)
jmp 0x15901e
movq 0xa0(%rsp), %rcx
addq 0xa8(%rsp), %rcx
movq 0xd0(%rsp), %rax
imulq $0x48, 0x98(%rsp), %rdx
addq %rdx, %rax
movq %rcx, 0x38(%rax)
movq 0xc8(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x98(%rsp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
movl %eax, 0xf8(%rsp)
movq 0x90(%rsp), %rax
movl $0x2, 0x10(%rax)
movq 0xd0(%rsp), %rax
imulq $0x48, 0x98(%rsp), %rcx
addq %rcx, %rax
addq $0x30, %rax
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x98(%rsp)
jne 0x158fcc
movq 0x4e3005(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bd06e(%rip), %rsi    # 0x516013
leaq 0x3d85e0(%rip), %rdx    # 0x53158c
leaq 0x3f46f8(%rip), %rcx    # 0x54d6ab
leaq 0x3f43e2(%rip), %r8     # 0x54d39c
movl $0x177, %r9d            # imm = 0x177
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x158fce
movq 0x98(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x15901e
jmp 0x158fe6
movq 0x4e2fb3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bd01c(%rip), %rsi    # 0x516013
leaq 0x3ffd65(%rip), %rdx    # 0x558d63
leaq 0x3f46a6(%rip), %rcx    # 0x54d6ab
leaq 0x3f4390(%rip), %r8     # 0x54d39c
movl $0x17b, %r9d            # imm = 0x17B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x158c9b
movl 0xf8(%rsp), %ecx
movq 0x90(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0xd0(%rsp), %rax
movq $-0x1, 0x48(%rsp)
movq 0xa8(%rsp), %rcx
movq %rcx, 0x50(%rsp)
movl 0xf0(%rsp), %ecx
movl %ecx, 0x58(%rsp)
movq 0x58(%rsp), %rcx
movq %rcx, 0x10(%rax)
movups 0x48(%rsp), %xmm0
movups %xmm0, (%rax)
movq 0xd0(%rsp), %rax
movq $-0x1, 0x30(%rsp)
movq 0xa8(%rsp), %rcx
movq %rcx, 0x38(%rsp)
movl 0xf0(%rsp), %ecx
movl %ecx, 0x40(%rsp)
movq 0x40(%rsp), %rcx
movq %rcx, 0x28(%rax)
movups 0x30(%rsp), %xmm0
movups %xmm0, 0x18(%rax)
movq 0xd0(%rsp), %rax
movq $-0x1, 0x18(%rsp)
movq 0xa8(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movl 0xf0(%rsp), %ecx
movl %ecx, 0x28(%rsp)
movq 0x28(%rsp), %rcx
movq %rcx, 0x40(%rax)
movups 0x18(%rsp), %xmm0
movups %xmm0, 0x30(%rax)
movq 0xd8(%rsp), %rax
movl 0xe0(%rsp), %edx
addq $0xe8, %rsp
retq
nopl (%rax)