// File: /workspace/github_cpp_makefile_star2_O3/attractivechaos[P]udb2/kbtree/test.c
// Function: test_int
uint32_t test_int(uint32_t n, uint32_t x0)
{
	uint32_t i, x, z = 0;
	kbtree_t(32) *h;
	h = kb_init(32, KB_DEFAULT_SIZE);
	for (i = 0, x = x0; i < n; ++i) {
		aux_t a, *p;
		x = hash32(x);
		a.key = get_key(n, x), a.cnt = 1;
		p = kb_getp(32, h, &a);
		if (p == 0) {
			kb_putp(32, h, &a);
			++z;
		} else z += ++p->cnt;
	}
	fprintf(stderr, "# unique keys: %d; checksum: %u\n", kb_size(h), z);
	x = kb_size(h);
	kb_destroy(32, h);
	return x;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r15d
movl %edi, %ebp
movl $0x200, %edi            # imm = 0x200
callq 0x1953
movq %rax, %rbx
xorl %ecx, %ecx
movl %ebp, (%rsp)
testl %ebp, %ebp
jne 0x151c
movq 0x2be9(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movl 0x20(%rbx), %ebp
leaq 0xc59(%rip), %rsi       # 0x2075
movl %ebp, %edx
xorl %eax, %eax
callq 0x1060
pushq $0x8
popq %rdi
movq %rdi, %rsi
callq 0x1050
movq %rax, %r12
movq (%rbx), %rax
movq %rax, (%r12)
movq %r12, %r14
addq $0x8, %r14
pushq $0x8
popq %r13
addq $-0x8, %r14
movq (%r14), %r15
movl (%r15), %ecx
testb $0x1, %cl
jne 0x146d
movq %r15, %rdi
callq 0x1030
leaq -0x8(%r14), %rax
cmpq %r12, %r14
movq %rax, %r14
jne 0x1449
jmp 0x14fb
movl %ebp, 0x8(%rsp)
testl %ecx, %ecx
js 0x14e6
movl 0xc(%rbx), %eax
pushq $-0x1
popq %rbp
movslq %eax, %rdx
addq %r15, %rdx
cmpq $0x0, 0x8(%rdx,%rbp,8)
je 0x14d7
movq %r14, %rcx
subq %r12, %rcx
sarq $0x3, %rcx
movslq %r13d, %rdx
cmpq %rdx, %rcx
jne 0x14c2
movq %r13, %r14
addl %r13d, %r13d
movslq %r13d, %rsi
shlq $0x3, %rsi
movq %r12, %rdi
callq 0x1080
movq %rax, %r12
shlq $0x21, %r14
sarq $0x21, %r14
leaq (%rax,%r14,8), %r14
movl 0xc(%rbx), %eax
movslq %eax, %rcx
addq %r15, %rcx
movq 0x8(%rcx,%rbp,8), %rcx
movq %rcx, (%r14)
addq $0x8, %r14
movl (%r15), %ecx
movl %ecx, %edx
sarl %edx
movslq %edx, %rdx
incq %rbp
cmpq %rdx, %rbp
jl 0x147b
movq %r15, %rdi
callq 0x1030
cmpq %r12, %r14
movl 0x8(%rsp), %ebp
jne 0x1445
movq %rbx, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%rsp), %eax
shrl $0x2, %eax
movl %eax, 0x10(%rsp)
xorl %r11d, %r11d
pushq $-0x1
popq %r14
xorl %ecx, %ecx
movl %r15d, %eax
shll $0xf, %eax
notl %eax
addl %r15d, %eax
movl %eax, %edx
shrl $0xa, %edx
xorl %eax, %edx
leal (%rdx,%rdx,8), %eax
movl %eax, %edx
shrl $0x6, %edx
xorl %eax, %edx
movl %edx, %eax
shll $0xb, %eax
notl %eax
addl %edx, %eax
movl %eax, %r15d
shrl $0x10, %r15d
xorl %eax, %r15d
movl %r15d, %eax
xorl %edx, %edx
divl 0x10(%rsp)
movl %edx, %eax
shll $0xf, %eax
notl %eax
addl %edx, %eax
movl %eax, %edx
shrl $0xa, %edx
xorl %eax, %edx
leal (%rdx,%rdx,8), %eax
movl %eax, %edx
shrl $0x6, %edx
xorl %eax, %edx
movl %edx, %eax
shll $0xb, %eax
notl %eax
addl %edx, %eax
movl %eax, %ebp
shrl $0x10, %ebp
xorl %eax, %ebp
movq (%rbx), %r13
testq %r13, %r13
je 0x1620
movq %r13, %rax
movl (%rax), %r10d
movl %r14d, %edx
cmpl $0x2, %r10d
jb 0x1606
movl %r10d, %edx
sarl %edx
xorl %esi, %esi
testl %edx, %edx
jle 0x15d9
movl %edx, %edi
leal (%rsi,%rdi), %r8d
sarl %r8d
movslq %r8d, %r9
cmpl %ebp, 0x4(%rax,%r9,8)
jb 0x15cf
movl %r8d, %edi
jmp 0x15d5
incl %r8d
movl %r8d, %esi
cmpl %edi, %esi
jl 0x15b9
cmpl %edx, %esi
jne 0x15e1
decl %edx
jmp 0x1606
movslq %esi, %rdx
xorl %edi, %edi
cmpl %ebp, 0x4(%rax,%rdx,8)
seta %dil
sbbl $0x0, %edi
negl %edi
movl %edi, %edx
sarl $0x1f, %edx
addl %esi, %edx
testl %edi, %edi
jne 0x1606
testl %edx, %edx
jns 0x17d6
testb $0x1, %r10b
je 0x1620
movslq 0xc(%rbx), %rsi
addq %rsi, %rax
movslq %edx, %rdx
movq 0x8(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x15a0
incl 0x20(%rbx)
movl (%r13), %eax
movl %eax, %esi
sarl %esi
movl 0x1c(%rbx), %edx
leal -0x1(,%rdx,2), %edx
cmpl %edx, %esi
movq %rcx, 0x8(%rsp)
movl %r11d, 0x4(%rsp)
movl %r15d, 0x14(%rsp)
jne 0x1722
incl 0x24(%rbx)
movslq 0x10(%rbx), %rsi
pushq $0x1
popq %rdi
callq 0x1050
movq %rax, %r15
movq %rax, (%rbx)
movl $0x1, (%rax)
movslq 0xc(%rbx), %rax
movq %r13, (%r15,%rax)
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x19da
movl (%r15), %eax
movq %r15, %r13
jmp 0x1722
movl %r14d, %ecx
cmpl $0x2, %eax
jb 0x16cc
sarl %eax
xorl %ecx, %ecx
testl %eax, %eax
jle 0x16b7
movl %eax, %edx
leal (%rcx,%rdx), %esi
sarl %esi
movslq %esi, %rdi
cmpl %ebp, 0x4(%r13,%rdi,8)
jb 0x16af
movl %esi, %edx
jmp 0x16b3
incl %esi
movl %esi, %ecx
cmpl %edx, %ecx
jl 0x169c
cmpl %eax, %ecx
jne 0x16c1
decl %eax
movl %eax, %ecx
jmp 0x16cc
movslq %ecx, %rax
cmpl 0x4(%r13,%rax,8), %ebp
sbbl $0x0, %ecx
movslq %ecx, %r12
movslq 0xc(%rbx), %rax
addq %r13, %rax
movq 0x8(%rax,%r12,8), %rcx
movl (%rcx), %eax
movl %eax, %edx
sarl %edx
movl 0x1c(%rbx), %esi
leal -0x1(,%rsi,2), %esi
cmpl %esi, %edx
jne 0x171f
leaq 0x1(%r12), %r15
movq %rbx, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x19da
addl $0x2, %r12d
cmpl 0x4(%r13,%r15,8), %ebp
cmovbel %r15d, %r12d
movslq 0xc(%rbx), %rax
movslq %r12d, %rcx
addq %r13, %rax
movq (%rax,%rcx,8), %rcx
movl (%rcx), %eax
movq %rcx, %r13
testb $0x1, %al
jne 0x168a
xorl %edx, %edx
movl %r14d, %ecx
cmpl $0x2, %eax
jb 0x176f
sarl %eax
xorl %ecx, %ecx
testl %eax, %eax
jle 0x1759
movl %eax, %edx
leal (%rcx,%rdx), %esi
sarl %esi
movslq %esi, %rdi
cmpl %ebp, 0x4(%r13,%rdi,8)
jb 0x1751
movl %esi, %edx
jmp 0x1755
incl %esi
movl %esi, %ecx
cmpl %edx, %ecx
jl 0x173e
cmpl %eax, %ecx
jne 0x1762
leal -0x1(%rax), %ecx
jmp 0x176d
movslq %ecx, %rdx
cmpl 0x4(%r13,%rdx,8), %ebp
sbbl $0x0, %ecx
movl %eax, %edx
leal -0x1(%rdx), %eax
movslq %ecx, %r15
cmpl %eax, %ecx
je 0x17a2
leaq 0x14(,%r15,8), %rdi
addq %r13, %rdi
leaq 0xc(,%r15,8), %rsi
addq %r13, %rsi
movl %r15d, %eax
notl %eax
addl %eax, %edx
movslq %edx, %rdx
shlq $0x3, %rdx
callq 0x1090
movq 0x8(%rsp), %rcx
movl 0x4(%rsp), %r11d
movl %ebp, %eax
btsq $0x20, %rax
movq %rax, 0xc(%r13,%r15,8)
addl $0x2, (%r13)
incl %ecx
movl 0x14(%rsp), %r15d
incl %r11d
cmpl (%rsp), %r11d
jne 0x152f
jmp 0x1408
movl %edx, %edi
movl 0x8(%rax,%rdi,8), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x8(%rax,%rdi,8)
addl %edx, %ecx
incl %ecx
jmp 0x17c4
nopl (%rax)