#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 */

/* Variables and functions */
unsigned long UINT64_C(int);
unsigned inthash(void *k) {
  int key = *(int *)k;
  unsigned long hash = (unsigned long)key;
  hash = (hash ^ (hash >> 30)) * UINT64_C(0xbf58476d1ce4e5b9);
  hash = (hash ^ (hash >> 27)) * UINT64_C(0x94d049bb133111eb);
  hash = hash ^ (hash >> 31);
  return hash;
}


x86 assembly (clang, -O0):
<inthash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x1e,%rcx
xor    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    $0x1ce4e5b9,%edi
call   1030 <UINT64_C@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x1b,%rcx
xor    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    $0x133111eb,%edi
call   1030 <UINT64_C@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x1f,%rcx
xor    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inthash>:
push   %r14
push   %rbx
push   %rax
movslq (%rdi),%rax
mov    %rax,%r14
shr    $0x1e,%r14
xor    %rax,%r14
mov    $0x1ce4e5b9,%edi
call   1030 <UINT64_C@plt>
mov    %rax,%rbx
imul   %r14,%rbx
mov    %rbx,%rax
shr    $0x1b,%rax
xor    %rax,%rbx
mov    $0x133111eb,%edi
call   1030 <UINT64_C@plt>
imul   %rbx,%rax
mov    %rax,%rcx
shr    $0x1f,%rcx
xor    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @inthash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = load i64, i64* %4
%12 = lshr i64 %11, 30
%13 = xor i64 %10, %12
%14 = call i64 @UINT64_C(i32 484763065)
%15 = mul i64 %13, %14
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = load i64, i64* %4
%18 = lshr i64 %17, 27
%19 = xor i64 %16, %18
%20 = call i64 @UINT64_C(i32 321982955)
%21 = mul i64 %19, %20
store i64 %21, i64* %4
%22 = load i64, i64* %4
%23 = load i64, i64* %4
%24 = lshr i64 %23, 31
%25 = xor i64 %22, %24
store i64 %25, i64* %4
%26 = load i64, i64* %4
%27 = trunc i64 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @inthash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = lshr i64 %4, 30
%6 = xor i64 %5, %4
%7 = tail call i64 @UINT64_C(i32 484763065)
%8 = mul i64 %6, %7
%9 = lshr i64 %8, 27
%10 = xor i64 %9, %8
%11 = tail call i64 @UINT64_C(i32 321982955)
%12 = mul i64 %10, %11
%13 = lshr i64 %12, 31
%14 = xor i64 %13, %12
%15 = trunc i64 %14 to i32
ret i32 %15
}