#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 uint64_t;

/* Variables and functions */
int UINT64_C(int);
uint64_t splitmix64_stateless(uint64_t index) {
  uint64_t z = (index + UINT64_C(0x9E3779B97F4A7C15));
  z = (z ^ (z >> 30)) * UINT64_C(0xBF58476D1CE4E5B9);
  z = (z ^ (z >> 27)) * UINT64_C(0x94D049BB133111EB);
  return z ^ (z >> 31);
}


x86 assembly (clang, -O0):
<splitmix64_stateless>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x7f4a7c15,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x1e,%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x1ce4e5b9,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x1b,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x133111eb,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitmix64_stateless>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x7f4a7c15,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %ebp,%eax
sar    $0x1e,%eax
xor    %eax,%ebp
mov    $0x1ce4e5b9,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ebx
imul   %ebp,%ebx
mov    %ebx,%eax
sar    $0x1b,%eax
xor    %eax,%ebx
mov    $0x133111eb,%edi
call   1030 <UINT64_C@plt>
imul   %ebx,%eax
mov    %eax,%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @splitmix64_stateless(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @UINT64_C(i32 2135587861)
%6 = add nsw i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = ashr i32 %8, 30
%10 = xor i32 %7, %9
%11 = call i32 @UINT64_C(i32 484763065)
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = ashr i32 %14, 27
%16 = xor i32 %13, %15
%17 = call i32 @UINT64_C(i32 321982955)
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = load i32, i32* %3
%21 = ashr i32 %20, 31
%22 = xor i32 %19, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @splitmix64_stateless(i32 %0) {
%2 = tail call i32 @UINT64_C(i32 2135587861)
%3 = add nsw i32 %2, %0
%4 = ashr i32 %3, 30
%5 = xor i32 %4, %3
%6 = tail call i32 @UINT64_C(i32 484763065)
%7 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 27
%9 = xor i32 %8, %7
%10 = tail call i32 @UINT64_C(i32 321982955)
%11 = mul nsw i32 %9, %10
%12 = ashr i32 %11, 31
%13 = xor i32 %12, %11
ret i32 %13
}