// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_reader_next_decoded_char
char gt_encseq_reader_next_decoded_char(GtEncseqReader *esr)
{
  char cc = GT_UNDEF_CHAR;
  gt_assert(esr && esr->encseq && esr->encseq->alpha);
  if (!esr->encseq->has_exceptiontable) {
    /* no lossless support available, we need to do simple decoding */
    GtUchar mycc = gt_encseq_reader_next_encoded_char(esr);
    if (mycc != (GtUchar) GT_SEPARATOR)
      cc = gt_alphabet_decode(esr->encseq->alpha, mycc);
    else
      cc = (char) mycc;
    return cc;
  } else {
    GtUchar ccc;
    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 (char) GT_SEPARATOR;
    }
    gt_assert(esr && esr->currentpos < esr->encseq->totallength);

    ccc = esr->encseq->seqdeliverchar(esr);
    if (ccc != (GtUchar) GT_SEPARATOR) {
      GtUword mappos = GT_UNDEF_UWORD;
      if (esr->encseq->specialcharinfo.realexceptionranges > 0UL
            && esr->encseq->getexceptionmapping(esr->encseq,
                                                &mappos, esr->currentpos)) {
        /* if the character at this position is not the most frequent in
           its class, look up its exception */
        unsigned char subalphcode = (unsigned char)
                                bitpackarray_get_uint32(esr->encseq->exceptions,
                                                        (BitOffset) mappos);
        gt_assert(subalphcode < esr->encseq->maxsubalphasize);
        /* and map it back to the original character */
        cc = esr->encseq->allchars[esr->encseq->classstartpositions[(int) ccc]
                                     + subalphcode];
      } else {
        /* otherwise return most frequent character */
        cc = esr->encseq->maxchars[(int) ccc];
      }
      gt_assert(cc != GT_UNDEF_CHAR);
    } else {
      cc = (char) GT_SEPARATOR;
    }
    switch (esr->readmode) {
      case GT_READMODE_FORWARD:
        esr->currentpos++;
        return cc;
      case GT_READMODE_REVERSE:
        esr->currentpos--;
        return cc;
      case GT_READMODE_COMPL: /* only works with dna */
        esr->currentpos++;
        if (cc != (char) GT_SEPARATOR)
          (void) gt_complement(&cc, cc, NULL);
        return cc;
      case GT_READMODE_REVCOMPL: /* only works with dna */
        esr->currentpos--;
        if (cc != (char) GT_SEPARATOR)
          (void) gt_complement(&cc, cc, NULL);
        return cc;
      default:
        fprintf(stderr, "gt_encseq_next_encoded_char: "
                       "readmode %d not implemented\n", (int) esr->readmode);
        exit(GT_EXIT_PROGRAMMING_ERROR);
    }
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movb $0x7f, 0x27(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x115713
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
je 0x115713
movq 0x28(%rsp), %rax
movq (%rax), %rax
cmpq $0x0, 0x220(%rax)
jne 0x11574b
movq 0x9e8be(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x48942(%rip), %rsi     # 0x15e066
leaq 0x70285(%rip), %rdx     # 0x1859b0
leaq 0x702a7(%rip), %rcx     # 0x1859d9
leaq 0x6ff25(%rip), %r8      # 0x18565e
movl $0x247, %r9d            # imm = 0x247
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x11574d
movq 0x28(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x2f0(%rax)
jne 0x1157ac
movq 0x28(%rsp), %rdi
callq 0x115010
movb %al, 0x26(%rsp)
movzbl 0x26(%rsp), %eax
cmpl $0xff, %eax
je 0x115797
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x220(%rax), %rdi
movzbl 0x26(%rsp), %esi
callq 0x10ac90
movb %al, 0x27(%rsp)
jmp 0x11579f
movb 0x26(%rsp), %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
movb %al, 0x37(%rsp)
jmp 0x115ce7
jmp 0x1157ae
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1157d0
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
cmpq 0x38(%rcx), %rax
jb 0x115808
movq 0x9e801(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x48885(%rip), %rsi     # 0x15e066
leaq 0x700c0(%rip), %rdx     # 0x1858a8
leaq 0x701ea(%rip), %rcx     # 0x1859d9
leaq 0x6fe68(%rip), %r8      # 0x18565e
movl $0x253, %r9d            # imm = 0x253
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x11580a
movq 0x28(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x3a8(%rax)
je 0x1159fc
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
cmpq 0x30(%rcx), %rax
jne 0x1159fc
movq 0x28(%rsp), %rax
testb $0x1, 0x20(%rax)
jne 0x1158ac
movq 0x28(%rsp), %rax
movl $0x3, %ecx
subl 0x8(%rax), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x28(%rsp), %rax
cmpl $0x1, 0x8(%rax)
je 0x1158a8
movq 0x28(%rsp), %rax
cmpl $0x3, 0x8(%rax)
je 0x1158a8
movq 0x9e761(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x487e5(%rip), %rsi     # 0x15e066
leaq 0x73d9a(%rip), %rdx     # 0x189622
leaq 0x7014a(%rip), %rcx     # 0x1859d9
leaq 0x6fdc8(%rip), %r8      # 0x18565e
movl $0x25b, %r9d            # imm = 0x25B
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x1158aa
jmp 0x1158ac
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x3a9(%rax)
je 0x1159b7
movq 0x28(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x29(%rax)
je 0x115940
jmp 0x1158e2
movq 0x28(%rsp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x115926
movq 0x9e6e3(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x48767(%rip), %rsi     # 0x15e066
leaq 0x70006(%rip), %rdx     # 0x18590c
leaq 0x700cc(%rip), %rcx     # 0x1859d9
leaq 0x6fd4a(%rip), %r8      # 0x18565e
movl $0x262, %r9d            # imm = 0x262
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x115928
movq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x115450
movq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x115520
movq 0x28(%rsp), %rax
movq (%rax), %rax
cmpq $0x1, 0x40(%rax)
jbe 0x1159b5
jmp 0x115951
movq 0x28(%rsp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x115995
movq 0x9e674(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x486f8(%rip), %rsi     # 0x15e066
leaq 0x6ffb7(%rip), %rdx     # 0x18592c
leaq 0x7005d(%rip), %rcx     # 0x1859d9
leaq 0x6fcdb(%rip), %r8      # 0x18565e
movl $0x267, %r9d            # imm = 0x267
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x115997
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x115450
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x115520
jmp 0x1159f2
movq 0x28(%rsp), %rax
movq (%rax), %rax
cmpl $0x2, (%rax)
jne 0x1159f0
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rdi
callq 0x1155f0
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
jmp 0x1159f2
movb $-0x1, 0x37(%rsp)
jmp 0x115ce7
jmp 0x1159fe
cmpq $0x0, 0x28(%rsp)
je 0x115a1d
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
cmpq 0x30(%rcx), %rax
jb 0x115a55
movq 0x9e5b4(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x48638(%rip), %rsi     # 0x15e066
leaq 0x6ff10(%rip), %rdx     # 0x185945
leaq 0x6ff9d(%rip), %rcx     # 0x1859d9
leaq 0x6fc1b(%rip), %r8      # 0x18565e
movl $0x275, %r9d            # imm = 0x275
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x115a57
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x110(%rax), %rax
movq 0x28(%rsp), %rdi
callq *%rax
movb %al, 0x25(%rsp)
movzbl 0x25(%rsp), %eax
cmpl $0xff, %eax
je 0x115be0
movq $-0x1, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
cmpq $0x0, 0x1e0(%rax)
jbe 0x115b7a
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x150(%rax), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rdi
movq 0x28(%rsp), %rcx
movq 0x10(%rcx), %rdx
leaq 0x18(%rsp), %rsi
callq *%rax
testb $0x1, %al
jne 0x115ad0
jmp 0x115b7a
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x330(%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x114930
movb %al, 0x17(%rsp)
movzbl 0x17(%rsp), %eax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movzbl 0x360(%rcx), %ecx
cmpl %ecx, %eax
jl 0x115b3d
movq 0x9e4cc(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x48550(%rip), %rsi     # 0x15e066
leaq 0x6fedf(%rip), %rdx     # 0x1859fc
leaq 0x6feb5(%rip), %rcx     # 0x1859d9
leaq 0x6fb33(%rip), %r8      # 0x18565e
movl $0x282, %r9d            # imm = 0x282
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x115b3f
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x350(%rax), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movq 0x338(%rcx), %rcx
movzbl 0x25(%rsp), %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movzbl 0x17(%rsp), %edx
addq %rdx, %rcx
movb (%rax,%rcx), %al
movb %al, 0x27(%rsp)
jmp 0x115b98
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x348(%rax), %rax
movzbl 0x25(%rsp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, 0x27(%rsp)
jmp 0x115b9a
movsbl 0x27(%rsp), %eax
cmpl $0x7f, %eax
jne 0x115bdc
movq 0x9e42d(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x484b1(%rip), %rsi     # 0x15e066
leaq 0x6fe6b(%rip), %rdx     # 0x185a27
leaq 0x6fe16(%rip), %rcx     # 0x1859d9
leaq 0x6fa94(%rip), %r8      # 0x18565e
movl $0x28a, %r9d            # imm = 0x28A
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x115bde
jmp 0x115be5
movb $-0x1, 0x27(%rsp)
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
movq %rax, 0x8(%rsp)
subq $0x3, %rax
ja 0x115cbd
movq 0x8(%rsp), %rax
leaq 0x6f838(%rip), %rcx     # 0x185440
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movb 0x27(%rsp), %al
movb %al, 0x37(%rsp)
jmp 0x115ce7
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movb 0x27(%rsp), %al
movb %al, 0x37(%rsp)
jmp 0x115ce7
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movsbl 0x27(%rsp), %eax
cmpl $-0x1, %eax
je 0x115c7b
leaq 0x27(%rsp), %rdi
xorl %eax, %eax
movl %eax, %edx
movsbl 0x27(%rsp), %esi
callq 0x112480
movb 0x27(%rsp), %al
movb %al, 0x37(%rsp)
jmp 0x115ce7
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movsbl 0x27(%rsp), %eax
cmpl $-0x1, %eax
je 0x115cb3
leaq 0x27(%rsp), %rdi
xorl %eax, %eax
movl %eax, %edx
movsbl 0x27(%rsp), %esi
callq 0x112480
movb 0x27(%rsp), %al
movb %al, 0x37(%rsp)
jmp 0x115ce7
movq 0x9e314(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
movq 0x28(%rsp), %rax
movl 0x8(%rax), %edx
leaq 0x6fd65(%rip), %rsi     # 0x185a3b
movb $0x0, %al
callq 0xb890
movl $0x2, %edi
callq 0xb780
movb 0x37(%rsp), %al
addq $0x38, %rsp
retq