#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 int UINT32_C(int);
unsigned int hash_int(void *key) {
  unsigned int x = (uintptr_t)key;
  x++;
  x ^= x >> 17;
  x *= UINT32_C(0xed5ad4bb);
  x ^= x >> 11;
  x *= UINT32_C(0xac4c1b51);
  x ^= x >> 15;
  x *= UINT32_C(0x31848bab);
  x ^= x >> 14;
  return x;
}


x86 assembly (clang, -O0):
<hash_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x11,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xed5ad4bb,%edi
call   1030 <UINT32_C@plt>
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xb,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xac4c1b51,%edi
call   1030 <UINT32_C@plt>
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xf,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x31848bab,%edi
call   1030 <UINT32_C@plt>
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xe,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_int>:
push   %rbp
push   %rbx
push   %rax
lea    0x1(%rdi),%eax
mov    %eax,%ebp
shr    $0x11,%ebp
xor    %eax,%ebp
mov    $0xed5ad4bb,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ebx
imul   %ebp,%ebx
mov    %ebx,%eax
shr    $0xb,%eax
xor    %eax,%ebx
mov    $0xac4c1b51,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ebp
imul   %ebx,%ebp
mov    %ebp,%eax
shr    $0xf,%eax
xor    %eax,%ebp
mov    $0x31848bab,%edi
call   1030 <UINT32_C@plt>
imul   %ebp,%eax
mov    %eax,%ecx
shr    $0xe,%ecx
xor    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hash_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = lshr i32 %9, 17
%11 = load i32, i32* %3
%12 = xor i32 %11, %10
store i32 %12, i32* %3
%13 = call i32 @UINT32_C(i32 -312814405)
%14 = load i32, i32* %3
%15 = mul i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = lshr i32 %16, 11
%18 = load i32, i32* %3
%19 = xor i32 %18, %17
store i32 %19, i32* %3
%20 = call i32 @UINT32_C(i32 -1404298415)
%21 = load i32, i32* %3
%22 = mul i32 %21, %20
store i32 %22, i32* %3
%23 = load i32, i32* %3
%24 = lshr i32 %23, 15
%25 = load i32, i32* %3
%26 = xor i32 %25, %24
store i32 %26, i32* %3
%27 = call i32 @UINT32_C(i32 830770091)
%28 = load i32, i32* %3
%29 = mul i32 %28, %27
store i32 %29, i32* %3
%30 = load i32, i32* %3
%31 = lshr i32 %30, 14
%32 = load i32, i32* %3
%33 = xor i32 %32, %31
store i32 %33, i32* %3
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @hash_int(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 1
%5 = lshr i32 %4, 17
%6 = xor i32 %5, %4
%7 = tail call i32 @UINT32_C(i32 -312814405)
%8 = mul i32 %7, %6
%9 = lshr i32 %8, 11
%10 = xor i32 %9, %8
%11 = tail call i32 @UINT32_C(i32 -1404298415)
%12 = mul i32 %10, %11
%13 = lshr i32 %12, 15
%14 = xor i32 %13, %12
%15 = tail call i32 @UINT32_C(i32 830770091)
%16 = mul i32 %14, %15
%17 = lshr i32 %16, 14
%18 = xor i32 %17, %16
ret i32 %18
}