// File: /workspace/github_c_makefile_star2_O2/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 0xa24f7
movq %rdi, %rbx
cmpq $0x0, 0x220(%rdi)
je 0xa24f7
movq %rsi, %r14
cmpq %rsi, 0x38(%rbx)
jbe 0xa2525
movl %edx, %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa1fd0
cmpb $-0x1, %al
je 0xa24bc
movl %eax, %ebp
movl %r15d, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0xa2405
notq %r14
addq 0x38(%rbx), %r14
cmpb $0x1, 0x2f0(%rbx)
jne 0xa24c0
orq $-0x1, 0x8(%rsp)
movq 0x30(%rbx), %rax
pushq $0x3
popq %r12
subl %r15d, %r12d
cmpq %rax, %r14
cmovbel %r15d, %r12d
cmpq $0x0, 0x1e0(%rbx)
je 0xa24dc
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 0xa24dc
movq 0x330(%rbx), %rdi
movq 0x8(%rsp), %rsi
callq 0xa258b
movzbl %al, %eax
movzbl 0x360(%rbx), %ecx
cmpl %ecx, %eax
jae 0xa255d
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 0xa24ea
movsbl %al, %esi
leaq 0x7(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0xa1140
movb (%rbx), %al
jmp 0xa24ea
movb $-0x1, %al
jmp 0xa24ea
movq 0x220(%rbx), %rdi
movzbl %bpl, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9bed8
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
movq 0x8baba(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x27b5e(%rip), %rsi     # 0xca066
leaq 0x497a2(%rip), %rdx     # 0xebcb1
leaq 0x497bb(%rip), %rcx     # 0xebcd1
leaq 0x4967d(%rip), %r8      # 0xebb9a
movl $0x152, %r9d            # imm = 0x152
jmp 0xa2551
movq 0x8ba8c(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x27b30(%rip), %rsi     # 0xca066
leaq 0x496c7(%rip), %rdx     # 0xebc04
leaq 0x4978d(%rip), %rcx     # 0xebcd1
leaq 0x4964f(%rip), %r8      # 0xebb9a
movl $0x153, %r9d            # imm = 0x153
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0x8ba54(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x27af8(%rip), %rsi     # 0xca066
leaq 0x49777(%rip), %rdx     # 0xebcec
leaq 0x49755(%rip), %rcx     # 0xebcd1
leaq 0x49617(%rip), %r8      # 0xebb9a
movl $0x165, %r9d            # imm = 0x165
jmp 0xa2551