// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq.c
// Function: gt_viautables_specialrangeiterator_next
static bool gt_viautables_specialrangeiterator_next(GtRange *range,
                                                    GtSpecialrangeiterator *sri)
{
  if (!sri->esr->encseq->has_specialranges || sri->exhausted)
    return false;
  while (true) {
    GtRange current;
    if (mergeWildcardssptab(sri, &current)) {
      if (sri->previous.defined) {
        if (sri->moveforward) {
          if (sri->previous.rng.end < current.start) {
            *range = sri->previous.rng;
            sri->previous.rng = current;
            return true;
          }
          gt_assert (sri->previous.rng.end == current.start);
          sri->previous.rng.end = current.end;
        }
        else {
          if (current.end < sri->previous.rng.start) {
            *range = sri->previous.rng;
            sri->previous.rng = current;
            return true;
          }
          gt_assert (current.end == sri->previous.rng.start);
          sri->previous.rng.start = current.start;
        }
      }
      else {
        sri->previous.rng = current;
        sri->previous.defined = true;
      }
    }
    else {
      gt_assert(sri->previous.defined);
      *range = sri->previous.rng;
      sri->previous.defined = false;
      sri->exhausted = true;
      return true;
    }
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
testb $0x1, 0x28(%rax)
je 0x13079b
movq 0x10(%rsp), %rax
testb $0x1, 0x61(%rax)
je 0x1307a5
movb $0x0, 0x27(%rsp)
jmp 0x1309bb
jmp 0x1307a7
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x1309d0
testb $0x1, %al
jne 0x1307bd
jmp 0x13093e
movq 0x10(%rsp), %rax
testb $0x1, 0x10(%rax)
je 0x13091e
movq 0x10(%rsp), %rax
testb $0x1, 0x60(%rax)
je 0x13087f
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
cmpq (%rsp), %rax
jae 0x130821
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, 0x27(%rsp)
jmp 0x1309bb
jmp 0x130823
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
cmpq (%rsp), %rax
je 0x13086a
movq 0x8379f(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x2d823(%rip), %rsi     # 0x15e066
leaq 0x5887e(%rip), %rdx     # 0x1890c8
leaq 0x5889e(%rip), %rcx     # 0x1890ef
leaq 0x54e06(%rip), %r8      # 0x18565e
movl $0xe63, %r9d            # imm = 0xE63
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x13086c
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x13091c
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x1308c5
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, 0x27(%rsp)
jmp 0x1309bb
jmp 0x1308c7
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq (%rcx), %rax
je 0x13090e
movq 0x836fb(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x2d77f(%rip), %rsi     # 0x15e066
leaq 0x58829(%rip), %rdx     # 0x189117
leaq 0x587fa(%rip), %rcx     # 0x1890ef
leaq 0x54d62(%rip), %r8      # 0x18565e
movl $0xe6c, %r9d            # imm = 0xE6C
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x130910
movq (%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
jmp 0x13093c
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movb $0x1, 0x10(%rax)
jmp 0x1309b6
jmp 0x130940
movq 0x10(%rsp), %rax
testb $0x1, 0x10(%rax)
jne 0x130983
movq 0x83686(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x2d70a(%rip), %rsi     # 0x15e066
leaq 0x587db(%rip), %rdx     # 0x18913e
leaq 0x58785(%rip), %rcx     # 0x1890ef
leaq 0x54ced(%rip), %r8      # 0x18565e
movl $0xe76, %r9d            # imm = 0xE76
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x130985
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rax
movb $0x1, 0x61(%rax)
movb $0x1, 0x27(%rsp)
jmp 0x1309bb
jmp 0x1307a7
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)