#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 unsigned int x;
typedef int uint64_t;
typedef unsigned int uint32_t;

/* Variables and functions */
uint64_t p64(uint64_t x) {
  uint32_t hi = x >> 32;
  uint32_t lo = ((x)&0x00000000FFFFFFFFULL);
  unsigned rcon[8] = {1, 29, 4, 8, 17, 12, 3, 14};
  for (int i = 0; i < 32; i++) {
    {
      (hi) += (lo);
      (lo) = ((((lo)) << ((rcon[i % 8]))) ^ (((lo)) >> (32 - ((rcon[i % 8])))));
      (lo) ^= (hi);
    };
    lo += i;
  }
  return ((((uint64_t)hi) << 32) ^ lo);
}


x86 assembly (clang, -O0):
<p64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x20,-0x34(%rbp)
jge    11dc <p64+0xdc>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x40(%rbp),%eax
movslq %edx,%rcx
mov    -0x30(%rbp,%rcx,4),%ecx
shl    %cl,%eax
mov    %eax,-0x3c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x3c(%rbp),%eax
mov    %edx,%ecx
mov    -0x38(%rbp),%edx
movslq %ecx,%rsi
mov    $0x20,%ecx
sub    -0x30(%rbp,%rsi,4),%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x34(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    115b <p64+0x5b>
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p64>:
ret

LLVM IR (-O0):
@__const.p64.rcon = [8 x i32] [i32 1, i32 29, i32 4, i32 8, i32 17, i32 12, i32 3, i32 14]
define i32 @p64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [8 x i32]
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 32
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = and i64 %10, 4294967295
%12 = trunc i64 %11 to i32
store i32 %12, i32* %4
%13 = bitcast [8 x i32]* %5 to i8*
store i32 0, i32* %6
br label %14
14: ; preds = %43, %1
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 32
br i1 %16, label %17, label %46
17: ; preds = %14
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = add i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %4
%22 = load i32, i32* %6
%23 = srem i32 %22, 8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = shl i32 %21, %26
%28 = load i32, i32* %4
%29 = load i32, i32* %6
%30 = srem i32 %29, 8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = sub i32 32, %33
%35 = lshr i32 %28, %34
%36 = xor i32 %27, %35
store i32 %36, i32* %4
%37 = load i32, i32* %3
%38 = load i32, i32* %4
%39 = xor i32 %38, %37
store i32 %39, i32* %4
%40 = load i32, i32* %6
%41 = load i32, i32* %4
%42 = add i32 %41, %40
store i32 %42, i32* %4
br label %43
43: ; preds = %17
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %14
46: ; preds = %14
%47 = load i32, i32* %3
%48 = shl i32 %47, 32
%49 = load i32, i32* %4
%50 = xor i32 %48, %49
ret i32 %50
}

LLVM IR (-O2):
define i32 @p64(i32 %0) {
ret i32 poison
}