// File: /workspace/github_c_makefile_star2_O2/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 0xa5b9d
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x28(%rsi)
jne 0xa5ae4
cmpb $0x1, 0x3a8(%r14)
jne 0xa5b9d
cmpq $0x2, 0x48(%r14)
jne 0xa5b9d
xorl %r12d, %r12d
movb %r12b, 0x61(%rbx)
movb %r12b, 0x10(%rbx)
movb %r12b, 0x28(%rbx)
movb %r12b, 0x58(%rbx)
movb %r12b, 0x40(%rbx)
andq $0x0, 0x70(%rbx)
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0xa5b0e
callq 0xa3c9a
xorb $0x1, %bpl
movzbl %bpl, %esi
movq %r14, %rdi
movq %r15, %rdx
callq 0xa3c4c
movq %rax, 0x68(%rbx)
movl 0x8(%rax), %edx
movl %edx, %ecx
andl $-0x3, %ecx
cmpl $0x1, %ecx
setne 0x60(%rbx)
cmpl $0x2, %edx
je 0xa5b42
cmpl $0x3, %edx
jne 0xa5b46
pushq $0x1
popq %r12
movl %r12d, 0x8(%rax)
cmpb $0x0, 0x3a9(%r14)
jne 0xa5b94
cmpl $0x1, %ecx
je 0xa5b5c
andq $0x0, 0x78(%rbx)
jmp 0xa5b94
movq 0x30(%r14), %rcx
decq %rcx
movq %rcx, 0x78(%rbx)
cmpl $0x3, (%r14)
jne 0xa5b94
movq (%rax), %rax
movq 0x2b0(%rax), %rax
movq %rcx, %rdx
shrq $0x6, %rdx
cmpq $0x0, (%rax,%rdx,8)
jne 0xa5b94
movl %ecx, %eax
notl %eax
orq $-0x40, %rax
addq %rcx, %rax
movq %rax, 0x78(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x88414(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x244b8(%rip), %rsi     # 0xca066
leaq 0x467f0(%rip), %rdx     # 0xec3a5
leaq 0x46855(%rip), %rcx     # 0xec411
leaq 0x45fd7(%rip), %r8      # 0xebb9a
movl $0xd0a, %r9d            # imm = 0xD0A
xorl %eax, %eax
callq 0xb8c0
callq 0xb300