// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x183841
movl %edx, %ecx
testq %rsi, %rsi
je 0x1837cf
movq (%rdi), %r11
movq 0x10(%rdi), %rbx
movq %rsi, %rax
shrq $0x20, %rax
imull $0x9e3779b1, %esi, %edx # imm = 0x9E3779B1
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
movl %eax, %r9d
roll $0xe, %r9d
movl %eax, %r8d
subl %r9d, %r8d
movl %r8d, %r9d
roll $0xb, %r9d
xorl %r8d, %edx
subl %r9d, %edx
xorl %edx, %eax
movl %edx, %r9d
roll $0x19, %r9d
subl %r9d, %eax
xorl %eax, %r8d
movl %eax, %r9d
roll $0x10, %r9d
subl %r9d, %r8d
xorl %r8d, %edx
movl %r8d, %r9d
roll $0x4, %r9d
subl %r9d, %edx
xorl %edx, %eax
roll $0xe, %edx
subl %edx, %eax
xorl %eax, %r8d
roll $0x18, %eax
subl %eax, %r8d
xorl %r10d, %r10d
movq %r8, %rax
xorl %edx, %edx
divq %rbx
movq %rdx, %r9
leaq -0x1(%rbx), %r14
cmpq $0x1, %rbx
movq %rbx, %r15
adcq $0x0, %r15
movq %rdx, %r12
cmpq %rbx, %r12
jae 0x183837
movq %r12, %rax
shlq $0x4, %rax
leaq (%r11,%rax), %rdx
movq (%r11,%rax), %r13
testq %r13, %r13
je 0x1837e9
cmpq %rsi, %r13
je 0x1837fe
incq 0x18(%rdi)
testq %r10, %r10
jne 0x1837ae
movq %r8, %rax
xorl %edx, %edx
divq %r14
movq %rdx, %r10
incq %r10
addq %r10, %r12
cmpq %rbx, %r12
movl $0x0, %eax
cmovaeq %rbx, %rax
subq %rax, %r12
cmpq %r9, %r12
je 0x18383c
decq %r15
jne 0x183775
callq 0x5928d
cmpb $0x0, 0x30(%rdi)
je 0x18380f
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x18384b
addq $0x20, %rdi
movb $0x1, %al
movq %rdi, %rdx
jmp 0x183823
testb %cl, %cl
je 0x18382b
incq 0x28(%rdi)
movq %rsi, (%rdx)
leaq (%r11,%rax), %rdx
addq $0x8, %rdx
jmp 0x18381e
movq 0x8(%rdx), %rcx
testq %rcx, %rcx
je 0x183846
addq $0x8, %rdx
movb $0x1, %al
jmp 0x183823
testb %cl, %cl
je 0x18382b
movb $0x1, 0x30(%rdi)
addq $0x20, %rdi
movq %rdi, %rdx
movq (%rdx), %rcx
xorl %eax, %eax
incq %rcx
movq %rcx, (%rdx)
jmp 0x18382d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x59254
callq 0x592c2
callq 0x5936d
callq 0x592fb
callq 0x59334