// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/bcktab.c
// Function: pfxidxpartialsums
static void pfxidxpartialsums(GtUword *count,
                              GtCodetype code,
                              const GtBcktab *bcktab)
{
  unsigned int prefixindex;
  GtUword sum = 0, specialsinbucket;
  GtCodetype ordercode, divisor;

  memset(count,0,sizeof (*count) * (size_t) bcktab->prefixlength);
  for (prefixindex=bcktab->prefixlength-2; prefixindex>=1U; prefixindex--)
  {
    if (code >= bcktab->filltable[prefixindex])
    {
      ordercode = code - bcktab->filltable[prefixindex];
      divisor = bcktab->filltable[prefixindex] + 1;
      if (ordercode % divisor == 0)
      {
        ordercode /= divisor;
        count[prefixindex]
          = gt_bcktab_distpfxidx_get(bcktab,prefixindex-1,ordercode);
        sum += count[prefixindex];
      }
    } else
    {
      break;
    }
  }
  specialsinbucket = fromcode2countspecialcodes(code,bcktab);
  gt_assert(sum <= specialsinbucket);
  count[bcktab->prefixlength-1] = specialsinbucket - sum;
  if (bcktab->prefixlength > 2U)
  {
    for (prefixindex = bcktab->prefixlength-2; prefixindex>=1U; prefixindex--)
    {
      count[prefixindex] += count[prefixindex+1];
    }
#ifndef NDEBUG
    if (specialsinbucket != count[1])
    {
      fprintf(stderr,"code " FormatGtCodetype ": sum = "GT_WU" != "GT_WU
              " = count[1]\n", code,sum,count[1]);
      exit(GT_EXIT_PROGRAMMING_ERROR);
    }
#endif
  }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rax
movl 0x48(%rax), %eax
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x19360
movq 0x30(%rsp), %rax
movl 0x48(%rax), %eax
subl $0x2, %eax
movl %eax, 0x2c(%rsp)
cmpl $0x1, 0x2c(%rsp)
jb 0x204c3c
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movq 0x78(%rcx), %rcx
movl 0x2c(%rsp), %edx
cmpq (%rcx,%rdx,8), %rax
jb 0x204c28
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movq 0x78(%rcx), %rcx
movl 0x2c(%rsp), %edx
subq (%rcx,%rdx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movq 0x78(%rax), %rax
movl 0x2c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x8(%rsp)
cmpq $0x0, %rdx
jne 0x204c26
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
movl 0x2c(%rsp), %esi
subl $0x1, %esi
movq 0x10(%rsp), %rdx
callq 0x205140
movq %rax, %rdx
movq 0x40(%rsp), %rax
movl 0x2c(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x40(%rsp), %rax
movl 0x2c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x204c2a
jmp 0x204c3c
jmp 0x204c2c
movl 0x2c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x204b65
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x206b30
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jbe 0x204c94
movq 0x43733d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3113a6(%rip), %rsi    # 0x516013
leaq 0x36c69c(%rip), %rdx    # 0x571310
leaq 0x36c6ad(%rip), %rcx    # 0x571328
leaq 0x36c190(%rip), %r8     # 0x570e12
movl $0x28f, %r9d            # imm = 0x28F
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x204c96
movq 0x18(%rsp), %rdx
subq 0x20(%rsp), %rdx
movq 0x40(%rsp), %rax
movq 0x30(%rsp), %rcx
movl 0x48(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x30(%rsp), %rax
cmpl $0x2, 0x48(%rax)
jbe 0x204d52
movq 0x30(%rsp), %rax
movl 0x48(%rax), %eax
subl $0x2, %eax
movl %eax, 0x2c(%rsp)
cmpl $0x1, 0x2c(%rsp)
jb 0x204d0b
movq 0x40(%rsp), %rax
movl 0x2c(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
movq 0x40(%rsp), %rax
movl 0x2c(%rsp), %ecx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl 0x2c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x204cd4
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x8(%rcx), %rax
je 0x204d50
movq 0x43727e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x38(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %rax
movq 0x8(%rax), %r8
leaq 0x36c5fb(%rip), %rsi    # 0x57133a
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
jmp 0x204d52
addq $0x48, %rsp
retq
nopw (%rax,%rax)