// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/ft-front-generation.c
// Function: gt_front_trace2eoplist_full_front_directed
void gt_front_trace2eoplist_full_front_directed(GtEoplist *eoplist,
                                                const GtFrontTrace *front_trace,
                                                GtUword distance,
                                                const GtUchar *useq,
                                                GtUword ulen,
                                                const GtUchar *vseq,
                                                GtUword vlen)
{
  const GtBackreftable *basefront, *current;
  GtUword firstindex;
  GtWord diagonal = (GtWord) vlen - (GtWord) ulen;
  uint32_t row;
  uint8_t preferred_eop = FT_EOP_MISMATCH;

  gt_assert(front_trace != NULL &&
            front_trace->backref_nextfree >= 2 * distance + 1);
  basefront = front_trace->backref_table + front_trace->backref_nextfree
                                         - (2 * distance + 1);
  current = basefront + distance + diagonal;
  firstindex = gt_eoplist_length(eoplist);
  gt_assert(ulen <= (GtUword) UINT32_MAX);
  row = ulen;
  while (distance > 0)
  {
    GtUword nextrowadd;

    if (eoplist != NULL)
    {
      if (current->lcs > 0)
      {
        gt_eoplist_match_add(eoplist,current->lcs);
      }
    } else
    {
      gt_check_diagonal_run(useq, vseq, diagonal, row - current->lcs, row);
    }
    if (current->bits & preferred_eop)
    {
      if (preferred_eop == FT_EOP_MISMATCH)
      {
        nextrowadd = 1;
      } else
      {
        if (preferred_eop == FT_EOP_INSERTION)
        {
          gt_assert(-(GtWord) ulen < diagonal);
          diagonal--;
          nextrowadd = 0;
        } else
        {
          gt_assert(preferred_eop == FT_EOP_DELETION);
          gt_assert(diagonal < (GtWord) vlen);
          diagonal++;
          nextrowadd = 1;
        }
      }
    } else
    {
      if (current->bits & FT_EOP_MISMATCH)
      {
        preferred_eop = FT_EOP_MISMATCH;
        nextrowadd = 1;
      } else
      {
        if (current->bits & FT_EOP_INSERTION)
        {
          gt_assert(-(GtWord) ulen < diagonal);
          diagonal--;
          preferred_eop = FT_EOP_INSERTION;
          nextrowadd = 0;
        } else
        {
          gt_assert(current->bits & FT_EOP_DELETION);
          gt_assert(diagonal < (GtWord) vlen);
          diagonal++;
          preferred_eop = FT_EOP_DELETION;
          nextrowadd = 1;
        }
      }
    }
    if (eoplist != NULL)
    {
      if (preferred_eop == FT_EOP_DELETION)
      {
        gt_eoplist_deletion_add(eoplist);
      } else
      {
        if (preferred_eop == FT_EOP_INSERTION)
        {
          gt_eoplist_insertion_add(eoplist);
        } else
        {
          gt_eoplist_mismatch_add(eoplist);
        }
      }
    }
    distance--;
    basefront -= (2 * distance + 1);
    gt_assert(basefront >= front_trace->backref_table);
    gt_assert(row >= current->lcs + nextrowadd);
    row -= current->lcs + nextrowadd;
    current = basefront + distance + diagonal;
  }
  gt_assert(basefront == front_trace->backref_table && current->bits == 0);
  if (eoplist != NULL)
  {
    if (current->lcs > 0)
    {
      gt_eoplist_match_add(eoplist,current->lcs);
    }
    gt_eoplist_reverse_end(eoplist,firstindex);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
testq %rsi, %rsi
je 0x31ae28
movq %rdx, %r14
movq 0x10(%rsi), %rbx
leaq (%rdx,%rdx), %r15
cmpq %r15, %rbx
jbe 0x31ae28
movq %r8, %r12
movq 0x80(%rsp), %rbp
movq %rsi, 0x28(%rsp)
movq (%rsi), %r13
movq %rdi, (%rsp)
callq 0x318721
movq %r12, %rcx
shrq $0x20, %rcx
jne 0x31ae41
movq %rax, 0x30(%rsp)
movq %rbp, 0x20(%rsp)
movq %rbp, %rdx
subq %r12, %rdx
leaq (,%rbx,4), %rax
addq %r13, %rax
movq %r15, %rcx
notq %rcx
leaq (%rax,%rcx,4), %r13
leaq (,%r14,4), %rax
addq %r13, %rax
leaq (%rax,%rdx,4), %rbp
testq %r14, %r14
je 0x31adb4
movq %r12, %rax
negq %rax
movq %rax, 0x18(%rsp)
decq %r14
movl $0x1, %ebx
subq %r15, %rbx
movb $0x1, %r8b
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x31ac43
movl (%rbp), %esi
cmpq $0x8, %rsi
jb 0x31ac80
shrl $0x3, %esi
movq (%rsp), %rdi
movq %rdx, %r15
movq %r14, 0x8(%rsp)
movq %rbp, %r14
movl %r8d, %ebp
callq 0x318485
jmp 0x31ac6e
movl (%rbp), %eax
shrl $0x3, %eax
movl %r12d, %ecx
subl %eax, %ecx
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %rdx, %r15
movq %r14, 0x8(%rsp)
movq %rbp, %r14
movl %r8d, %ebp
movl %r12d, %r8d
callq 0x31ae46
movl %ebp, %r8d
movq %r14, %rbp
movq 0x8(%rsp), %r14
movq %r15, %rdx
movq (%rsp), %rdi
movl (%rbp), %eax
movzbl %r8b, %r15d
testl %r15d, %eax
je 0x31acae
cmpb $0x1, %r8b
je 0x31ad04
cmpl $0x4, %r15d
je 0x31acd7
cmpl $0x2, %r15d
jne 0x31ae19
cmpq 0x18(%rsp), %rdx
jg 0x31acfb
jmp 0x31ae1e
movl $0x1, %r15d
movb $0x1, %r8b
testb $0x1, %al
jne 0x31ad04
testb $0x2, %al
jne 0x31acf0
testb $0x4, %al
je 0x31ae3c
cmpq 0x20(%rsp), %rdx
jge 0x31ae37
incq %rdx
jmp 0x31aceb
cmpq 0x20(%rsp), %rdx
jge 0x31ae23
incq %rdx
movl $0x1, %r15d
movb $0x4, %r8b
jmp 0x31ad04
cmpq 0x18(%rsp), %rdx
jle 0x31ae32
decq %rdx
movb $0x2, %r8b
xorl %r15d, %r15d
testq %rdi, %rdi
je 0x31ad6e
cmpb $0x2, %r8b
movq %rdx, 0x10(%rsp)
je 0x31ad2d
movb %r8b, 0x8(%rsp)
movzbl %r8b, %eax
cmpl $0x4, %eax
jne 0x31ad57
movq (%rsp), %rdi
callq 0x318327
jmp 0x31ad60
movq (%rsp), %rdi
movq %r14, 0x8(%rsp)
movq %rbp, %r14
movl %r8d, %ebp
callq 0x3183d6
movl %ebp, %r8d
movq %r14, %rbp
movq 0x8(%rsp), %r14
movq 0x10(%rsp), %rdx
movq (%rsp), %rdi
jmp 0x31ad6e
movq (%rsp), %rdi
callq 0x318601
movq (%rsp), %rdi
movq 0x10(%rsp), %rdx
movb 0x8(%rsp), %r8b
leaq (%r13,%rbx,4), %r13
movq 0x28(%rsp), %rax
movq (%rax), %rax
cmpq %rax, %r13
jb 0x31ae0f
movl %r12d, %r12d
movl (%rbp), %ecx
shrl $0x3, %ecx
addq %rcx, %r15
subq %r15, %r12
jb 0x31ae14
leaq (,%r14,4), %rcx
addq %r13, %rcx
leaq (%rcx,%rdx,4), %rbp
addq $0x2, %rbx
addq $-0x1, %r14
jb 0x31ac19
jmp 0x31adc0
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq (%rsp), %rdi
cmpq %rax, %r13
jne 0x31ae2d
movl (%rbp), %esi
testb $0x7, %sil
jne 0x31ae2d
testq %rdi, %rdi
je 0x31ae00
testq %rsi, %rsi
je 0x31ade8
shrl $0x3, %esi
movq (%rsp), %rdi
callq 0x318485
movq (%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31872d
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x92f0c
callq 0x92ed3
callq 0x92e28
callq 0x92def
callq 0x92db6
callq 0x92fb7
callq 0x92f7e
callq 0x92e61
callq 0x92e9a
callq 0x92f45
callq 0x92d7d