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

/* Variables and functions */
void setup_aeskeyX(uint_fast8_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
mov    -0x4(%rbp),%eax
or     %eax,%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    %edi,-0x4(%rsp)
mov    $0xffffff40,%eax
and    0x10009011,%eax
or     -0x4(%rsp),%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 volatile 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 volatile 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 = alloca i32
store volatile i32 %0, i32* %3
%4 = bitcast i8* %1 to i32*
%5 = load volatile i32, i32* inttoptr (i64 268472337 to i32*)
%6 = and i32 %5, -192
%7 = load volatile i32, i32* %3
%8 = or i32 %7, %6
%9 = or i32 %8, 128
store volatile i32 %9, i32* inttoptr (i64 268472337 to i32*)
%10 = load i32, i32* %4
store volatile i32 %10, i32* inttoptr (i64 268472580 to i32*)
%11 = getelementptr inbounds i8, i8* %1, i64 4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store volatile i32 %13, i32* inttoptr (i64 268472580 to i32*)
%14 = getelementptr inbounds i8, i8* %1, i64 8
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
store volatile i32 %16, i32* inttoptr (i64 268472580 to i32*)
%17 = getelementptr inbounds i8, i8* %1, i64 12
%18 = bitcast i8* %17 to i32*
%19 = load i32, i32* %18
store volatile i32 %19, i32* inttoptr (i64 268472580 to i32*)
ret void
}