// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/idxlocalidp.c
// Function: gt_processelemLocaliTracebackstate
void gt_processelemLocaliTracebackstate(Limdfsconstinfo *lci,
                                     GtUchar currentchar,
                                     const void *aliasstate)
{
  LocaliTracebackstate *tbs = &lci->tbs;
  const LocaliColumn *column = (const LocaliColumn *) aliasstate;

  while (true)
  {
    /*
    printf(" coord(i="GT_WU",j="GT_WU") with ",tbs->querypos,
                                       (GtUword) tbs->dbcurrent);
    printf("cellvalue="GT_WD", ",column->colvalues[tbs->querypos].bestcell);
    */
    switch (column->colvalues[tbs->querypos].tracebit)
    {
      case Insertbit:
        /* printf("insertbit\n"); */
        gt_alignment_add_insertion(tbs->alignment);
        gt_assert(tbs->dbcurrent > 0);
        tbs->dbcurrent--;
        tbs->spaceGtUchardbsubstring[tbs->dbcurrent] = currentchar;
        return;
      case Replacebit:
        /* printf("replacebit\n"); */
        gt_alignment_add_replacement(tbs->alignment);
        gt_assert(tbs->dbcurrent > 0);
        tbs->dbcurrent--;
        tbs->spaceGtUchardbsubstring[tbs->dbcurrent] = currentchar;
        gt_assert(tbs->querypos > 0);
        tbs->querypos--;
        return;
      case Deletebit:
        /* printf("deletebit\n"); */
        gt_alignment_add_deletion(tbs->alignment);
        gt_assert(tbs->querypos > 0);
        tbs->querypos--;
        break; /* stay in the same column => so next iteration */
      case Notraceback:
        fprintf(stderr,"tracebit = Notraceback not allowed\n");
        fprintf(stderr,"column->colvalues[tbs->querypos].bestcell="GT_WD"\n",
                        column->colvalues[tbs->querypos].bestcell);
        exit(GT_EXIT_PROGRAMMING_ERROR);
      default:
        fprintf(stderr,"tracebit = %d not allowed\n",
                (int) column->colvalues[tbs->querypos].tracebit);
        exit(GT_EXIT_PROGRAMMING_ERROR);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movq 0x50(%rdi), %rax
leaq 0x1e617d(%rip), %r15    # 0x3482e4
movq (%r14), %rcx
shlq $0x4, %rax
movl 0x8(%rcx,%rax), %edx
cmpq $0x3, %rdx
ja 0x162213
movslq (%r15,%rdx,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x70(%rbx), %rdi
callq 0xb5258
movq 0x50(%rbx), %rax
testq %rax, %rax
je 0x162271
decq %rax
movq %rax, 0x50(%rbx)
jmp 0x162167
movq 0x70(%rbx), %rdi
callq 0xb5208
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x1622a9
leaq -0x1(%rax), %rcx
movq %rcx, 0x40(%rbx)
movq 0x60(%rbx), %rcx
movb %bpl, -0x1(%rcx,%rax)
movq 0x50(%rbx), %rax
testq %rax, %rax
je 0x162305
decq %rax
movq %rax, 0x50(%rbx)
jmp 0x162208
movq 0x70(%rbx), %rdi
callq 0xb52a8
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x1622d7
leaq -0x1(%rax), %rcx
movq %rcx, 0x40(%rbx)
movq 0x60(%rbx), %rcx
movb %bpl, -0x1(%rcx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d5d4e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1e6183(%rip), %rsi    # 0x3483a7
xorl %eax, %eax
callq 0x17a50
jmp 0x162269
movq 0x2d5d34(%rip), %r15    # 0x437f68
movq (%r15), %rcx
leaq 0x1e6116(%rip), %rdi    # 0x348354
pushq $0x23
popq %rsi
pushq $0x1
popq %rdx
callq 0x17f00
movq (%r15), %rdi
movq (%r14), %rax
movq 0x50(%rbx), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rdx
leaq 0x1e6116(%rip), %rsi    # 0x348378
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0
movq 0x2d5cf0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x182d91(%rip), %rsi    # 0x2e5013
leaq 0x1e60b9(%rip), %rdx    # 0x348342
leaq 0x1e608f(%rip), %rcx    # 0x34831f
leaq 0x1e605d(%rip), %r8     # 0x3482f4
movl $0x2d8, %r9d            # imm = 0x2D8
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2d5cb8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x182d59(%rip), %rsi    # 0x2e5013
leaq 0x1e604b(%rip), %rdx    # 0x34830c
leaq 0x1e6057(%rip), %rcx    # 0x34831f
leaq 0x1e6025(%rip), %r8     # 0x3482f4
movl $0x2cf, %r9d            # imm = 0x2CF
jmp 0x16229d
movq 0x2d5c8a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x182d2b(%rip), %rsi    # 0x2e5013
leaq 0x1e601d(%rip), %rdx    # 0x34830c
leaq 0x1e6029(%rip), %rcx    # 0x34831f
leaq 0x1e5ff7(%rip), %r8     # 0x3482f4
movl $0x2c8, %r9d            # imm = 0x2C8
jmp 0x16229d
movq 0x2d5c5c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x182cfd(%rip), %rsi    # 0x2e5013
leaq 0x1e6025(%rip), %rdx    # 0x348342
leaq 0x1e5ffb(%rip), %rcx    # 0x34831f
leaq 0x1e5fc9(%rip), %r8     # 0x3482f4
movl $0x2d2, %r9d            # imm = 0x2D2
jmp 0x16229d