// File: /workspace/github_c_makefile_star2_O3/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
movb 0x28(%rax), %cl
cmpb $0x1, 0x3a8(%rax)
jne 0xc3297
testb $0x1, %cl
jne 0xc3297
cmpq $0x1, 0x40(%rax)
jne 0xc3297
cmpb $0x0, 0x65(%r14)
je 0xc337a
testb $0x1, %cl
je 0xc32c6
leaq 0x48(%r14), %r15
cmpb $0x1, 0x58(%r14)
jne 0xc32ce
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movb $0x0, 0x58(%r14)
movb 0x64(%r14), %cl
cmpb $0x1, 0x62(%r14)
jne 0xc3320
movb $0x1, %al
testb %cl, %cl
je 0xc32c8
jmp 0xc3326
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc3472
movq 0x68(%r14), %rcx
movq (%rcx), %rsi
cmpb $0x1, 0x3a8(%rsi)
jne 0xc32c8
movb 0x62(%r14), %cl
testb %cl, %cl
jne 0xc3407
testb %al, %al
je 0xc3394
movq 0x8(%rbx), %rdx
movb $0x1, %al
cmpq 0x30(%rsi), %rdx
jne 0xc340f
movq %rbx, %rdi
callq 0x7e19f
addq %rax, 0x8(%rbx)
movb $0x1, 0x63(%r14)
jmp 0xc338d
movb $0x1, %al
testb %cl, %cl
jne 0xc32c8
movq 0x68(%r14), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xc3463
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 0xc32c8
movq %rcx, %rdi
subq %rsi, %rdi
subq %rdx, %rcx
movq %rcx, 0x8(%rbx)
movq %rdi, (%rbx)
jmp 0xc32c8
movq 0x30(%rax), %rax
movq %rax, (%rbx)
incq %rax
movq %rax, 0x8(%rbx)
movb $0x1, 0x65(%r14)
movb $0x1, %al
jmp 0xc32c8
movzbl 0x60(%r14), %edx
xorl $0x1, %edx
movb %dl, 0x60(%r14)
movq 0x30(%rsi), %rcx
movq %r14, %rdi
callq 0xc30b5
cmpb $0x1, 0x63(%r14)
jne 0xc33c6
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc3472
testb %al, %al
je 0xc346d
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc3472
cmpb $0x0, 0x63(%r14)
jne 0xc3400
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)
movb $0x1, %cl
testb %al, %al
je 0xc32c8
movb 0x64(%r14), %dl
testb %cl, %cl
je 0xc3421
testb %dl, %dl
je 0xc32c8
jmp 0xc3429
testb %dl, %dl
jne 0xc32c8
testq %rbx, %rbx
je 0xc3468
movq 0x68(%r14), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0xc3468
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 0xc335c
callq 0x2af95
callq 0x2af5c
callq 0x2af23