// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movl $0x0, 0x28(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x2063a5
movq 0x435c2c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x30fc95(%rip), %rsi    # 0x516013
leaq 0x36ae24(%rip), %rdx    # 0x5711a9
leaq 0x36ae37(%rip), %rcx    # 0x5711c3
leaq 0x36aa7f(%rip), %r8     # 0x570e12
movl $0x4b9, %r9d            # imm = 0x4B9
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2063a7
movq 0x38(%rsp), %rax
movl 0x48(%rax), %ecx
movq 0x50(%rsp), %rax
movl %ecx, (%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x1, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movq 0x38(%rsp), %rcx
movl 0x48(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x20653f
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq 0x78(%rcx), %rcx
movl 0x2c(%rsp), %edx
cmpq (%rcx,%rdx,8), %rax
jb 0x20652d
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq 0x78(%rcx), %rcx
movl 0x2c(%rsp), %edx
subq (%rcx,%rdx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rax
movq 0x78(%rax), %rax
movl 0x2c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq (%rsp)
cmpq $0x0, %rdx
jne 0x20652b
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
movl 0x2c(%rsp), %esi
subl $0x1, %esi
movq 0x8(%rsp), %rdx
callq 0x205140
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jbe 0x206529
movl 0x2c(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x50(%rsp), %rax
movl (%rax), %eax
cmpl 0x2c(%rsp), %eax
jbe 0x2064a0
movl 0x2c(%rsp), %ecx
movq 0x50(%rsp), %rax
movl %ecx, (%rax)
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x206527
jmp 0x2064b7
cmpq $0x0, 0x10(%rsp)
ja 0x2064f7
movq 0x435ada(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x30fb43(%rip), %rsi    # 0x516013
leaq 0x36acc4(%rip), %rdx    # 0x57119b
leaq 0x36ace5(%rip), %rcx    # 0x5711c3
leaq 0x36a92d(%rip), %r8     # 0x570e12
movl $0x4cf, %r9d            # imm = 0x4CF
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2064f9
movl 0x2c(%rsp), %edx
movq 0x48(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, %rsi
addq $-0x1, %rsi
movq %rsi, 0x10(%rsp)
movl %edx, -0x4(%rax,%rcx,4)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2064a9
jmp 0x206529
jmp 0x20652b
jmp 0x20652d
jmp 0x20652f
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x2063c8
cmpq $0x0, 0x10(%rsp)
jbe 0x2065ac
movq 0x38(%rsp), %rax
movl 0x48(%rax), %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
movq 0x50(%rsp), %rax
movl (%rax), %eax
movq 0x38(%rsp), %rcx
cmpl 0x48(%rcx), %eax
jne 0x206579
movq 0x38(%rsp), %rax
movl 0x48(%rax), %ecx
subl $0x1, %ecx
movq 0x50(%rsp), %rax
movl %ecx, (%rax)
jmp 0x20657b
cmpq $0x0, 0x10(%rsp)
jbe 0x2065aa
movq 0x38(%rsp), %rax
movl 0x48(%rax), %edx
subl $0x1, %edx
movq 0x48(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, %rsi
addq $-0x1, %rsi
movq %rsi, 0x10(%rsp)
movl %edx, -0x4(%rax,%rcx,4)
jmp 0x20657b
jmp 0x2065ac
movl 0x28(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)