// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: gt_encseq_extract2bitencvector
unsigned int gt_encseq_extract2bitencvector(
                                       GtArrayGtTwobitencoding *tbereservoir,
                                       const GtEncseq *encseq,
                                       GtEncseqReader *esr,
                                       GtReadmode readmode,
                                       GtUword pos,
                                       bool withstoppos,
                                       GtUword stoppos)
{
  GtEndofTwobitencoding etbecurrent;
  GtUword twobitencodingstoppos;
  unsigned int offset;
  bool fwd;

  if (pos == encseq->totallength || pos == encseq->logicaltotallength ||
      (withstoppos && pos >= stoppos)) {
    return 0;
  }
  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 {
    gt_assert(!withstoppos);
    twobitencodingstoppos = fwd ? GT_TWOBITENCODINGSTOPPOSUNDEF(encseq) : 0;
  }
  if (withstoppos) {
    if (fwd) {
      if (twobitencodingstoppos > stoppos) {
        twobitencodingstoppos = stoppos;
      }
    }
    else {
      if (stoppos < encseq->logicaltotallength) {
        stoppos = GT_REVERSEPOS(encseq->logicaltotallength, stoppos);
        if (twobitencodingstoppos < stoppos) {
          twobitencodingstoppos = stoppos;
        }
      }
    }
  }
  if (GT_ISDIRREVERSE(readmode)) {
    pos = GT_REVERSEPOS(encseq->logicaltotallength, pos);
  }
  for (offset = 0; /* Nothing */;
       offset += (unsigned int) GT_UNITSIN2BITENC) {
    if (fwd) {
      if (pos == twobitencodingstoppos) {
        return offset;
      }
    }
    else {
      if (pos < twobitencodingstoppos) {
        return offset;
      }
    }
    (void) gt_encseq_extract2bitenc(&etbecurrent, encseq, fwd, pos,
                                    twobitencodingstoppos);
    GT_STOREINARRAY(tbereservoir, GtTwobitencoding, 32UL, etbecurrent.tbe);
    if (etbecurrent.unitsnotspecial < (unsigned int) GT_UNITSIN2BITENC) {
      return offset + etbecurrent.unitsnotspecial;
    }
    if (fwd) {
      pos += GT_UNITSIN2BITENC;
    }
    else {
      if (pos >= (GtUword) GT_UNITSIN2BITENC) {
        pos -= (GtUword) GT_UNITSIN2BITENC;
      }
      else {
        return offset + etbecurrent.unitsnotspecial;
      }
    }
  }
  /*@ignore@*/
  return 0;
  /*@end@*/
}

// Assembly:
subq $0x88, %rsp
movb %r9b, %al
movq 0x90(%rsp), %r9
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdx, 0x68(%rsp)
movl %ecx, 0x64(%rsp)
movq %r8, 0x58(%rsp)
andb $0x1, %al
movb %al, 0x57(%rsp)
movq 0x58(%rsp), %rax
movq 0x70(%rsp), %rcx
cmpq 0x30(%rcx), %rax
je 0x11dac6
movq 0x58(%rsp), %rax
movq 0x70(%rsp), %rcx
cmpq 0x38(%rcx), %rax
je 0x11dac6
testb $0x1, 0x57(%rsp)
je 0x11dad6
movq 0x58(%rsp), %rax
cmpq 0x90(%rsp), %rax
jb 0x11dad6
movl $0x0, 0x84(%rsp)
jmp 0x11de7d
movb $0x1, %al
cmpl $0x1, 0x64(%rsp)
movb %al, 0x1f(%rsp)
je 0x11daef
cmpl $0x3, 0x64(%rsp)
sete %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x2b(%rsp)
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
movl 0x64(%rsp), %edx
movq 0x58(%rsp), %rcx
callq 0x115f90
movq 0x70(%rsp), %rdi
callq 0x116950
testb $0x1, %al
jne 0x11db34
jmp 0x11db51
movb 0x2b(%rsp), %al
movq 0x68(%rsp), %rsi
andb $0x1, %al
movzbl %al, %edi
callq 0x11d360
movq %rax, 0x30(%rsp)
jmp 0x11dbe6
jmp 0x11db53
testb $0x1, 0x57(%rsp)
je 0x11db92
movq 0x96477(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x404fb(%rip), %rsi     # 0x15e066
leaq 0x68b7a(%rip), %rdx     # 0x1866ec
leaq 0x68b80(%rip), %rcx     # 0x1866f9
leaq 0x67ade(%rip), %r8      # 0x18565e
movl $0x188d, %r9d           # imm = 0x188D
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x11db94
testb $0x1, 0x2b(%rsp)
je 0x11dbd3
movq 0x70(%rsp), %rax
testb $0x1, 0x3a8(%rax)
je 0x11dbb9
movq 0x70(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x11dbc7
movq 0x70(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x11dbdc
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x11dbdc
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
testb $0x1, 0x57(%rsp)
je 0x11dc64
testb $0x1, 0x2b(%rsp)
je 0x11dc12
movq 0x30(%rsp), %rax
cmpq 0x90(%rsp), %rax
jbe 0x11dc10
movq 0x90(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x11dc62
movq 0x90(%rsp), %rax
movq 0x70(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x11dc60
movq 0x70(%rsp), %rax
movq 0x38(%rax), %rax
subq $0x1, %rax
subq 0x90(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x90(%rsp), %rax
jae 0x11dc5e
movq 0x90(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x11dc60
jmp 0x11dc62
jmp 0x11dc64
cmpl $0x1, 0x64(%rsp)
je 0x11dc72
cmpl $0x3, 0x64(%rsp)
jne 0x11dc89
movq 0x70(%rsp), %rax
movq 0x38(%rax), %rax
subq $0x1, %rax
subq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
movl $0x0, 0x2c(%rsp)
testb $0x1, 0x2b(%rsp)
je 0x11dcb6
movq 0x58(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x11dcb4
movl 0x2c(%rsp), %eax
movl %eax, 0x84(%rsp)
jmp 0x11de7d
jmp 0x11dcd4
movq 0x58(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x11dcd2
movl 0x2c(%rsp), %eax
movl %eax, 0x84(%rsp)
jmp 0x11de7d
jmp 0x11dcd4
movq 0x70(%rsp), %rsi
movb 0x2b(%rsp), %al
movq 0x58(%rsp), %rcx
movq 0x30(%rsp), %r8
leaq 0x38(%rsp), %rdi
andb $0x1, %al
movzbl %al, %edx
callq 0x11d840
jmp 0x11dcf8
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq 0x78(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jb 0x11dda3
movq $0x20, 0x20(%rsp)
xorl %eax, %eax
cmpq 0x20(%rsp), %rax
jbe 0x11dd5e
movq 0x962ab(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x4032f(%rip), %rsi     # 0x15e066
leaq 0x5355e(%rip), %rdx     # 0x17129c
leaq 0x689b4(%rip), %rcx     # 0x1866f9
leaq 0x67912(%rip), %r8      # 0x18565e
movl $0x18b0, %r9d           # imm = 0x18B0
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x11dd60
movq 0x20(%rsp), %rcx
movq 0x78(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x78(%rsp), %rax
movq (%rax), %rdi
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
leaq 0x678d0(%rip), %rdx     # 0x18565e
movl $0x18b0, %ecx           # imm = 0x18B0
callq 0xd730
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, (%rax)
jmp 0x11dda5
movq 0x78(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x11dde8
movq 0x96221(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x402a5(%rip), %rsi     # 0x15e066
leaq 0x68950(%rip), %rdx     # 0x186718
leaq 0x6892a(%rip), %rcx     # 0x1866f9
leaq 0x67888(%rip), %r8      # 0x18565e
movl $0x18b0, %r9d           # imm = 0x18B0
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x11ddea
jmp 0x11ddec
movq 0x38(%rsp), %rdx
movq 0x78(%rsp), %rax
movq (%rax), %rax
movq 0x78(%rsp), %rsi
movq 0x10(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x10(%rsi)
movq %rdx, (%rax,%rcx,8)
cmpl $0x20, 0x40(%rsp)
jae 0x11de29
movl 0x2c(%rsp), %eax
addl 0x40(%rsp), %eax
movl %eax, 0x84(%rsp)
jmp 0x11de7d
testb $0x1, 0x2b(%rsp)
je 0x11de40
movq 0x58(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x58(%rsp)
jmp 0x11de6b
cmpq $0x20, 0x58(%rsp)
jb 0x11de58
movq 0x58(%rsp), %rax
subq $0x20, %rax
movq %rax, 0x58(%rsp)
jmp 0x11de69
movl 0x2c(%rsp), %eax
addl 0x40(%rsp), %eax
movl %eax, 0x84(%rsp)
jmp 0x11de7d
jmp 0x11de6b
jmp 0x11de6d
movl 0x2c(%rsp), %eax
addl $0x20, %eax
movl %eax, 0x2c(%rsp)
jmp 0x11dc91
movl 0x84(%rsp), %eax
addq $0x88, %rsp
retq
nopl (%rax)