// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/khashl/test.c
// Function: intmap_put
KHASHL_MAP_INIT(, intmap_t, intmap, uint32_t, int, hash_fn, kh_eq_generic)

uint32_t test_int(uint32_t n, uint32_t x0)
{
	uint32_t i, x, z = 0;
	intmap_t *h;
	h = intmap_init();
	for (i = 0, x = x0; i < n; ++i) {
		khint_t k;
		int absent;
		x = hash32(x);
		k = intmap_put(h, get_key(n, x), &absent);
#ifndef UDB2_TEST_DEL
		if (absent) kh_val(h, k) = 0;
		z += ++kh_val(h, k);
#else
		if (absent) ++z;
		else intmap_del(h, k);
#endif
	}
	fprintf(stderr, "# unique keys: %d; checksum: %u; capacity: %u\n", kh_size(h), z, kh_capacity(h));
	x = kh_size(h);
	intmap_destroy(h);
	return x;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq 0x10(%rdi), %rbp
pushq $0x1
popq %rbx
testq %rbp, %rbp
je 0x165f
movb (%r14), %cl
movl %ebx, %r12d
shll %cl, %r12d
jmp 0x1662
xorl %r12d, %r12d
orl $-0x1, (%rdx)
movl 0x4(%r14), %eax
movl %r12d, %ecx
shrl %ecx
movl %r12d, %edi
shrl $0x2, %edi
addl %ecx, %edi
cmpl %edi, %eax
jae 0x1685
movl (%r14), %ecx
movl %r12d, %r15d
jmp 0x183c
leal 0x1(%r12), %ecx
xorl %edi, %edi
movl %ecx, %r8d
cmpl $0x2, %r8d
jb 0x169c
shrl %r8d
incl %edi
jmp 0x168f
leal -0x1(%rcx), %r8d
andl %ecx, %r8d
cmpl $0x1, %r8d
sbbl $-0x1, %edi
cmpl $0x3, %edi
pushq $0x2
popq %rcx
cmovael %edi, %ecx
movl %ebx, %r15d
shll %cl, %r15d
movl %r15d, %r9d
shrl %r9d
movl %r15d, %r8d
shrl $0x2, %r8d
addl %r9d, %r8d
cmpl %r8d, %eax
jbe 0x16dc
movl (%r14), %ecx
movl %ebx, %r15d
shll %cl, %r15d
jmp 0x183c
movl %ecx, 0xc(%rsp)
movl %esi, 0x14(%rsp)
movq %rdx, 0x20(%rsp)
movl %r15d, %eax
shrl $0x3, %eax
andl $-0x4, %eax
cmpl $0x5, %edi
pushq $0x4
popq %rsi
cmovael %eax, %esi
pushq $0x1
popq %rdi
callq 0x1050
testq %rax, %rax
je 0x18b9
movq %rax, %r13
movl %r15d, %eax
movq %rax, 0x18(%rsp)
testq %rbp, %rbp
je 0x172a
movb (%r14), %cl
movl %ebx, %edx
shll %cl, %edx
cmpl %r15d, %edx
jb 0x172c
jmp 0x1756
xorl %edx, %edx
movl %edx, 0x10(%rsp)
movq 0x18(%rsp), %rax
leaq (,%rax,8), %rsi
movq %rbp, %rdi
callq 0x1070
testq %rax, %rax
je 0x18cb
movq %rax, 0x10(%r14)
movl 0x10(%rsp), %edx
leal -0x1(%r15), %edi
pushq $0x20
popq %rax
subl 0xc(%rsp), %eax
movl %edx, %r8d
xorl %edx, %edx
cmpq %r8, %rdx
je 0x1804
movq 0x8(%r14), %r9
movl %edx, %esi
shrl $0x5, %esi
movl (%r9,%rsi,4), %r11d
movl %ebx, %ebp
movl %edx, %ecx
shll %cl, %ebp
btl %edx, %r11d
jae 0x17fc
movq 0x10(%r14), %rcx
movq (%rcx,%rdx,8), %r10
notl %ebp
andl %ebp, %r11d
movl %r11d, (%r9,%rsi,4)
imull $0x9e3779b9, %r10d, %esi # imm = 0x9E3779B9
movl %eax, %ecx
shrl %cl, %esi
movl %esi, %r11d
shrl $0x5, %r11d
movl (%r13,%r11,4), %ebp
movl %ebx, %r12d
movl %esi, %ecx
shll %cl, %r12d
btl %esi, %ebp
jae 0x17c3
incl %esi
andl %edi, %esi
jmp 0x17a4
orl %r12d, %ebp
movl %ebp, (%r13,%r11,4)
movl %esi, %ecx
cmpl %r8d, %esi
jae 0x17f4
movq 0x10(%r14), %rsi
testl %r12d, (%r9,%r11,4)
je 0x17f8
movq (%rsi,%rcx,8), %rbp
movq %r10, (%rsi,%rcx,8)
notl %r12d
movq 0x8(%r14), %r9
andl %r12d, (%r9,%r11,4)
movq %rbp, %r10
jmp 0x1799
movq 0x10(%r14), %rsi
movq %r10, (%rsi,%rcx,8)
incq %rdx
jmp 0x1766
cmpl %r15d, %r8d
jbe 0x181f
movq 0x10(%r14), %rdi
movq 0x18(%rsp), %rsi
shlq $0x3, %rsi
callq 0x1070
movq %rax, 0x10(%r14)
movq 0x8(%r14), %rdi
callq 0x1030
movq %r13, 0x8(%r14)
movl 0xc(%rsp), %ecx
movl %ecx, (%r14)
movq 0x20(%rsp), %rdx
movl 0x14(%rsp), %esi
imull $0x9e3779b9, %esi, %r12d # imm = 0x9E3779B9
negb %cl
shrl %cl, %r12d
decl %r15d
movl %esi, %eax
movq 0x8(%r14), %rdi
movl %r12d, %ecx
movl %ecx, %r11d
shrl $0x5, %r11d
movl (%rdi,%r11,4), %r8d
movl %ebx, %ebp
shll %cl, %ebp
btl %ecx, %r8d
jae 0x1894
movq 0x10(%r14), %r9
movl %ecx, %r10d
cmpl %esi, (%r9,%r10,8)
je 0x1894
incl %ecx
andl %r15d, %ecx
cmpl %r12d, %ecx
jne 0x1854
movl %r12d, %r11d
shrl $0x5, %r11d
movl %ebx, %ebp
movl %r12d, %ecx
shll %cl, %ebp
movl (%rdi,%r11,4), %r8d
jmp 0x1897
movl %ecx, %r12d
xorl %ecx, %ecx
testl %ebp, %r8d
jne 0x18b7
movq 0x10(%r14), %rcx
movl %r12d, %edi
movq %rax, (%rcx,%rdi,8)
movq 0x8(%r14), %rax
orl %ebp, (%rax,%r11,4)
incl 0x4(%r14)
movl %ebx, %ecx
movl %ecx, (%rdx)
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x1030
jmp 0x18b9