// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_extract2bitencwithtwobitencodingstoppos
GtUword gt_encseq_extract2bitencwithtwobitencodingstoppos(
                                         GtEndofTwobitencoding *ptbe,
                                         GtEncseqReader *esr,
                                         const GtEncseq *encseq,
                                         GtReadmode readmode,
                                         GtUword pos)
{
  GtUword twobitencodingstoppos, ret;
  bool fwd;

  gt_assert(pos < encseq->logicaltotallength);
  fwd = GT_ISDIRREVERSE(readmode) ? false : true;
  gt_encseq_reader_reinit_with_readmode(esr, encseq, readmode, pos);
  if (gt_encseq_has_twobitencoding_stoppos_support(encseq)) {
    twobitencodingstoppos = gt_getnexttwobitencodingstoppos(fwd, esr);
  }
  else {
    twobitencodingstoppos = GT_TWOBITENCODINGSTOPPOSUNDEF(encseq);
  }
  if (GT_ISDIRREVERSE(readmode)) {
    pos = GT_REVERSEPOS(encseq->logicaltotallength, pos);
  }
  ret = gt_encseq_extract2bitenc(ptbe, encseq, fwd, pos, twobitencodingstoppos);

  /* XXX: may be less efficient, but just assigning ret to esr->currentpos may
     not reflect the real reading direction! */
  if (ret < encseq->logicaltotallength) {
    gt_encseq_reader_reinit_with_readmode(esr, encseq, readmode, ret);
  }
  return ret;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movl %ecx, 0x2c(%rsp)
movq %r8, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jb 0x11d714
movq 0x968f5(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x40979(%rip), %rsi     # 0x15e066
leaq 0x67fd4(%rip), %rdx     # 0x1856c8
leaq 0x68fbf(%rip), %rcx     # 0x1866ba
leaq 0x67f5c(%rip), %r8      # 0x18565e
movl $0x185f, %r9d           # imm = 0x185F
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x11d716
movb $0x1, %al
cmpl $0x1, 0x2c(%rsp)
movb %al, 0xe(%rsp)
je 0x11d72f
cmpl $0x3, 0x2c(%rsp)
sete %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0xf(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x2c(%rsp), %edx
movq 0x20(%rsp), %rcx
callq 0x115f90
movq 0x30(%rsp), %rdi
callq 0x116950
testb $0x1, %al
jne 0x11d774
jmp 0x11d78e
movb 0xf(%rsp), %al
movq 0x38(%rsp), %rsi
andb $0x1, %al
movzbl %al, %edi
callq 0x11d360
movq %rax, 0x18(%rsp)
jmp 0x11d7c1
movq 0x30(%rsp), %rax
testb $0x1, 0x3a8(%rax)
je 0x11d7ab
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, (%rsp)
jmp 0x11d7b8
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x18(%rsp)
cmpl $0x1, 0x2c(%rsp)
je 0x11d7cf
cmpl $0x3, 0x2c(%rsp)
jne 0x11d7e6
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
subq $0x1, %rax
subq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rsi
movb 0xf(%rsp), %al
movq 0x20(%rsp), %rcx
movq 0x18(%rsp), %r8
andb $0x1, %al
movzbl %al, %edx
callq 0x11d840
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x11d835
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x2c(%rsp), %edx
movq 0x10(%rsp), %rcx
callq 0x115f90
movq 0x10(%rsp), %rax
addq $0x48, %rsp
retq
nop