// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/seed_extend_parts.c
// Function: gt_encseq_next_larger_width
static GtUword gt_encseq_next_larger_width(const GtSequencePartsInfo *spi,
                                           GtUword startseqnum,
                                           GtUword width,
                                           GtUword numofsequences)
{
  GtUword left, right, found = GT_UWORD_MAX,
          start_segment = gt_sequence_parts_info_seqstartpos(spi,startseqnum);

  left = startseqnum;
  gt_assert(numofsequences > 0);
  right = numofsequences - 1;
  while (left <= right)
  {
    GtUword mid = left + (right - left + 1)/2, mid_end, this_width;

    gt_assert(mid < numofsequences);
    mid_end = gt_sequence_parts_info_seqendpos(spi,mid);
    gt_assert(mid_end > start_segment);
    this_width = mid_end - start_segment;
    if (this_width > width)
    {
      found = mid;
      if (right == 0)
      {
        break;
      }
      right = mid - 1;
    } else
    {
      if (left == numofsequences - 1)
      {
        break;
      }
      left = mid + 1;
    }
  }
  return found;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq $-0x1, 0x20(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x2af760
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x38(%rsp)
ja 0x2afeef
movq 0x38c0e2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x26614b(%rip), %rsi    # 0x516013
leaq 0x2c8548(%rip), %rdx    # 0x578417
leaq 0x2d8282(%rip), %rcx    # 0x588158
leaq 0x2d801c(%rip), %r8     # 0x587ef9
movl $0x50, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2afef1
movq 0x38(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
ja 0x2b0032
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rcx
subq 0x30(%rsp), %rcx
addq $0x1, %rcx
shrq %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x38(%rsp), %rax
jb 0x2aff71
movq 0x38c060(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2660c9(%rip), %rsi    # 0x516013
leaq 0x2d8223(%rip), %rdx    # 0x588174
leaq 0x2d8200(%rip), %rcx    # 0x588158
leaq 0x2d7f9a(%rip), %r8     # 0x587ef9
movl $0x56, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2aff73
movq 0x50(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x2af7e0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x18(%rsp), %rax
ja 0x2affcb
movq 0x38c006(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x26606f(%rip), %rsi    # 0x516013
leaq 0x2d81de(%rip), %rdx    # 0x588189
leaq 0x2d81a6(%rip), %rcx    # 0x588158
leaq 0x2d7f40(%rip), %r8     # 0x587ef9
movl $0x58, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2affcd
movq 0x8(%rsp), %rax
subq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
cmpq 0x40(%rsp), %rax
jbe 0x2b000a
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x2afffa
jmp 0x2b0032
movq 0x10(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x2b002d
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x2b001f
jmp 0x2b0032
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x2afeff
movq 0x20(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax)