#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 /*<<< orphan*/ uint64_t;

/* Variables and functions */
void round_constant(uint64_t *rc, size_t i) {
  static uint64_t lookup[2] = {(uint64_t)0x0000000000000000,
                               ((uint64_t)0xFFFFFFFFFFFFFFFF)};
  rc[4] = lookup[(i & (1 << 0)) >> 0];
  rc[3] = lookup[(i & (1 << 1)) >> 1];
  rc[2] = lookup[(i & (1 << 2)) >> 2];
  rc[1] = lookup[(i & (1 << 3)) >> 3];
  rc[0] = lookup[(i & (1 << 4)) >> 4];
}


x86 assembly (clang, -O0):
<round_constant>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
and    $0x1,%rcx
shr    $0x0,%rcx
lea    0x2f01(%rip),%rax
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x10(%rbp),%rcx
and    $0x2,%rcx
shr    $0x1,%rcx
lea    0x2ee4(%rip),%rax
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x10(%rbp),%rcx
and    $0x4,%rcx
shr    $0x2,%rcx
lea    0x2ec7(%rip),%rax
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rcx
and    $0x8,%rcx
shr    $0x3,%rcx
lea    0x2eaa(%rip),%rax
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rcx
and    $0x10,%rcx
shr    $0x4,%rcx
lea    0x2e8d(%rip),%rax
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_constant>:
mov    %esi,%eax
and    $0x1,%eax
lea    0xef4(%rip),%rcx
mov    (%rcx,%rax,4),%eax
mov    %eax,0x10(%rdi)
mov    %esi,%eax
and    $0x2,%eax
mov    (%rcx,%rax,2),%eax
mov    %eax,0xc(%rdi)
mov    %esi,%eax
and    $0x4,%eax
mov    (%rax,%rcx,1),%eax
mov    %eax,0x8(%rdi)
mov    %rsi,%rax
shr    %rax
and    $0x4,%eax
mov    (%rax,%rcx,1),%eax
mov    %eax,0x4(%rdi)
shr    $0x2,%rsi
and    $0x4,%esi
mov    (%rsi,%rcx,1),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
@round_constant.lookup = internal global [2 x i32] [i32 0, i32 -1]
define void @round_constant(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 1
%7 = lshr i64 %6, 0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 4
store i32 %9, i32* %11
%12 = load i64, i64* %4
%13 = and i64 %12, 2
%14 = lshr i64 %13, 1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 3
store i32 %16, i32* %18
%19 = load i64, i64* %4
%20 = and i64 %19, 4
%21 = lshr i64 %20, 2
%22 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 2
store i32 %23, i32* %25
%26 = load i64, i64* %4
%27 = and i64 %26, 8
%28 = lshr i64 %27, 3
%29 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = load i32*, i32** %3
%32 = getelementptr inbounds i32, i32* %31, i64 1
store i32 %30, i32* %32
%33 = load i64, i64* %4
%34 = and i64 %33, 16
%35 = lshr i64 %34, 4
%36 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = load i32*, i32** %3
%39 = getelementptr inbounds i32, i32* %38, i64 0
store i32 %37, i32* %39
ret void
}

LLVM IR (-O2):
@round_constant.lookup = internal unnamed_addr constant [2 x i32] [i32 0, i32 -1]
define void @round_constant(i32* nocapture writeonly %0, i64 %1) {
%3 = and i64 %1, 1
%4 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %3
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %5, i32* %6
%7 = lshr i64 %1, 1
%8 = and i64 %7, 1
%9 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
%12 = lshr i64 %1, 2
%13 = and i64 %12, 1
%14 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %15, i32* %16
%17 = lshr i64 %1, 3
%18 = and i64 %17, 1
%19 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %20, i32* %21
%22 = lshr i64 %1, 4
%23 = and i64 %22, 1
%24 = getelementptr inbounds [2 x i32], [2 x i32]* @round_constant.lookup, i64 0, i64 %23
%25 = load i32, i32* %24
store i32 %25, i32* %0
ret void
}