// File: /workspace/github_cpp_makefile_star2_O2/prakhar2808[P]DBEngine/dbengine/MurmurHash3.cc
// Function: MurmurHash3_x86_128(void const*, int, unsigned int, void*)
void MurmurHash3_x86_128 ( const void * key, const int len,
                           uint32_t seed, void * out )
{
  const uint8_t * data = (const uint8_t*)key;
  const int nblocks = len / 16;

  uint32_t h1 = seed;
  uint32_t h2 = seed;
  uint32_t h3 = seed;
  uint32_t h4 = seed;

  const uint32_t c1 = 0x239b961b; 
  const uint32_t c2 = 0xab0e9789;
  const uint32_t c3 = 0x38b34ae5; 
  const uint32_t c4 = 0xa1e38b93;

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

  const uint32_t * blocks = (const uint32_t *)(data + nblocks*16);

  for(int i = -nblocks; i; i++)
  {
    uint32_t k1 = getblock32(blocks,i*4+0);
    uint32_t k2 = getblock32(blocks,i*4+1);
    uint32_t k3 = getblock32(blocks,i*4+2);
    uint32_t k4 = getblock32(blocks,i*4+3);

    k1 *= c1; k1  = ROTL32(k1,15); k1 *= c2; h1 ^= k1;

    h1 = ROTL32(h1,19); h1 += h2; h1 = h1*5+0x561ccd1b;

    k2 *= c2; k2  = ROTL32(k2,16); k2 *= c3; h2 ^= k2;

    h2 = ROTL32(h2,17); h2 += h3; h2 = h2*5+0x0bcaa747;

    k3 *= c3; k3  = ROTL32(k3,17); k3 *= c4; h3 ^= k3;

    h3 = ROTL32(h3,15); h3 += h4; h3 = h3*5+0x96cd1c35;

    k4 *= c4; k4  = ROTL32(k4,18); k4 *= c1; h4 ^= k4;

    h4 = ROTL32(h4,13); h4 += h1; h4 = h4*5+0x32ac3b17;
  }

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

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

  uint32_t k1 = 0;
  uint32_t k2 = 0;
  uint32_t k3 = 0;
  uint32_t k4 = 0;

  switch(len & 15)
  {
  case 15: k4 ^= tail[14] << 16;
  case 14: k4 ^= tail[13] << 8;
  case 13: k4 ^= tail[12] << 0;
           k4 *= c4; k4  = ROTL32(k4,18); k4 *= c1; h4 ^= k4;

  case 12: k3 ^= tail[11] << 24;
  case 11: k3 ^= tail[10] << 16;
  case 10: k3 ^= tail[ 9] << 8;
  case  9: k3 ^= tail[ 8] << 0;
           k3 *= c3; k3  = ROTL32(k3,17); k3 *= c4; h3 ^= k3;

  case  8: k2 ^= tail[ 7] << 24;
  case  7: k2 ^= tail[ 6] << 16;
  case  6: k2 ^= tail[ 5] << 8;
  case  5: k2 ^= tail[ 4] << 0;
           k2 *= c2; k2  = ROTL32(k2,16); k2 *= c3; h2 ^= k2;

  case  4: k1 ^= tail[ 3] << 24;
  case  3: k1 ^= tail[ 2] << 16;
  case  2: k1 ^= tail[ 1] << 8;
  case  1: k1 ^= tail[ 0] << 0;
           k1 *= c1; k1  = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
  };

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

  h1 ^= len; h2 ^= len; h3 ^= len; h4 ^= len;

  h1 += h2; h1 += h3; h1 += h4;
  h2 += h1; h3 += h1; h4 += h1;

  h1 = fmix32(h1);
  h2 = fmix32(h2);
  h3 = fmix32(h3);
  h4 = fmix32(h4);

  h1 += h2; h1 += h3; h1 += h4;
  h2 += h1; h3 += h1; h4 += h1;

  ((uint32_t*)out)[0] = h1;
  ((uint32_t*)out)[1] = h2;
  ((uint32_t*)out)[2] = h3;
  ((uint32_t*)out)[3] = h4;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %r8d
movl $0x10, %r9d
movl %esi, %eax
cltd
idivl %r9d
movslq %eax, %r11
shll $0x4, %eax
movslq %eax, %r10
movq %r11, %rax
shlq $0x4, %rax
movq %r10, %rdx
subq %rax, %rdx
leaq (%rdi,%rdx), %rbx
addq $0xc, %rbx
movl %r8d, %eax
movl %r8d, %edx
movl %r8d, %r9d
subq $0x1, %r11
jb 0x5c3a
movl -0xc(%rbx), %r14d
movl -0x8(%rbx), %r12d
movl -0x4(%rbx), %r15d
movl (%rbx), %ebp
imull $0x239b961b, %r14d, %r13d # imm = 0x239B961B
imull $0xcb0d8000, %r14d, %r14d # imm = 0xCB0D8000
shrl $0x11, %r13d
orl %r14d, %r13d
imull $0xab0e9789, %r13d, %r13d # imm = 0xAB0E9789
xorl %r9d, %r13d
roll $0x13, %r13d
addl %edx, %r13d
leal (%r13,%r13,4), %r14d
imull $0xab0e9789, %r12d, %r9d # imm = 0xAB0E9789
imull $0x97890000, %r12d, %r12d # imm = 0x97890000
shrl $0x10, %r9d
orl %r12d, %r9d
imull $0x38b34ae5, %r9d, %r12d # imm = 0x38B34AE5
xorl %edx, %r12d
roll $0x11, %r12d
leal 0x561ccd1b(%r13,%r13,4), %r9d
addl %eax, %r12d
leal (%r12,%r12,4), %edx
addl $0xbcaa747, %edx        # imm = 0xBCAA747
imull $0x38b34ae5, %r15d, %r12d # imm = 0x38B34AE5
imull $0x95ca0000, %r15d, %r15d # imm = 0x95CA0000
shrl $0xf, %r12d
orl %r15d, %r12d
imull $0xa1e38b93, %r12d, %r15d # imm = 0xA1E38B93
xorl %eax, %r15d
roll $0xf, %r15d
addl %r8d, %r15d
imull $0xa1e38b93, %ebp, %eax # imm = 0xA1E38B93
imull $0x2e4c0000, %ebp, %ebp # imm = 0x2E4C0000
shrl $0xe, %eax
orl %ebp, %eax
imull $0x239b961b, %eax, %r12d # imm = 0x239B961B
xorl %r8d, %r12d
roll $0xd, %r12d
leal (%r15,%r15,4), %eax
addl $0x96cd1c35, %eax       # imm = 0x96CD1C35
leal (%r12,%r14), %r8d
addl $0x561ccd1b, %r8d       # imm = 0x561CCD1B
leal (%r8,%r8,4), %r8d
addl $0x32ac3b17, %r8d       # imm = 0x32AC3B17
addq $0x10, %rbx
jmp 0x5b52
movl %esi, %ebx
andl $0xf, %ebx
xorl %r11d, %r11d
leaq 0x113cb(%rip), %r14     # 0x17014
movslq (%r14,%rbx,4), %rbx
addq %r14, %rbx
jmpq *%rbx
movzbl 0xe(%rdi,%r10), %r11d
shll $0x10, %r11d
movzbl 0xd(%rdi,%r10), %ebx
shll $0x8, %ebx
orl %ebx, %r11d
movzbl 0xc(%rdi,%r10), %ebx
xorl %r11d, %ebx
imull $0xa1e38b93, %ebx, %r11d # imm = 0xA1E38B93
imull $0x2e4c0000, %ebx, %ebx # imm = 0x2E4C0000
shrl $0xe, %r11d
orl %ebx, %r11d
imull $0x239b961b, %r11d, %r11d # imm = 0x239B961B
xorl %r11d, %r8d
movzbl 0xb(%rdi,%r10), %r11d
shll $0x18, %r11d
movzbl 0xa(%rdi,%r10), %ebx
shll $0x10, %ebx
orl %ebx, %r11d
movzbl 0x9(%rdi,%r10), %ebx
shll $0x8, %ebx
xorl %ebx, %r11d
movzbl 0x8(%rdi,%r10), %ebx
xorl %r11d, %ebx
imull $0x38b34ae5, %ebx, %r11d # imm = 0x38B34AE5
imull $0x95ca0000, %ebx, %ebx # imm = 0x95CA0000
shrl $0xf, %r11d
orl %ebx, %r11d
imull $0xa1e38b93, %r11d, %r11d # imm = 0xA1E38B93
xorl %r11d, %eax
movzbl 0x7(%rdi,%r10), %r11d
shll $0x18, %r11d
movzbl 0x6(%rdi,%r10), %ebx
shll $0x10, %ebx
orl %ebx, %r11d
movzbl 0x5(%rdi,%r10), %ebx
shll $0x8, %ebx
xorl %ebx, %r11d
movzbl 0x4(%rdi,%r10), %ebx
xorl %r11d, %ebx
imull $0xab0e9789, %ebx, %r11d # imm = 0xAB0E9789
imull $0x97890000, %ebx, %ebx # imm = 0x97890000
shrl $0x10, %r11d
orl %ebx, %r11d
imull $0x38b34ae5, %r11d, %r11d # imm = 0x38B34AE5
xorl %r11d, %edx
movzbl 0x3(%rdi,%r10), %r11d
shll $0x18, %r11d
movzbl 0x2(%rdi,%r10), %ebx
shll $0x10, %ebx
orl %ebx, %r11d
movzbl 0x1(%rdi,%r10), %ebx
shll $0x8, %ebx
xorl %ebx, %r11d
movzbl (%rdi,%r10), %edi
xorl %r11d, %edi
imull $0x239b961b, %edi, %r10d # imm = 0x239B961B
imull $0xcb0d8000, %edi, %edi # imm = 0xCB0D8000
shrl $0x11, %r10d
orl %edi, %r10d
imull $0xab0e9789, %r10d, %edi # imm = 0xAB0E9789
xorl %edi, %r9d
xorl %esi, %r9d
xorl %esi, %edx
xorl %esi, %eax
xorl %esi, %r8d
addl %edx, %r9d
addl %eax, %r9d
addl %r8d, %r9d
addl %r9d, %edx
addl %r9d, %eax
addl %r9d, %r8d
movl %r9d, %esi
shrl $0x10, %esi
xorl %r9d, %esi
imull $0x85ebca6b, %esi, %esi # imm = 0x85EBCA6B
movl %esi, %edi
shrl $0xd, %edi
xorl %esi, %edi
imull $0xc2b2ae35, %edi, %edi # imm = 0xC2B2AE35
movl %edi, %esi
shrl $0x10, %esi
xorl %edi, %esi
movl %edx, %edi
shrl $0x10, %edi
xorl %edx, %edi
imull $0x85ebca6b, %edi, %edx # imm = 0x85EBCA6B
movl %edx, %edi
shrl $0xd, %edi
xorl %edx, %edi
imull $0xc2b2ae35, %edi, %edi # imm = 0xC2B2AE35
movl %edi, %edx
shrl $0x10, %edx
xorl %edi, %edx
movl %eax, %edi
shrl $0x10, %edi
xorl %eax, %edi
imull $0x85ebca6b, %edi, %eax # imm = 0x85EBCA6B
movl %eax, %edi
shrl $0xd, %edi
xorl %eax, %edi
imull $0xc2b2ae35, %edi, %edi # imm = 0xC2B2AE35
movl %edi, %eax
shrl $0x10, %eax
xorl %edi, %eax
movl %r8d, %edi
shrl $0x10, %edi
xorl %r8d, %edi
imull $0x85ebca6b, %edi, %edi # imm = 0x85EBCA6B
movl %edi, %r8d
shrl $0xd, %r8d
xorl %edi, %r8d
imull $0xc2b2ae35, %r8d, %edi # imm = 0xC2B2AE35
movl %edi, %r8d
shrl $0x10, %r8d
xorl %edi, %r8d
addl %edx, %esi
addl %eax, %esi
addl %r8d, %esi
addl %esi, %edx
addl %esi, %eax
addl %esi, %r8d
movl %esi, (%rcx)
movl %edx, 0x4(%rcx)
movl %eax, 0x8(%rcx)
movl %r8d, 0xc(%rcx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq