// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_get_decoded_char
char gt_encseq_get_decoded_char(const GtEncseq *encseq, GtUword pos,
                                GtReadmode readmode)
{
  char cc;
  GtUchar mycc;
  gt_assert(encseq != NULL && encseq->alpha);
  gt_assert(pos < encseq->logicaltotallength);
  mycc = gt_encseq_get_encoded_char(encseq, pos, readmode);
  if (mycc != (GtUchar) GT_SEPARATOR) {
    if (GT_ISDIRREVERSE(readmode))
      pos = GT_REVERSEPOS(encseq->logicaltotallength, pos);
    if (encseq->has_exceptiontable) {
      GtUword mappos = GT_UNDEF_UWORD;
      if (pos > encseq->totallength) {
        pos = GT_REVERSEPOS(encseq->totallength, pos - encseq->totallength - 1);
        gt_readmode_invert(readmode);
      }
      if (encseq->specialcharinfo.realexceptionranges >  0UL
            && encseq->getexceptionmapping(encseq, &mappos, pos)) {
        /* 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(encseq->exceptions,
                                                            (BitOffset) mappos);
        gt_assert(subalphcode < encseq->maxsubalphasize);
        /* and map it back to the original character */
        cc = encseq->allchars[encseq->classstartpositions[mycc] + subalphcode];
        if (GT_ISDIRCOMPLEMENT(readmode))
          (void) gt_complement(&cc, cc, NULL);
      } else {
        /* otherwise return most frequent character */
        cc = encseq->maxchars[mycc];
      }
    } else {
      /* we do not have lossless support, decode to class printable */
      cc = gt_alphabet_decode(encseq->alpha, mycc);
    }
  } else {
    cc = (char) mycc;
  }

  return cc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0xbf373
movq %rdi, %rbx
cmpq $0x0, 0x220(%rdi)
je 0xbf373
movq %rsi, %r14
cmpq %rsi, 0x38(%rbx)
jbe 0xbf378
movl %edx, %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbef7c
movl %eax, %ebp
cmpb $-0x1, %al
je 0xbf337
movl %r15d, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0xbf259
notq %r14
addq 0x38(%rbx), %r14
cmpb $0x1, 0x2f0(%rbx)
jne 0xbf33e
movq $-0x1, 0x8(%rsp)
movq 0x30(%rbx), %rax
movl $0x3, %r12d
subl %r15d, %r12d
cmpq %rax, %r14
cmovbel %r15d, %r12d
cmpq $0x0, 0x1e0(%rbx)
je 0xbf350
leaq (%rax,%rax), %rdx
subq %r14, %rdx
cmpq %rax, %r14
cmovbeq %r14, %rdx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq *0x150(%rbx)
testb %al, %al
je 0xbf350
movq 0x330(%rbx), %rax
testq %rax, %rax
je 0xbf37d
movq 0x8(%rsp), %rsi
cmpq %rsi, 0x8(%rax)
jbe 0xbf37d
movl 0x10(%rax), %edx
cmpq $0x21, %rdx
jae 0xbf37d
movq (%rax), %rdi
imulq %rdx, %rsi
callq 0xdda90
movzbl %al, %eax
movzbl 0x360(%rbx), %ecx
cmpl %ecx, %eax
jae 0xbf382
movq 0x338(%rbx), %rcx
movq 0x350(%rbx), %rdx
movzbl %bpl, %esi
addq (%rcx,%rsi,8), %rdx
movb (%rax,%rdx), %al
movb %al, 0x7(%rsp)
andl $-0x2, %r12d
cmpl $0x2, %r12d
jne 0xbf362
movsbl %al, %esi
leaq 0x7(%rsp), %rdi
xorl %edx, %edx
callq 0xbe154
jmp 0xbf362
movb %bpl, 0x7(%rsp)
jmp 0xbf362
movq 0x220(%rbx), %rdi
movzbl %bpl, %esi
callq 0xb9d4b
jmp 0xbf35e
movq 0x348(%rbx), %rax
movzbl %bpl, %ecx
movb (%rax,%rcx), %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x2a3d1
callq 0x2a328
callq 0x2a39a
callq 0x2a361