#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 */
unsigned int __service_hash(void *k) {
  uint32_t key = (uint32_t)(*(uint32_t *)k);
  key = (key + 0x7ed55d16) + (key << 12);
  key = (key ^ 0xc761c23c) ^ (key >> 19);
  key = (key + 0x165667b1) + (key << 5);
  key = (key + 0xd3a2646c) ^ (key << 9);
  key = (key + 0xfd7046c5) + (key << 3);
  key = (key ^ 0xb55a4f09) ^ (key >> 16);
  return key;
}


x86 assembly (clang, -O0):
<__service_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x7ed55d16,%eax
mov    -0xc(%rbp),%ecx
shl    $0xc,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xc761c23c,%eax
mov    -0xc(%rbp),%ecx
sar    $0x13,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x165667b1,%eax
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xd3a2646c,%eax
mov    -0xc(%rbp),%ecx
shl    $0x9,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfd7046c5,%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xb55a4f09,%eax
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__service_hash>:
mov    (%rdi),%eax
mov    %eax,%ecx
shl    $0xc,%ecx
add    %ecx,%eax
add    $0x7ed55d16,%eax
mov    %eax,%ecx
sar    $0x13,%ecx
xor    %eax,%ecx
xor    $0xc761c23c,%ecx
mov    %ecx,%eax
shl    $0x5,%eax
lea    (%rcx,%rax,1),%edx
shl    $0x9,%edx
add    %ecx,%eax
add    $0xe9f8cc1d,%eax
add    $0xaccf6200,%edx
xor    %eax,%edx
lea    (%rdx,%rdx,8),%ecx
add    $0xfd7046c5,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
xor    $0xb55a4f09,%eax
ret

LLVM IR (-O0):
define i32 @__service_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 2127912214
%9 = load i32, i32* %3
%10 = shl i32 %9, 12
%11 = add nsw i32 %8, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = xor i32 %12, -949894596
%14 = load i32, i32* %3
%15 = ashr i32 %14, 19
%16 = xor i32 %13, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 374761393
%19 = load i32, i32* %3
%20 = shl i32 %19, 5
%21 = add nsw i32 %18, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = add i32 %22, -744332180
%24 = load i32, i32* %3
%25 = shl i32 %24, 9
%26 = xor i32 %23, %25
store i32 %26, i32* %3
%27 = load i32, i32* %3
%28 = add i32 %27, -42973499
%29 = load i32, i32* %3
%30 = shl i32 %29, 3
%31 = add i32 %28, %30
store i32 %31, i32* %3
%32 = load i32, i32* %3
%33 = xor i32 %32, -1252372727
%34 = load i32, i32* %3
%35 = ashr i32 %34, 16
%36 = xor i32 %33, %35
store i32 %36, i32* %3
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @__service_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2127912214
%5 = shl i32 %3, 12
%6 = add nsw i32 %4, %5
%7 = ashr i32 %6, 19
%8 = xor i32 %6, %7
%9 = xor i32 %8, -949894596
%10 = add nsw i32 %9, 374761393
%11 = shl i32 %9, 5
%12 = add nsw i32 %10, %11
%13 = add i32 %12, -744332180
%14 = shl i32 %12, 9
%15 = xor i32 %13, %14
%16 = add i32 %15, -42973499
%17 = shl i32 %15, 3
%18 = add i32 %16, %17
%19 = ashr i32 %18, 16
%20 = xor i32 %18, %19
%21 = xor i32 %20, -1252372727
ret i32 %21
}