// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/reconstructalignment.c
// Function: gt_reconstructalignment_from_Ltab
void gt_reconstructalignment_from_Ltab(GtAlignment *align,
                                       GtWord **Ltabcolumn,
                                       GtMaxcoordvalue *max,
                                       const GtUchar *useq,
                                       GtUword ustart,
                                       GT_UNUSED GtUword ulen,
                                       const GtUchar *vseq,
                                       GtUword vstart,
                                       GT_UNUSED GtUword vlen,
                                       const GtScoreHandler *scorehandler)
{
  GtUword i, j;
  GtWord gapscore;
  GtUwordPair max_end;

  gt_assert(align && Ltabcolumn && scorehandler);
  max_end = gt_maxcoordvalue_get_end(max);
  i = max_end.a;
  j = max_end.b;
  gt_assert(i <= ulen && j <= vlen);
  gapscore = gt_scorehandler_get_gapscore(scorehandler);
  while ((i > 0 || j > 0) && Ltabcolumn[i][j] != 0)
  {
    if (i > 0 && j > 0 && Ltabcolumn[i][j] == Ltabcolumn[i-1][j-1] +
                                              gt_scorehandler_get_replacement(
                                                    scorehandler,
                                                    useq[ustart+i-1],
                                                    vseq[vstart+j-1]))
    {
      gt_alignment_add_replacement(align);
      i--;
      j--;
      continue;
    }
    if (j > 0 && Ltabcolumn[i][j] == Ltabcolumn[i][j-1] + gapscore)
    {
      gt_alignment_add_insertion(align);
      j--;
      continue;
    }
    if (i > 0 && Ltabcolumn[i][j] == Ltabcolumn[i-1][j] + gapscore)
    {
      gt_alignment_add_deletion(align);
      i--;
      continue;
    }
    gt_assert(false);
  }
  gt_maxcoordvalue_set_start(max,i,j);
}

// Assembly:
subq $0x88, %rsp
movq 0xa8(%rsp), %rax
movq 0xa0(%rsp), %rax
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rax
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x58(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x1c6b56
cmpq $0x0, 0x78(%rsp)
je 0x1c6b56
cmpq $0x0, 0xa8(%rsp)
jne 0x1c6b8e
movq 0x475443(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x34f4ac(%rip), %rsi    # 0x516013
leaq 0x39b839(%rip), %rdx    # 0x5623a7
leaq 0x39b856(%rip), %rcx    # 0x5623cb
leaq 0x39b807(%rip), %r8     # 0x562383
movl $0x6e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1c6b90
movq 0x70(%rsp), %rdi
callq 0x1ac670
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x58(%rsp), %rax
ja 0x1c6be7
movq 0x48(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jbe 0x1c6c1f
movq 0x4753b2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x34f41b(%rip), %rsi    # 0x516013
leaq 0x39b7ee(%rip), %rdx    # 0x5623ed
leaq 0x39b7c5(%rip), %rcx    # 0x5623cb
leaq 0x39b776(%rip), %r8     # 0x562383
movl $0x72, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1c6c21
movq 0xa8(%rsp), %rdi
callq 0x1d11d0
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x50(%rsp)
ja 0x1c6c49
xorl %eax, %eax
cmpq $0x0, 0x48(%rsp)
movb %al, 0x1f(%rsp)
jbe 0x1c6c68
movq 0x78(%rsp), %rax
movq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
setne %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x1c6c75
jmp 0x1c6e55
cmpq $0x0, 0x50(%rsp)
jbe 0x1c6d53
cmpq $0x0, 0x48(%rsp)
jbe 0x1c6d53
movq 0x78(%rsp), %rax
movq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x78(%rsp), %rax
movq 0x50(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0xa8(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rcx
addq 0x50(%rsp), %rcx
subq $0x1, %rcx
movb (%rax,%rcx), %dl
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
addq 0x48(%rsp), %rcx
subq $0x1, %rcx
movzbl %dl, %esi
movzbl (%rax,%rcx), %edx
callq 0x1d12c0
movq 0x8(%rsp), %rcx
movq %rax, %rdx
movq 0x10(%rsp), %rax
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x1c6d53
movq 0x80(%rsp), %rdi
callq 0x12a410
movq 0x50(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x1c6c33
cmpq $0x0, 0x48(%rsp)
jbe 0x1c6db7
movq 0x78(%rsp), %rax
movq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x78(%rsp), %rcx
movq 0x50(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x48(%rsp), %rdx
subq $0x1, %rdx
movq (%rcx,%rdx,8), %rcx
addq 0x40(%rsp), %rcx
cmpq %rcx, %rax
jne 0x1c6db7
movq 0x80(%rsp), %rdi
callq 0x12a4f0
movq 0x48(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x1c6c33
cmpq $0x0, 0x50(%rsp)
jbe 0x1c6e1b
movq 0x78(%rsp), %rax
movq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x78(%rsp), %rcx
movq 0x50(%rsp), %rdx
subq $0x1, %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x48(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
addq 0x40(%rsp), %rcx
cmpq %rcx, %rax
jne 0x1c6e1b
movq 0x80(%rsp), %rdi
callq 0x12a480
movq 0x50(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x1c6c33
jmp 0x1c6e1d
movq 0x47517c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x34f1e5(%rip), %rsi    # 0x516013
leaq 0x391f2e(%rip), %rdx    # 0x558d63
leaq 0x39b58f(%rip), %rcx    # 0x5623cb
leaq 0x39b540(%rip), %r8     # 0x562383
movl $0x8d, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
movq 0x70(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x1ac510
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)