// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/encseq.c
// Function: gt_dabc_specialrangeiterator_next
static bool gt_dabc_specialrangeiterator_next(bool directaccess,
                                              GtRange *range,
                                              GtSpecialrangeiterator *sri)
{
  bool success = false;
  GtUchar cc;

  if (sri->exhausted)
    return false;
  while (!success) {
    if (directaccess)
      cc = sri->esr->encseq->plainseq[sri->jumppos];
    else
      cc = delivercharViabytecompress(sri->esr->encseq, sri->jumppos);
    if (GT_ISSPECIAL(cc))
      sri->lengthofspecialrange++;
    else {
      if (sri->lengthofspecialrange > 0) {
        if (sri->moveforward) {
          range->start = sri->jumppos - sri->lengthofspecialrange;
          range->end = sri->jumppos;
        }
        else {
          range->start = sri->jumppos+1;
          range->end = sri->jumppos+1+sri->lengthofspecialrange;
        }
        success = true;
        sri->lengthofspecialrange = 0;
      }
    }
    if (sri->moveforward) {
      if (sri->jumppos == sri->esr->encseq->totallength - 1) {
        if (sri->lengthofspecialrange > 0) {
          range->start = sri->esr->encseq->totallength -
                         sri->lengthofspecialrange;
          range->end = sri->esr->encseq->totallength;
          success = true;
        }
        sri->exhausted = true;
        break;
      }
      sri->jumppos++;
    }
    else {
      if (sri->jumppos == 0) {
        if (sri->lengthofspecialrange > 0) {
          range->start = 0;
          range->end = sri->lengthofspecialrange;
          success = true;
        }
        sri->exhausted = true;
        break;
      }
      sri->jumppos--;
    }
  }
  return success;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x61(%rdx)
je 0xcf1f3
xorl %r15d, %r15d
jmp 0xcf2d7
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r15d, %r15d
movq 0x68(%rbx), %rax
movq (%rax), %rdi
testb %bpl, %bpl
je 0xcf21a
movq 0x290(%rdi), %rax
movq 0x78(%rbx), %rcx
movb (%rax,%rcx), %al
jmp 0xcf223
movq 0x78(%rbx), %rsi
callq 0xc01af
movq 0x70(%rbx), %rcx
cmpb $-0x2, %al
jb 0xcf237
incq %rcx
movq %rcx, 0x70(%rbx)
movb 0x60(%rbx), %al
jmp 0xcf270
movb 0x60(%rbx), %al
testq %rcx, %rcx
je 0xcf26e
movq 0x78(%rbx), %rdx
testb $0x1, %al
je 0xcf252
movq %rdx, %rsi
subq %rcx, %rsi
movq %rsi, (%r14)
jmp 0xcf25f
leaq 0x1(%rdx), %rsi
movq %rsi, (%r14)
addq %rcx, %rdx
incq %rdx
movq %rdx, 0x8(%r14)
movq $0x0, 0x70(%rbx)
movb $0x1, %r15b
xorl %ecx, %ecx
movq 0x78(%rbx), %rdx
testb $0x1, %al
je 0xcf293
movq 0x68(%rbx), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
leaq -0x1(%rax), %rdi
movl $0x1, %esi
cmpq %rdi, %rdx
jne 0xcf29f
jmp 0xcf2be
movq $-0x1, %rsi
testq %rdx, %rdx
je 0xcf2b2
addq %rsi, %rdx
movq %rdx, 0x78(%rbx)
testb $0x1, %r15b
je 0xcf1fe
jmp 0xcf2d7
testq %rcx, %rcx
je 0xcf2d3
xorl %edx, %edx
movq %rcx, %rax
jmp 0xcf2c9
testq %rcx, %rcx
je 0xcf2d3
movq %rax, %rdx
subq %rcx, %rdx
movq %rdx, (%r14)
movq %rax, 0x8(%r14)
movb $0x1, %r15b
movb $0x1, 0x61(%rbx)
andb $0x1, %r15b
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq