// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/encseq.c
// Function: gt_specialrangeiterator_next
bool gt_specialrangeiterator_next(GtSpecialrangeiterator *sri, GtRange *range)
{
  bool retval;

  /* handle special case where only one sequence is mirrored w/o wildcards  */
  if (sri->esr->encseq->hasmirror
        && !sri->esr->encseq->has_specialranges
        && sri->esr->encseq->numofdbsequences == 1UL
        && !sri->middle_separator_emitted) {
    range->start = sri->esr->encseq->totallength;
    range->end = range->start + 1;
    sri->middle_separator_emitted = true;
    return true;
  }

  if (!sri->esr->encseq->has_specialranges)
    return false;
  if (sri->queued.defined) {
    *range = sri->queued.rng;
    sri->queued.defined = false;
    if ((sri->reflected && sri->originalmoveforward)
         || (!sri->reflected && !sri->originalmoveforward)) {
      gt_specialrangeiterator_invert_range(sri->esr->encseq,
                                           range);
    }
    return true;
  }
  retval = gt_specialrangeiterator_deliver_range(sri, range);

  if (sri->esr->encseq->hasmirror) {
    if (!sri->reflected) {
      if (retval && range->end == sri->esr->encseq->totallength) {
        /* the last range was at end of sequence -> in the mirrored version we
           will have a separator plus the wildcard complement */
        range->end += gt_range_length(range);
        sri->skipnext = true;
        return true;
      }

      if (!retval) {
        /* turn around */
        sri->moveforward = !sri->moveforward;
        gt_specialrangeiterator_reinit_with_startpos(sri, sri->esr->encseq,
                                                 sri->moveforward,
                                                 sri->esr->encseq->totallength);
        if (sri->skipnext) {
          retval = gt_specialrangeiterator_deliver_range(sri, range);
          gt_assert(retval);
        }
        retval = gt_specialrangeiterator_deliver_range(sri, range);

        if (!sri->skipnext) {
          sri->queued.defined = true;
          /* the virtual separator is isolated */
          sri->queued.rng = *range;
          range->start = sri->esr->encseq->totallength;
          range->end = range->start + 1;
          sri->skipnext = false;
          retval = true;
        }
        sri->reflected = true;
      }
    }
    if (retval && ((sri->reflected && sri->originalmoveforward)
         || (!sri->reflected && !sri->originalmoveforward))) {
      gt_specialrangeiterator_invert_range(sri->esr->encseq,
                                           range);
    }
  }

  return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x68(%rdi), %rax
movq (%rax), %rax
movb 0x28(%rax), %cl
cmpb $0x1, 0x3a8(%rax)
jne 0xa5cae
testb $0x1, %cl
jne 0xa5cae
cmpq $0x1, 0x40(%rax)
jne 0xa5cae
cmpb $0x0, 0x65(%r14)
je 0xa5d53
testb $0x1, %cl
je 0xa5ce2
leaq 0x48(%r14), %r15
cmpb $0x1, 0x58(%r14)
jne 0xa5ce9
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movb $0x0, 0x58(%r14)
movb 0x64(%r14), %al
cmpb $0x1, 0x62(%r14)
jne 0xa5d3b
movb $0x1, %bpl
testb %al, %al
je 0xa5d69
jmp 0xa5d42
xorl %ebp, %ebp
jmp 0xa5d69
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa5ed6
movl %eax, %ebp
movq 0x68(%r14), %rax
movq (%rax), %rsi
cmpb $0x1, 0x3a8(%rsi)
jne 0xa5d69
movb 0x62(%r14), %al
testb %al, %al
jne 0xa5dea
testb %bpl, %bpl
je 0xa5d76
movq 0x8(%rbx), %rcx
movb $0x1, %bpl
cmpq 0x30(%rsi), %rcx
jne 0xa5df3
movq %rbx, %rdi
callq 0x5d05e
addq %rax, 0x8(%rbx)
movb $0x1, 0x63(%r14)
jmp 0xa5d66
movb $0x1, %bpl
testb %al, %al
jne 0xa5d69
movq 0x68(%r14), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0xa5e59
jmp 0xa5d66
movq 0x30(%rax), %rax
movq %rax, (%rbx)
incq %rax
movq %rax, 0x8(%rbx)
movb $0x1, 0x65(%r14)
movb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x60(%r14), %edx
xorl $0x1, %edx
movb %dl, 0x60(%r14)
movq 0x30(%rsi), %rcx
movq %r14, %rdi
callq 0xa5aa9
cmpb $0x1, 0x63(%r14)
jne 0xa5da4
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa5ed6
testb %al, %al
je 0xa5e21
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa5ed6
cmpb $0x0, 0x63(%r14)
je 0xa5dba
movl %eax, %ebp
jmp 0xa5de3
movb $0x1, 0x58(%r14)
movups (%rbx), %xmm0
movups %xmm0, (%r15)
movq 0x68(%r14), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
movq %rax, (%rbx)
incq %rax
movq %rax, 0x8(%rbx)
movb $0x0, 0x63(%r14)
movb $0x1, %bpl
movb $0x1, 0x62(%r14)
movb $0x1, %al
testb %bpl, %bpl
je 0xa5d69
movb 0x64(%r14), %cl
testb %al, %al
je 0xa5e05
testb %cl, %cl
je 0xa5d69
jmp 0xa5e0d
testb %cl, %cl
jne 0xa5d69
movq 0x68(%r14), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0xa5e59
jmp 0xa5d69
movq 0x88190(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x24234(%rip), %rsi     # 0xca066
leaq 0x4667c(%rip), %rdx     # 0xec4b5
leaq 0x4667c(%rip), %rcx     # 0xec4bc
leaq 0x45d53(%rip), %r8      # 0xebb9a
movl $0xed0, %r9d            # imm = 0xED0
xorl %eax, %eax
callq 0xb8c0
callq 0xb300