// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/uint64hashtable.c
// Function: gt_uint64hashtable_search
bool gt_uint64hashtable_search(GtUint64hashtable *table, uint64_t key,
                               bool insert_if_not_found)
{
  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)
      {
        if (insert_if_not_found)
        {
          table->allentries++;
          table->hspace[pos].key = key;
          table->hspace[pos].count++;
        }
        return false;
      }
      if (table->hspace[pos].key == key)
      {
        gt_assert(table->hspace[pos].count > 0);
        table->hspace[pos].count++;
        return true;
      }
      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 at "
                    "https://github.com/genometools/genometools/issues.\n",
                    __func__, __FILE__, __LINE__);
    exit(GT_EXIT_PROGRAMMING_ERROR);
  } else
  {
    if (!table->zero_occurs)
    {
      if (insert_if_not_found)
      {
        table->zero_occurs = true;
        table->zero_count++;
      }
      return false;
    } else
    {
      gt_assert(table->zero_count > 0);
      table->zero_count++;
      return true;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x12b238
movq %rsi, %r14
testq %rsi, %rsi
je 0x12b154
movl %edx, 0xc(%rsp)
movq 0x10(%rdi), %r15
movq %rdi, 0x10(%rsp)
movq %r14, %rdi
callq 0x12b9f8
movq 0x10(%rsp), %rdi
movl %eax, %eax
xorl %ecx, %ecx
xorl %edx, %edx
divq %r15
movq %rdx, %rbx
movq (%rdi), %r13
pushq $-0x1
popq %rbp
movq %rdx, %r12
incq %rbp
cmpq %rbp, %r15
je 0x12b204
cmpq %r15, %r12
jae 0x12b1cc
movq %r12, %rax
shlq $0x4, %rax
leaq (%rax,%r13), %rdx
movq (%r13,%rax), %rsi
testq %rsi, %rsi
je 0x12b172
cmpq %r14, %rsi
je 0x12b18a
incq 0x18(%rdi)
testq %rcx, %rcx
jne 0x12b10c
movq %r14, %rdi
movq %r15, %rsi
callq 0x12b2c8
movq 0x10(%rsp), %rdi
movq %rax, %rcx
addq %rcx, %r12
cmpq %r15, %r12
movl $0x0, %eax
cmovaeq %r15, %rax
subq %rax, %r12
cmpq %rbx, %r12
jne 0x12b0b9
movq 0x30ce3e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9edf(%rip), %rsi    # 0x2e5013
leaq 0x20ca9e(%rip), %rdx    # 0x337bd9
leaq 0x20ca4d(%rip), %rcx    # 0x337b8f
leaq 0x20ca27(%rip), %r8     # 0x337b70
movl $0xcc, %r9d
jmp 0x12b1f8
cmpb $0x0, 0x30(%rdi)
je 0x12b19f
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x12b297
addq $0x20, %rdi
movb $0x1, %al
movq %rdi, %rdx
jmp 0x12b1b3
cmpb $0x0, 0xc(%rsp)
je 0x12b1bb
incq 0x28(%rdi)
movq %r14, (%rdx)
leaq (%rax,%r13), %rdx
addq $0x8, %rdx
jmp 0x12b1ae
movq 0x8(%rdx), %rcx
testq %rcx, %rcx
je 0x12b266
addq $0x8, %rdx
movb $0x1, %al
jmp 0x12b1b3
testb %dl, %dl
je 0x12b1bb
movb $0x1, 0x30(%rdi)
addq $0x20, %rdi
movq %rdi, %rdx
movq (%rdx), %rcx
xorl %eax, %eax
incq %rcx
movq %rcx, (%rdx)
jmp 0x12b1bd
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30cd95(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9e36(%rip), %rsi    # 0x2e5013
leaq 0x20c9c5(%rip), %rdx    # 0x337ba9
leaq 0x20c9a4(%rip), %rcx    # 0x337b8f
leaq 0x20c97e(%rip), %r8     # 0x337b70
movl $0xb0, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x30cd5d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x20c9d5(%rip), %rsi    # 0x337bea
leaq 0x20c973(%rip), %rdx    # 0x337b8f
leaq 0x20c94d(%rip), %rcx    # 0x337b70
movl $0xd2, %r8d
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0
movq 0x30cd29(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9dca(%rip), %rsi    # 0x2e5013
leaq 0x1fcc4e(%rip), %rdx    # 0x327e9e
leaq 0x20c938(%rip), %rcx    # 0x337b8f
leaq 0x20c912(%rip), %r8     # 0x337b70
movl $0xa1, %r9d
jmp 0x12b1f8
movq 0x30ccfb(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9d9c(%rip), %rsi    # 0x2e5013
leaq 0x20c93e(%rip), %rdx    # 0x337bbc
leaq 0x20c90a(%rip), %rcx    # 0x337b8f
leaq 0x20c8e4(%rip), %r8     # 0x337b70
movl $0xbd, %r9d
jmp 0x12b1f8
movq 0x30ccca(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9d6b(%rip), %rsi    # 0x2e5013
leaq 0x20c9df(%rip), %rdx    # 0x337c8e
leaq 0x20c8d9(%rip), %rcx    # 0x337b8f
leaq 0x20c8b3(%rip), %r8     # 0x337b70
movl $0xe0, %r9d
jmp 0x12b1f8