#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 */
uint32_t xorwow() {
  static uint32_t x = 123456789, y = 362436069, z = 521288629, w = 88675123,
                  v = 5783321, d = 6615241;
  uint32_t t = (x ^ (x >> 2));
  x = y;
  y = z;
  z = w;
  w = v;
  v = (v ^ (v << 4)) ^ (t ^ (t << 1));
  return (d += 362437) + v;
}


x86 assembly (clang, -O0):
<xorwow>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    0x2f10(%rip),%ecx
sar    $0x2,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    0x2f06(%rip),%eax
mov    %eax,0x2efc(%rip)
mov    0x2efe(%rip),%eax
mov    %eax,0x2ef4(%rip)
mov    0x2ef6(%rip),%eax
mov    %eax,0x2eec(%rip)
mov    0x2eee(%rip),%eax
mov    %eax,0x2ee4(%rip)
mov    0x2ee2(%rip),%eax
mov    0x2edc(%rip),%ecx
shl    $0x4,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
xor    %edx,%ecx
xor    %ecx,%eax
mov    %eax,0x2ec4(%rip)
mov    0x2ec2(%rip),%eax
add    $0x587c5,%eax
mov    %eax,0x2eb7(%rip)
add    0x2ead(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorwow>:
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
sar    $0x2,%ecx
xor    %eax,%ecx
mov    0x2f11(%rip),%eax
mov    %eax,0x2f07(%rip)
mov    0x2f09(%rip),%eax
mov    %eax,0x2eff(%rip)
mov    0x2f01(%rip),%eax
mov    %eax,0x2ef7(%rip)
mov    0x2ef9(%rip),%eax
mov    %eax,0x2eef(%rip)
lea    (%rcx,%rcx,1),%edx
xor    %eax,%ecx
shl    $0x4,%eax
xor    %edx,%ecx
xor    %eax,%ecx
mov    %ecx,0x2ee1(%rip)
mov    0x2edf(%rip),%eax
lea    0x587c5(%rax),%edx
mov    %edx,0x2ed3(%rip)
add    %ecx,%eax
add    $0x587c5,%eax
ret

LLVM IR (-O0):
@xorwow.x = internal global i32 123456789
@xorwow.y = internal global i32 362436069
@xorwow.z = internal global i32 521288629
@xorwow.w = internal global i32 88675123
@xorwow.v = internal global i32 5783321
@xorwow.d = internal global i32 6615241
define i32 @xorwow() {
%1 = alloca i32
%2 = load i32, i32* @xorwow.x
%3 = load i32, i32* @xorwow.x
%4 = ashr i32 %3, 2
%5 = xor i32 %2, %4
store i32 %5, i32* %1
%6 = load i32, i32* @xorwow.y
store i32 %6, i32* @xorwow.x
%7 = load i32, i32* @xorwow.z
store i32 %7, i32* @xorwow.y
%8 = load i32, i32* @xorwow.w
store i32 %8, i32* @xorwow.z
%9 = load i32, i32* @xorwow.v
store i32 %9, i32* @xorwow.w
%10 = load i32, i32* @xorwow.v
%11 = load i32, i32* @xorwow.v
%12 = shl i32 %11, 4
%13 = xor i32 %10, %12
%14 = load i32, i32* %1
%15 = load i32, i32* %1
%16 = shl i32 %15, 1
%17 = xor i32 %14, %16
%18 = xor i32 %13, %17
store i32 %18, i32* @xorwow.v
%19 = load i32, i32* @xorwow.d
%20 = add nsw i32 %19, 362437
store i32 %20, i32* @xorwow.d
%21 = load i32, i32* @xorwow.v
%22 = add nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
@xorwow.x = internal unnamed_addr global i32 123456789
@xorwow.y = internal unnamed_addr global i32 362436069
@xorwow.z = internal unnamed_addr global i32 521288629
@xorwow.w = internal unnamed_addr global i32 88675123
@xorwow.v = internal unnamed_addr global i32 5783321
@xorwow.d = internal unnamed_addr global i32 6615241
define i32 @xorwow() {
%1 = load i32, i32* @xorwow.x
%2 = ashr i32 %1, 2
%3 = xor i32 %2, %1
%4 = load i32, i32* @xorwow.y
store i32 %4, i32* @xorwow.x
%5 = load i32, i32* @xorwow.z
store i32 %5, i32* @xorwow.y
%6 = load i32, i32* @xorwow.w
store i32 %6, i32* @xorwow.z
%7 = load i32, i32* @xorwow.v
store i32 %7, i32* @xorwow.w
%8 = shl i32 %7, 4
%9 = shl i32 %3, 1
%10 = xor i32 %9, %3
%11 = xor i32 %10, %7
%12 = xor i32 %11, %8
store i32 %12, i32* @xorwow.v
%13 = load i32, i32* @xorwow.d
%14 = add nsw i32 %13, 362437
store i32 %14, i32* @xorwow.d
%15 = add nsw i32 %14, %12
ret i32 %15
}