// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/hashtable.c
// Function: gt_ht_remove
static htsize_t
gt_ht_remove(GtHashtable *ht, const void *elem)
{
  htsize_t remove_pos = free_mark, referent = free_mark;
  gt_ht_traverse_list_of_key(ht, elem,,
                          if (link != free_mark
                              && !ht->table_info.cmp(elem,
                                                     gt_ht_elem_ptr(ht, idx)))
                          { remove_pos = idx; break; }
                          referent = idx;,);
  /* was elem found? */
  if (remove_pos != free_mark)
  {
    htsize_t chain_next = HT_GET_LINK(ht, remove_pos);
    if (referent != free_mark)
    {
      HT_SET_LINK(ht, referent, chain_next);
    }
    else if (chain_next != end_mark)
    {
      /* handle removal of chain head, where there is a non-empty tail */
      /* find next free field to move chain head to temporarily */
      htsize_t cp_dest_idx = gt_ht_find_free_idx(ht, remove_pos, -1);
      gt_ht_cp_elem(ht, cp_dest_idx, gt_ht_elem_ptr(ht, remove_pos));
      gt_ht_cp_elem(ht, remove_pos, gt_ht_elem_ptr(ht, chain_next));
      HT_SET_LINK(ht, remove_pos, HT_GET_LINK(ht, chain_next));
      HT_SET_LINK(ht, chain_next, free_mark);
      remove_pos = cp_dest_idx;
    }
    if (ht->table_info.free_op.free_elem_with_data)
      ht->table_info.free_op.free_elem_with_data(gt_ht_elem_ptr(ht, remove_pos),
                                                 ht->table_info.table_data);
    HT_SET_LINK(ht, remove_pos, free_mark);
    --ht->current_fill;
    return remove_pos;
  }
  return free_mark;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq *(%rbx)
movl %eax, %r13d
andl 0x48(%rbx), %r13d
pushq $-0x1
popq %rbp
movq 0x58(%rbx), %rax
movl %r13d, %r12d
movl (%rax,%r12,4), %r14d
cmpl $-0x1, %r14d
je 0x56aec
movq 0x10(%rbx), %rsi
imulq %r12, %rsi
addq 0x30(%rbx), %rsi
movq %r15, %rdi
callq *0x18(%rbx)
testl %eax, %eax
je 0x56af2
movl %r13d, %ebp
movl %r14d, %r13d
testl %r14d, %r14d
jns 0x56aba
pushq $-0x1
popq %r15
jmp 0x56b44
cmpl $-0x1, %r13d
pushq $-0x1
popq %r15
je 0x56b44
movq 0x58(%rbx), %rax
movl (%rax,%r12,4), %r15d
cmpl $-0x1, %ebp
je 0x56b11
movl %ebp, %ecx
movl %r15d, (%rax,%rcx,4)
jmp 0x56b17
cmpl $-0x2, %r15d
jne 0x56b56
movl %r13d, %r15d
movq 0x8(%rbx), %rax
movl %r15d, %r14d
testq %rax, %rax
je 0x56b38
movq 0x10(%rbx), %rdi
imulq %r14, %rdi
addq 0x30(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq *%rax
movq 0x58(%rbx), %rax
orl $-0x1, (%rax,%r14,4)
decl 0x54(%rbx)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movl %r13d, %esi
callq 0x57b34
movl %eax, %ebp
movq 0x10(%rbx), %rdx
movq 0x30(%rbx), %rax
movq %rdx, %rsi
imulq %r12, %rsi
addq %rax, %rsi
movl %ebp, %edi
imulq %rdx, %rdi
addq %rax, %rdi
callq 0xb520
movq 0x10(%rbx), %rdx
movq 0x30(%rbx), %rax
movq %rdx, %rsi
imulq %r15, %rsi
addq %rax, %rsi
movq %rdx, %rdi
imulq %r12, %rdi
addq %rax, %rdi
callq 0xb520
movq 0x58(%rbx), %rax
movl (%rax,%r15,4), %ecx
movl %ecx, (%rax,%r12,4)
movq 0x58(%rbx), %rax
orl $-0x1, (%rax,%r15,4)
movl %ebp, %r15d
jmp 0x56b1a