// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/encseq.c
// Function: gt_specialrangeiterator_reinit_with_startpos
void gt_specialrangeiterator_reinit_with_startpos(GtSpecialrangeiterator *sri,
                                                  const GtEncseq *encseq,
                                                  bool moveforward,
                                                  GtUword startpos)
{
  gt_assert(sri != NULL && (encseq->has_specialranges
              || (encseq->hasmirror
                    && encseq->logicalnumofdbsequences == 2UL)));
  sri->exhausted = false;
  sri->previous.defined = false;
  sri->wildcard.defined = false;
  sri->queued.defined = false;
  sri->ssptab.defined = false;
  sri->lengthofspecialrange = 0;
  if (sri->esr != NULL)
    gt_encseq_reader_delete(sri->esr);
  sri->esr = gt_encseq_create_reader_with_readmode(encseq,
                                                   moveforward
                                                     ? GT_READMODE_FORWARD
                                                     : GT_READMODE_REVERSE,
                                                   startpos);

  /* the reader initialization may have changed the direction! so reevaluate. */
  sri->moveforward = !GT_ISDIRREVERSE(sri->esr->readmode);

  if (sri->esr->readmode == GT_READMODE_COMPL)
    sri->esr->readmode = GT_READMODE_FORWARD;
  if (sri->esr->readmode == GT_READMODE_REVCOMPL)
    sri->esr->readmode = GT_READMODE_REVERSE;

  /* for satviautables we do not need sri->jumppos and therefore we do not
     initialize it. */
  if (!encseq->accesstype_via_utables) {
    if (sri->moveforward)
      sri->jumppos = 0;
     else {
      sri->jumppos = encseq->totallength-1;
      if (encseq->sat == GT_ACCESS_TYPE_BITACCESS &&
          GT_BITNUM2WORD(sri->esr->encseq->specialbits, sri->jumppos) == 0) {
        sri->jumppos -= (GT_MODWORDSIZE(sri->jumppos) + 1);
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xc31e8
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x28(%rsi)
jne 0xc30f3
cmpb $0x1, 0x3a8(%r14)
jne 0xc31e8
cmpq $0x2, 0x48(%r14)
jne 0xc31e8
xorl %r13d, %r13d
movb %r13b, 0x61(%rbx)
movb %r13b, 0x10(%rbx)
movb %r13b, 0x28(%rbx)
movb %r13b, 0x58(%rbx)
movb %r13b, 0x40(%rbx)
movq $0x0, 0x70(%rbx)
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0xc3120
callq 0xc15cc
xorb $0x1, %bpl
movzbl %bpl, %ebp
leaq 0x3f7eb(%rip), %rdx     # 0x10291a
movl $0x1, %edi
movl $0x38, %esi
movl $0xc5e, %ecx            # imm = 0xC5E
callq 0x359a6
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %r15, %rcx
callq 0xc12b5
movq %r12, 0x68(%rbx)
movl 0x8(%r12), %ecx
movl %ecx, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
setne 0x60(%rbx)
cmpl $0x2, %ecx
je 0xc3182
cmpl $0x3, %ecx
jne 0xc3187
movl $0x1, %r13d
movl %r13d, 0x8(%r12)
cmpb $0x0, 0x3a9(%r14)
jne 0xc31d9
cmpl $0x1, %eax
je 0xc31a0
movq $0x0, 0x78(%rbx)
jmp 0xc31d9
movq 0x30(%r14), %rax
decq %rax
movq %rax, 0x78(%rbx)
cmpl $0x3, (%r14)
jne 0xc31d9
movq (%r12), %rcx
movq 0x2b0(%rcx), %rcx
movq %rax, %rdx
shrq $0x6, %rdx
cmpq $0x0, (%rcx,%rdx,8)
jne 0xc31d9
movl %eax, %ecx
notl %ecx
orq $-0x40, %rcx
addq %rax, %rcx
movq %rcx, 0x78(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2aeb1