// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/bcktab.c
// Function: gt_bcktab_pfxidx2lcpvalues_uint8
unsigned int gt_bcktab_pfxidx2lcpvalues_uint8(unsigned int *minprefixindex,
                                              uint8_t *smalllcpvalues,
                                              GtUword specialsinbucket,
                                              const GtBcktab *bcktab,
                                              GtCodetype code)
{
  unsigned int prefixindex, maxprefixindex = 0;
  GtUword idx, value, insertpos;
  GtCodetype ordercode, divisor;

  gt_assert(smalllcpvalues != NULL);
  *minprefixindex = bcktab->prefixlength;
  insertpos = specialsinbucket;
  for (prefixindex=1U; prefixindex<bcktab->prefixlength-1; prefixindex++)
  {
    if (code >= bcktab->filltable[prefixindex])
    {
      ordercode = code - bcktab->filltable[prefixindex];
      divisor = bcktab->filltable[prefixindex] + 1;
      if (ordercode % divisor == 0)
      {
        ordercode /= divisor;
        value = gt_bcktab_distpfxidx_get(bcktab,prefixindex-1,ordercode);
        if (value > 0)
        {
          maxprefixindex = prefixindex;
          if (*minprefixindex > prefixindex)
          {
            *minprefixindex = prefixindex;
          }
          for (idx=0; idx < value; idx++)
          {
            gt_assert(insertpos > 0);
            smalllcpvalues[--insertpos] = (uint8_t) prefixindex;
          }
        }
      }
    }
  }
  if (insertpos > 0)
  {
    maxprefixindex = bcktab->prefixlength-1;
    if (*minprefixindex == bcktab->prefixlength)
    {
      *minprefixindex = bcktab->prefixlength-1;
    }
    while (insertpos > 0)
    {
      smalllcpvalues[--insertpos] = (uint8_t) (bcktab->prefixlength-1);
    }
  }
  return maxprefixindex;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x13587a
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movl 0x48(%rcx), %ecx
movq %rdi, (%rsp)
movl %ecx, (%rdi)
xorl %r12d, %r12d
pushq $0x1
popq %rbp
leal -0x1(%rcx), %eax
cmpq %rax, %rbp
jae 0x135806
movq 0x78(%rbx), %rax
movq (%rax,%rbp,8), %rcx
movq %r13, %rax
subq %rcx, %rax
jb 0x1357fe
incq %rcx
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
jne 0x1357fe
leal -0x1(%rbp), %esi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x134fa8
testq %rax, %rax
je 0x1357fe
movq (%rsp), %rdx
movl (%rdx), %ecx
cmpq %rcx, %rbp
jae 0x1357f5
movl %ebp, (%rdx)
jmp 0x1357f5
movq %r15, %rcx
subq $0x1, %rcx
jb 0x135842
movb %bpl, -0x1(%r14,%r15)
movq %rcx, %r15
subq $0x1, %rax
jae 0x1357e4
movl %ebp, %r12d
incq %rbp
movl 0x48(%rbx), %ecx
jmp 0x13579d
testq %r15, %r15
je 0x135830
movq (%rsp), %rdx
cmpl %ecx, (%rdx)
jne 0x135815
movl %eax, (%rdx)
movq %r15, %rcx
subq $0x1, %rcx
jb 0x13582d
movb 0x48(%rbx), %dl
decb %dl
movb %dl, -0x1(%r14,%r15)
movq %rcx, %r15
jmp 0x135818
movl %eax, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30271f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1af7c0(%rip), %rsi    # 0x2e5013
leaq 0x2091b5(%rip), %rdx    # 0x33ea0f
leaq 0x20918d(%rip), %rcx    # 0x33e9ee
leaq 0x208e1e(%rip), %r8     # 0x33e686
movl $0x498, %r9d            # imm = 0x498
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x3026e7(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1af788(%rip), %rsi    # 0x2e5013
leaq 0x209145(%rip), %rdx    # 0x33e9d7
leaq 0x209155(%rip), %rcx    # 0x33e9ee
leaq 0x208de6(%rip), %r8     # 0x33e686
movl $0x482, %r9d            # imm = 0x482
jmp 0x13586e