#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 rotl(int const, int);
uint64_t rand64() {
  static uint64_t s[2] = {0x853c49e6748fea9bull, 0xda3e39cb94b95bdbull};
  const uint64_t s0 = s[0];
  uint64_t s1 = s[1];
  const uint64_t result = s0 + s1;
  s1 ^= s0;
  s[0] = rotl(s0, 55) ^ s1 ^ (s1 << 14);
  s[1] = rotl(s1, 36);
  return result;
}


x86 assembly (clang, -O0):
<rand64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f0a(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0x2f05(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x37,%esi
call   1030 <rotl@plt>
xor    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0xe,%ecx
xor    %ecx,%eax
mov    %eax,0x2ece(%rip)
mov    -0x8(%rbp),%edi
mov    $0x24,%esi
call   1030 <rotl@plt>
mov    %eax,0x2ebf(%rip)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand64>:
push   %rbp
push   %rbx
push   %rax
mov    0x2f0f(%rip),%edi
mov    0x2f0d(%rip),%ebx
lea    (%rbx,%rdi,1),%ebp
xor    %edi,%ebx
mov    $0x37,%esi
call   1030 <rotl@plt>
xor    %ebx,%eax
mov    %ebx,%ecx
shl    $0xe,%ecx
xor    %eax,%ecx
mov    %ecx,0x2eeb(%rip)
mov    %ebx,%edi
mov    $0x24,%esi
call   1030 <rotl@plt>
mov    %eax,0x2edd(%rip)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@rand64.s = internal global [2 x i32] [i32 1955588763, i32 -1799791653]
define i32 @rand64() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @rand64.s, i64 0, i64 0)
store i32 %4, i32* %1
%5 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @rand64.s, i64 0, i64 1)
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = xor i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %1
%13 = call i32 @rotl(i32 %12, i32 55)
%14 = load i32, i32* %2
%15 = xor i32 %13, %14
%16 = load i32, i32* %2
%17 = shl i32 %16, 14
%18 = xor i32 %15, %17
store i32 %18, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @rand64.s, i64 0, i64 0)
%19 = load i32, i32* %2
%20 = call i32 @rotl(i32 %19, i32 36)
store i32 %20, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @rand64.s, i64 0, i64 1)
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@rand64.s.0 = internal unnamed_addr global i32 1955588763
@rand64.s.1 = internal unnamed_addr global i32 -1799791653
define i32 @rand64() {
%1 = load i32, i32* @rand64.s.0
%2 = load i32, i32* @rand64.s.1
%3 = add nsw i32 %2, %1
%4 = xor i32 %2, %1
%5 = tail call i32 @rotl(i32 %1, i32 55)
%6 = xor i32 %5, %4
%7 = shl i32 %4, 14
%8 = xor i32 %6, %7
store i32 %8, i32* @rand64.s.0
%9 = tail call i32 @rotl(i32 %4, i32 36)
store i32 %9, i32* @rand64.s.1
ret i32 %3
}