// File: /workspace/github_c_makefile_star2_O1/attractivechaos[P]rb-eval/rb-c-mp.c
// Function: test_int
int test_int(int n)
{
	int i, cnt = 0;
	uint64_t x = 11;
	intmap_t *d, *r;
	struct rb_table *h;
	kmempool_t(node) *mp;

	mp = kmp_init(node);
	h = rb_create(int_cmp, 0, 0);
	for (i = 0; i < n; ++i) {
		unsigned y = x % (n>>1);
		x = kad_splitmix64(x);
		d = kmp_alloc(node, mp);
		d->key = y; d->value = i;
		if (rb_find(h, d) == 0) {
			rb_insert(h, d);
			++cnt;
		} else {
			r = rb_delete(h, d);
			kmp_free(node, mp, d);
			kmp_free(node, mp, r);
			--cnt;
		}
	}
	rb_destroy(h, 0);
	kmp_destroy(node, mp);
	return cnt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebp
movl $0x1, %edi
movl $0x20, %esi
callq 0x1050
movq %rax, %r13
leaq -0x36(%rip), %rdi       # 0x235c
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
callq 0x11ec
movq %rax, 0x18(%rsp)
testl %ebp, %ebp
movq %r13, (%rsp)
jle 0x2541
movl %ebp, %eax
shrl %eax
movq %rax, 0x20(%rsp)
movq (%r13), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%r13), %r15
movl $0xb, %r12d
xorl %ebx, %ebx
xorl %r14d, %r14d
movq %r13, %r8
movl %ebp, 0x14(%rsp)
movq %r12, %rax
xorl %edx, %edx
divq 0x20(%rsp)
movq %rdx, %rbp
testq %r15, %r15
je 0x23f7
movq 0x18(%r8), %rax
movq -0x8(%rax,%r15,8), %r13
decq %r15
jmp 0x2409
movl $0x1, %edi
movl $0x8, %esi
callq 0x1050
movq %rax, %r13
movl %ebp, (%r13)
movl %ebx, 0x4(%r13)
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x125d
testq %rax, %rax
je 0x24c1
movq %rbp, %rdi
movq %r13, %rsi
callq 0x1509
movq %rax, %rbp
movq (%rsp), %r8
movq 0x10(%r8), %rax
cmpq %rax, %r15
jne 0x246e
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x10, %eax
cmoveq %rax, %rsi
movq %rsi, 0x10(%r8)
movq 0x18(%r8), %rdi
shlq $0x3, %rsi
callq 0x1090
movq (%rsp), %r8
movq %rax, 0x18(%r8)
movq 0x18(%r8), %rdi
leaq 0x1(%r15), %rcx
movq %r13, (%rdi,%r15,8)
movq 0x10(%r8), %rax
cmpq %rax, %rcx
jne 0x24a8
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x10, %eax
cmoveq %rax, %rsi
movq %rsi, 0x10(%r8)
shlq $0x3, %rsi
callq 0x1090
movq (%rsp), %r8
movq %rax, 0x18(%r8)
decq 0x8(%rsp)
movq 0x18(%r8), %rax
movq %rbp, 0x8(%rax,%r15,8)
addq $0x2, %r15
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x24da
incq 0x8(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x14c7
movl $0x1, %eax
movq (%rsp), %r8
addl %eax, %r14d
movabsq $-0x61c8864680b583eb, %rax # imm = 0x9E3779B97F4A7C15
addq %rax, %r12
movq %r12, %rax
shrq $0x1e, %rax
xorq %r12, %rax
movabsq $-0x40a7b892e31b1a47, %rcx # imm = 0xBF58476D1CE4E5B9
imulq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movabsq $-0x6b2fb644ecceee15, %rax # imm = 0x94D049BB133111EB
imulq %rax, %rcx
movq %rcx, %r12
shrq $0x1f, %r12
xorq %rcx, %r12
incl %ebx
movl 0x14(%rsp), %ebp
cmpl %ebx, %ebp
jne 0x23d7
movq 0x8(%rsp), %rax
movq %rax, (%r8)
movq %r15, 0x8(%r8)
movq %r8, %r13
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x2204
movq 0x8(%r13), %rbx
testq %rbx, %rbx
je 0x2572
movq (%rsp), %rax
movq 0x18(%rax), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x1030
incq %r12
cmpq %r12, %rbx
jne 0x2561
movq (%rsp), %rbx
movq 0x18(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq