// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rdi
shlq $0x2, %rdi
leaq 0x3747e4(%rip), %rsi    # 0x56a218
movl $0x133, %edx            # imm = 0x133
callq 0xe80f0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x28(%rsp)
je 0x1f5a6d
movq 0x28(%rsp), %rdi
movq 0x4464da(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x374994(%rip), %rsi    # 0x56a3fc
callq 0x121930
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1f5b6c
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
jbe 0x1f5b57
jmp 0x1f5aab
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x28(%rcx), %rax
jb 0x1f5af3
movq 0x4464de(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x320547(%rip), %rsi    # 0x516013
leaq 0x37493e(%rip), %rdx    # 0x56a411
leaq 0x374959(%rip), %rcx    # 0x56a433
leaq 0x374737(%rip), %r8     # 0x56a218
movl $0x13c, %r9d            # imm = 0x13C
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1f5af5
movq 0x20(%rsp), %rax
movl %eax, %edx
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x18(%rsp)
movl %edx, (%rax,%rcx,4)
movq 0x8(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rcx), %rcx
movq 0x20(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jae 0x1f5b55
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x1f5b57
jmp 0x1f5b59
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x1f5a76
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x18(%rsp), %rsi
movq 0x30(%rsp), %rax
movq (%rax), %rcx
movl $0x4, %edx
leaq 0x172(%rip), %r8        # 0x1f5d00
callq 0xfb9e0
cmpq $0x0, 0x18(%rsp)
ja 0x1f5bd3
movq 0x4463fe(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x320467(%rip), %rsi    # 0x516013
leaq 0x37489f(%rip), %rdx    # 0x56a452
leaq 0x374879(%rip), %rcx    # 0x56a433
leaq 0x374657(%rip), %r8     # 0x56a218
movl $0x146, %r9d            # imm = 0x146
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1f5bd5
movq 0x30(%rsp), %rax
testb $0x1, 0x30(%rax)
je 0x1f5c0b
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rdx
movq 0x8(%rdx), %rdx
movl (%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x28(%rsp)
je 0x1f5c2e
movq 0x28(%rsp), %rdi
movq 0x446319(%rip), %rax    # 0x63bf38
movq (%rax), %rdx
leaq 0x374832(%rip), %rsi    # 0x56a45b
callq 0x121930
movq $0x1, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x1f5ca3
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x20(%rsp), %rdx
subq $0x1, %rdx
movl (%rcx,%rdx,4), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rdx
movq 0x8(%rdx), %rdx
movq 0x20(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
shlq $0x4, %rdx
addq %rdx, %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x1f5c37
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x18(%rsp), %rdx
subq $0x1, %rdx
movl (%rcx,%rdx,4), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x374538(%rip), %rsi    # 0x56a218
movl $0x155, %edx            # imm = 0x155
callq 0xe88c0
movq 0x10(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)