// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/hashtable.c
// Function: gt_ht_insert
static int
gt_ht_insert(GtHashtable *ht, const void *elem, void **stor_ptr)
{
  htsize_t insert_pos;
  do {
    htsize_t elem_hash = gt_ht_elem_hash_idx(ht, elem), idx,
      link = elem_hash;
    if (HT_GET_LINK(ht, link) == free_mark)
    {
      /* we can insert at initial link and start a new chain */
      insert_pos = link;
      break;
    }
    else if (gt_ht_elem_hash_idx(ht, gt_ht_elem_ptr(ht, link)) != elem_hash)
    {
      /* relocate chained element */
      htsize_t reloc_idx = link, reloc_referent, new_idx;
      gt_ht_traverse_list_of_key(ht, gt_ht_elem_ptr(ht, reloc_idx),,
                              if (link == reloc_idx)
                                break;,
                              reloc_referent = idx;);
      new_idx = gt_ht_find_free_idx(ht, reloc_referent, -1);
      gt_ht_cp_elem(ht, new_idx, gt_ht_elem_ptr(ht, reloc_idx));
      HT_SET_LINK(ht, new_idx,
                  HT_GET_LINK(ht, reloc_idx));
      HT_SET_LINK(ht, reloc_referent, new_idx);
      insert_pos = link;
      break;
    }
    do {
      idx = link;
      link = HT_GET_LINK(ht, idx);
      if (!ht->table_info.cmp(elem, gt_ht_elem_ptr(ht, idx))) {
        if (stor_ptr)
          *stor_ptr = gt_ht_elem_ptr(ht, idx);
        /* don't insert elements already present! */
        return 0;
      }
    } while (link != end_mark);
    {
      /* we can search, starting at idx, for a
       * free position to insert elem */
      htsize_t referent = idx,
        new_idx = gt_ht_find_free_idx(ht, idx, +1);
      HT_SET_LINK(ht, referent, new_idx);
      insert_pos = new_idx;
    }
  } while (0);
  gt_ht_cp_elem(ht, insert_pos, elem);
  if (stor_ptr)
    *stor_ptr = gt_ht_elem_ptr(ht, insert_pos);
  HT_SET_LINK(ht, insert_pos, end_mark);
  ht->current_fill += 1;
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq *(%rbx)
movl %eax, %r12d
andl 0x48(%rbx), %r12d
movq 0x58(%rbx), %rax
cmpl $-0x1, (%rax,%r12,4)
je 0x5691a
movq 0x10(%rbx), %rdi
imulq %r12, %rdi
addq 0x30(%rbx), %rdi
callq *(%rbx)
andl 0x48(%rbx), %eax
cmpl %r12d, %eax
jne 0x568a5
movq 0x58(%rbx), %rax
movl %r12d, %r13d
movl (%rax,%r13,4), %r12d
movq 0x10(%rbx), %rsi
imulq %r13, %rsi
addq 0x30(%rbx), %rsi
movq %r15, %rdi
callq *0x18(%rbx)
testl %eax, %eax
je 0x56966
cmpl $-0x2, %r12d
jne 0x5685f
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %r13d, %esi
callq 0x57b34
movq 0x58(%rbx), %rcx
movl %eax, (%rcx,%r13,4)
movl %eax, %r12d
jmp 0x5691a
movq %r14, (%rsp)
movq 0x10(%rbx), %rdi
imulq %r12, %rdi
addq 0x30(%rbx), %rdi
callq *(%rbx)
andl 0x48(%rbx), %eax
movq 0x58(%rbx), %rcx
movl %eax, %r13d
movl (%rcx,%r13,4), %eax
cmpl %r12d, %eax
je 0x568ce
testl %eax, %eax
jns 0x568be
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, %r14d
movq %rdx, %rdi
imulq %r14, %rdi
addq %rax, %rdi
callq 0xb520
movq 0x58(%rbx), %rax
movl (%rax,%r12,4), %ecx
movl %ecx, (%rax,%r14,4)
movq 0x58(%rbx), %rax
movl %ebp, (%rax,%r13,4)
movq (%rsp), %r14
movq 0x10(%rbx), %rdx
movq %rdx, %rdi
imulq %r12, %rdi
addq 0x30(%rbx), %rdi
movq %r15, %rsi
callq 0xb520
testq %r14, %r14
je 0x56945
movq 0x10(%rbx), %rax
imulq %r12, %rax
addq 0x30(%rbx), %rax
movq %rax, (%r14)
pushq $0x1
popq %rax
movq 0x58(%rbx), %rcx
movl $0xfffffffe, (%rcx,%r12,4) # imm = 0xFFFFFFFE
incl 0x54(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
testq %r14, %r14
je 0x56957
imulq 0x10(%rbx), %r13
addq 0x30(%rbx), %r13
movq %r13, (%r14)
jmp 0x56957