// File: /workspace/github_cpp_makefile_star2_O3/amadvance[P]tommyds/check.c
// Function: test_trie_inplace
void test_trie_inplace(void)
{
	tommy_trie_inplace trie_inplace;
	struct object_trie_inplace* OBJ;
	struct object_trie_inplace DUP[2];
	unsigned i;
	const unsigned size = TOMMY_SIZE * 4;

	OBJ = malloc(size * sizeof(struct object_trie_inplace));

	for(i=0;i<size;++i)
		OBJ[i].value = i;

	START("trie_inplace");
	tommy_trie_inplace_init(&trie_inplace);

	/* insert */
	for(i=0;i<size;++i)
		tommy_trie_inplace_insert(&trie_inplace, &OBJ[i].node, &OBJ[i], OBJ[i].value);

	if (tommy_trie_inplace_memory_usage(&trie_inplace) < size * sizeof(tommy_trie_inplace_node))
		/* LCOV_EXCL_START */
		abort();
		/* LCOV_EXCL_STOP */

	if (tommy_trie_inplace_count(&trie_inplace) != size)
		/* LCOV_EXCL_START */
		abort();
		/* LCOV_EXCL_STOP */

	/* insert duplicates */
	for(i=0;i<2;++i) {
		DUP[i].value = 0;
		tommy_trie_inplace_insert(&trie_inplace, &DUP[i].node, &DUP[i], DUP[i].value);
	}

	/* search present */
	for(i=0;i<size/2;++i)
		if (tommy_trie_inplace_search(&trie_inplace, OBJ[i].value) == 0)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */

	/* remove first duplicate */
	tommy_trie_inplace_remove_existing(&trie_inplace, &DUP[0].node);

	/* remove existing */
	for(i=0;i<size/2;++i)
		tommy_trie_inplace_remove_existing(&trie_inplace, &OBJ[i].node);

	/* remove second duplicate */
	tommy_trie_inplace_remove_existing(&trie_inplace, &DUP[1].node);

	/* remove missing */
	for(i=0;i<size/2;++i)
		if (tommy_trie_inplace_remove(&trie_inplace, OBJ[i].value) != 0)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */

	/* search missing */
	for(i=0;i<size/2;++i)
		if (tommy_trie_inplace_search(&trie_inplace, OBJ[i].value) != 0)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */

	/* remove present */
	for(i=0;i<size/2;++i)
		if (tommy_trie_inplace_remove(&trie_inplace, OBJ[size/2+i].value) == 0)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */

	STOP();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movl $0x14fb1800, %edi       # imm = 0x14FB1800
callq 0x10c0
movq %rax, %rbx
xorl %eax, %eax
movq %rbx, %rcx
movl %eax, (%rcx)
incq %rax
addq $0x58, %rcx
cmpq $0x3d0900, %rax         # imm = 0x3D0900
jne 0x3a70
movq $-0x20, %rax
leaq 0x8381(%rip), %rcx      # 0xbe10
incb 0x20(%rax,%rcx)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x3a8f
movl $0x0, 0x8357(%rip)      # 0xbe00
leaq 0x3850(%rip), %rax      # 0x7300
movq %rax, 0x1008359(%rip)   # 0x100be10
callq 0x12e3
movq %rax, 0x1008355(%rip)   # 0x100be18
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
callq 0x52d0
movl $0x3d0900, %r12d        # imm = 0x3D0900
movq %rbx, %r15
leaq 0x8(%r15), %rsi
movslq (%r15), %rcx
movq %r14, %rdi
movq %r15, %rdx
callq 0x52dc
addq $0x58, %r15
decq %r12
jne 0x3adc
leaq 0xb0(%rsp), %rdi
callq 0x55b3
cmpq $0xf423fff, %rax        # imm = 0xF423FFF
jbe 0x3c62
cmpq $0x3d0900, 0x2b0(%rsp) # imm = 0x3D0900
jne 0x3c62
xorl %r15d, %r15d
leaq 0x8(%rsp), %rsi
movl %r15d, -0x8(%rsi)
leaq 0xb0(%rsp), %r14
movq %rsp, %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x52dc
leaq 0x58(%rsp), %rdx
movl %r15d, (%rdx)
leaq 0x60(%rsp), %rsi
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x52dc
movslq (%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x5555
testq %rax, %rax
je 0x3c62
cmpq $0x0, 0x10(%rax)
je 0x3c62
addq $0x58, %r15
cmpq $0xa7d8c00, %r15        # imm = 0xA7D8C00
jne 0x3b5a
leaq 0x8(%rsp), %rsi
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
callq 0x54d8
movl $0x8, %r15d
leaq (%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x54d8
addq $0x58, %r15
cmpq $0xa7d8c08, %r15        # imm = 0xA7D8C08
jne 0x3ba2
leaq 0x60(%rsp), %rsi
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
callq 0x54d8
xorl %r15d, %r15d
movslq (%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x5392
testq %rax, %rax
jne 0x3c62
addq $0x58, %r15
cmpq $0xa7d8c00, %r15        # imm = 0xA7D8C00
jne 0x3bd3
xorl %r15d, %r15d
leaq 0xb0(%rsp), %r14
movslq (%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x5555
testq %rax, %rax
je 0x3c14
cmpq $0x0, 0x10(%rax)
jne 0x3c62
addq $0x58, %r15
cmpq $0xa7d8c00, %r15        # imm = 0xA7D8C00
jne 0x3bfc
xorl %r15d, %r15d
leaq 0xb0(%rsp), %r14
movslq 0xa7d8c00(%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x5392
testq %rax, %rax
je 0x3c62
addq $0x58, %r15
cmpq $0xa7d8c00, %r15        # imm = 0xA7D8C00
jne 0x3c2c
callq 0x1312
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x1040