// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_reader_next_encoded_char
GtUchar gt_encseq_reader_next_encoded_char(GtEncseqReader *esr)
{
  GtUchar cc;
  gt_assert(esr->encseq
              && esr->currentpos < esr->encseq->logicaltotallength);
  /* if we have mirroring enabled, we need to check whether we cross the
     boundary between real and virtual sequences, turn around if necessary */
  if (esr->encseq->hasmirror && esr->currentpos == esr->encseq->totallength) {
    if (!esr->startedonmiddle) {
      /* only turn around if we arrived from complementary side */
      gt_readmode_invert(esr->readmode);
      /* from now on, we can only go backwards on the original sequence! */
      gt_assert(GT_ISDIRREVERSE(esr->readmode));
    }
    /* go back */
    esr->currentpos--;
    if (esr->encseq->accesstype_via_utables) {
      /* prepare esr for directional change */
      if (esr->encseq->has_wildcardranges) {
        gt_assert(esr->wildcardrangestate != NULL);
        binpreparenextrangeGtEncseqReader(esr, SWtable_wildcardrange);
        advancerangeGtEncseqReader(esr, SWtable_wildcardrange);
      }
      if (esr->encseq->numofdbsequences > 1UL) {
        gt_assert(esr->ssptabstate != NULL);
        binpreparenextrangeGtEncseqReader(esr, SWtable_ssptab);
        advancerangeGtEncseqReader(esr, SWtable_ssptab);
      }
    }
    else {
      if (esr->encseq->sat == GT_ACCESS_TYPE_EQUALLENGTH) {
        esr->currentpos++;
        singlepositioninseparatorViaequallength_updatestate(esr);
        esr->currentpos--;
      }
    }
    return (GtUchar) GT_SEPARATOR;
  }
  gt_assert(esr && esr->currentpos < esr->encseq->totallength);

  switch (esr->readmode) {
    case GT_READMODE_FORWARD:
      cc = esr->encseq->seqdeliverchar(esr);
      esr->currentpos++;
      return cc;
    case GT_READMODE_REVERSE:
      cc = esr->encseq->seqdeliverchar(esr);
      esr->currentpos--;
      return cc;
    case GT_READMODE_COMPL: /* only works with dna */
      cc = esr->encseq->seqdeliverchar(esr);
      esr->currentpos++;
      return GT_ISSPECIAL(cc) ? cc : GT_COMPLEMENTBASE(cc);
    case GT_READMODE_REVCOMPL: /* only works with dna */
      cc = esr->encseq->seqdeliverchar(esr);
      esr->currentpos--;
      return GT_ISSPECIAL(cc) ? cc : GT_COMPLEMENTBASE(cc);
    default:
      fprintf(stderr, "gt_encseq_get_encoded_char: "
                     "readmode %d not implemented\n", (int) esr->readmode);
      exit(GT_EXIT_PROGRAMMING_ERROR);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0xa2a9d
movq %rdi, %rbx
movq 0x10(%rdi), %rcx
cmpq 0x38(%rax), %rcx
jae 0xa2a9d
movq 0x30(%rax), %rdx
cmpq %rdx, %rcx
sete %sil
andb 0x3a8(%rax), %sil
cmpb $0x1, %sil
jne 0xa2a0d
cmpb $0x0, 0x20(%rbx)
jne 0xa299b
movl 0x8(%rbx), %edx
pushq $0x3
popq %rsi
subl %edx, %esi
movl %esi, 0x8(%rbx)
testl $0xfffffffd, %edx       # imm = 0xFFFFFFFD
jne 0xa2b03
leaq -0x1(%rcx), %rdx
movq %rdx, 0x10(%rbx)
cmpb $0x1, 0x3a9(%rax)
jne 0xa2a42
cmpb $0x1, 0x29(%rax)
jne 0xa29d8
cmpq $0x0, 0x28(%rbx)
je 0xa2b31
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa2bb3
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa32f8
movq (%rbx), %rax
movb $-0x1, %bpl
cmpq $0x2, 0x40(%rax)
jb 0xa2a87
cmpq $0x0, 0x30(%rbx)
je 0xa2b62
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0xa2bb3
movq %rbx, %rdi
movl %r14d, %esi
callq 0xa32f8
jmp 0xa2a87
cmpq %rdx, %rcx
jae 0xa2ad5
movl 0x8(%rbx), %edx
cmpq $0x3, %rdx
ja 0xa2b93
leaq 0x48f86(%rip), %rcx     # 0xeb9b0
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %rbx, %rdi
callq *0x110(%rax)
incq 0x10(%rbx)
jmp 0xa2a89
movb $-0x1, %bpl
cmpl $0x2, (%rax)
jne 0xa2a87
movq %rcx, 0x10(%rbx)
movq %rbx, %rdi
callq 0xa3350
decq 0x10(%rbx)
jmp 0xa2a87
movq %rbx, %rdi
callq *0x110(%rax)
incq 0x10(%rbx)
jmp 0xa2a78
movq %rbx, %rdi
callq *0x110(%rax)
decq 0x10(%rbx)
movb $0x3, %cl
subb %al, %cl
cmpb $-0x2, %al
movzbl %al, %eax
movzbl %cl, %ebp
cmovael %eax, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq *0x110(%rax)
decq 0x10(%rbx)
jmp 0xa2a89
movq 0x8b514(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x275b8(%rip), %rsi     # 0xca066
leaq 0x4932f(%rip), %rdx     # 0xebde4
leaq 0x49369(%rip), %rcx     # 0xebe25
leaq 0x490d7(%rip), %r8      # 0xebb9a
movl $0x208, %r9d            # imm = 0x208
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0x8b4dc(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x27580(%rip), %rsi     # 0xca066
leaq 0x49394(%rip), %rdx     # 0xebe81
leaq 0x49331(%rip), %rcx     # 0xebe25
leaq 0x4909f(%rip), %r8      # 0xebb9a
movl $0x22a, %r9d            # imm = 0x22A
jmp 0xa2ac9
movq 0x8b4ae(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x27552(%rip), %rsi     # 0xca066
leaq 0x4ceff(%rip), %rdx     # 0xefa1a
leaq 0x49303(%rip), %rcx     # 0xebe25
leaq 0x49071(%rip), %r8      # 0xebb9a
movl $0x210, %r9d            # imm = 0x210
jmp 0xa2ac9
movq 0x8b480(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x27524(%rip), %rsi     # 0xca066
leaq 0x492ff(%rip), %rdx     # 0xebe48
leaq 0x492d5(%rip), %rcx     # 0xebe25
leaq 0x49043(%rip), %r8      # 0xebb9a
movl $0x217, %r9d            # imm = 0x217
jmp 0xa2ac9
movq 0x8b44f(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x274f3(%rip), %rsi     # 0xca066
leaq 0x492ee(%rip), %rdx     # 0xebe68
leaq 0x492a4(%rip), %rcx     # 0xebe25
leaq 0x49012(%rip), %r8      # 0xebb9a
movl $0x21c, %r9d            # imm = 0x21C
jmp 0xa2ac9
movq 0x8b41e(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x4930f(%rip), %rsi     # 0xebeb3
xorl %eax, %eax
callq 0xb8c0
pushq $0x2
popq %rdi
callq 0xb7b0