#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 */
uint64_t xorshift4096_r(uint64_t *s) {
  static int p = 0;
  register uint64_t s0 = s[p];
  register uint64_t s1 = s[p = ((p + 1) & 63U)];
  s1 ^= s1 << 25;
  s1 ^= s1 >> 3;
  s0 ^= s0 >> 49;
  return (s[p] = s0 ^ s1) * 8372773778140471301LL;
}


x86 assembly (clang, -O0):
<xorshift4096_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq 0x2f11(%rip),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2f01(%rip),%ecx
add    $0x1,%ecx
and    $0x3f,%ecx
mov    %ecx,0x2ef5(%rip)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x19,%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x3,%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x31,%ecx
sar    %cl,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq 0x2eb3(%rip),%rdx
mov    %eax,(%rcx,%rdx,4)
cltq
movabs $0x74321163eec4a005,%rcx
11 32 74
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorshift4096_r>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
and    $0x3f,%eax
mov    %eax,0x2f12(%rip)
ret

LLVM IR (-O0):
@xorshift4096_r.p = internal global i32 0
define i32 @xorshift4096_r(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* @xorshift4096_r.p
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* @xorshift4096_r.p
%12 = add nsw i32 %11, 1
%13 = and i32 %12, 63
store i32 %13, i32* @xorshift4096_r.p
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %10, i64 %14
%16 = load i32, i32* %15
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = shl i32 %17, 25
%19 = load i32, i32* %4
%20 = xor i32 %19, %18
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = ashr i32 %21, 3
%23 = load i32, i32* %4
%24 = xor i32 %23, %22
store i32 %24, i32* %4
%25 = load i32, i32* %3
%26 = ashr i32 %25, 49
%27 = load i32, i32* %3
%28 = xor i32 %27, %26
store i32 %28, i32* %3
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = xor i32 %29, %30
%32 = load i32*, i32** %2
%33 = load i32, i32* @xorshift4096_r.p
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
store i32 %31, i32* %35
%36 = sext i32 %31 to i64
%37 = mul nsw i64 %36, 8372773778140471301
%38 = trunc i64 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
@xorshift4096_r.p = internal unnamed_addr global i32 0
define i32 @xorshift4096_r(i32* nocapture readnone %0) {
%2 = load i32, i32* @xorshift4096_r.p
%3 = add nsw i32 %2, 1
%4 = and i32 %3, 63
store i32 %4, i32* @xorshift4096_r.p
ret i32 poison
}