// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/hashtable.c
// Function: gt_hashtable_foreach_g
static int gt_hashtable_foreach_g(GtHashtable *ht, Elemvisitfunc visitor,
                                  void *data, GtError *err, bool lock)
{
  htsize_t i, table_size = ht->table_mask + 1, deletion_count = 0;
  jmp_buf env;
  if (lock) {
    gt_rwlock_wrlock(ht->lock);
  }
  while (setjmp(env))
    ;
  for (i = 0; i < table_size; ++i)
  {
    htsize_t idx = i, link = HT_GET_LINK(ht, i);
    /* if i is occupied and forms a chain start */
    if (link != free_mark
        && gt_ht_elem_hash_idx(ht, gt_ht_elem_ptr(ht, i)) == i)
      while (1)
      {
        void *elem;
        elem = gt_ht_elem_ptr(ht, idx);
        switch (visitor(elem, data, err))
        {
        case CONTINUE_ITERATION:
          break;
        case STOP_ITERATION:
          if (lock) {
           gt_rwlock_unlock(ht->lock);
          }
          return -1;
        case DELETED_ELEM:
          {
            htsize_t remove_pos = gt_ht_remove(ht, elem);
            ht->table_info.free_op.free_elem_with_data(
              gt_ht_elem_ptr(ht, remove_pos), ht->table_info.table_data);
            ++deletion_count;
          }
          break;
        case MODIFIED_KEY:
          if (gt_ht_elem_hash_idx(ht, elem) != i)
          {
            /* elem now belongs to new chain */
            /* FIXME: handle deferred move */
            fprintf(stderr, "Feature MODIFIED_KEY not implemented yet"
                    " (%s:%d).\n", __FILE__, __LINE__);
            /* push idx */
            abort();
          }
          break;
        case REDO_ITERATION:
          longjmp(env, 1);
          break;
        }
        idx = link;
        if (idx == end_mark)
          break;
        link = HT_GET_LINK(ht, link);
      }
  }
  /* FIXME: re-insert pushed indices and rectify affected chains */
  /* if hashtable shrunk below low_mark, resize */
  if (deletion_count &&
      ht->current_fill < ht->low_fill)
    gt_ht_shrink(ht);
  if (lock) {
    gt_rwlock_unlock(ht->lock);
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r8d, %ebp
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %rbx
movl 0x48(%rdi), %r14d
testl %r8d, %r8d
je 0x56dff
movq 0x68(%rbx), %rdi
callq 0x15e99
movb %bpl, 0x7(%rsp)
movl %r14d, %ebp
incl %ebp
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0xb8e0
testl %eax, %eax
jne 0x56e0e
movl %ebp, %ebp
movl %ebp, %eax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
movl %r14d, %ebp
cmpq 0x8(%rsp), %rbp
je 0x56f00
movq 0x58(%rbx), %rax
movl (%rax,%rbp,4), %r15d
cmpl $-0x1, %r15d
je 0x56ef3
movq 0x10(%rbx), %rdi
imulq %rbp, %rdi
addq 0x30(%rbx), %rdi
callq *(%rbx)
andl 0x48(%rbx), %eax
cmpq %rax, %rbp
jne 0x56ef3
movl %ebp, %ecx
movl %r14d, %eax
movl %r15d, %r14d
movl %ecx, %ecx
movl %ecx, %r13d
imulq 0x10(%rbx), %r13
movl %eax, %r15d
addq 0x30(%rbx), %r13
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq *%r12
decl %eax
cmpl $0x3, %eax
ja 0x56ed2
leaq 0x834bd(%rip), %rcx     # 0xda354
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r13, %rsi
callq 0x56a9a
movl %eax, %eax
imulq 0x10(%rbx), %rax
movq %rax, %rdi
addq 0x30(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq *0x8(%rbx)
incl %r15d
jmp 0x56ed2
movq %r13, %rdi
callq *(%rbx)
andl 0x48(%rbx), %eax
cmpq %rax, %rbp
jne 0x56f3f
cmpl $-0x2, %r14d
je 0x56ef0
movq 0x58(%rbx), %rcx
movl %r14d, %edx
movl (%rcx,%rdx,4), %edx
movl %r15d, %eax
movl %r14d, %ecx
movl %edx, %r14d
jmp 0x56e68
movl %r15d, %r14d
incq %rbp
jmp 0x56e29
pushq $-0x1
popq %rcx
jmp 0x56f17
testl %r14d, %r14d
je 0x56f15
movl 0x54(%rbx), %eax
cmpl 0x50(%rbx), %eax
jae 0x56f15
movq %rbx, %rdi
callq 0x56bc4
xorl %ecx, %ecx
movl %ecx, %eax
cmpb $0x0, 0x7(%rsp)
je 0x56f2d
movl %ecx, %ebp
movq 0x68(%rbx), %rdi
callq 0x15f0a
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd7072(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x8362c(%rip), %rsi     # 0xda57c
leaq 0x83452(%rip), %rdx     # 0xda3a9
xorl %eax, %eax
movl $0x218, %ecx            # imm = 0x218
callq 0xb8c0
callq 0xb300
leaq 0x20(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0xb220