// File: /workspace/github_cpp_makefile_star2_O2/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 $0x28, %rsp
movl %esi, %r13d
movl %edi, %ebp
movl $0x200, %edi            # imm = 0x200
callq 0x179a
movq %rax, %rbx
xorl %r12d, %r12d
xorl %eax, %eax
movl %ebp, 0x8(%rsp)
cmpl %ebp, %eax
je 0x166b
movl %eax, (%rsp)
movl %r13d, %edi
callq 0x121c
movl %eax, %r13d
movl %ebp, %edi
movl %eax, %esi
callq 0x1247
movl %eax, %r14d
movl %eax, 0x20(%rsp)
movl $0x1, 0x24(%rsp)
andl $0x0, 0x1c(%rsp)
movq %rbx, %rax
movq (%rax), %r15
testq %r15, %r15
je 0x152c
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x1c(%rsp), %rdx
callq 0x181b
testl %eax, %eax
js 0x1513
cmpl $0x0, 0x1c(%rsp)
je 0x164c
testb $0x1, (%r15)
je 0x152c
movslq 0xc(%rbx), %rcx
addq %rcx, %r15
cltq
leaq (%r15,%rax,8), %rax
addq $0x8, %rax
jmp 0x14ea
incl 0x20(%rbx)
movq (%rbx), %r15
movl (%r15), %eax
sarl %eax
movl 0x1c(%rbx), %ecx
leal -0x1(,%rcx,2), %ecx
cmpl %ecx, %eax
movq %r12, 0x10(%rsp)
movl %r13d, 0xc(%rsp)
jne 0x15db
incl 0x24(%rbx)
movslq 0x10(%rbx), %rsi
pushq $0x1
popq %rdi
callq 0x1050
movq %rax, %rbp
movq %rax, (%rbx)
movl $0x1, (%rax)
movslq 0xc(%rbx), %rax
movq %r15, (%rbp,%rax)
movq %rbx, %rdi
movq %rbp, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x1884
movq %rbp, %r15
jmp 0x15db
movslq 0xc(%rbx), %rax
addq %rbp, %rax
movq 0x8(%rax,%r13,8), %r15
movl (%r15), %eax
sarl %eax
movl 0x1c(%rbx), %ecx
leal -0x1(,%rcx,2), %ecx
cmpl %ecx, %eax
jne 0x15db
leaq 0x1(%r13), %r12
movq %rbx, %rdi
movq %rbp, %rsi
movl %r12d, %edx
movq %r15, %rcx
callq 0x1884
addl $0x2, %r13d
cmpl 0x4(%rbp,%r12,8), %r14d
cmovbel %r12d, %r13d
movslq 0xc(%rbx), %rax
movslq %r13d, %rcx
addq %rbp, %rax
movq (%rax,%rcx,8), %r15
movq %r15, %rbp
movl (%r15), %r15d
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0x181b
movslq %eax, %r13
testb $0x1, %r15b
jne 0x158c
sarl %r15d
leal -0x1(%r15), %ecx
cmpl %ecx, %eax
je 0x162b
leaq 0x14(,%r13,8), %rdi
addq %rbp, %rdi
leaq 0xc(,%r13,8), %rsi
addq %rbp, %rsi
notl %eax
addl %eax, %r15d
movslq %r15d, %rdx
shlq $0x3, %rdx
callq 0x1090
movq 0x20(%rsp), %rax
movq %rax, 0xc(%rbp,%r13,8)
addl $0x2, (%rbp)
movq 0x10(%rsp), %r12
incl %r12d
movl 0x8(%rsp), %ebp
movl 0xc(%rsp), %r13d
jmp 0x1661
movl %eax, %eax
movl 0x8(%r15,%rax,8), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x8(%r15,%rax,8)
addl %ecx, %r12d
incl %r12d
movl (%rsp), %eax
incl %eax
jmp 0x14b4
movq 0x2986(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movl 0x20(%rbx), %ebp
leaq 0x9f6(%rip), %rsi       # 0x2075
movl %ebp, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x1060
pushq $0x8
popq %rdi
movq %rdi, %rsi
callq 0x1050
movq %rax, %r13
movq (%rbx), %rax
movq %rax, (%r13)
movq %r13, (%rsp)
addq $0x8, %r13
pushq $0x8
popq %r14
addq $-0x8, %r13
leaq 0x8(%r13), %rax
cmpq (%rsp), %rax
je 0x1778
movq (%r13), %r15
movl (%r15), %eax
testb $0x1, %al
jne 0x16d3
movq %r15, %rdi
callq 0x1030
jmp 0x16ac
movq %r14, 0x10(%rsp)
movl %ebp, 0x8(%rsp)
movq %r15, %rbp
xorl %r14d, %r14d
movl %eax, %ecx
sarl %ecx
movslq %ecx, %rcx
cmpq %rcx, %r14
jg 0x1762
movslq 0xc(%rbx), %rcx
movq (%rbp,%rcx), %rcx
testq %rcx, %rcx
je 0x1759
movq %r13, %rax
subq (%rsp), %rax
sarq $0x3, %rax
movq 0x10(%rsp), %r12
movslq %r12d, %rdx
cmpq %rdx, %rax
jne 0x174e
leal (%r12,%r12), %eax
movl %eax, 0xc(%rsp)
movslq %eax, %rsi
shlq $0x3, %rsi
movq (%rsp), %rdi
callq 0x1080
movq %rax, (%rsp)
shlq $0x21, %r12
sarq $0x21, %r12
leaq (%rax,%r12,8), %r13
movslq 0xc(%rbx), %rcx
movq (%rbp,%rcx), %rcx
movl 0xc(%rsp), %eax
movq %rax, 0x10(%rsp)
movq %rcx, (%r13)
addq $0x8, %r13
movl (%r15), %eax
incq %r14
addq $0x8, %rbp
jmp 0x16e2
movq %r15, %rdi
callq 0x1030
movl 0x8(%rsp), %ebp
movq 0x10(%rsp), %r14
jmp 0x16ac
movq %rbx, %rdi
callq 0x1030
movq (%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq