// File: /workspace/github_cpp_makefile_star2_O2/prakhar2808[P]DBEngine/dbengine/MurmurHash3.cc
// Function: MurmurHash3_x64_128(void const*, int, unsigned int, void*)
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;

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

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

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

  for(int i = 0; i < nblocks; i++)
  {
    uint64_t k1 = getblock64(blocks,i*2+0);
    uint64_t k2 = getblock64(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
movl %edx, %r8d
movabsq $-0x775ed61580000000, %r11 # imm = 0x88A129EA80000000
movabsq $-0x783c846eeebdac2b, %r9 # imm = 0x87C37B91114253D5
movabsq $0x4e8b26fe00000000, %r14 # imm = 0x4E8B26FE00000000
movabsq $0x4cf5ad432745937f, %r10 # imm = 0x4CF5AD432745937F
movl $0x10, %ebx
movl %esi, %eax
cltd
idivl %ebx
movl %r8d, %edx
xorl %ebx, %ebx
testl %eax, %eax
movl $0x0, %r15d
cmovgl %eax, %r15d
shlq $0x4, %r15
movq %rdx, %r8
cmpq %rbx, %r15
je 0x5f06
movq (%rdi,%rbx), %r13
movq %r13, %r12
imulq %r9, %r12
imulq %r11, %r13
shrq $0x21, %r12
orq %r13, %r12
imulq %r10, %r12
xorq %r8, %r12
rolq $0x1b, %r12
movq 0x8(%rdi,%rbx), %r8
addq %rdx, %r12
leaq (%r12,%r12,4), %r13
movq %r8, %rbp
imulq %r10, %rbp
imulq %r14, %r8
shrq $0x1f, %rbp
orq %r8, %rbp
imulq %r9, %rbp
xorq %rdx, %rbp
rolq $0x1f, %rbp
leaq (%r12,%r12,4), %r8
addq $0x52dce729, %r8        # imm = 0x52DCE729
leaq 0x52dce729(,%r13), %rdx
addq %rbp, %rdx
leaq (%rdx,%rdx,4), %rdx
addq $0x38495ab5, %rdx       # imm = 0x38495AB5
addq $0x10, %rbx
jmp 0x5e90
cltq
shlq $0x4, %rax
movl %esi, %r15d
andl $0xf, %r15d
xorl %ebx, %ebx
leaq 0x11138(%rip), %r12     # 0x17054
movslq (%r12,%r15,4), %r15
addq %r12, %r15
jmpq *%r15
movzbl 0xe(%rdi,%rax), %ebx
shlq $0x30, %rbx
movzbl 0xd(%rdi,%rax), %r15d
shlq $0x28, %r15
orq %r15, %rbx
movzbl 0xc(%rdi,%rax), %r15d
shlq $0x20, %r15
xorq %r15, %rbx
movzbl 0xb(%rdi,%rax), %r15d
shll $0x18, %r15d
xorq %r15, %rbx
movzbl 0xa(%rdi,%rax), %r15d
shll $0x10, %r15d
xorq %r15, %rbx
movzbl 0x9(%rdi,%rax), %r15d
shll $0x8, %r15d
xorq %r15, %rbx
movzbl 0x8(%rdi,%rax), %r15d
xorq %rbx, %r15
movq %r15, %rbx
imulq %r10, %rbx
imulq %r14, %r15
shrq $0x1f, %rbx
orq %r15, %rbx
imulq %r9, %rbx
xorq %rbx, %rdx
movzbl 0x7(%rdi,%rax), %ebx
shlq $0x38, %rbx
movzbl 0x6(%rdi,%rax), %r14d
shlq $0x30, %r14
orq %r14, %rbx
movzbl 0x5(%rdi,%rax), %r14d
shlq $0x28, %r14
xorq %r14, %rbx
movzbl 0x4(%rdi,%rax), %r14d
shlq $0x20, %r14
xorq %r14, %rbx
movzbl 0x3(%rdi,%rax), %r14d
shll $0x18, %r14d
xorq %r14, %rbx
movzbl 0x2(%rdi,%rax), %r14d
shll $0x10, %r14d
xorq %r14, %rbx
movzbl 0x1(%rdi,%rax), %r14d
shll $0x8, %r14d
xorq %r14, %rbx
movzbl (%rdi,%rax), %eax
xorq %rbx, %rax
imulq %rax, %r9
imulq %r11, %rax
shrq $0x21, %r9
orq %rax, %r9
imulq %r10, %r9
xorq %r9, %r8
movslq %esi, %rax
xorq %rax, %r8
xorq %rax, %rdx
addq %rdx, %r8
addq %r8, %rdx
movq %r8, %rax
shrq $0x21, %rax
xorq %r8, %rax
movabsq $-0xae502812aa7333, %rsi # imm = 0xFF51AFD7ED558CCD
imulq %rsi, %rax
movq %rax, %rdi
shrq $0x21, %rdi
xorq %rax, %rdi
movabsq $-0x3b314601e57a13ad, %rax # imm = 0xC4CEB9FE1A85EC53
imulq %rax, %rdi
movq %rdi, %r8
shrq $0x21, %r8
xorq %rdi, %r8
movq %rdx, %rdi
shrq $0x21, %rdi
xorq %rdx, %rdi
imulq %rsi, %rdi
movq %rdi, %rdx
shrq $0x21, %rdx
xorq %rdi, %rdx
imulq %rax, %rdx
movq %rdx, %rax
shrq $0x21, %rax
xorq %rdx, %rax
addq %rax, %r8
addq %r8, %rax
movq %r8, (%rcx)
movq %rax, 0x8(%rcx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)