// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/sfx-lcpvalues.c
// Function: gt_Outlcpinfo_postbucket
void gt_Outlcpinfo_postbucket(GtOutlcpinfo *outlcpinfo,
                              unsigned int prefixlength,
                              const GtSuffixsortspace *sssp,
                              const GtBcktab *bcktab,
                              const GtBucketspecification *bucketspec,
                              GtCodetype code)
{
  if (outlcpinfo != NULL)
  {
    if (bucketspec->specialsinbucket > 0)
    {
      unsigned int minprefixindex;
      GtUword suffixvalue
        = gt_suffixsortspace_get(sssp,
                                 0,
                                 bucketspec->left
                                   + bucketspec->nonspecialsinbucket);
      minprefixindex = lcp_bucketends(&outlcpinfo->lcpsubtab,
                                      &outlcpinfo->previoussuffix,
                                      /* first special element in bucket */
                                      suffixvalue,
                                      outlcpinfo->minchanged,
                                      bucketspec->nonspecialsinbucket,
                                      bucketspec->specialsinbucket,
                                      code,
                                      bcktab);
      if (outlcpinfo->lcpsubtab.lcp2file != NULL)
      {
        outsmalllcpvalues(outlcpinfo->lcpsubtab.lcp2file,
                          bucketspec->specialsinbucket);
      } else
      {
        if (outlcpinfo->lcpsubtab.lcpprocess != NULL)
        {
          outlcpinfo->lcpsubtab.lcpprocess->final_process_bucket(
              outlcpinfo->lcpsubtab.lcpprocess->final_process_bucket_info,
              sssp,
              &outlcpinfo->lcpsubtab.tableoflcpvalues,
              bucketspec->nonspecialsinbucket,
              bucketspec->specialsinbucket,
              bucketspec->left);
        }
      }
      /* there is at least one special element: this is the last element
         in the bucket, and thus the previoussuffix for the next round */
      outlcpinfo->previoussuffix.defined = true;
      outlcpinfo->previoussuffix.code = code;
      outlcpinfo->previoussuffix.prefixindex = minprefixindex;
#ifdef SKDEBUG
      outlcpinfo->previoussuffix.startpos
        = gt_suffixsortspace_get(sssp,
                                 0,
                                 bucketspec->left
                                   + bucketspec->nonspecialsinbucket +
                                     bucketspec->specialsinbucket - 1);
      /*
        gt_bcktab_consistencyofsuffix(__LINE__,
                                      encseq,readmode,bcktab,numofchars,
                                      &outlcpinfo->previoussuffix);
      */
#endif
    } else
    {
      if (bucketspec->nonspecialsinbucket > 0)
      {
        /* if there is at least one element in the bucket, then the last
           one becomes the next previous suffix */
        outlcpinfo->previoussuffix.defined = true;
        outlcpinfo->previoussuffix.code = code;
        outlcpinfo->previoussuffix.prefixindex = prefixlength;
#ifdef SKDEBUG
        outlcpinfo->previoussuffix.startpos
          = gt_suffixsortspace_get(sssp,
                                   0,
                                   bucketspec.left
                                     + bucketspec.nonspecialsinbucket-1);
        /*
        gt_bcktab_consistencyofsuffix(__LINE__,
                                      encseq,readmode,bcktab,numofchars,
                                      &outlcpinfo->previoussuffix);
        */
#endif
      }
    }
    if (bucketspec->nonspecialsinbucket + bucketspec->specialsinbucket == 0)
    {
      outlcpinfo->previousbucketwasempty = true;
    } else
    {
      outlcpinfo->previousbucketwasempty = false;
    }
    if (outlcpinfo->lcpsubtab.lcp2file != NULL ||
        outlcpinfo->lcpsubtab.lcpprocess != NULL)
    {
      gt_assert(outlcpinfo->lcpsubtab.tableoflcpvalues.lcptaboffset == 0);
    } else
    {
      outlcpinfo->lcpsubtab.tableoflcpvalues.lcptaboffset = 0;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x1ecf3b
movq %r9, %r14
movq %r8, %r15
movq %rdi, %rbx
cmpq $0x0, 0x10(%r8)
je 0x1ecdac
movq %rcx, %r13
movq %rdx, %r12
movq 0x8(%r15), %rdx
addq (%r15), %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x1fc965
leaq 0x40(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%rbx), %rdx
movl 0x10(%rbx), %eax
movq 0x8(%r15), %rcx
movq 0x10(%r15), %rbp
cmpq $0x2, %rbp
movq %rcx, 0x20(%rsp)
jb 0x1ecdc7
movq %rdx, 0x8(%rsp)
movl %eax, (%rsp)
movq 0x68(%rbx), %rax
testq %rax, %rax
je 0x1ecdf9
movq 0x50(%rax), %rsi
leaq 0x4(%rsp), %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
callq 0x18c12b
movq 0x68(%rbx), %rcx
movl %eax, %edx
cmpq %rdx, 0x28(%rcx)
jae 0x1ece6b
movq %rdx, 0x28(%rcx)
jmp 0x1ece6b
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x1ecdf0
movb $0x1, 0x20(%rbx)
movq %r14, 0x28(%rbx)
movl %esi, 0x30(%rbx)
xorl %ecx, %ecx
jmp 0x1ecf1f
movq %r12, 0x10(%rsp)
movq %rdx, %r12
movq %r13, %rdi
movq %r14, %rsi
movl %eax, %ebp
callq 0x18c058
movq %r12, %rdi
movq 0x10(%rsp), %r12
movl %ebp, %r8d
movl %eax, 0x4(%rsp)
jmp 0x1ece74
xorl %ecx, %ecx
xorl %eax, %eax
jmp 0x1ecf1f
movq %r12, 0x10(%rsp)
movq 0x60(%rbx), %r12
addq %rcx, %r12
leaq (,%r12,4), %rsi
addq 0x48(%rbx), %rsi
leaq 0x4(%rsp), %rdi
movq %rbp, %rdx
movq %r13, %rcx
movq %r14, %r8
callq 0x18c20b
leaq (%r12,%rbp), %rcx
cmpq %rcx, %r12
jae 0x1ece66
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
movq 0x18(%rsp), %rcx
movq (%rcx), %rsi
movl (%rsp), %r8d
movq %rdx, %rdi
movl %r12d, %ecx
shrq %cl, %rdi
movq %r12, %rcx
shrq $0x6, %rcx
orq %rdi, (%rsi,%rcx,8)
incq %r12
decq %rbp
jne 0x1ece43
movq 0x10(%rsp), %r12
jmp 0x1ece6f
movq 0x10(%rsp), %r12
movl (%rsp), %r8d
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl %eax, %edx
movl %r8d, %ecx
callq 0x1ecce2
movq 0x68(%rbx), %rcx
testq %rcx, %rcx
je 0x1eceb2
cmpq %rax, 0x28(%rcx)
jae 0x1ece94
movq %rax, 0x28(%rcx)
movq 0x50(%rcx), %rcx
movb %al, (%rcx)
movq 0x68(%rbx), %rdi
movl 0x4(%rsp), %ebp
testq %rdi, %rdi
je 0x1eceea
movq 0x10(%r15), %rsi
callq 0x1ecf59
jmp 0x1ecf0c
movq 0x60(%rbx), %rcx
leaq (,%rcx,4), %rdx
addq 0x48(%rbx), %rdx
movq 0x20(%rsp), %rdi
addq %rdi, %rcx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
shrq %cl, %rsi
movl %eax, (%rdx,%rdi,4)
movq 0x40(%rbx), %rax
shrq $0x6, %rcx
orq %rsi, (%rax,%rcx,8)
movl 0x4(%rsp), %ebp
movq 0x70(%rbx), %rax
testq %rax, %rax
je 0x1ecf0c
movq 0x8(%rax), %rdi
movq (%r15), %r9
movq 0x8(%r15), %rcx
movq 0x10(%r15), %r8
movq %r12, %rsi
movq 0x18(%rsp), %rdx
callq *(%rax)
movb $0x1, 0x20(%rbx)
movq %r14, 0x28(%rbx)
movl %ebp, 0x30(%rbx)
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
addq %rax, %rcx
sete 0x38(%rbx)
cmpq $0x0, 0x68(%rbx)
jne 0x1ecf34
cmpq $0x0, 0x70(%rbx)
je 0x1ecf4a
cmpq $0x0, 0x60(%rbx)
jne 0x1ecf54
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x60(%rbx)
jmp 0x1ecf3b
callq 0x78b2f