// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: gt_bitaccess_specialrangeiterator_next
static bool gt_bitaccess_specialrangeiterator_next(GtRange *range,
                                                   GtSpecialrangeiterator *sri)
{
  bool success = false;
  GtBitsequence currentword;

  if (sri->exhausted)
    return false;
  while (!success) {
    currentword = GT_BITNUM2WORD(sri->esr->encseq->specialbits, sri->jumppos);
    if (GT_ISBITSET(currentword, sri->jumppos))
      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;
      }
      if (currentword == 0) {
        gt_assert(GT_MODWORDSIZE(sri->jumppos) == 0);
        sri->jumppos += GT_INTWORDSIZE;
        if (sri->jumppos >= sri->esr->encseq->totallength) {
          sri->exhausted = true;
          break;
        }
      }
      else {
        sri->jumppos++;
      }
    }
    else {
      if (sri->jumppos == 0) {
        if (sri->lengthofspecialrange > 0) {
          range->start = 0;
          range->end = sri->lengthofspecialrange;
          success = true;
        }
        sri->exhausted = true;
        break;
      }
      if (currentword == 0) {
        gt_assert(GT_MODWORDSIZE(sri->jumppos) == (GtUword)
                                                  (GT_INTWORDSIZE-1));
        if (sri->jumppos < (GtUword) GT_INTWORDSIZE) {
          sri->exhausted = true;
          break;
        }
        sri->jumppos -= GT_INTWORDSIZE;
      }
      else {
        sri->jumppos--;
      }
    }
  }
  return success;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movb $0x0, 0xf(%rsp)
movq 0x10(%rsp), %rax
testb $0x1, 0x61(%rax)
je 0x130438
movb $0x0, 0x27(%rsp)
jmp 0x130758
jmp 0x13043a
movb 0xf(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x130449
jmp 0x13074e
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
movq 0x2b0(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x78(%rcx), %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x78(%rcx), %rcx
shlq %cl, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
andq %rcx, %rax
cmpq $0x0, %rax
je 0x1304aa
movq 0x10(%rsp), %rax
movq 0x70(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rax)
jmp 0x130537
movq 0x10(%rsp), %rax
cmpq $0x0, 0x70(%rax)
jbe 0x130535
movq 0x10(%rsp), %rax
testb $0x1, 0x60(%rax)
je 0x1304ef
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rcx
movq 0x10(%rsp), %rax
subq 0x70(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x130523
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rcx
addq $0x1, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rcx
addq $0x1, %rcx
movq 0x10(%rsp), %rax
addq 0x70(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movb $0x1, 0xf(%rsp)
movq 0x10(%rsp), %rax
movq $0x0, 0x70(%rax)
jmp 0x130537
movq 0x10(%rsp), %rax
testb $0x1, 0x60(%rax)
je 0x13066d
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x68(%rcx), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x1305c1
movq 0x10(%rsp), %rax
cmpq $0x0, 0x70(%rax)
jbe 0x1305b3
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
movq 0x30(%rax), %rcx
movq 0x10(%rsp), %rax
subq 0x70(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
movq 0x30(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movb $0x1, 0xf(%rsp)
movq 0x10(%rsp), %rax
movb $0x1, 0x61(%rax)
jmp 0x13074e
cmpq $0x0, (%rsp)
jne 0x130657
jmp 0x1305ce
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rax
andq $0x3f, %rax
cmpq $0x0, %rax
je 0x130619
movq 0x839f0(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x2da74(%rip), %rsi     # 0x15e066
leaq 0x58a49(%rip), %rdx     # 0x189042
leaq 0x58a64(%rip), %rcx     # 0x189064
leaq 0x55057(%rip), %r8      # 0x18565e
movl $0xdcb, %r9d            # imm = 0xDCB
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x13061b
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rcx
addq $0x40, %rcx
movq %rcx, 0x78(%rax)
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x68(%rcx), %rcx
movq (%rcx), %rcx
cmpq 0x30(%rcx), %rax
jb 0x130655
movq 0x10(%rsp), %rax
movb $0x1, 0x61(%rax)
jmp 0x13074e
jmp 0x130668
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x78(%rax)
jmp 0x130749
movq 0x10(%rsp), %rax
cmpq $0x0, 0x78(%rax)
jne 0x1306b6
movq 0x10(%rsp), %rax
cmpq $0x0, 0x70(%rax)
jbe 0x1306a8
movq 0x18(%rsp), %rax
movq $0x0, (%rax)
movq 0x10(%rsp), %rax
movq 0x70(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movb $0x1, 0xf(%rsp)
movq 0x10(%rsp), %rax
movb $0x1, 0x61(%rax)
jmp 0x13074e
cmpq $0x0, (%rsp)
jne 0x130736
jmp 0x1306bf
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rax
andq $0x3f, %rax
cmpq $0x3f, %rax
je 0x13070a
movq 0x838ff(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x2d983(%rip), %rsi     # 0x15e066
leaq 0x589a1(%rip), %rdx     # 0x18908b
leaq 0x58973(%rip), %rcx     # 0x189064
leaq 0x54f66(%rip), %r8      # 0x18565e
movl $0xde2, %r9d            # imm = 0xDE2
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x13070c
movq 0x10(%rsp), %rax
cmpq $0x40, 0x78(%rax)
jae 0x130723
movq 0x10(%rsp), %rax
movb $0x1, 0x61(%rax)
jmp 0x13074e
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rcx
subq $0x40, %rcx
movq %rcx, 0x78(%rax)
jmp 0x130747
movq 0x10(%rsp), %rax
movq 0x78(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x78(%rax)
jmp 0x130749
jmp 0x13043a
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)