// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq *(%rbx)
movl %eax, %r15d
andl 0x48(%rbx), %r15d
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r15d, %ebp
movq 0x58(%rbx), %rax
movl %r15d, %esi
movl (%rax,%rsi,4), %r15d
cmpl $-0x1, %r15d
je 0x77d55
imulq 0x10(%rbx), %rsi
addq 0x30(%rbx), %rsi
movq %r14, %rdi
callq *0x18(%rbx)
testl %eax, %eax
je 0x77d65
movl %ebp, %r12d
testl %r15d, %r15d
jns 0x77d2e
movl %ebp, %r12d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $-0x1, %ebp
je 0x77d84
movq 0x58(%rbx), %rax
movl %ebp, %r15d
movl (%rax,%r15,4), %r14d
cmpl $-0x1, %r12d
je 0x77d8e
movl %r12d, %ecx
movl %r14d, (%rax,%rcx,4)
jmp 0x77dfe
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x77e2b
cmpl $-0x2, %r14d
je 0x77dfe
movq %rbx, %rdi
movl %ebp, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x78dba
movl %eax, %ebp
movq 0x10(%rbx), %rdx
movq 0x30(%rbx), %rax
movq %rdx, %rsi
imulq %r15, %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 %r14, %rsi
addq %rax, %rsi
movq %rdx, %rdi
imulq %r15, %rdi
addq %rax, %rdi
callq 0xb520
movq 0x58(%rbx), %rax
movl (%rax,%r14,4), %ecx
movl %ecx, (%rax,%r15,4)
movq 0x58(%rbx), %rax
movl $0xffffffff, (%rax,%r14,4) # imm = 0xFFFFFFFF
movq 0x8(%rbx), %rax
movl %ebp, %r14d
testq %rax, %rax
je 0x77e1c
movq 0x10(%rbx), %rdi
imulq %r14, %rdi
addq 0x30(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq *%rax
movq 0x58(%rbx), %rax
movl $0xffffffff, (%rax,%r14,4) # imm = 0xFFFFFFFF
decl 0x54(%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq