// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movb %dl, %al
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
andb $0x1, %al
movb %al, 0x17(%rsp)
movq %rcx, 0x8(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x119618
movq 0x18(%rsp), %rax
testb $0x1, 0x28(%rax)
jne 0x119650
movq 0x18(%rsp), %rax
testb $0x1, 0x3a8(%rax)
je 0x119618
movq 0x18(%rsp), %rax
cmpq $0x2, 0x48(%rax)
je 0x119650
movq 0x9a9b9(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x44a3d(%rip), %rsi     # 0x15e066
leaq 0x6c845(%rip), %rdx     # 0x185e75
leaq 0x6c8aa(%rip), %rcx     # 0x185ee1
leaq 0x6c020(%rip), %r8      # 0x18565e
movl $0xd0a, %r9d            # imm = 0xD0A
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x119652
movq 0x20(%rsp), %rax
movb $0x0, 0x61(%rax)
movq 0x20(%rsp), %rax
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rax
movb $0x0, 0x28(%rax)
movq 0x20(%rsp), %rax
movb $0x0, 0x58(%rax)
movq 0x20(%rsp), %rax
movb $0x0, 0x40(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x70(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x68(%rax)
je 0x1196a6
movq 0x20(%rsp), %rax
movq 0x68(%rax), %rdi
callq 0x1165d0
movq 0x18(%rsp), %rdi
movb 0x17(%rsp), %cl
movl $0x1, %esi
xorl %eax, %eax
testb $0x1, %cl
cmovnel %eax, %esi
movq 0x8(%rsp), %rdx
callq 0x116560
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0x20(%rsp), %rax
movq 0x68(%rax), %rcx
movb $0x1, %al
cmpl $0x1, 0x8(%rcx)
movb %al, 0x7(%rsp)
je 0x1196fb
movq 0x20(%rsp), %rax
movq 0x68(%rax), %rax
cmpl $0x3, 0x8(%rax)
sete %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %cl
xorb $-0x1, %cl
movq 0x20(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x60(%rax)
movq 0x20(%rsp), %rax
movq 0x68(%rax), %rax
cmpl $0x2, 0x8(%rax)
jne 0x11972c
movq 0x20(%rsp), %rax
movq 0x68(%rax), %rax
movl $0x0, 0x8(%rax)
movq 0x20(%rsp), %rax
movq 0x68(%rax), %rax
cmpl $0x3, 0x8(%rax)
jne 0x11974b
movq 0x20(%rsp), %rax
movq 0x68(%rax), %rax
movl $0x1, 0x8(%rax)
movq 0x18(%rsp), %rax
testb $0x1, 0x3a9(%rax)
jne 0x1197e3
movq 0x20(%rsp), %rax
testb $0x1, 0x60(%rax)
je 0x119777
movq 0x20(%rsp), %rax
movq $0x0, 0x78(%rax)
jmp 0x1197e1
movq 0x18(%rsp), %rax
movq 0x30(%rax), %rcx
subq $0x1, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x78(%rax)
movq 0x18(%rsp), %rax
cmpl $0x3, (%rax)
jne 0x1197df
movq 0x20(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
movq 0x2b0(%rax), %rax
movq 0x20(%rsp), %rcx
movq 0x78(%rcx), %rcx
shrq $0x6, %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x1197df
movq 0x20(%rsp), %rax
movq 0x78(%rax), %rdx
andq $0x3f, %rdx
addq $0x1, %rdx
movq 0x20(%rsp), %rax
movq 0x78(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x78(%rax)
jmp 0x1197e1
jmp 0x1197e3
addq $0x28, %rsp
retq
nopl (%rax,%rax)