// File: /workspace/github_cpp_makefile_star2_O1/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, %r12d
movl %edi, %r15d
movl $0x200, %edi            # imm = 0x200
callq 0x1833
movq %rax, %rbx
xorl %ecx, %ecx
testl %r15d, %r15d
je 0x15b5
movl %r15d, %eax
shrl $0x2, %eax
movl %eax, (%rsp)
xorl %ebp, %ebp
pushq $-0x1
popq %r14
xorl %ecx, %ecx
movl %r15d, 0x4(%rsp)
movl %r12d, %eax
shll $0xf, %eax
notl %eax
addl %r12d, %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, %r12d
shrl $0x10, %r12d
xorl %eax, %r12d
movl %r12d, %eax
xorl %edx, %edx
divl (%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, %esi
shrl $0x6, %esi
xorl %eax, %esi
movl %esi, %edx
shll $0xb, %edx
notl %edx
addl %esi, %edx
movl %edx, %eax
shrl $0x10, %eax
xorl %edx, %eax
movl %eax, 0x8(%rsp)
movl $0x1, 0xc(%rsp)
movq (%rbx), %r13
testq %r13, %r13
je 0x151a
xorl %edi, %edi
movq %r13, %r11
movl (%r11), %edx
movl %r14d, %esi
cmpl $0x2, %edx
jb 0x14f9
movl %edx, %esi
sarl %esi
xorl %r8d, %r8d
testl %esi, %esi
jle 0x14d4
movl %esi, %edi
leal (%r8,%rdi), %r9d
sarl %r9d
movslq %r9d, %r10
cmpl %eax, 0x4(%r11,%r10,8)
jb 0x14c9
movl %r9d, %edi
jmp 0x14cf
incl %r9d
movl %r9d, %r8d
cmpl %edi, %r8d
jl 0x14b3
cmpl %esi, %r8d
jne 0x14e0
decl %esi
pushq $0x1
popq %rdi
jmp 0x14f9
movslq %r8d, %rsi
xorl %edi, %edi
cmpl 0x4(%r11,%rsi,8), %eax
seta %dil
sbbl $0x0, %edi
movl %edi, %esi
sarl $0x1f, %esi
addl %r8d, %esi
testl %esi, %esi
js 0x1501
testl %edi, %edi
je 0x151e
testb $0x1, %dl
je 0x151a
movslq 0xc(%rbx), %rdx
addq %rdx, %r11
movslq %esi, %rdx
movq 0x8(%r11,%rdx,8), %r11
testq %r11, %r11
jne 0x149b
xorl %eax, %eax
jmp 0x1528
movl %esi, %eax
leaq (%r11,%rax,8), %rax
addq $0x4, %rax
testq %rax, %rax
je 0x153c
movl 0x4(%rax), %esi
leal 0x1(%rsi), %edx
movl %edx, 0x4(%rax)
addl %esi, %ecx
incl %ecx
jmp 0x15aa
movq %rcx, 0x10(%rsp)
incl 0x20(%rbx)
movl (%r13), %eax
sarl %eax
movl 0x1c(%rbx), %ecx
leal -0x1(,%rcx,2), %ecx
cmpl %ecx, %eax
jne 0x1593
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 0x18b9
movq %r15, %r13
movl 0x4(%rsp), %r15d
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x8(%rsp), %rdx
callq 0x19ea
movq 0x10(%rsp), %rcx
incl %ecx
incl %ebp
cmpl %r15d, %ebp
jne 0x141d
movq 0x2a3c(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movl 0x20(%rbx), %ebp
leaq 0xaac(%rip), %rsi       # 0x2075
xorl %r12d, %r12d
movl %ebp, %edx
xorl %eax, %eax
callq 0x1060
testq %rbx, %rbx
je 0x16ab
pushq $0x8
popq %rdi
movq %rdi, %rsi
callq 0x1050
movq %rax, %r12
movq (%rbx), %rax
movq %rax, (%r12)
movq %r12, %r15
addq $0x8, %r15
pushq $0x8
popq %r13
addq $-0x8, %r15
movq (%r15), %r14
testb $0x1, (%r14)
jne 0x1624
movq %r14, %rdi
callq 0x1030
leaq -0x8(%r15), %rax
cmpq %r12, %r15
movq %rax, %r15
jne 0x1602
jmp 0x16ab
movl %ebp, (%rsp)
cmpl $0x0, (%r14)
js 0x1697
pushq $-0x1
popq %rbp
movslq 0xc(%rbx), %rax
addq %r14, %rax
cmpq $0x0, 0x8(%rax,%rbp,8)
je 0x1688
movq %r15, %rax
subq %r12, %rax
sarq $0x3, %rax
movslq %r13d, %rcx
cmpq %rcx, %rax
jne 0x1675
movq %r13, %r15
addl %r13d, %r13d
movslq %r13d, %rsi
shlq $0x3, %rsi
movq %r12, %rdi
callq 0x1080
movq %rax, %r12
shlq $0x21, %r15
sarq $0x21, %r15
leaq (%rax,%r15,8), %r15
movslq 0xc(%rbx), %rax
addq %r14, %rax
movq 0x8(%rax,%rbp,8), %rax
movq %rax, (%r15)
addq $0x8, %r15
movl (%r14), %eax
sarl %eax
cltq
incq %rbp
cmpq %rax, %rbp
jl 0x1630
movq %r14, %rdi
callq 0x1030
cmpq %r12, %r15
movl (%rsp), %ebp
jne 0x15fe
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
nopl (%rax)