// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x68(%rdi), %rax
movq (%rax), %rax
cmpb $0x1, 0x3a8(%rax)
jne 0xc2208
cmpb $0x0, 0x28(%rax)
jne 0xc2208
cmpq $0x1, 0x40(%rax)
jne 0xc2208
cmpb $0x0, 0x65(%r14)
je 0xc22f1
cmpb $0x1, 0x28(%rax)
jne 0xc22a2
leaq 0x48(%r14), %r15
cmpb $0x1, 0x58(%r14)
jne 0xc22aa
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movb $0x0, 0x58(%r14)
movb 0x62(%r14), %cl
cmpb $0x1, %cl
jne 0xc2243
cmpb $0x0, 0x64(%r14)
jne 0xc224c
movb $0x1, %al
testb %cl, %cl
jne 0xc22a4
movb $0x1, %al
cmpb $0x0, 0x64(%r14)
jne 0xc22a4
testq %rbx, %rbx
je 0xc23e2
movq 0x68(%r14), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xc23e2
movq 0x38(%rax), %rcx
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
movq %rdx, %rdi
notq %rdi
addq %rcx, %rdi
movq %rdi, (%rbx)
movq %rsi, %r8
notq %r8
addq %rcx, %r8
movq %r8, 0x8(%rbx)
movb $0x1, %al
cmpq %rdi, %r8
ja 0xc22a4
movq %rcx, %rdi
subq %rsi, %rdi
subq %rdx, %rcx
movq %rcx, 0x8(%rbx)
movq %rdi, (%rbx)
jmp 0xc22a4
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc23f1
movq 0x68(%r14), %rcx
movq (%rcx), %rsi
cmpb $0x1, 0x3a8(%rsi)
jne 0xc22a4
cmpb $0x0, 0x62(%r14)
jne 0xc237d
testb %al, %al
je 0xc230c
movq 0x8(%rbx), %rcx
cmpq 0x30(%rsi), %rcx
jne 0xc2308
movq %rbx, %rdi
callq 0x7e05b
addq %rax, 0x8(%rbx)
movb $0x1, 0x63(%r14)
jmp 0xc2304
movq 0x30(%rax), %rax
movq %rax, (%rbx)
incq %rax
movq %rax, 0x8(%rbx)
movb $0x1, 0x65(%r14)
movb $0x1, %al
jmp 0xc22a4
testb %al, %al
jne 0xc237d
movzbl 0x60(%r14), %edx
xorl $0x1, %edx
movb %dl, 0x60(%r14)
movq 0x30(%rsi), %rcx
movq %r14, %rdi
callq 0xc2023
cmpb $0x1, 0x63(%r14)
jne 0xc233e
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc23f1
testb %al, %al
je 0xc23ec
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc23f1
cmpb $0x0, 0x63(%r14)
jne 0xc2378
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, %al
movb $0x1, 0x62(%r14)
testb %al, %al
je 0xc22a4
movb 0x62(%r14), %cl
cmpb $0x1, %cl
jne 0xc239d
cmpb $0x0, 0x64(%r14)
jne 0xc23a8
testb %cl, %cl
jne 0xc22a4
cmpb $0x0, 0x64(%r14)
jne 0xc22a4
testq %rbx, %rbx
je 0xc23e7
movq 0x68(%r14), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0xc23e7
movq 0x38(%rcx), %rcx
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
movq %rdx, %rdi
notq %rdi
addq %rcx, %rdi
movq %rdi, (%rbx)
movq %rsi, %r8
notq %r8
addq %rcx, %r8
movq %r8, 0x8(%rbx)
jmp 0xc228b
callq 0x2b202
callq 0x2b1c9
callq 0x2b190