// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, 0x61(%rdx)
je 0xb42e3
xorl %r15d, %r15d
jmp 0xb43c9
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r15d, %r15d
pushq $0x1
popq %r12
pushq $-0x1
popq %r13
testb $0x1, %r15b
jne 0xb43c9
movq 0x68(%rbx), %rax
movq (%rax), %rdi
testb %bpl, %bpl
je 0xb431c
movq 0x290(%rdi), %rax
movq 0x78(%rbx), %rcx
movb (%rax,%rcx), %al
jmp 0xb4325
movq 0x78(%rbx), %rsi
callq 0xa2358
movq 0x70(%rbx), %rcx
cmpb $-0x2, %al
jb 0xb4339
incq %rcx
movq %rcx, 0x70(%rbx)
movb 0x60(%rbx), %al
jmp 0xb436f
movb 0x60(%rbx), %al
testq %rcx, %rcx
je 0xb436d
movq 0x78(%rbx), %rdx
testb $0x1, %al
je 0xb4354
movq %rdx, %rsi
subq %rcx, %rsi
movq %rsi, (%r14)
jmp 0xb4361
leaq 0x1(%rdx), %rsi
movq %rsi, (%r14)
addq %rcx, %rdx
incq %rdx
movq %rdx, 0x8(%r14)
andq $0x0, 0x70(%rbx)
movb $0x1, %r15b
xorl %ecx, %ecx
movq 0x78(%rbx), %rdx
testb $0x1, %al
je 0xb4390
movq 0x68(%rbx), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
leaq -0x1(%rax), %rdi
movq %r12, %rsi
cmpq %rdi, %rdx
jne 0xb4398
jmp 0xb43a4
movq %r13, %rsi
testq %rdx, %rdx
je 0xb43b1
addq %rsi, %rdx
movq %rdx, 0x78(%rbx)
jmp 0xb42f6
testq %rcx, %rcx
je 0xb43c5
movq %rax, %rdx
subq %rcx, %rdx
jmp 0xb43bb
testq %rcx, %rcx
je 0xb43c5
xorl %edx, %edx
movq %rcx, %rax
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 %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq