// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/uint64hashtable.c
// Function: gt_uint64hashtable_insertionindex
GtUword gt_uint64hashtable_insertionindex(GtUint64hashtable *table,
                                                uint64_t key)
{
  gt_assert(table != NULL);
  if (key > 0)
  {
    size_t pos, hashadd = 0, iteration;
    const uint64_t emptymark = 0;

#ifndef NDEBUG
    size_t first_pos;
#endif
    pos = gt_uint64hashtable_h1(key, table->alloc);
#ifndef NDEBUG
    first_pos = pos;
#endif
    for (iteration = 0; iteration < table->alloc; iteration++)
    {
      gt_assert(pos < table->alloc);
      if (table->hspace[pos].key == emptymark)
      {
        return ULONG_MAX;
      }
      if (table->hspace[pos].key == key)
      {
        gt_assert(table->hspace[pos].count > 0);
        return --table->hspace[pos].count;
      }
      table->countcollisions++;
      if (hashadd == 0)
      {
        hashadd = gt_uint64hashtable_h2(key, table->alloc);
      }
      gt_assert(hashadd > 0);
      pos += hashadd;
      if (pos >= table->alloc)
      {
        pos -= table->alloc;
      }
      gt_assert(pos != first_pos);
    }
    fprintf(stderr, "function %s, file %s, line %d.\n"
                    "Cannot find empty slot in hashtable: "
                    "This is probably a bug, please report it.\n",
                    __func__, __FILE__, __LINE__);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  } else
  {
    gt_assert(table->zero_occurs);
    gt_assert(table->zero_count > 0);
    return --table->zero_count;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x12b479
movq %rsi, %r15
testq %rsi, %rsi
je 0x12b3be
movq 0x10(%rdi), %r12
movq %rdi, (%rsp)
movq %r15, %rdi
callq 0x12b9f8
movq (%rsp), %rsi
movl %eax, %eax
xorl %ecx, %ecx
xorl %edx, %edx
divq %r12
movq %rdx, %rbx
movq (%rsi), %rbp
pushq $-0x1
popq %r14
movq %rdx, %r13
incq %r14
cmpq %r14, %r12
je 0x12b445
cmpq %r12, %r13
jae 0x12b40d
movq %r13, %rax
shlq $0x4, %rax
movq (%rbp,%rax), %rdx
testq %rdx, %rdx
je 0x12b3de
cmpq %r15, %rdx
je 0x12b3e3
incq 0x18(%rsi)
testq %rcx, %rcx
jne 0x12b379
movq %r15, %rdi
movq %r12, %rsi
callq 0x12b2c8
movq (%rsp), %rsi
movq %rax, %rcx
addq %rcx, %r13
cmpq %r12, %r13
movl $0x0, %eax
cmovaeq %r12, %rax
subq %rax, %r13
cmpq %rbx, %r13
jne 0x12b32b
movq 0x30cbd1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9c72(%rip), %rsi    # 0x2e5013
leaq 0x20c831(%rip), %rdx    # 0x337bd9
leaq 0x20c8f5(%rip), %rcx    # 0x337ca4
leaq 0x20c7ba(%rip), %r8     # 0x337b70
movl $0x10e, %r9d            # imm = 0x10E
jmp 0x12b439
cmpb $0x0, 0x30(%rdi)
je 0x12b4a7
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x12b4d8
addq $0x20, %rdi
movq %rdi, %rbp
jmp 0x12b3f7
pushq $-0x1
popq %rax
jmp 0x12b3fe
addq %rax, %rbp
movq 0x8(%rbp), %rax
testq %rax, %rax
je 0x12b509
addq $0x8, %rbp
decq %rax
movq %rax, (%rbp)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30cb54(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9bf5(%rip), %rsi    # 0x2e5013
leaq 0x20c784(%rip), %rdx    # 0x337ba9
leaq 0x20c878(%rip), %rcx    # 0x337ca4
leaq 0x20c73d(%rip), %r8     # 0x337b70
movl $0xf9, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x30cb1c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x20c870(%rip), %rsi    # 0x337cc6
leaq 0x20c847(%rip), %rdx    # 0x337ca4
leaq 0x20c70c(%rip), %rcx    # 0x337b70
movl $0x113, %r8d            # imm = 0x113
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0
movq 0x30cae8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9b89(%rip), %rsi    # 0x2e5013
leaq 0x1fca0d(%rip), %rdx    # 0x327e9e
leaq 0x20c80c(%rip), %rcx    # 0x337ca4
leaq 0x20c6d1(%rip), %r8     # 0x337b70
movl $0xea, %r9d
jmp 0x12b439
movq 0x30caba(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9b5b(%rip), %rsi    # 0x2e5013
leaq 0x20c876(%rip), %rdx    # 0x337d35
leaq 0x20c7de(%rip), %rcx    # 0x337ca4
leaq 0x20c6a3(%rip), %r8     # 0x337b70
movl $0x117, %r9d            # imm = 0x117
jmp 0x12b439
movq 0x30ca89(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9b2a(%rip), %rsi    # 0x2e5013
leaq 0x20c79e(%rip), %rdx    # 0x337c8e
leaq 0x20c7ad(%rip), %rcx    # 0x337ca4
leaq 0x20c672(%rip), %r8     # 0x337b70
movl $0x118, %r9d            # imm = 0x118
jmp 0x12b439
movq 0x30ca58(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9af9(%rip), %rsi    # 0x2e5013
leaq 0x20c69b(%rip), %rdx    # 0x337bbc
leaq 0x20c77c(%rip), %rcx    # 0x337ca4
leaq 0x20c641(%rip), %r8     # 0x337b70
movl $0x100, %r9d            # imm = 0x100
jmp 0x12b439