// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-seqranges.c
// Function: gt_SRLFindPositionNext
struct seqRange *
gt_SRLFindPositionNext(struct seqRangeList *rangeList, GtUword pos,
                    seqRangeListSearchHint *hint)
{
  /* no ranges no matches in ranges */
  seqRangeListSearchHint hintCopy;
  size_t numRanges;
  struct seqRange *ranges;
  unsigned symBits;
  gt_assert(rangeList);
  ranges = rangeList->ranges;
  symBits = rangeList->symBits;
  if (hint)
    hintCopy = *hint;
  else
    gt_SRLInitListSearchHint(rangeList, &hintCopy);
  if ((numRanges = rangeList->numRanges) == 0)
  {
    return NULL;
  }
  if (ranges[0].startPos >= pos
      || pos < ranges[0].startPos + seqRangeLen(ranges + 0, symBits))
  {
    return ranges + 0;
  }
  else if (hintCopy && rangeNextMatch(hintCopy))
  {
    return ranges + hintCopy;
  }
  else if ((numRanges > hintCopy + 1) && rangeNextMatch(hintCopy + 1))
  {
    ++hintCopy;
    if (hint)
      *hint = hintCopy;
    return rangeList->ranges + hintCopy;
  }
  else if (hintCopy && rangeNextMatch(hintCopy - 1))
  {
    --hintCopy;
    if (hint)
      *hint = hintCopy;
    return rangeList->ranges + hintCopy;
  }
  else if (numRanges > 2)
  {
    GtUword searchPos = pos;
    struct seqRange *searchRes =
      gt_bsearch_data(&searchPos, rangeList->ranges + 1,
                      rangeList->numRanges - 1, sizeof (struct seqRange),
                      posSeqRangeNextCompare, rangeList);
    if (searchRes && hint)
      *hint = searchRes - rangeList->ranges;
    return searchRes;
  }
  else /* numRanges <= 2 */
    return NULL;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movq %rdx, 0x78(%rsp)
cmpq $0x0, 0x88(%rsp)
jne 0x4b0cdf
movq 0x18b2f2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x6535b(%rip), %rsi     # 0x516013
leaq 0x106507(%rip), %rdx    # 0x5b71c6
leaq 0x1065dd(%rip), %rcx    # 0x5b72a3
leaq 0x1064df(%rip), %r8     # 0x5b71ac
movl $0x140, %r9d            # imm = 0x140
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4b0ce1
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x88(%rsp), %rax
movl 0x28(%rax), %eax
movl %eax, 0x5c(%rsp)
cmpq $0x0, 0x78(%rsp)
je 0x4b0d18
movq 0x78(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x4b0d2a
movq 0x88(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x4b08e0
movq 0x88(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, %rax
jne 0x4b0d52
movq $0x0, 0x90(%rsp)
jmp 0x4b1189
movq 0x60(%rsp), %rax
movq (%rax), %rax
cmpq 0x80(%rsp), %rax
jae 0x4b0da1
movq 0x80(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
callq 0x4b06a0
movq 0x38(%rsp), %rcx
movq %rax, %rdx
movq 0x40(%rsp), %rax
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x4b0db3
movq 0x60(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x4b1189
cmpq $0x0, 0x70(%rsp)
je 0x4b0e93
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
cmpq 0x80(%rsp), %rax
jae 0x4b0e25
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movl 0x5c(%rsp), %esi
callq 0x4b06a0
movq %rax, %rcx
movq 0x30(%rsp), %rax
addq %rcx, %rax
cmpq 0x80(%rsp), %rax
jbe 0x4b0e93
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $-0x10, %rdi
movl 0x5c(%rsp), %esi
callq 0x4b06a0
movq %rax, %rcx
movq 0x28(%rsp), %rax
addq %rcx, %rax
cmpq 0x80(%rsp), %rax
ja 0x4b0e93
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
jmp 0x4b1189
movq 0x68(%rsp), %rax
movq 0x70(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x4b0fc0
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
addq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
cmpq 0x80(%rsp), %rax
jae 0x4b0f20
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
addq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $0x10, %rdi
movl 0x5c(%rsp), %esi
callq 0x4b06a0
movq %rax, %rcx
movq 0x20(%rsp), %rax
addq %rcx, %rax
cmpq 0x80(%rsp), %rax
jbe 0x4b0fc0
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
addq $0x1, %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $0x10, %rdi
addq $-0x10, %rdi
movl 0x5c(%rsp), %esi
callq 0x4b06a0
movq %rax, %rcx
movq 0x18(%rsp), %rax
addq %rcx, %rax
cmpq 0x80(%rsp), %rax
ja 0x4b0fc0
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, 0x78(%rsp)
je 0x4b0f9b
movq 0x70(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, (%rax)
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x70(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
jmp 0x4b1189
cmpq $0x0, 0x70(%rsp)
je 0x4b10e2
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
cmpq 0x80(%rsp), %rax
jae 0x4b1042
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $-0x10, %rdi
movl 0x5c(%rsp), %esi
callq 0x4b06a0
movq %rax, %rcx
movq 0x10(%rsp), %rax
addq %rcx, %rax
cmpq 0x80(%rsp), %rax
jbe 0x4b10e2
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
subq $0x1, %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
addq $-0x10, %rdi
addq $-0x10, %rdi
movl 0x5c(%rsp), %esi
callq 0x4b06a0
movq %rax, %rcx
movq 0x8(%rsp), %rax
addq %rcx, %rax
cmpq 0x80(%rsp), %rax
ja 0x4b10e2
movq 0x70(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, 0x78(%rsp)
je 0x4b10bd
movq 0x70(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, (%rax)
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x70(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
jmp 0x4b1189
cmpq $0x2, 0x68(%rsp)
jbe 0x4b117d
movq 0x80(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rsi
addq $0x10, %rsi
movq 0x88(%rsp), %rax
movq 0x8(%rax), %rdx
subq $0x1, %rdx
movq 0x88(%rsp), %r9
leaq 0x50(%rsp), %rdi
movl $0x10, %ecx
leaq 0x6c(%rip), %r8         # 0x4b11a0
callq 0x8c130
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x4b116e
cmpq $0x0, 0x78(%rsp)
je 0x4b116e
movq 0x48(%rsp), %rcx
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rax
subq %rax, %rcx
sarq $0x4, %rcx
movq 0x78(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x4b1189
movq $0x0, 0x90(%rsp)
movq 0x90(%rsp), %rax
addq $0x98, %rsp
retq
nopl (%rax)