// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/uint64hashtable.c
// Function: gt_uint64hashtable_partialsums
GtUword gt_uint64hashtable_partialsums(GtUint64hashtable *table,
                                             GtTimer *timer)
{
  size_t idx, next = 0;
  GtUword psum, maxsize = 0;

  table->sortedhspace = gt_malloc((size_t) table->allentries *
                                  sizeof (*table->sortedhspace));
  if (timer != NULL)
  {
    gt_timer_show_progress(timer, "sorting the hashkeys",stdout);
  }
  for (idx = 0; idx < table->alloc; idx++)
  {
    if (table->hspace[idx].count > 0)
    {
      gt_assert(next < (size_t) table->allentries);
      table->sortedhspace[next++] = idx;
      if (maxsize < table->hspace[idx].count)
      {
        maxsize = table->hspace[idx].count;
      }
    }
  }
  gt_qsort_r(table->sortedhspace,next,sizeof (*table->sortedhspace),
             table->hspace,compareGtUint64hashstoredvalue);
  gt_assert(next > 0);
  if (table->zero_occurs)
  {
    table->hspace[table->sortedhspace[0]].count += table->zero_count;
  }
  if (timer != NULL)
  {
    gt_timer_show_progress(timer, "computing partial sums",stdout);
  }
  for (idx = (size_t) 1; idx < next; idx++)
  {
    table->hspace[table->sortedhspace[idx]].count +=
      table->hspace[table->sortedhspace[idx-1]].count;
  }
  psum = table->hspace[table->sortedhspace[next-1]].count;
  gt_free(table->sortedhspace);
  return psum;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
shlq $0x2, %rdi
leaq 0x214beb(%rip), %rsi    # 0x3a0ce0
movl $0x133, %edx            # imm = 0x133
callq 0x1092b2
movq %rax, 0x8(%rbx)
testq %r14, %r14
je 0x18c121
movq 0x337dd9(%rip), %rax    # 0x4c3ee8
movq (%rax), %rdx
leaq 0x214d9f(%rip), %rsi    # 0x3a0eb8
movq %r14, %rdi
callq 0x1229c8
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x18c15f
movq (%rbx), %rcx
addq $0x8, %rcx
xorl %edx, %edx
xorl %r15d, %r15d
cmpq $0x0, (%rcx)
je 0x18c151
cmpq 0x28(%rbx), %r15
jae 0x18c230
movq 0x8(%rbx), %rsi
movl %edx, (%rsi,%r15,4)
incq %r15
incq %rdx
addq $0x10, %rcx
cmpq %rdx, %rax
jne 0x18c136
jmp 0x18c162
xorl %r15d, %r15d
movq (%rbx), %rcx
movq 0x8(%rbx), %rdi
leaq 0xca(%rip), %r8         # 0x18c23a
movl $0x4, %edx
movq %r15, %rsi
callq 0x1118d4
testq %r15, %r15
je 0x18c235
cmpb $0x1, 0x30(%rbx)
jne 0x18c1a2
movq 0x20(%rbx), %rax
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
movl (%rdx), %edx
shlq $0x4, %rdx
addq %rax, 0x8(%rcx,%rdx)
testq %r14, %r14
je 0x18c1c0
movq 0x337d3a(%rip), %rax    # 0x4c3ee8
movq (%rax), %rdx
leaq 0x214d5f(%rip), %rsi    # 0x3a0f17
movq %r14, %rdi
callq 0x1229c8
cmpq $0x1, %r15
je 0x18c201
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq $0x3, %r15
movl $0x2, %edx
cmovaeq %r15, %rdx
movl $0x1, %esi
movl -0x4(%rcx,%rsi,4), %edi
movl (%rcx,%rsi,4), %r8d
shlq $0x4, %rdi
movq 0x8(%rax,%rdi), %rdi
shlq $0x4, %r8
addq %rdi, 0x8(%rax,%r8)
incq %rsi
cmpq %rsi, %rdx
jne 0x18c1df
movq (%rbx), %rax
movq 0x8(%rbx), %rdi
movl -0x4(%rdi,%r15,4), %ecx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rbx
leaq 0x214ac3(%rip), %rsi    # 0x3a0ce0
movl $0x155, %edx            # imm = 0x155
callq 0x109670
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x5a7e9
callq 0x5a822