#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int fmix(int);
int mur(int, int);
scalar_t__ read32(char const *);
uint32_t Hash32Len5to12(const char *s, size_t len) {
  uint32_t a = len, b = len * 5, c = 9, d = b;
  a += read32(s);
  b += read32(s + len - 4);
  c += read32(s + ((len >> 1) & 4));
  return fmix(mur(c, mur(b, mur(a, d))));
}


x86 assembly (clang, -O0):
<Hash32Len5to12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
imul   $0x5,-0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
movl   $0x9,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <read32@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
call   1040 <read32@plt>
mov    %rax,%rcx
movslq -0x18(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
and    $0x4,%rax
add    %rax,%rdi
call   1040 <read32@plt>
mov    %rax,%rcx
movslq -0x1c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1050 <mur@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   1050 <mur@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1050 <mur@plt>
mov    %eax,%edi
call   1030 <fmix@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hash32Len5to12>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r15
lea    (%rsi,%rsi,4),%r14d
call   1040 <read32@plt>
lea    (%rbx,%rax,1),%r12d
lea    (%r15,%rbx,1),%rdi
add    $0xfffffffffffffffc,%rdi
call   1040 <read32@plt>
lea    (%rax,%r14,1),%ebp
shr    %rbx
and    $0x4,%ebx
add    %r15,%rbx
mov    %rbx,%rdi
call   1040 <read32@plt>
lea    0x9(%rax),%ebx
mov    %r12d,%edi
mov    %r14d,%esi
call   1050 <mur@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <mur@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <mur@plt>
mov    %eax,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fmix@plt>

LLVM IR (-O0):
define i32 @Hash32Len5to12(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
%11 = load i64, i64* %4
%12 = mul i64 %11, 5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
store i32 9, i32* %7
%14 = load i32, i32* %6
store i32 %14, i32* %8
%15 = load i8*, i8** %3
%16 = call i64 @read32(i8* %15)
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = add nsw i64 %18, %16
%20 = trunc i64 %19 to i32
store i32 %20, i32* %5
%21 = load i8*, i8** %3
%22 = load i64, i64* %4
%23 = getelementptr inbounds i8, i8* %21, i64 %22
%24 = getelementptr inbounds i8, i8* %23, i64 -4
%25 = call i64 @read32(i8* %24)
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = add nsw i64 %27, %25
%29 = trunc i64 %28 to i32
store i32 %29, i32* %6
%30 = load i8*, i8** %3
%31 = load i64, i64* %4
%32 = lshr i64 %31, 1
%33 = and i64 %32, 4
%34 = getelementptr inbounds i8, i8* %30, i64 %33
%35 = call i64 @read32(i8* %34)
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = add nsw i64 %37, %35
%39 = trunc i64 %38 to i32
store i32 %39, i32* %7
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = load i32, i32* %5
%43 = load i32, i32* %8
%44 = call i32 @mur(i32 %42, i32 %43)
%45 = call i32 @mur(i32 %41, i32 %44)
%46 = call i32 @mur(i32 %40, i32 %45)
%47 = call i32 @fmix(i32 %46)
ret i32 %47
}

LLVM IR (-O2):
define i32 @Hash32Len5to12(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = mul i32 %3, 5
%5 = tail call i64 @read32(i8* %0)
%6 = add i64 %5, %1
%7 = trunc i64 %6 to i32
%8 = getelementptr inbounds i8, i8* %0, i64 %1
%9 = getelementptr inbounds i8, i8* %8, i64 -4
%10 = tail call i64 @read32(i8* %9)
%11 = trunc i64 %10 to i32
%12 = add i32 %4, %11
%13 = lshr i64 %1, 1
%14 = and i64 %13, 4
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = tail call i64 @read32(i8* %15)
%17 = trunc i64 %16 to i32
%18 = add i32 %17, 9
%19 = tail call i32 @mur(i32 %7, i32 %4)
%20 = tail call i32 @mur(i32 %12, i32 %19)
%21 = tail call i32 @mur(i32 %18, i32 %20)
%22 = tail call i32 @fmix(i32 %21)
ret i32 %22
}