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

  gt_assert(bucketoflcpvalues != 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);
            bucketoflcpvalues[--insertpos] = (GtLcpvaluetype) prefixindex;
          }
        }
      }
    }
  }
  if (insertpos > 0)
  {
    maxprefixindex = bcktab->prefixlength-1;
    if (*minprefixindex == bcktab->prefixlength)
    {
      *minprefixindex = bcktab->prefixlength-1;
    }
    while (insertpos > 0)
    {
      bucketoflcpvalues[--insertpos]
        = (GtLcpvaluetype) (bcktab->prefixlength-1);
    }
  }
  return maxprefixindex;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x1359a6
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
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 0x135939
movq 0x78(%rbx), %rax
movq (%rax,%rbp,8), %rcx
movq %r13, %rax
subq %rcx, %rax
jb 0x135931
incq %rcx
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
jne 0x135931
leal -0x1(%rbp), %esi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x134fa8
testq %rax, %rax
je 0x135931
movq (%rsp), %rdx
movl (%rdx), %ecx
cmpq %rcx, %rbp
jae 0x135928
movl %ebp, (%rdx)
jmp 0x135928
subq $0x1, %r14
jb 0x13596e
movl %ebp, (%r15,%r14,4)
subq $0x1, %rax
jae 0x13591e
movl %ebp, %r12d
incq %rbp
movl 0x48(%rbx), %ecx
jmp 0x1358d7
testq %r14, %r14
je 0x13595c
movq (%rsp), %rdx
cmpl %ecx, (%rdx)
jne 0x135953
movl %eax, (%rdx)
jmp 0x135953
movl 0x48(%rbx), %ecx
decl %ecx
movl %ecx, (%r15,%r14,4)
subq $0x1, %r14
jae 0x13594a
movl %eax, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3025f3(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1af694(%rip), %rsi    # 0x2e5013
leaq 0x209089(%rip), %rdx    # 0x33ea0f
leaq 0x2090aa(%rip), %rcx    # 0x33ea37
leaq 0x208cf2(%rip), %r8     # 0x33e686
movl $0x4cf, %r9d            # imm = 0x4CF
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x3025bb(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1af65c(%rip), %rsi    # 0x2e5013
leaq 0x20905f(%rip), %rdx    # 0x33ea1d
leaq 0x209072(%rip), %rcx    # 0x33ea37
leaq 0x208cba(%rip), %r8     # 0x33e686
movl $0x4b9, %r9d            # imm = 0x4B9
jmp 0x13599a