// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x88, %rsp
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x68(%rsp) # imm = 0xFFFFFFFF
movq 0x78(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x87250
movl %eax, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x58(%rsp)
movq 0x60(%rsp), %rdi
movl 0x58(%rsp), %esi
callq 0x87280
movl %eax, 0x54(%rsp)
cmpl $-0x1, 0x54(%rsp)
je 0x87adb
movq 0x78(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x78(%rsp), %rdi
movl 0x58(%rsp), %esi
callq 0x872a0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movq 0x40(%rsp), %rax
callq *%rax
cmpl $0x0, %eax
jne 0x87adb
movl 0x58(%rsp), %eax
movl %eax, 0x6c(%rsp)
jmp 0x87afc
movl 0x58(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x54(%rsp), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x87a76
jmp 0x87afe
cmpl $-0x1, 0x6c(%rsp)
je 0x87c71
movq 0x78(%rsp), %rdi
movl 0x6c(%rsp), %esi
callq 0x87280
movl %eax, 0x50(%rsp)
cmpl $-0x1, 0x68(%rsp)
je 0x87b39
movq 0x78(%rsp), %rdi
movl 0x68(%rsp), %esi
movl 0x50(%rsp), %edx
callq 0x89980
jmp 0x87c0a
cmpl $-0x2, 0x50(%rsp)
je 0x87c08
movq 0x78(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x898a0
movl %eax, 0x4c(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x78(%rsp), %rdi
movl 0x6c(%rsp), %esi
callq 0x872a0
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
movq %rax, %rdx
callq 0x89940
movq 0x78(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x78(%rsp), %rdi
movl 0x50(%rsp), %esi
callq 0x872a0
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %esi
movq %rax, %rdx
callq 0x89940
movq 0x78(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0x78(%rsp), %rdi
movl 0x50(%rsp), %esi
callq 0x87280
movq 0x28(%rsp), %rdi
movl 0x34(%rsp), %esi
movl %eax, %edx
callq 0x89980
movq 0x78(%rsp), %rdi
movl 0x50(%rsp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x89980
movl 0x4c(%rsp), %eax
movl %eax, 0x6c(%rsp)
jmp 0x87c0a
movq 0x78(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x87c43
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
movq 0x78(%rsp), %rdi
movl 0x6c(%rsp), %esi
callq 0x872a0
movq %rax, %rdi
movq (%rsp), %rax
movq 0x78(%rsp), %rcx
movq 0x20(%rcx), %rsi
callq *%rax
movq 0x78(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x89980
movq 0x78(%rsp), %rax
movl 0x54(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x54(%rax)
movl 0x6c(%rsp), %eax
movl %eax, 0x84(%rsp)
jmp 0x87c7c
movl $0xffffffff, 0x84(%rsp) # imm = 0xFFFFFFFF
movl 0x84(%rsp), %eax
addq $0x88, %rsp
retq
nopl (%rax,%rax)