// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
testq %rdi, %rdi
je 0x10f08c
movq %rsi, %r14
testq %rsi, %rsi
je 0x10f08c
movq 0x88(%rsp), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x10f08c
movq %rdi, %r15
movq 0x80(%rsp), %rbx
movq 0x78(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x70(%rsp), %r12
movq %rdx, 0x28(%rsp)
movq %rdx, %rdi
callq 0xff6e3
cmpq 0x18(%rsp), %rax
ja 0x10f0b6
movq %rdx, %rbp
cmpq %rbx, %rdx
ja 0x10f0b6
movq %rax, %r13
movq 0x20(%rsp), %rdi
callq 0x114a6a
movq %rax, %rbx
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
addq %rcx, %rax
decq %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
addq %r12, %rax
decq %rax
movq %rax, 0x8(%rsp)
movq %r13, %rax
orq %rbp, %rax
je 0x10f034
movq (%r14,%r13,8), %rax
movq (%rax,%rbp,8), %r12
testq %r12, %r12
je 0x10f036
testq %r13, %r13
setne %cl
testq %rbp, %rbp
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x10efdf
movq -0x8(%r14,%r13,8), %rax
movq -0x8(%rax,%rbp,8), %rax
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
movzbl (%rax,%r13), %esi
movq 0x8(%rsp), %rax
movzbl (%rax,%rbp), %edx
movq 0x20(%rsp), %rdi
callq 0x114b2c
addq 0x18(%rsp), %rax
cmpq %rax, %r12
je 0x10f021
movq (%r14,%r13,8), %rax
movq (%rax,%rbp,8), %r12
jmp 0x10efe4
testq %rbp, %rbp
je 0x10eff1
movq -0x8(%rax,%rbp,8), %rax
addq %rbx, %rax
cmpq %rax, %r12
je 0x10f017
testq %r13, %r13
je 0x10f054
movq -0x8(%r14,%r13,8), %rax
movq (%rax,%rbp,8), %rax
addq %rbx, %rax
cmpq %rax, %r12
jne 0x10f054
movq %r15, %rdi
callq 0xb5258
decq %r13
jmp 0x10ef6f
movq %r15, %rdi
callq 0xb52a8
jmp 0x10f02c
movq %r15, %rdi
callq 0xb5208
decq %r13
decq %rbp
jmp 0x10ef6f
xorl %ebp, %ebp
movq 0x28(%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xff614
movq 0x328f0d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1d5fae(%rip), %rsi    # 0x2e5013
leaq 0x217980(%rip), %rdx    # 0x3269ec
leaq 0x220ea5(%rip), %rcx    # 0x32ff18
leaq 0x220e56(%rip), %r8     # 0x32fed0
movl $0x8d, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x328ed5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1d5f76(%rip), %rsi    # 0x2e5013
leaq 0x220e50(%rip), %rdx    # 0x32fef4
leaq 0x220e6d(%rip), %rcx    # 0x32ff18
leaq 0x220e1e(%rip), %r8     # 0x32fed0
pushq $0x6e
jmp 0x10f0de
movq 0x328eab(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1d5f4c(%rip), %rsi    # 0x2e5013
leaq 0x220e6c(%rip), %rdx    # 0x32ff3a
leaq 0x220e43(%rip), %rcx    # 0x32ff18
leaq 0x220df4(%rip), %r8     # 0x32fed0
pushq $0x72
popq %r9
jmp 0x10f080