// File: /workspace/github_c_makefile_star2_O1/richarddurbin[P]hash10x/hash.c
// Function: hashAdd
int hashAdd (HASH hx, HASHKEY k)
{
  TRUE_HASH *h = (TRUE_HASH*) hx ;
  long int hash, delta = 0 ;
  int test ;

  if (!h->guard)
    hashDouble (h) ;

  HASH_FUNC(k) ;
  while (TRUE)
    if (!h->keys[hash] || h->keys[hash] == REMOVED)	/* free slot to fill */
      { if (!h->keys[hash]) --h->guard ;
	h->keys[hash] = k.i ;
	if (h->nFree)
	  h->values[hash] = arr(h->freeList, h->nFree--, int) ;
	else
	  h->values[hash] = ++h->n  ;
	nAdded++ ;
	return h->values[hash] ;
      }
    else if (h->keys[hash] == k.i)		/* already there */
      { ++nFound ;
	return h->values[hash] ;
      }
    else
      { nBounced++ ;
	if (!delta) DELTA (k) ;
	hash = (hash + delta) & h->mask ;
      }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0xc(%rdi)
jne 0x46d3
movl (%rbx), %r13d
movl $0x1, %r12d
movl %r13d, %ecx
shll %cl, %r12d
leal 0x1(%r13), %ecx
movl $0x1, %eax
shll %cl, %eax
movl $0x1, %r15d
movl %ecx, (%rbx)
leal -0x1(%rax), %ecx
movl %ecx, 0x4(%rbx)
movl %r12d, 0xc(%rbx)
movq 0x10(%rbx), %rcx
movq %rcx, 0x8(%rsp)
movslq %eax, %rbp
shlq $0x2, %rbp
movq %rbp, %rdi
callq 0x57a0
movq %rax, 0x10(%rbx)
movb (%rbx), %cl
movl $0x1, %edx
shll %cl, %edx
movslq %edx, %rdx
shlq $0x2, %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x10d0
movq 0x18(%rbx), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
callq 0x57a0
movq %rax, 0x18(%rbx)
cmpl $0x1f, %r13d
je 0x46bf
movq 0x6d76(%rip), %rcx      # 0xb378
cmpl $0x2, %r12d
cmovgel %r12d, %r15d
movq 0x6d5f(%rip), %rdx      # 0xb370
xorl %esi, %esi
xorl %r8d, %r8d
movq 0x8(%rsp), %rdi
movl (%rdi), %r9d
cmpq $0x2, %r9
jb 0x46af
movl $0xfffffff4, %r11d      # imm = 0xFFFFFFF4
movl %r9d, %r12d
movq %r9, %r10
sarl $0x5, %r12d
xorq %r12, %r10
incl %r11d
jne 0x4634
movl 0x4(%rbx), %r13d
movq 0x10(%rbx), %r11
andl %r13d, %r10d
cmpl $0x0, (%r11,%r10,4)
je 0x4691
testq %r8, %r8
jne 0x4674
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
movl %r9d, %r12d
movq %r9, %r8
sarl $0x7, %r12d
xorq %r12, %r8
incl %ebp
jne 0x4662
andl %r13d, %r8d
orq $0x1, %r8
incq %rdx
movl %r10d, %ebp
addl %r8d, %ebp
movl %r13d, %r10d
andl %ebp, %r10d
cmpl $0x0, (%r11,%r10,4)
jne 0x4652
movq %rdx, 0x6cdf(%rip)      # 0xb370
movl %r9d, (%r11,%r10,4)
movq 0x10(%rsp), %r9
movl (%r9,%rsi,4), %r9d
movl %r9d, (%rax,%r10,4)
decl 0xc(%rbx)
incq %rcx
movq %rcx, 0x6cc9(%rip)      # 0xb378
incq %rsi
addq $0x4, %rdi
cmpq %r15, %rsi
jne 0x461b
movq 0x8(%rsp), %rdi
callq 0x1040
movq 0x10(%rsp), %rdi
callq 0x1040
movslq %r14d, %rax
movl $0xfffffff4, %edx       # imm = 0xFFFFFFF4
movl %r14d, %esi
movq %rax, %rcx
sarl $0x5, %esi
xorq %rsi, %rcx
incl %edx
jne 0x46e1
movl 0x4(%rbx), %esi
movq 0x10(%rbx), %rdx
andl %esi, %ecx
movl (%rdx,%rcx,4), %r11d
cmpl $0x2, %r11d
jae 0x4703
movq %rcx, %r10
jmp 0x4764
movq 0x6c66(%rip), %r8       # 0xb370
xorl %r9d, %r9d
leaq 0x6c4c(%rip), %rdi      # 0xb360
movslq %r11d, %r10
cmpq %r14, %r10
je 0x47ad
incq %r8
movq %r8, 0x6c46(%rip)       # 0xb370
testq %r9, %r9
jne 0x474e
movl $0xfffffff7, %r10d      # imm = 0xFFFFFFF7
movl %r14d, %r11d
movq %rax, %r9
sarl $0x7, %r11d
xorq %r11, %r9
incl %r10d
jne 0x473b
andl %esi, %r9d
orq $0x1, %r9
addl %r9d, %ecx
movl %esi, %r10d
andl %ecx, %r10d
movl (%rdx,%r10,4), %r11d
movq %r10, %rcx
cmpl $0x2, %r11d
jae 0x4714
testl %r11d, %r11d
jne 0x476c
decl 0xc(%rbx)
movl %r14d, (%rdx,%r10,4)
movslq 0x28(%rbx), %rax
testq %rax, %rax
je 0x4794
movq 0x20(%rbx), %rcx
movq 0x8(%rcx), %rdx
leal -0x1(%rax), %esi
movl %esi, 0x28(%rbx)
movslq 0x14(%rcx), %rcx
imulq %rax, %rcx
movl (%rdx,%rcx), %eax
jmp 0x479c
movl 0x8(%rbx), %eax
incl %eax
movl %eax, 0x8(%rbx)
movq 0x18(%rbx), %rcx
movl %eax, (%rcx,%r10,4)
leaq 0x6bcd(%rip), %rdi      # 0xb378
jmp 0x47b0
movq %rcx, %r10
incq (%rdi)
movq 0x18(%rbx), %rax
movl (%rax,%r10,4), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq