// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
movl %edi, %ebx
movl $0x1, %edi
movl $0x20, %esi
callq 0x1050
movq %rax, 0x10(%rsp)
leaq -0x38(%rip), %rdi       # 0x22e8
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
callq 0x11ec
movq %rax, %r15
testl %ebx, %ebx
jle 0x2523
movl %ebx, %eax
shrl %eax
movq %rax, 0x38(%rsp)
movl $0xb, %r13d
movq $0x0, 0x20(%rsp)
xorl %esi, %esi
xorl %ebp, %ebp
movq $0x0, 0x18(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movl %ebx, 0xc(%rsp)
movq %r15, 0x28(%rsp)
movq %r13, %rax
xorl %edx, %edx
divq 0x38(%rsp)
movq %rdx, %r15
testq %rbp, %rbp
movq %rsi, 0x30(%rsp)
je 0x238c
movq -0x8(%rsi,%rbp,8), %rbx
decq %rbp
jmp 0x23a0
movl $0x1, %edi
movl $0x8, %esi
callq 0x1050
movq %rax, %rbx
xorl %ebp, %ebp
movl %r15d, (%rbx)
movl %r12d, 0x4(%rbx)
movq 0x28(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1259
testq %rax, %rax
je 0x2409
movq %r15, %rdi
movq %rbx, %rsi
callq 0x14fe
movq %rax, 0x40(%rsp)
movq 0x20(%rsp), %rsi
cmpq %rsi, %rbp
jne 0x2429
movq %rsi, %rax
addq %rsi, %rsi
testq %rax, %rax
movl $0x10, %eax
cmoveq %rax, %rsi
movq 0x10(%rsp), %r15
movq %rsi, 0x10(%r15)
shlq $0x3, %rsi
movq 0x30(%rsp), %rdi
callq 0x1090
movq %rax, 0x18(%r15)
movq 0x10(%r15), %rsi
jmp 0x242e
incq 0x18(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x14bc
movl $0x1, %eax
movl 0xc(%rsp), %ebx
movq 0x30(%rsp), %rsi
jmp 0x2492
movq 0x30(%rsp), %rax
leaq 0x1(%rbp), %rcx
movq %rbx, (%rax,%rbp,8)
cmpq %rsi, %rcx
jne 0x2463
leaq (%rsi,%rsi), %rbx
movq 0x10(%rsp), %r15
movq %rbx, 0x10(%r15)
movq 0x18(%r15), %rdi
shlq $0x4, %rsi
callq 0x1090
movq %rax, %rsi
movq %rax, 0x18(%r15)
movq %rbx, 0x20(%rsp)
jmp 0x2471
movq %rsi, 0x20(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0xc(%rsp), %ebx
movq 0x28(%rsp), %r15
decq 0x18(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsi,%rbp,8)
addq $0x2, %rbp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %eax, %r14d
movabsq $-0x61c8864680b583eb, %rax # imm = 0x9E3779B97F4A7C15
addq %rax, %r13
movq %r13, %rax
shrq $0x1e, %rax
xorq %r13, %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, %r13
shrq $0x1f, %r13
xorq %rcx, %r13
incl %r12d
cmpl %r12d, %ebx
jne 0x236b
movq %rsi, %r12
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
movq %rbp, 0x8(%rax)
movq %r15, %rdi
xorl %esi, %esi
callq 0x218d
testq %rbp, %rbp
je 0x251e
xorl %ebx, %ebx
movq (%r12,%rbx,8), %rdi
callq 0x1030
incq %rbx
cmpq %rbx, %rbp
jne 0x250d
movq %r12, %rdi
jmp 0x252f
movq %r15, %rdi
xorl %esi, %esi
callq 0x218d
xorl %edi, %edi
callq 0x1030
movq 0x10(%rsp), %rdi
callq 0x1030
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq