// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/affinealign.c
// Function: affinealign_traceback_local
static void affinealign_traceback_local(GtAlignment *align,
                                        GtAffinealignDPentry **dptable,
                                        GtMaxcoordvalue *max)
{
  GtWord maxvalue;
  GtUword i,j;
  GtUwordPair max_end;
  GtAffineAlignEdge edge;
  gt_assert(align && dptable);

  max_end = gt_maxcoordvalue_get_end(max);
  i = max_end.a;
  j = max_end.b;

  maxvalue = GT_MAX(GT_MAX(dptable[i][j].Rvalue, dptable[i][j].Dvalue),
                  GT_MAX(dptable[i][j].Ivalue,dptable[i][j].totalvalue));
  gt_assert(gt_maxcoordvalue_get_value(max) == maxvalue);

  if (dptable[i][j].Rvalue == maxvalue)
    edge = Affine_R;
  else if (dptable[i][j].Dvalue == maxvalue)
    edge = Affine_D;
  else /* dptable[i][j].Ivalue == maxvalue */
    edge = Affine_I;

  /* backtracing */
  while (edge != Affine_X && (i > 0 || j > 0)) {
    switch (edge) {
      case Affine_R:
        gt_assert(dptable[i][j].Rvalue != LONG_MAX);
        gt_alignment_add_replacement(align);
        edge = dptable[i][j].Redge;
        gt_assert(i > 0 && j > 0);
        i--;
        j--;
        break;
      case Affine_D:
        gt_alignment_add_deletion(align);
        edge = dptable[i][j].Dedge;
        gt_assert(i);
        i--;
        break;
      case Affine_I:
        gt_alignment_add_insertion(align);
        edge = dptable[i][j].Iedge;
        gt_assert(j);
        j--;
        break;
      default:
        gt_assert(false);
    }
  }
  gt_maxcoordvalue_set_start(max,i,j);
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
cmpq $0x0, 0x90(%rsp)
je 0x487545
cmpq $0x0, 0x88(%rsp)
jne 0x48757d
movq 0x1b4a54(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x8eabd(%rip), %rsi     # 0x516013
leaq 0x129e85(%rip), %rdx    # 0x5b13e2
leaq 0x12a0d1(%rip), %rcx    # 0x5b1635
leaq 0x129ea1(%rip), %r8     # 0x5b140c
movl $0x1d3, %r9d            # imm = 0x1D3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x48757f
movq 0x80(%rsp), %rdi
callq 0x1ac670
movq %rax, 0x40(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x88(%rsp), %rcx
movq 0x70(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
imulq $0x30, 0x68(%rsp), %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jle 0x48761f
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x487642
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq 0x88(%rsp), %rcx
movq 0x70(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
imulq $0x30, 0x68(%rsp), %rdx
addq %rdx, %rcx
cmpq 0x18(%rcx), %rax
jle 0x4876af
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
jmp 0x4876d2
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq %rcx, %rax
jle 0x487778
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x88(%rsp), %rcx
movq 0x70(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
imulq $0x30, 0x68(%rsp), %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jle 0x487746
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x487769
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x487808
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq 0x88(%rsp), %rcx
movq 0x70(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
imulq $0x30, 0x68(%rsp), %rdx
addq %rdx, %rcx
cmpq 0x18(%rcx), %rax
jle 0x4877db
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x4877fe
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rdi
callq 0x1ac4c0
cmpq 0x78(%rsp), %rax
je 0x48785e
movq 0x1b4773(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x8e7dc(%rip), %rsi     # 0x516013
leaq 0x129e13(%rip), %rdx    # 0x5b1651
leaq 0x129df0(%rip), %rcx    # 0x5b1635
leaq 0x129bc0(%rip), %r8     # 0x5b140c
movl $0x1db, %r9d            # imm = 0x1DB
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x487860
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq (%rax), %rax
cmpq 0x78(%rsp), %rax
jne 0x48788e
movl $0x0, 0x54(%rsp)
jmp 0x4878c7
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
cmpq 0x78(%rsp), %rax
jne 0x4878bd
movl $0x1, 0x54(%rsp)
jmp 0x4878c5
movl $0x2, 0x54(%rsp)
jmp 0x4878c7
jmp 0x4878c9
xorl %eax, %eax
cmpl $0x3, 0x54(%rsp)
movb %al, 0xf(%rsp)
je 0x4878f9
movb $0x1, %al
cmpq $0x0, 0x70(%rsp)
movb %al, 0xe(%rsp)
ja 0x4878f1
cmpq $0x0, 0x68(%rsp)
seta %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x487906
jmp 0x487b75
movl 0x54(%rsp), %eax
movl %eax, 0x8(%rsp)
testl %eax, %eax
je 0x487935
jmp 0x487914
movl 0x8(%rsp), %eax
subl $0x1, %eax
je 0x487a33
jmp 0x487923
movl 0x8(%rsp), %eax
subl $0x2, %eax
je 0x487ab6
jmp 0x487b36
jmp 0x487937
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, (%rax)
jne 0x487998
movq 0x1b4639(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x8e6a2(%rip), %rsi     # 0x516013
leaq 0x129aaf(%rip), %rdx    # 0x5b1427
leaq 0x129cb6(%rip), %rcx    # 0x5b1635
leaq 0x129a86(%rip), %r8     # 0x5b140c
movl $0x1e8, %r9d            # imm = 0x1E8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x48799a
movq 0x90(%rsp), %rdi
callq 0x12a410
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
movl %eax, 0x54(%rsp)
cmpq $0x0, 0x70(%rsp)
jbe 0x4879d8
cmpq $0x0, 0x68(%rsp)
ja 0x487a10
movq 0x1b45c1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x8e62a(%rip), %rsi     # 0x516013
leaq 0xc5d0c(%rip), %rdx     # 0x54d6fc
leaq 0x129c3e(%rip), %rcx    # 0x5b1635
leaq 0x129a0e(%rip), %r8     # 0x5b140c
movl $0x1eb, %r9d            # imm = 0x1EB
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x487a12
movq 0x70(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x70(%rsp)
movq 0x68(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x487b70
movq 0x90(%rsp), %rdi
callq 0x12a480
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movl 0x24(%rax), %eax
movl %eax, 0x54(%rsp)
cmpq $0x0, 0x70(%rsp)
jne 0x487aa1
movq 0x1b4530(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x8e599(%rip), %rsi     # 0x516013
leaq 0xb8b1a(%rip), %rdx     # 0x54059b
leaq 0x129bad(%rip), %rcx    # 0x5b1635
leaq 0x12997d(%rip), %r8     # 0x5b140c
movl $0x1f2, %r9d            # imm = 0x1F2
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x487aa3
movq 0x70(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x487b70
movq 0x90(%rsp), %rdi
callq 0x12a4f0
movq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rax
imulq $0x30, 0x68(%rsp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
movl %eax, 0x54(%rsp)
cmpq $0x0, 0x68(%rsp)
jne 0x487b24
movq 0x1b44ad(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x8e516(%rip), %rsi     # 0x516013
leaq 0xa9a88(%rip), %rdx     # 0x53158c
leaq 0x129b2a(%rip), %rcx    # 0x5b1635
leaq 0x1298fa(%rip), %r8     # 0x5b140c
movl $0x1f8, %r9d            # imm = 0x1F8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x487b26
movq 0x68(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x487b70
jmp 0x487b38
movq 0x1b4461(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x8e4ca(%rip), %rsi     # 0x516013
leaq 0xd1213(%rip), %rdx     # 0x558d63
leaq 0x129ade(%rip), %rcx    # 0x5b1635
leaq 0x1298ae(%rip), %r8     # 0x5b140c
movl $0x1fc, %r9d            # imm = 0x1FC
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4878c9
movq 0x80(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x1ac510
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)