// File: /workspace/github_cpp_makefile_star2_O1/amadvance[P]tommyds/check.c
// Function: test_hash
void test_hash(void)
{
	unsigned i;
	unsigned char buffer[16];
	unsigned COUNT = 1024*1024*16;
	tommy_uint32_t hash32;
	tommy_uint64_t hash64;

	START("hash_test_vectors");

	for(i=0;HASH32[i].data;++i) {
		if (tommy_hash_u32(0xa766795d, HASH32[i].data, HASH32[i].len) != HASH32[i].hash)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */
	}

	for(i=0;STRHASH32[i].data;++i) {
		if (tommy_strhash_u32(0xa766795d, STRHASH32[i].data) != STRHASH32[i].hash)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */
	}

	for(i=0;HASH64[i].data;++i) {
		if (tommy_hash_u64(0x2f022773a766795dULL, HASH64[i].data, HASH64[i].len) != HASH64[i].hash)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */
	}

	for(i=0;INTHASH32[i].value || !i;++i) {
		if (tommy_inthash_u32(INTHASH32[i].value) != INTHASH32[i].hash)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */
	}

	for(i=0;INTHASH64[i].value || !i;++i) {
		if (tommy_inthash_u64(INTHASH64[i].value) != INTHASH64[i].hash)
			/* LCOV_EXCL_START */
			abort();
			/* LCOV_EXCL_STOP */
	}

	STOP();

	memset(buffer, 0xAA, sizeof(buffer));
	buffer[sizeof(buffer) - 1] = 0;

	hash32 = 0;
	hash64 = 0;

	START("hash_u32");

	for(i=0;i<COUNT;++i) {
		hash32 = tommy_hash_u32(hash32, buffer, sizeof(buffer));
	}

	STOP();

	START("strhash_u32");

	for(i=0;i<COUNT;++i) {
		hash32 = tommy_strhash_u32(hash32, buffer);
	}

	STOP();

	START("hash_u64");

	for(i=0;i<COUNT;++i) {
		hash64 = tommy_hash_u64(hash64, buffer, sizeof(buffer));
	}

	STOP();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq $-0x20, %rax
leaq 0x9aa7(%rip), %r15      # 0xae10
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x1369
movl $0x0, 0x9a7c(%rip)      # 0xae00
leaq 0x5de4(%rip), %rax      # 0x716f
movq %rax, 0x1009a7e(%rip)   # 0x100ae10
callq 0x12e3
movq %rax, 0x1009a7a(%rip)   # 0x100ae18
movq 0x8cdb(%rip), %rsi      # 0xa080
testq %rsi, %rsi
je 0x13e6
leaq 0x8ccf(%rip), %rbx      # 0xa080
movl $0x1, %ebp
movq %rbx, %r14
movl 0x8(%r14), %edx
movl $0xa766795d, %edi       # imm = 0xA766795D
callq 0x3d14
cmpl 0xc(%r14), %eax
jne 0x16b6
movl %ebp, %eax
shlq $0x4, %rax
leaq (%rbx,%rax), %r14
movq (%rax,%rbx), %rsi
incl %ebp
testq %rsi, %rsi
jne 0x13b9
movl $0x80000001, %r14d      # imm = 0x80000001
movq 0x8e0d(%rip), %rsi      # 0xa200
testq %rsi, %rsi
je 0x1435
leaq 0x8e01(%rip), %r12      # 0xa200
movl $0x1, %ebp
leaq 0x2766795c(%r14), %rbx
movq %r12, %r13
movq %rbx, %rdi
callq 0x3f74
cmpl 0x8(%r13), %eax
jne 0x16b6
movl %ebp, %eax
shlq $0x4, %rax
leaq (%r12,%rax), %r13
movq (%rax,%r12), %rsi
incl %ebp
testq %rsi, %rsi
jne 0x140e
movq 0x8f44(%rip), %rsi      # 0xa380
testq %rsi, %rsi
je 0x1485
leaq 0x8f38(%rip), %r12      # 0xa380
movl $0x1, %ebp
movabsq $0x2f022773a766795d, %rbx # imm = 0x2F022773A766795D
movq %r12, %r13
movl 0x8(%r13), %edx
movq %rbx, %rdi
callq 0x3e3b
cmpq 0x10(%r13), %rax
jne 0x16b6
movl %ebp, %eax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %r13
movq (%r13), %rsi
incl %ebp
testq %rsi, %rsi
jne 0x145a
leaq 0x9134(%rip), %rax      # 0xa5c0
movl $0x1, %ecx
movl 0x9129(%rip), %esi      # 0xa5c0
movq %rax, %rdx
movl %esi, %edi
shll $0x6, %edi
subl %edi, %esi
movl %esi, %edi
shrl $0x11, %edi
xorl %esi, %edi
movl %edi, %esi
shll $0x9, %esi
imull $0xffffe010, %edi, %r8d # imm = 0xFFFFE010
subl %esi, %edi
xorl %r8d, %edi
leal (,%rdi,8), %esi
imull $0xffffe400, %edi, %r8d # imm = 0xFFFFE400
subl %esi, %edi
xorl %r8d, %edi
movl %edi, %esi
shrl $0xf, %esi
xorl %edi, %esi
cmpl 0x4(%rdx), %esi
jne 0x16b6
movl %ecx, %edx
leaq (%rax,%rdx,8), %rdx
movl (%rdx), %esi
testl %esi, %esi
setne %dil
testl %ecx, %ecx
sete %r8b
orb %dil, %r8b
incl %ecx
testb %r8b, %r8b
jne 0x149a
leaq 0x92cf(%rip), %rax      # 0xa7d0
movl $0x1, %ecx
movq 0x92c3(%rip), %rsi      # 0xa7d0
movq %rax, %rdx
movq %rsi, %rdi
notq %rdi
shlq $0x15, %rsi
addq %rdi, %rsi
movq %rsi, %rdi
shrq $0x18, %rdi
xorq %rsi, %rdi
imulq $0x109, %rdi, %rsi      # imm = 0x109
movq %rsi, %rdi
shrq $0xe, %rdi
xorq %rsi, %rdi
leaq (%rdi,%rdi,4), %rsi
leaq (%rdi,%rsi,4), %rsi
movq %rsi, %rdi
shrq $0x1c, %rdi
xorq %rsi, %rdi
imulq %r14, %rdi
cmpq 0x8(%rdx), %rdi
jne 0x16b6
movl %ecx, %esi
shlq $0x4, %rsi
leaq (%rax,%rsi), %rdx
movq (%rsi,%rax), %rsi
testq %rsi, %rsi
sete %dil
testl %ecx, %ecx
setne %r8b
incl %ecx
testb %dil, %r8b
je 0x1510
callq 0x1312
movaps 0x5a8a(%rip), %xmm0     # 0x7010
movaps %xmm0, (%rsp)
movb $0x0, 0xf(%rsp)
movq $-0x20, %rax
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x1596
movl $0x0, 0x984f(%rip)      # 0xae00
leaq 0x5bcc(%rip), %rax      # 0x7184
movq %rax, 0x1009851(%rip)   # 0x100ae10
callq 0x12e3
movq %rax, 0x100984d(%rip)   # 0x100ae18
xorl %ebx, %ebx
movl $0x1000000, %ebp        # imm = 0x1000000
movq %rsp, %r14
movl $0x10, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x3d14
movl %eax, %ebx
decl %ebp
jne 0x15d5
callq 0x1312
movq $-0x20, %rax
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x15f6
movl $0x0, 0x97ef(%rip)      # 0xae00
leaq 0x5b69(%rip), %rax      # 0x7181
movq %rax, 0x10097f1(%rip)   # 0x100ae10
callq 0x12e3
movq %rax, 0x10097ed(%rip)   # 0x100ae18
movl $0x1000000, %ebp        # imm = 0x1000000
movq %rsp, %r14
movl %ebx, %edi
movq %r14, %rsi
callq 0x3f74
movl %eax, %ebx
decl %ebp
jne 0x1633
callq 0x1312
movq $-0x20, %rax
incb 0x20(%rax,%r15)
addq $0x20, %rax
cmpq $0xffffe0, %rax         # imm = 0xFFFFE0
jb 0x164f
movl $0x0, 0x9796(%rip)      # 0xae00
leaq 0x5b1c(%rip), %rax      # 0x718d
movq %rax, 0x1009798(%rip)   # 0x100ae10
callq 0x12e3
movq %rax, 0x1009794(%rip)   # 0x100ae18
movl $0x1000000, %ebp        # imm = 0x1000000
xorl %eax, %eax
movq %rsp, %rbx
movl $0x10, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3e3b
decl %ebp
jne 0x168e
callq 0x1312
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1040