// File: /workspace/github_c_makefile_star2_O1/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, %rbp
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq *(%rbx)
movl %eax, %r12d
andl 0x48(%rbx), %r12d
movq 0x58(%rbx), %rax
movl $0x2, %ecx
cmpl $-0x1, (%rax,%r12,4)
je 0x77bd3
movq 0x10(%rbx), %rdi
imulq %r12, %rdi
addq 0x30(%rbx), %rdi
callq *(%rbx)
andl 0x48(%rbx), %eax
cmpl %r12d, %eax
jne 0x77b3e
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 0x77bbc
cmpl $-0x2, %r12d
jne 0x77af1
movq %rbx, %rdi
movl %r13d, %esi
movl $0x1, %edx
callq 0x78dba
movl %eax, %r12d
movq 0x58(%rbx), %rax
movl %r12d, (%rax,%r13,4)
xorl %ecx, %ecx
jmp 0x77bd3
movq %rbp, (%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 0x77b67
testl %eax, %eax
jns 0x77b57
movq %rbx, %rdi
movl %r13d, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x78dba
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), %rbp
movl $0x2, %ecx
jmp 0x77bd3
movl $0x1, %ecx
testq %rbp, %rbp
je 0x77bd3
imulq 0x10(%rbx), %r13
addq 0x30(%rbx), %r13
movq %r13, (%rbp)
testb $0x1, %cl
jne 0x77c1d
movq 0x10(%rbx), %rdx
movl %r12d, %r14d
movq %rdx, %rdi
imulq %r14, %rdi
addq 0x30(%rbx), %rdi
movq %r15, %rsi
callq 0xb520
testq %rbp, %rbp
je 0x77c07
movq 0x10(%rbx), %rax
imulq %r14, %rax
addq 0x30(%rbx), %rax
movq %rax, (%rbp)
movq 0x58(%rbx), %rax
movl $0xfffffffe, (%rax,%r14,4) # imm = 0xFFFFFFFE
incl 0x54(%rbx)
movl $0x1, %eax
jmp 0x77c1f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq