// File: /workspace/github_c_makefile_star2_O3/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 0xc037f
movq %rdi, %rbx
cmpq $0x0, 0x220(%rdi)
je 0xc037f
movq %rsi, %r14
cmpq %rsi, 0x38(%rbx)
jbe 0xc0384
movl %edx, %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbff84
cmpb $-0x1, %al
je 0xc0344
movl %eax, %ebp
movl %r15d, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0xc0261
notq %r14
addq 0x38(%rbx), %r14
cmpb $0x1, 0x2f0(%rbx)
jne 0xc0348
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 0xc0364
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 0xc0364
movq 0x330(%rbx), %rax
testq %rax, %rax
je 0xc0389
movq 0x8(%rsp), %rsi
cmpq %rsi, 0x8(%rax)
jbe 0xc0389
movl 0x10(%rax), %edx
cmpq $0x21, %rdx
jae 0xc0389
movq (%rax), %rdi
imulq %rdx, %rsi
callq 0xde1d4
movzbl %al, %eax
movzbl 0x360(%rbx), %ecx
cmpl %ecx, %eax
jae 0xc038e
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 0xc0372
movsbl %al, %esi
leaq 0x7(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0xbf1e4
movb (%rbx), %al
jmp 0xc0372
movb $-0x1, %al
jmp 0xc0372
movq 0x220(%rbx), %rdi
movzbl %bpl, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xbae5f
movq 0x348(%rbx), %rax
movzbl %bpl, %ecx
movb (%rax,%rcx), %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x2a1d6
callq 0x2a12d
callq 0x2a19f
callq 0x2a166