// File: /workspace/github_c_makefile_star2_O3/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
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x58(%rbx), %rax
movl %r13d, %r12d
movl (%rax,%r12,4), %r14d
cmpl $-0x1, %r14d
je 0x78232
movq 0x10(%rbx), %rsi
imulq %r12, %rsi
addq 0x30(%rbx), %rsi
movq %r15, %rdi
callq *0x18(%rbx)
testl %eax, %eax
je 0x7823a
movl %r13d, %ebp
movl %r14d, %r13d
testl %r14d, %r14d
jns 0x78200
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x78291
cmpl $-0x1, %r13d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
je 0x78291
movq 0x58(%rbx), %rax
movl (%rax,%r12,4), %r15d
cmpl $-0x1, %ebp
je 0x7825b
movl %ebp, %ecx
movl %r15d, (%rax,%rcx,4)
jmp 0x78261
cmpl $-0x2, %r15d
jne 0x782a3
movl %r13d, %r15d
movq 0x8(%rbx), %rax
movl %r15d, %r14d
testq %rax, %rax
je 0x78282
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 %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl %r13d, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x79258
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
movl $0xffffffff, (%rax,%r15,4) # imm = 0xFFFFFFFF
movl %ebp, %r15d
jmp 0x78264