// File: /workspace/github_c_makefile_star2_O2/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, %r15
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
shlq $0x2, %rdi
leaq 0x20c5fb(%rip), %rsi    # 0x337b70
movl $0x133, %edx            # imm = 0x133
callq 0x93160
movq %rax, 0x8(%rbx)
testq %r15, %r15
je 0x12b5a1
movq 0x30c921(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x20c7af(%rip), %rsi    # 0x337d48
movq %r15, %rdi
callq 0xaf86f
movq 0x10(%rbx), %rax
pushq $0x8
popq %rcx
xorl %r14d, %r14d
xorl %edx, %edx
cmpq %rdx, %rax
je 0x12b5da
movq (%rbx), %rsi
cmpq $0x0, (%rsi,%rcx)
je 0x12b5d1
cmpq 0x28(%rbx), %r14
jae 0x12b68b
movq 0x8(%rbx), %rsi
movl %edx, (%rsi,%r14,4)
incq %r14
incq %rdx
addq $0x10, %rcx
jmp 0x12b5ad
movq (%rbx), %rcx
movq 0x8(%rbx), %rdi
leaq 0x109(%rip), %r8        # 0x12b6f1
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x9d5a0
testq %r14, %r14
je 0x12b6c3
cmpb $0x1, 0x30(%rbx)
jne 0x12b618
movq 0x20(%rbx), %rax
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
movl (%rdx), %edx
shlq $0x4, %rdx
addq %rax, 0x8(%rcx,%rdx)
testq %r15, %r15
je 0x12b636
movq 0x30c88c(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x20c779(%rip), %rsi    # 0x337da7
movq %r15, %rdi
callq 0xaf86f
movq (%rbx), %rax
movq 0x8(%rbx), %rdi
pushq $0x1
popq %rcx
cmpq %r14, %rcx
jae 0x12b663
movl -0x4(%rdi,%rcx,4), %edx
movl (%rdi,%rcx,4), %esi
shlq $0x4, %rdx
movq 0x8(%rax,%rdx), %rdx
shlq $0x4, %rsi
addq %rdx, 0x8(%rax,%rsi)
incq %rcx
jmp 0x12b640
movl -0x4(%rdi,%r14,4), %ecx
shlq $0x4, %rcx
movq 0x8(%rax,%rcx), %rbx
leaq 0x20c4f8(%rip), %rsi    # 0x337b70
movl $0x155, %edx            # imm = 0x155
callq 0x936f9
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x30c8d6(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9977(%rip), %rsi    # 0x2e5013
leaq 0x20c6ba(%rip), %rdx    # 0x337d5d
leaq 0x20c6d5(%rip), %rcx    # 0x337d7f
leaq 0x20c4bf(%rip), %r8     # 0x337b70
movl $0x13c, %r9d            # imm = 0x13C
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x30c89e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b993f(%rip), %rsi    # 0x2e5013
leaq 0x20c6c3(%rip), %rdx    # 0x337d9e
leaq 0x20c69d(%rip), %rcx    # 0x337d7f
leaq 0x20c487(%rip), %r8     # 0x337b70
movl $0x146, %r9d            # imm = 0x146
jmp 0x12b6b7