// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/hash/city.cc
// Function: CityHash32(char const*, unsigned long)
uint32 CityHash32(const char *s, size_t len) {
  if (len <= 24) {
    return len <= 12 ?
        (len <= 4 ? Hash32Len0to4(s, len) : Hash32Len5to12(s, len)) :
        Hash32Len13to24(s, len);
  }

  // len > 24
  uint32 h = len, g = c1 * len, f = g;
  uint32 a0 = Rotate32(Fetch32(s + len - 4) * c1, 17) * c2;
  uint32 a1 = Rotate32(Fetch32(s + len - 8) * c1, 17) * c2;
  uint32 a2 = Rotate32(Fetch32(s + len - 16) * c1, 17) * c2;
  uint32 a3 = Rotate32(Fetch32(s + len - 12) * c1, 17) * c2;
  uint32 a4 = Rotate32(Fetch32(s + len - 20) * c1, 17) * c2;
  h ^= a0;
  h = Rotate32(h, 19);
  h = h * 5 + 0xe6546b64;
  h ^= a2;
  h = Rotate32(h, 19);
  h = h * 5 + 0xe6546b64;
  g ^= a1;
  g = Rotate32(g, 19);
  g = g * 5 + 0xe6546b64;
  g ^= a3;
  g = Rotate32(g, 19);
  g = g * 5 + 0xe6546b64;
  f += a4;
  f = Rotate32(f, 19);
  f = f * 5 + 0xe6546b64;
  size_t iters = (len - 1) / 20;
  do {
    uint32 a0 = Rotate32(Fetch32(s) * c1, 17) * c2;
    uint32 a1 = Fetch32(s + 4);
    uint32 a2 = Rotate32(Fetch32(s + 8) * c1, 17) * c2;
    uint32 a3 = Rotate32(Fetch32(s + 12) * c1, 17) * c2;
    uint32 a4 = Fetch32(s + 16);
    h ^= a0;
    h = Rotate32(h, 18);
    h = h * 5 + 0xe6546b64;
    f += a1;
    f = Rotate32(f, 19);
    f = f * c1;
    g += a2;
    g = Rotate32(g, 18);
    g = g * 5 + 0xe6546b64;
    h ^= a3 + a1;
    h = Rotate32(h, 19);
    h = h * 5 + 0xe6546b64;
    g ^= a4;
    g = bswap_32(g) * 5;
    h += a4 * 5;
    h = bswap_32(h);
    f += a0;
    PERMUTE3(f, h, g);
    s += 20;
  } while (--iters != 0);
  g = Rotate32(g, 11) * c1;
  g = Rotate32(g, 17) * c1;
  f = Rotate32(f, 11) * c1;
  f = Rotate32(f, 17) * c1;
  h = Rotate32(h + g, 19);
  h = h * 5 + 0xe6546b64;
  h = Rotate32(h, 17) * c1;
  h = Rotate32(h + f, 19);
  h = h * 5 + 0xe6546b64;
  h = Rotate32(h, 17) * c1;
  return h;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpq $0x18, %rsi
ja 0x213fd
cmpq $0xc, %rsi
ja 0x21620
cmpq $0x4, %rsi
ja 0x21666
xorl %ecx, %ecx
pushq $0x9
popq %rax
xorl %ebx, %ebx
cmpq %rcx, %rsi
je 0x21694
movsbl (%rdi,%rcx), %edx
imull $0xcc9e2d51, %ebx, %ebx # imm = 0xCC9E2D51
addl %edx, %ebx
xorl %ebx, %eax
incq %rcx
jmp 0x213e1
imull $0xcc9e2d51, %esi, %eax # imm = 0xCC9E2D51
movl -0x4(%rdi,%rsi), %ecx
imull $0xcc9e2d51, %ecx, %edx # imm = 0xCC9E2D51
shrl $0x11, %edx
imull $0x16a88000, %ecx, %ecx # imm = 0x16A88000
orl %edx, %ecx
imull $0x1b873593, %ecx, %ecx # imm = 0x1B873593
movl -0x8(%rdi,%rsi), %edx
imull $0xcc9e2d51, %edx, %r8d # imm = 0xCC9E2D51
shrl $0x11, %r8d
imull $0x16a88000, %edx, %edx # imm = 0x16A88000
orl %r8d, %edx
imull $0x1b873593, %edx, %edx # imm = 0x1B873593
movl -0x14(%rdi,%rsi), %r8d
movl -0x10(%rdi,%rsi), %r9d
imull $0xcc9e2d51, %r9d, %r10d # imm = 0xCC9E2D51
shrl $0x11, %r10d
imull $0x16a88000, %r9d, %r9d # imm = 0x16A88000
orl %r10d, %r9d
imull $0x1b873593, %r9d, %r10d # imm = 0x1B873593
movl -0xc(%rdi,%rsi), %r9d
imull $0xcc9e2d51, %r9d, %r11d # imm = 0xCC9E2D51
shrl $0x11, %r11d
imull $0x16a88000, %r9d, %r9d # imm = 0x16A88000
orl %r11d, %r9d
imull $0x1b873593, %r9d, %r9d # imm = 0x1B873593
imull $0xcc9e2d51, %r8d, %r11d # imm = 0xCC9E2D51
shrl $0x11, %r11d
imull $0x16a88000, %r8d, %ebx # imm = 0x16A88000
orl %r11d, %ebx
xorl %esi, %ecx
roll $0xd, %ecx
leal (%rcx,%rcx,4), %ecx
movl $0xe6546b64, %r8d       # imm = 0xE6546B64
addl %r8d, %ecx
xorl %r10d, %ecx
roll $0xd, %ecx
imull $0x1b873593, %ebx, %r11d # imm = 0x1B873593
leal (%rcx,%rcx,4), %ecx
addl %r8d, %ecx
xorl %eax, %edx
roll $0xd, %edx
leal (%rdx,%rdx,4), %edx
addl %r8d, %edx
xorl %r9d, %edx
roll $0xd, %edx
leal (%rdx,%rdx,4), %r10d
addl %r8d, %r10d
addl %eax, %r11d
roll $0xd, %r11d
leal (%r11,%r11,4), %r9d
addl %r8d, %r9d
decq %rsi
pushq $0x14
popq %r11
movq %rsi, %rax
xorl %edx, %edx
divq %r11
movl (%rdi), %edx
movl 0x4(%rdi), %esi
imull $0xcc9e2d51, %edx, %r11d # imm = 0xCC9E2D51
shrl $0x11, %r11d
imull $0x16a88000, %edx, %edx # imm = 0x16A88000
orl %r11d, %edx
imull $0x1b873593, %edx, %edx # imm = 0x1B873593
movl 0x8(%rdi), %r11d
imull $0xcc9e2d51, %r11d, %ebx # imm = 0xCC9E2D51
shrl $0x11, %ebx
imull $0x16a88000, %r11d, %r11d # imm = 0x16A88000
orl %ebx, %r11d
imull $0x1b873593, %r11d, %r11d # imm = 0x1B873593
addl %r10d, %r11d
movl 0xc(%rdi), %r10d
imull $0xcc9e2d51, %r10d, %ebx # imm = 0xCC9E2D51
shrl $0x11, %ebx
imull $0x16a88000, %r10d, %r10d # imm = 0x16A88000
orl %ebx, %r10d
imull $0x1b873593, %r10d, %r10d # imm = 0x1B873593
movl 0x10(%rdi), %ebx
xorl %edx, %ecx
roll $0xe, %ecx
leal (%rcx,%rcx,4), %ebp
addl %esi, %r9d
roll $0xd, %r9d
addl %r8d, %ebp
imull $0xcc9e2d51, %r9d, %ecx # imm = 0xCC9E2D51
roll $0xe, %r11d
leal (%r11,%r11,4), %r11d
addl %r8d, %r11d
addl %esi, %r10d
xorl %ebp, %r10d
roll $0xd, %r10d
xorl %ebx, %r11d
bswapl %r11d
leal (%r11,%r11,4), %r9d
addl %ebx, %r10d
leal (%r10,%r10,4), %r10d
addl %r8d, %r10d
bswapl %r10d
addl %edx, %ecx
addq $0x14, %rdi
decq %rax
jne 0x214f1
roll $0x15, %r10d
imull $0xcc9e2d51, %r10d, %eax # imm = 0xCC9E2D51
shrl $0x11, %eax
imull $0x16a88000, %r10d, %edx # imm = 0x16A88000
orl %eax, %edx
imull $0xcc9e2d51, %edx, %eax # imm = 0xCC9E2D51
shrl $0xb, %r9d
imull $0xa00000, %r11d, %edx  # imm = 0xA00000
orl %r9d, %edx
imull $0xcc9e2d51, %edx, %esi # imm = 0xCC9E2D51
shrl $0x11, %esi
imull $0x16a88000, %edx, %edx # imm = 0x16A88000
addl %ecx, %eax
roll $0xd, %eax
leal (%rax,%rax,4), %eax
movl $0xe6546b64, %ecx       # imm = 0xE6546B64
addl %ecx, %eax
roll $0xf, %eax
orl %esi, %edx
addl %edx, %eax
imull $0xcc9e2d51, %eax, %edx # imm = 0xCC9E2D51
shrl $0x13, %edx
imull $0xc5aa2000, %eax, %eax # imm = 0xC5AA2000
orl %edx, %eax
leal (%rax,%rax,4), %eax
addl %ecx, %eax
roll $0xf, %eax
imull $0xcc9e2d51, %eax, %eax # imm = 0xCC9E2D51
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rcx
shrq %rcx
movl (%rdi), %ebp
movl 0x4(%rdi), %r14d
movl -0x4(%rdi,%rcx), %eax
movl (%rdi,%rcx), %r15d
movl -0x8(%rdi,%rsi), %r12d
movl -0x4(%rdi,%rsi), %ebx
movl %eax, %edi
callq 0x21f3f
movl %r14d, %edi
movl %eax, %esi
callq 0x21f3f
movl %r12d, %edi
movl %eax, %esi
callq 0x21f3f
movl %r15d, %edi
movl %eax, %esi
callq 0x21f3f
movl %ebp, %edi
jmp 0x21696
leal (%rsi,%rsi,4), %eax
movl (%rdi), %ecx
addl %esi, %ecx
movl -0x4(%rdi,%rsi), %ebx
addl %eax, %ebx
shrl %esi
andl $0x4, %esi
movl (%rdi,%rsi), %ebp
addl $0x9, %ebp
movl %ecx, %edi
movl %eax, %esi
callq 0x21f3f
movl %ebx, %edi
movl %eax, %esi
callq 0x21f3f
movl %ebp, %edi
jmp 0x2169f
movl %esi, %edi
movl %eax, %esi
callq 0x21f3f
movl %ebx, %edi
movl %eax, %esi
callq 0x21f3f
movl %eax, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x21f1d