// File: /workspace/github_cpp_makefile_star2_O1/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 0x3aba
movq $-0x20, %rax
leaq 0x7337(%rip), %rcx      # 0xae10
incb 0x20(%rax,%rcx)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x3ad9
movl $0x0, 0x730d(%rip)      # 0xae00
leaq 0x3806(%rip), %rax      # 0x7300
movq %rax, 0x100730f(%rip)   # 0x100ae10
callq 0x12e3
movq %rax, 0x100730b(%rip)   # 0x100ae18
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
callq 0x510d
movl $0x3d0900, %r12d        # imm = 0x3D0900
movq %rbx, %r15
leaq 0x8(%r15), %rsi
movslq (%r15), %rcx
movq %r14, %rdi
movq %r15, %rdx
callq 0x512a
addq $0x58, %r15
decq %r12
jne 0x3b26
leaq 0xb0(%rsp), %rdi
callq 0x5404
cmpq $0xf423fff, %rax        # imm = 0xF423FFF
jbe 0x3cb1
cmpq $0x3d0900, 0x2b0(%rsp) # imm = 0x3D0900
jne 0x3cb1
leaq 0x8(%rsp), %r15
xorl %r12d, %r12d
leaq 0xb0(%rsp), %r14
leaq (%rsp,%r12), %rdx
movl $0x0, (%rdx)
leaq (%r15,%r12), %rsi
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x512a
addq $0x58, %r12
cmpq $0x58, %r12
je 0x3b7c
xorl %r15d, %r15d
leaq 0xb0(%rsp), %r14
movslq (%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x53a8
testq %rax, %rax
je 0x3cb1
cmpq $0x0, 0x10(%rax)
je 0x3cb1
addq $0x58, %r15
cmpq $0xa7d8c00, %r15        # imm = 0xA7D8C00
jne 0x3ba9
leaq 0x8(%rsp), %rsi
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
callq 0x532b
movl $0x8, %r15d
leaq (%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x532b
addq $0x58, %r15
cmpq $0xa7d8c08, %r15        # imm = 0xA7D8C08
jne 0x3bf1
leaq 0x60(%rsp), %rsi
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
callq 0x532b
xorl %r15d, %r15d
movslq (%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x51e0
testq %rax, %rax
jne 0x3cb1
addq $0x58, %r15
cmpq $0xa7d8c00, %r15        # imm = 0xA7D8C00
jne 0x3c22
xorl %r15d, %r15d
leaq 0xb0(%rsp), %r14
movslq (%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x53a8
testq %rax, %rax
je 0x3c63
cmpq $0x0, 0x10(%rax)
jne 0x3cb1
addq $0x58, %r15
cmpq $0xa7d8c00, %r15        # imm = 0xA7D8C00
jne 0x3c4b
xorl %r15d, %r15d
leaq 0xb0(%rsp), %r14
movslq 0xa7d8c00(%rbx,%r15), %rsi
movq %r14, %rdi
callq 0x51e0
testq %rax, %rax
je 0x3cb1
addq $0x58, %r15
cmpq $0xa7d8c00, %r15        # imm = 0xA7D8C00
jne 0x3c7b
callq 0x1312
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x1040