// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
testq %rdi, %rdi
je 0xc2151
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x28(%rsi)
jne 0xc205e
cmpb $0x1, 0x3a8(%r14)
jne 0xc2151
cmpq $0x2, 0x48(%r14)
jne 0xc2151
xorl %eax, %eax
movb %al, 0x61(%rbx)
movb %al, 0x10(%rbx)
movb %al, 0x28(%rbx)
movb %al, 0x58(%rbx)
movb %al, 0x40(%rbx)
movq $0x0, 0x70(%rbx)
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0xc2085
callq 0xc0543
xorb $0x1, %bpl
movzbl %bpl, %ebp
leaq 0x40996(%rip), %rdx     # 0x102a2a
movl $0x1, %edi
movl $0x38, %esi
movl $0xc5e, %ecx            # imm = 0xC5E
callq 0x3601f
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %r15, %rcx
callq 0xc0212
movq %r12, 0x68(%rbx)
movl 0x8(%r12), %ecx
movl %ecx, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
setne 0x60(%rbx)
cmpl $0x2, %ecx
jne 0xc20e5
movl $0x0, 0x8(%r12)
cmpl $0x3, 0x8(%r12)
jne 0xc20f6
movl $0x1, 0x8(%r12)
cmpb $0x0, 0x3a9(%r14)
jne 0xc2148
cmpl $0x1, %eax
je 0xc210f
movq $0x0, 0x78(%rbx)
jmp 0xc2148
movq 0x30(%r14), %rax
decq %rax
movq %rax, 0x78(%rbx)
cmpl $0x3, (%r14)
jne 0xc2148
movq (%r12), %rcx
movq 0x2b0(%rcx), %rcx
movq %rax, %rdx
shrq $0x6, %rdx
cmpq $0x0, (%rcx,%rdx,8)
jne 0xc2148
movl %eax, %ecx
notl %ecx
orq $-0x40, %rcx
addq %rax, %rcx
movq %rcx, 0x78(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x2b0e5