#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 uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void setup_aeskeyX(uint8_t keyslot, void *keyx) {
  uint32_t *_keyx = (uint32_t *)keyx;
  *((volatile uint8_t *)0x10009011) =
      (*((volatile uint8_t *)0x10009011) >> 6 << 6) | keyslot | 0x80;
  *((volatile uint32_t *)0x10009104) = _keyx[0];
  *((volatile uint32_t *)0x10009104) = _keyx[1];
  *((volatile uint32_t *)0x10009104) = _keyx[2];
  *((volatile uint32_t *)0x10009104) = _keyx[3];
}


x86 assembly (clang, -O0):
<setup_aeskeyX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x10009011,%eax
mov    (%rax),%ecx
sar    $0x6,%ecx
shl    $0x6,%ecx
or     -0x4(%rbp),%ecx
or     $0x80,%ecx
mov    $0x10009011,%eax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    $0x10009104,%eax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
mov    $0x10009104,%eax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%ecx
mov    $0x10009104,%eax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%ecx
mov    $0x10009104,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_aeskeyX>:
mov    $0xffffff40,%eax
and    0x10009011,%eax
or     %edi,%eax
or     $0x80,%eax
mov    %eax,0x10009011
mov    (%rsi),%eax
mov    %eax,0x10009104
mov    0x4(%rsi),%eax
mov    %eax,0x10009104
mov    0x8(%rsi),%eax
mov    %eax,0x10009104
mov    0xc(%rsi),%eax
mov    %eax,0x10009104
ret

LLVM IR (-O0):
define void @setup_aeskeyX(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load volatile i32, i32* inttoptr (i64 268472337 to i32*)
%9 = ashr i32 %8, 6
%10 = shl i32 %9, 6
%11 = load i32, i32* %3
%12 = or i32 %10, %11
%13 = or i32 %12, 128
store volatile i32 %13, i32* inttoptr (i64 268472337 to i32*)
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
store volatile i32 %16, i32* inttoptr (i64 268472580 to i32*)
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
store volatile i32 %19, i32* inttoptr (i64 268472580 to i32*)
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
store volatile i32 %22, i32* inttoptr (i64 268472580 to i32*)
%23 = load i32*, i32** %5
%24 = getelementptr inbounds i32, i32* %23, i64 3
%25 = load i32, i32* %24
store volatile i32 %25, i32* inttoptr (i64 268472580 to i32*)
ret void
}

LLVM IR (-O2):
define void @setup_aeskeyX(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load volatile i32, i32* inttoptr (i64 268472337 to i32*)
%5 = and i32 %4, -192
%6 = or i32 %5, %0
%7 = or i32 %6, 128
store volatile i32 %7, i32* inttoptr (i64 268472337 to i32*)
%8 = load i32, i32* %3
store volatile i32 %8, i32* inttoptr (i64 268472580 to i32*)
%9 = getelementptr inbounds i8, i8* %1, i64 4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
store volatile i32 %11, i32* inttoptr (i64 268472580 to i32*)
%12 = getelementptr inbounds i8, i8* %1, i64 8
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
store volatile i32 %14, i32* inttoptr (i64 268472580 to i32*)
%15 = getelementptr inbounds i8, i8* %1, i64 12
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
store volatile i32 %17, i32* inttoptr (i64 268472580 to i32*)
ret void
}