// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes.c
// Function: gt_randomcodes_find_accu
GtUword gt_randomcodes_find_accu(const GtRandomcodesinfo *fci,
                                       GtUword code)
{
  const GtUword *found = NULL, *leftptr = NULL, *midptr, *rightptr = NULL;

  if (code <= fci->allrandomcodes[0])
  {
    return 0;
  }
  if (fci->binsearchcache.spaceGtIndexwithcodeRC != NULL)
  {
    const GtIndexwithcodeRC *leftic, *midic, *rightic;
    unsigned int depth;

    leftic = fci->binsearchcache.spaceGtIndexwithcodeRC;
    rightic = fci->binsearchcache.spaceGtIndexwithcodeRC +
              fci->binsearchcache.nextfreeGtIndexwithcodeRC - 1;
    for (depth = 0; /* Nothing */; depth++)
    {
      midic = leftic + GT_DIV2((GtUword) (rightic-leftic));
      if (code < midic->code)
      {
        found = midic->ptr;
        if (depth < fci->binsearchcache.depth)
        {
          rightic = midic - 1;
        } else
        {
          gt_assert(leftic->ptr != NULL && rightic->ptr != NULL);
          if (leftic > fci->binsearchcache.spaceGtIndexwithcodeRC)
          {
            leftptr = (leftic-1)->ptr + 1;
          } else
          {
            gt_assert(code > fci->allrandomcodes[0]);
            leftptr = fci->allrandomcodes + 1;
          }
          rightptr = rightic->ptr - 1;
          break;
        }
      } else
      {
        if (code > midic->code)
        {
          if (depth < fci->binsearchcache.depth)
          {
            leftic = midic + 1;
          } else
          {
            gt_assert(leftic->ptr != NULL && rightic->ptr != NULL);
            leftptr = leftic->ptr + 1;
            if (rightic < fci->binsearchcache.spaceGtIndexwithcodeRC +
                          fci->binsearchcache.nextfreeGtIndexwithcodeRC - 1)
            {
              rightptr = (rightic+1)->ptr - 1;
            } else
            {
              rightptr = fci->allrandomcodes + fci->differentcodes - 1;
            }
            break;
          }
        } else
        {
          gt_assert(midic->ptr != NULL);
          return (GtUword) (midic->ptr - fci->allrandomcodes);
        }
      }
    }
    gt_assert(leftptr != NULL && rightptr != NULL);
  } else
  {
    leftptr = fci->allrandomcodes + 1;
    rightptr = fci->allrandomcodes + fci->differentcodes - 1;
  }
  while (leftptr <= rightptr)
  {
    midptr = leftptr + GT_DIV2((GtUword) (rightptr-leftptr));
    if (code < *midptr)
    {
      rightptr = midptr - 1;
      if (code > *rightptr)
      {
        return (GtUword) (midptr - fci->allrandomcodes);
      }
      found = midptr;
    } else
    {
      if (code > *midptr)
      {
        leftptr = midptr + 1;
        if (code <= *leftptr)
        {
          return (GtUword) (leftptr - fci->allrandomcodes);
        }
      } else
      {
        gt_assert(midptr != NULL);
        return (GtUword) (midptr - fci->allrandomcodes);
      }
    }
  }
 return (found != NULL) ? (GtUword) (found - fci->allrandomcodes)
                         : ULONG_MAX;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0xa0(%rcx), %rcx
cmpq (%rcx), %rax
ja 0x26c2bd
movq $0x0, 0x60(%rsp)
jmp 0x26c802
movq 0x58(%rsp), %rax
cmpq $0x0, 0x48(%rax)
je 0x26c63e
movq 0x58(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x58(%rsp), %rcx
imulq $0x18, 0x58(%rcx), %rcx
addq %rcx, %rax
addq $-0x18, %rax
movq %rax, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rcx, %rax
movl $0x18, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq 0x8(%rsp), %rax
shrq %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x26c474
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movl 0x14(%rsp), %eax
movq 0x58(%rsp), %rcx
cmpl 0x68(%rcx), %eax
jae 0x26c37c
movq 0x20(%rsp), %rax
addq $-0x18, %rax
movq %rax, 0x18(%rsp)
jmp 0x26c46f
jmp 0x26c37e
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
je 0x26c394
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x26c3cc
movq 0x3cfc05(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a9c6e(%rip), %rsi    # 0x516013
leaq 0x3126e4(%rip), %rdx    # 0x57ea90
leaq 0x312709(%rip), %rcx    # 0x57eabc
leaq 0x31271b(%rip), %r8     # 0x57ead5
movl $0xb3, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x26c3ce
movq 0x28(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x48(%rcx), %rax
jbe 0x26c3f2
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
addq $0x8, %rax
movq %rax, 0x40(%rsp)
jmp 0x26c459
jmp 0x26c3f4
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0xa0(%rcx), %rcx
cmpq (%rcx), %rax
ja 0x26c442
movq 0x3cfb8f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a9bf8(%rip), %rsi    # 0x516013
leaq 0x3126cb(%rip), %rdx    # 0x57eaed
leaq 0x312693(%rip), %rcx    # 0x57eabc
leaq 0x3126a5(%rip), %r8     # 0x57ead5
movl $0xb9, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x26c444
movq 0x58(%rsp), %rax
movq 0xa0(%rax), %rax
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
addq $-0x8, %rax
movq %rax, 0x30(%rsp)
jmp 0x26c5f0
jmp 0x26c5de
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x26c570
movl 0x14(%rsp), %eax
movq 0x58(%rsp), %rcx
cmpl 0x68(%rcx), %eax
jae 0x26c4a9
movq 0x20(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x28(%rsp)
jmp 0x26c56e
jmp 0x26c4ab
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
je 0x26c4c1
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x26c4f9
movq 0x3cfad8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a9b41(%rip), %rsi    # 0x516013
leaq 0x3125b7(%rip), %rdx    # 0x57ea90
leaq 0x3125dc(%rip), %rcx    # 0x57eabc
leaq 0x3125ee(%rip), %r8     # 0x57ead5
movl $0xc8, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x26c4fb
movq 0x28(%rsp), %rax
movq (%rax), %rax
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq 0x18(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0x48(%rcx), %rcx
movq 0x58(%rsp), %rdx
imulq $0x18, 0x58(%rdx), %rdx
addq %rdx, %rcx
addq $-0x18, %rcx
cmpq %rcx, %rax
jae 0x26c544
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
addq $-0x8, %rax
movq %rax, 0x30(%rsp)
jmp 0x26c569
movq 0x58(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x58(%rsp), %rcx
movq 0x38(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0x30(%rsp)
jmp 0x26c5f0
jmp 0x26c5dc
jmp 0x26c572
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x26c5b5
movq 0x3cfa1c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a9a85(%rip), %rsi    # 0x516013
leaq 0x312576(%rip), %rdx    # 0x57eb0b
leaq 0x312520(%rip), %rcx    # 0x57eabc
leaq 0x312532(%rip), %r8     # 0x57ead5
movl $0xd6, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x26c5b7
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x58(%rsp), %rcx
movq 0xa0(%rcx), %rcx
subq %rcx, %rax
sarq $0x3, %rax
movq %rax, 0x60(%rsp)
jmp 0x26c802
jmp 0x26c5de
jmp 0x26c5e0
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x26c302
jmp 0x26c5f2
cmpq $0x0, 0x40(%rsp)
je 0x26c602
cmpq $0x0, 0x30(%rsp)
jne 0x26c63a
movq 0x3cf997(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a9a00(%rip), %rsi    # 0x516013
leaq 0x312504(%rip), %rdx    # 0x57eb1e
leaq 0x31249b(%rip), %rcx    # 0x57eabc
leaq 0x3124ad(%rip), %r8     # 0x57ead5
movl $0xdb, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x26c63c
jmp 0x26c678
movq 0x58(%rsp), %rax
movq 0xa0(%rax), %rax
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x58(%rsp), %rcx
movq 0x38(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0x30(%rsp)
jmp 0x26c67a
movq 0x40(%rsp), %rax
cmpq 0x30(%rsp), %rax
ja 0x26c7c6
movq 0x40(%rsp), %rax
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rdx
subq %rdx, %rcx
sarq $0x3, %rcx
shrq %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x26c70c
movq 0x38(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq (%rcx), %rax
jbe 0x26c6fd
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0xa0(%rcx), %rcx
subq %rcx, %rax
sarq $0x3, %rax
movq %rax, 0x60(%rsp)
jmp 0x26c802
movq 0x38(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x26c7c1
movq 0x50(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq (%rcx), %rax
jbe 0x26c75c
movq 0x38(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq 0x50(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq (%rcx), %rax
ja 0x26c75a
movq 0x40(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0xa0(%rcx), %rcx
subq %rcx, %rax
sarq $0x3, %rax
movq %rax, 0x60(%rsp)
jmp 0x26c802
jmp 0x26c7bf
jmp 0x26c75e
cmpq $0x0, 0x38(%rsp)
jne 0x26c79e
movq 0x3cf833(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a989c(%rip), %rsi    # 0x516013
leaq 0x3123c4(%rip), %rdx    # 0x57eb42
leaq 0x312337(%rip), %rcx    # 0x57eabc
leaq 0x312349(%rip), %r8     # 0x57ead5
movl $0xf7, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x26c7a0
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0xa0(%rcx), %rcx
subq %rcx, %rax
sarq $0x3, %rax
movq %rax, 0x60(%rsp)
jmp 0x26c802
jmp 0x26c7c1
jmp 0x26c67a
cmpq $0x0, 0x48(%rsp)
je 0x26c7ec
movq 0x48(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0xa0(%rcx), %rcx
subq %rcx, %rax
sarq $0x3, %rax
movq %rax, (%rsp)
jmp 0x26c7f9
movq $-0x1, %rax
movq %rax, (%rsp)
jmp 0x26c7f9
movq (%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopl (%rax)