// File: /workspace/github_c_makefile_star2_O3/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 0x784a8
movq 0x68(%rbx), %rdi
callq 0x3cfc0
movl %ebp, %r15d
movl %r14d, %ebp
incl %ebp
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0xb8f0
testl %eax, %eax
jne 0x784b5
testl %ebp, %ebp
je 0x785f3
movb %r15b, 0x7(%rsp)
movl %ebp, %ebp
movl %ebp, %eax
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
movl %r14d, %ebp
movq 0x58(%rbx), %rax
movl (%rax,%rbp,4), %r15d
cmpl $-0x1, %r15d
je 0x7859d
movq 0x10(%rbx), %rdi
imulq %rbp, %rdi
addq 0x30(%rbx), %rdi
callq *(%rbx)
andl 0x48(%rbx), %eax
cmpq %rax, %rbp
jne 0x7859d
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 0x7857f
leaq 0x78e64(%rip), %rcx     # 0xf13a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r13, %rsi
callq 0x781de
movl %eax, %eax
imulq 0x10(%rbx), %rax
movq %rax, %rdi
addq 0x30(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq *0x8(%rbx)
incl %r15d
jmp 0x7857f
movq %r13, %rdi
callq *(%rbx)
andl 0x48(%rbx), %eax
cmpq %rax, %rbp
jne 0x7862b
movl %r15d, %eax
cmpl $-0x2, %r14d
je 0x785a0
movq 0x58(%rbx), %rcx
movl %r14d, %edx
movl (%rcx,%rdx,4), %edx
movl %r14d, %ecx
movl %edx, %r14d
jmp 0x78511
movl %r14d, %eax
movq %rbp, %rcx
incq %rcx
movq %rcx, %rbp
movl %eax, %r14d
cmpq 0x8(%rsp), %rcx
jne 0x784dd
testl %eax, %eax
movb 0x7(%rsp), %r15b
je 0x785f3
movl 0x50(%rbx), %ecx
movl 0x54(%rbx), %eax
cmpl %ecx, %eax
jae 0x785f3
movzwl 0x60(%rbx), %esi
cmpw $0x5, %si
jb 0x785f3
movl %ecx, %edx
movl %esi, %ecx
decl %ecx
cmpl %edx, %eax
jae 0x785e8
shrl %edx
movl %ecx, %esi
cmpw $0x4, %cx
ja 0x785d6
movzwl %cx, %esi
movq %rbx, %rdi
callq 0x77ee5
xorl %ecx, %ecx
movl %ecx, %eax
testb %r15b, %r15b
je 0x78609
movl %ecx, %ebp
movq 0x68(%rbx), %rdi
callq 0x3cfdb
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
cmpb $0x0, 0x7(%rsp)
jne 0x785fc
jmp 0x78609
callq 0x1c6b0
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0xb220