// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/bcktab.c
// Function: gt_bcktab_findfirstlarger
GtCodetype gt_bcktab_findfirstlarger(const GtBcktab *bcktab,
                                     GtCodetype mincode,
                                     GtCodetype maxcode,
                                     GtUword suftaboffset)
{
  GtCodetype left, right, found, offset;
  GT_UNUSED bool found_defined = false;

  if (mincode <= maxcode)
  {
    if (mincode == maxcode)
    {
      return mincode;
    }
    gt_assert(mincode < maxcode);
    left = mincode;
    right = maxcode;
    if (mincode > 0)
    {
      offset = gt_bcktab_get_leftborder(bcktab,mincode - 1);
    } else
    {
      offset = 0;
    }
  } else
  {
    left = 0;
    right = bcktab->numofallcodes - 1;
    offset = 0;
  }
  found = right + 1; /* undefined */
  while (left <= right)
  {
    GtCodetype midval, mid = GT_DIV2(left+right);

    gt_assert(mincode > maxcode || left <= mid);
    midval = gt_bcktab_get_leftborder(bcktab,mid) - offset;
    if (suftaboffset <= midval)
    {
      found = mid;
      found_defined = true;
      if (suftaboffset < midval)
      {
        if (mid == 0)
        {
          break;
        }
        right = mid - 1;
      } else
      {
        break;
      }
    } else
    {
      left = mid + 1;
    }
  }
  gt_assert(found_defined);
  return found;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x20(%rsp)
movq %rsi, %r12
movq %rdx, 0x8(%rsp)
cmpq %rdx, %rsi
movq %rdi, (%rsp)
jbe 0x135b08
movq 0x58(%rdi), %r15
decq %r15
xorl %r13d, %r13d
xorl %r14d, %r14d
jmp 0x135b3e
jne 0x135b12
movq %r12, %rax
jmp 0x135bb3
jae 0x135c3e
testq %r12, %r12
je 0x135bc2
leaq -0x1(%r12), %rsi
movq (%rsp), %rdi
callq 0x134141
movq (%rsp), %rdi
movq %rax, %r13
movq 0x8(%rsp), %r15
movq %r12, %r14
leaq 0x1(%r15), %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
cmpq %r15, %r14
ja 0x135ba7
leaq (%r14,%r15), %rbx
movq %rbx, %rbp
shrq %rbp
cmpq 0x8(%rsp), %r12
ja 0x135b6b
cmpq %rbp, %r14
ja 0x135bd8
movq %rbp, %rsi
callq 0x134141
subq %r13, %rax
cmpq 0x20(%rsp), %rax
jae 0x135b89
incq %rbp
movq %rbp, %r14
movq (%rsp), %rdi
jmp 0x135b50
jbe 0x135bcf
cmpq $0x2, %rbx
jb 0x135bd4
leaq -0x1(%rbp), %r15
movb $0x1, %al
movq %rax, 0x10(%rsp)
movq %rbp, 0x18(%rsp)
movq (%rsp), %rdi
jmp 0x135b50
testb $0x1, 0x10(%rsp)
movq 0x18(%rsp), %rax
je 0x135c10
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
movq 0x8(%rsp), %r15
jmp 0x135b03
movq %rbp, %rax
jmp 0x135bb3
xorl %eax, %eax
jmp 0x135bb3
movq 0x302389(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1af42a(%rip), %rsi    # 0x2e5013
leaq 0x208ed5(%rip), %rdx    # 0x33eac5
leaq 0x208eb4(%rip), %rcx    # 0x33eaab
leaq 0x208a88(%rip), %r8     # 0x33e686
movl $0x54d, %r9d            # imm = 0x54D
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x302351(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1af3f2(%rip), %rsi    # 0x2e5013
leaq 0x208ebe(%rip), %rdx    # 0x33eae6
leaq 0x208e7c(%rip), %rcx    # 0x33eaab
leaq 0x208a50(%rip), %r8     # 0x33e686
movl $0x563, %r9d            # imm = 0x563
jmp 0x135c04
movq 0x302323(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1af3c4(%rip), %rsi    # 0x2e5013
leaq 0x208e43(%rip), %rdx    # 0x33ea99
leaq 0x208e4e(%rip), %rcx    # 0x33eaab
leaq 0x208a22(%rip), %r8     # 0x33e686
movl $0x538, %r9d            # imm = 0x538
jmp 0x135c04