// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-lcpvalues.c
// Function: lcp_bucketends
static unsigned int lcp_bucketends(Lcpsubtab *lcpsubtab,
                                   Suffixwithcode *previoussuffix,
                                   GT_UNUSED GtUword firstspecialsuffix,
                                   unsigned int minchanged,
                                   GtUword nonspecialsinbucket,
                                   GtUword specialsinbucket,
                                   GtCodetype code,
                                   const GtBcktab *bcktab)
{
  GtUword lcpvalue;
  unsigned int maxprefixindex, minprefixindex;
  Suffixwithcode firstspecialsuffixwithcode;

  /*
     there is at least one element in the bucket. if there is more than
     one element in the bucket, then we insert them using the
     information from the bcktab
  */
  if (specialsinbucket > 1UL)
  {
    if (lcpsubtab->lcp2file != NULL)
    {
      maxprefixindex = gt_bcktab_pfxidx2lcpvalues_uint8(
                          &minprefixindex,
                          lcpsubtab->lcp2file->smalllcpvalues,
                          specialsinbucket,
                          bcktab,
                          code);
      if (lcpsubtab->lcp2file->maxbranchdepth < (GtUword) maxprefixindex)
      {
        lcpsubtab->lcp2file->maxbranchdepth = (GtUword) maxprefixindex;
      }
    } else
    {
      GtUword start = lcpsubtab->tableoflcpvalues.lcptaboffset +
                            nonspecialsinbucket;
      maxprefixindex = gt_bcktab_pfxidx2lcpvalues_Lcpvaluetype(
                          &minprefixindex,
                          lcpsubtab->tableoflcpvalues.bucketoflcpvalues + start,
                          specialsinbucket,
                          bcktab,
                          code);
#ifndef NDEBUG
      {
        GtUword idx;

        for (idx=start; idx<start + specialsinbucket; idx++)
        {
          GT_SETIBIT(lcpsubtab->tableoflcpvalues.isset,idx);
        }
      }
#endif
    }
  } else
  {
    minprefixindex = maxprefixindex = gt_bcktab_singletonmaxprefixindex(bcktab,
                                                                        code);
  }
  firstspecialsuffixwithcode.code = code;
  firstspecialsuffixwithcode.prefixindex = maxprefixindex;
#ifdef SKDEBUG
  firstspecialsuffixwithcode.startpos = firstspecialsuffix;
  /*
  gt_bcktab_consistencyofsuffix(__LINE__,
                                encseq,readmode,bcktab,numofchars,
                                &firstspecialsuffixwithcode);
  */
#endif
  lcpvalue = computelocallcpvalue(previoussuffix,
                                  &firstspecialsuffixwithcode,
                                  minchanged);
  if (lcpsubtab->lcp2file != NULL)
  {
    if (lcpsubtab->lcp2file->maxbranchdepth < lcpvalue)
    {
      lcpsubtab->lcp2file->maxbranchdepth = lcpvalue;
    }
    lcpsubtab->lcp2file->smalllcpvalues[0] = (uint8_t) lcpvalue;
  } else
  {
    gt_assert(lcpvalue <= GT_LCPVALUE_MAX);
    lcpsubtab->tableoflcpvalues.bucketoflcpvalues
               [lcpsubtab->tableoflcpvalues.lcptaboffset + nonspecialsinbucket]
               = (GtLcpvaluetype) lcpvalue;
#ifndef NDEBUG
    GT_SETIBIT(lcpsubtab->tableoflcpvalues.isset,
               lcpsubtab->tableoflcpvalues.lcptaboffset + nonspecialsinbucket);
#endif
  }
  return minprefixindex;
}

// Assembly:
subq $0x68, %rsp
movq 0x78(%rsp), %rax
movq 0x70(%rsp), %rax
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movl %ecx, 0x4c(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x38(%rsp)
cmpq $0x1, 0x38(%rsp)
jbe 0x2c772b
movq 0x60(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x2c768b
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x50(%rax), %rsi
movq 0x38(%rsp), %rdx
movq 0x78(%rsp), %rcx
movq 0x70(%rsp), %r8
leaq 0x28(%rsp), %rdi
callq 0x2060c0
movl %eax, 0x2c(%rsp)
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x28(%rax), %rax
movl 0x2c(%rsp), %ecx
cmpq %rcx, %rax
jae 0x2c7686
movl 0x2c(%rsp), %eax
movl %eax, %ecx
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x28(%rax)
jmp 0x2c7729
movq 0x60(%rsp), %rax
movq 0x20(%rax), %rax
addq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movq 0x38(%rsp), %rdx
movq 0x78(%rsp), %rcx
movq 0x70(%rsp), %r8
leaq 0x28(%rsp), %rdi
callq 0x206340
movl %eax, 0x2c(%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
addq 0x38(%rsp), %rcx
cmpq %rcx, %rax
jae 0x2c7727
movq (%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq (%rsp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq (%rsp), %rax
addq $0x1, %rax
movq %rax, (%rsp)
jmp 0x2c76d9
jmp 0x2c7729
jmp 0x2c7742
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x205ec0
movl %eax, 0x2c(%rsp)
movl %eax, 0x28(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x58(%rsp), %rdi
movl 0x4c(%rsp), %edx
leaq 0x10(%rsp), %rsi
callq 0x2c6e00
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x2c77b9
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x28(%rax), %rax
cmpq 0x30(%rsp), %rax
jae 0x2c779e
movq 0x30(%rsp), %rcx
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x28(%rax)
movq 0x30(%rsp), %rax
movb %al, %cl
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x50(%rax), %rax
movb %cl, (%rax)
jmp 0x2c7863
jmp 0x2c77bb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, 0x30(%rsp)
jbe 0x2c77ff
movq 0x3747d2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24e83b(%rip), %rsi    # 0x516013
leaq 0x2c3348(%rip), %rdx    # 0x58ab27
leaq 0x2c335d(%rip), %rcx    # 0x58ab43
leaq 0x2c301b(%rip), %r8     # 0x58a808
movl $0xcd, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2c7801
movq 0x30(%rsp), %rax
movl %eax, %edx
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rcx
movq 0x20(%rcx), %rcx
addq 0x40(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x60(%rsp), %rax
movq 0x20(%rax), %rcx
addq 0x40(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq 0x60(%rsp), %rcx
movq 0x20(%rcx), %rcx
addq 0x40(%rsp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl 0x28(%rsp), %eax
addq $0x68, %rsp
retq
nopl (%rax)