// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/hashtable.c
// Function: gt_hashtable_foreach_ordered
int gt_hashtable_foreach_ordered(GtHashtable *ht, Elemvisitfunc iter,
                                 void *data, GtCompare cmp, GtError *err)
{
  GtArray *hash_entries;
  void *elem;
  GtUword i;
  int had_err;
  gt_error_check(err);
  gt_assert(ht && iter && cmp);
  gt_rwlock_wrlock(ht->lock);
  hash_entries = gt_array_new(ht->table_info.elem_size);
  {
    struct hash_to_array_data visitor_data = { ht->table_info.elem_size,
                                               hash_entries };

    had_err = gt_hashtable_foreach_g(ht, gt_ht_save_entry_to_array,
                                     &visitor_data, err, false);
  }
  gt_rwlock_unlock(ht->lock);
  if (!had_err) {
    size_t hash_size;
    gt_qsort_r(gt_array_get_space(hash_entries), gt_array_size(hash_entries),
               gt_array_elem_size(hash_entries), data, (GtCompareWithData)cmp);
    hash_size = gt_array_size(hash_entries);
    gt_assert(hash_size == gt_hashtable_fill(ht));
    for (i = 0; !had_err && i < hash_size; i++) {
      elem = gt_array_get(hash_entries, i);
      had_err = iter(elem, data, err);
    }
  }
  gt_array_delete(hash_entries);
  return had_err;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
je 0x87df3
movq 0x60(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x87dbb
jmp 0x87df3
movq 0x12c216(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xd629a(%rip), %rsi     # 0x15e066
leaq 0xd6875(%rip), %rdx     # 0x15e648
leaq 0xe6bd2(%rip), %rcx     # 0x16e9ac
leaq 0xe6b64(%rip), %r8      # 0x16e945
movl $0x239, %r9d            # imm = 0x239
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x87df5
jmp 0x87df7
cmpq $0x0, 0x80(%rsp)
je 0x87e12
cmpq $0x0, 0x78(%rsp)
je 0x87e12
cmpq $0x0, 0x68(%rsp)
jne 0x87e4a
movq 0x12c1bf(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xd6243(%rip), %rsi     # 0x15e066
leaq 0xe6b9f(%rip), %rdx     # 0x16e9c9
leaq 0xe6b7b(%rip), %rcx     # 0x16e9ac
leaq 0xe6b0d(%rip), %r8      # 0x16e945
movl $0x23a, %r9d            # imm = 0x23A
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x87e4c
movq 0x80(%rsp), %rax
movq 0x68(%rax), %rdi
callq 0x1c100
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x75ab0
movq %rax, 0x58(%rsp)
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x80(%rsp), %rdi
movq 0x60(%rsp), %rcx
leaq 0x46e(%rip), %rsi       # 0x88310
leaq 0x30(%rsp), %rdx
xorl %r8d, %r8d
callq 0x88010
movl %eax, 0x44(%rsp)
movq 0x80(%rsp), %rax
movq 0x68(%rax), %rdi
callq 0x1c1a0
cmpl $0x0, 0x44(%rsp)
jne 0x87ff1
movq 0x58(%rsp), %rdi
callq 0x761a0
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rdi
callq 0x76490
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rdi
callq 0x764c0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
movq 0x70(%rsp), %rcx
movq 0x68(%rsp), %r8
callq 0x8fd20
movq 0x58(%rsp), %rdi
callq 0x76490
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x80(%rsp), %rdi
callq 0x883a0
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
je 0x87f7e
movq 0x12c08b(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xd610f(%rip), %rsi     # 0x15e066
leaq 0xe6a7d(%rip), %rdx     # 0x16e9db
leaq 0xe6a47(%rip), %rcx     # 0x16e9ac
leaq 0xe69d9(%rip), %r8      # 0x16e945
movl $0x24a, %r9d            # imm = 0x24A
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x87f80
movq $0x0, 0x48(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x44(%rsp)
movb %al, 0xf(%rsp)
jne 0x87fa7
movq 0x48(%rsp), %rax
cmpq 0x28(%rsp), %rax
setb %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x87fb1
jmp 0x87fef
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x75c80
movq %rax, 0x50(%rsp)
movq 0x78(%rsp), %rax
movq 0x50(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x60(%rsp), %rdx
callq *%rax
movl %eax, 0x44(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x87f89
jmp 0x87ff1
movq 0x58(%rsp), %rdi
callq 0x770a0
movl 0x44(%rsp), %eax
addq $0x88, %rsp
retq
nopw (%rax,%rax)