// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/core/encseq.c
// Function: revextract2bitenc
static GtUword revextract2bitenc(GtEndofTwobitencoding *ptbe,
                                       const GtEncseq *encseq,
                                       GtUword currentpos,
                                       GtUword twobitencodingstoppos)
{
  gt_assert(encseq != NULL && currentpos < encseq->totallength);
  if (encseq->sat != GT_ACCESS_TYPE_BITACCESS) {
    if (currentpos >= twobitencodingstoppos) {
      if (currentpos - twobitencodingstoppos + 1 >
          (GtUword) GT_UNITSIN2BITENC) {
        ptbe->unitsnotspecial = (unsigned int) GT_UNITSIN2BITENC;
      }
      else {
        ptbe->unitsnotspecial
          = (unsigned int) (currentpos - twobitencodingstoppos + 1);
      }
      ptbe->tbe = calctbereverse(encseq->twobitencoding, currentpos);
    }
    else {
      ptbe->unitsnotspecial = 0;
      ptbe->tbe = 0;
    }
  }
  else {
    if (gt_encseq_has_specialranges(encseq)) {
      GtBitsequence spbits;

      spbits = revextractspecialbits(encseq->specialbits, currentpos);
      ptbe->unitsnotspecial = revbitaccessunitsnotspecial(spbits, currentpos);
    }
    else {
      ptbe->unitsnotspecial = revbitaccessunitsnotspecial0(currentpos);
    }
    if (ptbe->unitsnotspecial == 0) {
      ptbe->tbe = 0;
    }
    else {
      ptbe->tbe = calctbereverse(encseq->twobitencoding, currentpos);
    }
  }
  if (currentpos > (GtUword) GT_UNITSIN2BITENC) {
    return currentpos - (GtUword) GT_UNITSIN2BITENC;
  }
  else {
    return 0;
  }
}

// Assembly:
testq %rsi, %rsi
je 0xcebd5
cmpq %rdx, 0x30(%rsi)
jbe 0xcebd5
cmpl $0x3, (%rsi)
jne 0xceade
cmpb $0x1, 0x3a8(%rsi)
jne 0xceaac
cmpb $0x1, 0x28(%rsi)
jne 0xceab6
cmpb $0x1, 0x28(%rsi)
jne 0xceb4b
movq 0x2b0(%rsi), %r9
movl %edx, %eax
andl $0x3f, %eax
movq %rdx, %r10
shrq $0x6, %r10
movq (%r9,%r10,8), %r8
movl %eax, %ecx
notb %cl
shrq %cl, %r8
cmpl $0x20, %eax
jb 0xceb07
movl %r8d, %r8d
jmp 0xceb20
movq %rdx, %rax
subq %rcx, %rax
jae 0xceaf2
movl $0x0, 0x8(%rdi)
jmp 0xceba1
incq %rax
cmpq $0x20, %rax
movl $0x20, %ecx
cmovbq %rax, %rcx
movl %ecx, 0x8(%rdi)
jmp 0xceb63
cmpq $0x40, %rdx
jb 0xceb20
movq -0x8(%r9,%r10,8), %r9
incb %al
movl %eax, %ecx
shlq %cl, %r9
andl $-0x2, %r9d
orq %r9, %r8
testq %r8, %r8
je 0xceb4b
testl %r8d, %r8d
je 0xcebb1
movl %r8d, %eax
negl %eax
andl %r8d, %eax
imull $0x77cb531, %eax, %eax  # imm = 0x77CB531
shrl $0x1b, %eax
leaq 0x33d2a(%rip), %rcx     # 0x102870
movl (%rcx,%rax,4), %eax
jmp 0xceb5c
leaq 0x1(%rdx), %rcx
cmpq $0x20, %rcx
movl $0x20, %eax
cmovbq %rcx, %rax
movl %eax, 0x8(%rdi)
testl %eax, %eax
je 0xceba1
movq 0x280(%rsi), %r8
movl %edx, %eax
andl $0x1f, %eax
movq %rdx, %r9
shrq $0x5, %r9
movq (%r8,%r9,8), %rsi
cmpq $0x1f, %rax
je 0xceba3
addl %eax, %eax
movl %eax, %ecx
xorb $0x3e, %cl
shrq %cl, %rsi
cmpq $0x20, %rdx
jb 0xceba3
movq -0x8(%r8,%r9,8), %r8
addb $0x2, %al
movl %eax, %ecx
shlq %cl, %r8
orq %r8, %rsi
jmp 0xceba3
xorl %esi, %esi
movq %rsi, (%rdi)
xorl %eax, %eax
subq $0x20, %rdx
cmovaeq %rdx, %rax
retq
shrq $0x20, %r8
movl %r8d, %eax
negl %eax
andl %r8d, %eax
imull $0x77cb531, %eax, %eax  # imm = 0x77CB531
shrl $0x1b, %eax
leaq 0x33ca3(%rip), %rcx     # 0x102870
movl (%rcx,%rax,4), %eax
addl $0x20, %eax
jmp 0xceb5c
pushq %rax
callq 0x2f0b2