// File: /workspace/github_c_makefile_star2_O1/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 $0xf8, %rsp
movl %r8d, %ebp
movq %rcx, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %rbx
movl 0x48(%rdi), %r14d
testl %r8d, %r8d
je 0x77fca
movq 0x68(%rbx), %rdi
callq 0x3d934
movb %bpl, 0xf(%rsp)
movl %r14d, %ebp
incl %ebp
leaq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0xb8f0
testl %eax, %eax
jne 0x77fd9
testl %ebp, %ebp
je 0x7815e
movl %ebp, %ebp
movl %ebp, %r12d
xorl %r14d, %r14d
movl %r14d, %ebp
movq %r12, 0x10(%rsp)
movq 0x58(%rbx), %rax
movl (%rax,%rbp,4), %r15d
movb $0x1, %al
cmpl $-0x1, %r15d
je 0x7810e
movq 0x10(%rbx), %rdi
imulq %rbp, %rdi
addq 0x30(%rbx), %rdi
callq *(%rbx)
andl 0x48(%rbx), %eax
cmpq %rax, %rbp
jne 0x7810c
movl %ebp, %r12d
movl %r14d, %ecx
movl %r15d, %r14d
movl %r12d, %eax
movl %eax, %r13d
imulq 0x10(%rbx), %r13
movl %ecx, %r15d
addq 0x30(%rbx), %r13
movq %r13, %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq *0x18(%rsp)
decl %eax
cmpl $0x3, %eax
ja 0x780c2
leaq 0x7938f(%rip), %rcx     # 0xf13f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %r13d
cmpb $0x0, 0xf(%rsp)
je 0x78084
movq 0x68(%rbx), %rdi
callq 0x3d94f
xorl %eax, %eax
movl %eax, %ecx
movl %r13d, %edx
jmp 0x780f2
movq %r13, %rdi
callq *(%rbx)
andl 0x48(%rbx), %eax
cmpq %rax, %rbp
je 0x780c2
jmp 0x7819a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x77d0e
movl %eax, %eax
imulq 0x10(%rbx), %rax
movq %rax, %rdi
addq 0x30(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq *0x8(%rbx)
incl %r15d
xorl %eax, %eax
cmpl $-0x2, %r14d
jne 0x780dc
movl $0x8, %edx
movl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
movl %eax, %ecx
movl %r12d, %r14d
jmp 0x780f2
movq 0x58(%rbx), %rcx
movl %r14d, %edx
movl (%rcx,%rdx,4), %ecx
movb $0x1, %dl
movl %r14d, %r12d
movl %ecx, %r14d
movl %edx, %ecx
movl %eax, %edx
movl %ecx, %eax
movl %r15d, %ecx
testl %edx, %edx
je 0x78034
cmpl $0x8, %edx
movq 0x10(%rsp), %r12
movl %r15d, %r14d
jne 0x7810e
movb $0x1, %al
testb %al, %al
je 0x78174
movl %r14d, %eax
movq %rbp, %rcx
incq %rcx
movq %rcx, %rbp
cmpq %r12, %rcx
jne 0x77ffd
testl %eax, %eax
je 0x7815e
movl 0x50(%rbx), %ecx
movl 0x54(%rbx), %eax
cmpl %ecx, %eax
jae 0x7815e
movzwl 0x60(%rbx), %esi
cmpw $0x5, %si
jb 0x7815e
movl %ecx, %edx
movl %esi, %ecx
decl %ecx
cmpl %edx, %eax
jae 0x78153
shrl %edx
movl %ecx, %esi
cmpw $0x4, %cx
ja 0x78141
movzwl %cx, %esi
movq %rbx, %rdi
callq 0x779f5
xorl %ebp, %ebp
cmpb $0x0, 0xf(%rsp)
je 0x78170
movq 0x68(%rbx), %rdi
callq 0x3d94f
movl %ebp, %eax
jmp 0x78179
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0xb220
callq 0x1c705