// File: /workspace/github_c_makefile_star2_O2/yancanchen[P]mc-bloom-filter/murmur.c
// Function: MurmurHash3_x64_128
void MurmurHash3_x64_128 ( const void * key, const int len,
		const uint32_t seed, void * out )
{
	const uint8_t * data = (const uint8_t*)key;
	const int nblocks = len / 16;

	uint64_t h1 = seed;
	uint64_t h2 = seed;

	uint64_t c1 = BIG_CONSTANT(0x87c37b91114253d5);
	uint64_t c2 = BIG_CONSTANT(0x4cf5ad432745937f);

	int i;

	//----------
	// body

	const uint64_t * blocks = (const uint64_t *)(data);

	for(i = 0; i < nblocks; i++) {
		uint64_t k1 = getblock(blocks,i*2+0);
		uint64_t k2 = getblock(blocks,i*2+1);

		k1 *= c1; k1  = ROTL64(k1,31); k1 *= c2; h1 ^= k1;

		h1 = ROTL64(h1,27); h1 += h2; h1 = h1*5+0x52dce729;

		k2 *= c2; k2  = ROTL64(k2,33); k2 *= c1; h2 ^= k2;

		h2 = ROTL64(h2,31); h2 += h1; h2 = h2*5+0x38495ab5;
	}

	//----------
	// tail

	const uint8_t * tail = (const uint8_t*)(data + nblocks*16);

	uint64_t k1 = 0;
	uint64_t k2 = 0;

	switch(len & 15) {
		case 15: k2 ^= ((uint64_t)tail[14]) << 48;
		case 14: k2 ^= ((uint64_t)tail[13]) << 40;
		case 13: k2 ^= ((uint64_t)tail[12]) << 32;
		case 12: k2 ^= ((uint64_t)tail[11]) << 24;
		case 11: k2 ^= ((uint64_t)tail[10]) << 16;
		case 10: k2 ^= ((uint64_t)tail[ 9]) << 8;
		case  9: k2 ^= ((uint64_t)tail[ 8]) << 0;
				 k2 *= c2; k2  = ROTL64(k2,33); k2 *= c1; h2 ^= k2;

		case  8: k1 ^= ((uint64_t)tail[ 7]) << 56;
		case  7: k1 ^= ((uint64_t)tail[ 6]) << 48;
		case  6: k1 ^= ((uint64_t)tail[ 5]) << 40;
		case  5: k1 ^= ((uint64_t)tail[ 4]) << 32;
		case  4: k1 ^= ((uint64_t)tail[ 3]) << 24;
		case  3: k1 ^= ((uint64_t)tail[ 2]) << 16;
		case  2: k1 ^= ((uint64_t)tail[ 1]) << 8;
		case  1: k1 ^= ((uint64_t)tail[ 0]) << 0;
				 k1 *= c1; k1  = ROTL64(k1,31); k1 *= c2; h1 ^= k1;
	}

	//----------
	// finalization

	h1 ^= len; h2 ^= len;

	h1 += h2;
	h2 += h1;

	h1 = fmix64(h1);
	h2 = fmix64(h2);

	h1 += h2;
	h2 += h1;

	((uint64_t*)out)[0] = h1;
	((uint64_t*)out)[1] = h2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ecx
movabsq $-0x775ed61580000000, %r10 # imm = 0x88A129EA80000000
movabsq $-0x783c846eeebdac2b, %r8 # imm = 0x87C37B91114253D5
movabsq $0x4e8b26fe00000000, %r11 # imm = 0x4E8B26FE00000000
movabsq $0x4cf5ad432745937f, %r9 # imm = 0x4CF5AD432745937F
pushq $0x10
popq %rbp
movl %esi, %eax
cltd
idivl %ebp
movl %ecx, %r14d
xorl %edx, %edx
testl %eax, %eax
movl $0x0, %r15d
cmovgl %eax, %r15d
shlq $0x4, %r15
movq %r14, %rcx
cmpq %rdx, %r15
je 0x4bde
movq (%rdi,%rdx), %r13
movq %r13, %r12
imulq %r8, %r12
imulq %r10, %r13
shrq $0x21, %r12
orq %r13, %r12
imulq %r9, %r12
xorq %rcx, %r12
rolq $0x1b, %r12
movq 0x8(%rdi,%rdx), %rcx
addq %r14, %r12
leaq (%r12,%r12,4), %r13
movq %rcx, %rbp
imulq %r9, %rbp
imulq %r11, %rcx
shrq $0x1f, %rbp
orq %rcx, %rbp
imulq %r8, %rbp
xorq %r14, %rbp
rolq $0x1f, %rbp
leaq (%r12,%r12,4), %rcx
addq $0x52dce729, %rcx       # imm = 0x52DCE729
leaq 0x52dce729(,%r13), %r14
addq %rbp, %r14
leaq (%r14,%r14,4), %r14
addq $0x38495ab5, %r14       # imm = 0x38495AB5
addq $0x10, %rdx
jmp 0x4b68
cltq
shlq $0x4, %rax
movl %esi, %r15d
andl $0xf, %r15d
xorl %edx, %edx
leaq 0x1244(%rip), %r12      # 0x5e38
movslq (%r12,%r15,4), %r15
addq %r12, %r15
jmpq *%r15
movzbl 0xe(%rdi,%rax), %edx
shlq $0x30, %rdx
movzbl 0xd(%rdi,%rax), %r15d
shlq $0x28, %r15
orq %r15, %rdx
movzbl 0xc(%rdi,%rax), %r15d
shlq $0x20, %r15
xorq %r15, %rdx
movzbl 0xb(%rdi,%rax), %r15d
shll $0x18, %r15d
xorq %r15, %rdx
movzbl 0xa(%rdi,%rax), %r15d
shll $0x10, %r15d
xorq %r15, %rdx
movzbl 0x9(%rdi,%rax), %r15d
shll $0x8, %r15d
xorq %r15, %rdx
movzbl 0x8(%rdi,%rax), %r15d
xorq %rdx, %r15
movq %r15, %rdx
imulq %r9, %rdx
imulq %r11, %r15
shrq $0x1f, %rdx
orq %r15, %rdx
imulq %r8, %rdx
xorq %rdx, %r14
movzbl 0x7(%rdi,%rax), %edx
shlq $0x38, %rdx
movzbl 0x6(%rdi,%rax), %r11d
shlq $0x30, %r11
orq %r11, %rdx
movzbl 0x5(%rdi,%rax), %r11d
shlq $0x28, %r11
xorq %r11, %rdx
movzbl 0x4(%rdi,%rax), %r11d
shlq $0x20, %r11
xorq %r11, %rdx
movzbl 0x3(%rdi,%rax), %r11d
shll $0x18, %r11d
xorq %r11, %rdx
movzbl 0x2(%rdi,%rax), %r11d
shll $0x10, %r11d
xorq %r11, %rdx
movzbl 0x1(%rdi,%rax), %r11d
shll $0x8, %r11d
xorq %r11, %rdx
movzbl (%rdi,%rax), %eax
xorq %rdx, %rax
imulq %rax, %r8
imulq %r10, %rax
shrq $0x21, %r8
orq %rax, %r8
imulq %r9, %r8
xorq %r8, %rcx
movslq %esi, %rax
xorq %rax, %rcx
xorq %rax, %r14
addq %r14, %rcx
addq %rcx, %r14
movq %rcx, %rdi
callq 0x4d1c
movq %rax, %r15
movq %r14, %rdi
callq 0x4d1c
addq %rax, %r15
addq %r15, %rax
movq %r15, (%rbx)
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq