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

/* Variables and functions */
int /*<<< orphan*/ AESEncrypt(unsigned int const *, unsigned int *);
void jambu_initialization(const unsigned int *rk, const uint8_t *iv,
                          unsigned int *stateS, unsigned int *stateR) {
  stateS[0] = ((unsigned int *)iv)[0];
  stateS[1] = ((unsigned int *)iv)[1];
  AESEncrypt(rk, stateS);
  stateS[0] ^= 0x5;
  stateR[0] = stateS[2];
  stateR[1] = stateS[3];
  return;
}


x86 assembly (clang, -O0):
<jambu_initialization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <AESEncrypt@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
xor    $0x5,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jambu_initialization>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    (%rsi),%eax
mov    %eax,(%rdx)
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdx)
mov    %rdx,%rsi
call   1030 <AESEncrypt@plt>
xorb   $0x5,(%rbx)
mov    0x8(%rbx),%eax
mov    %eax,(%r14)
mov    0xc(%rbx),%eax
mov    %eax,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @jambu_initialization(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %6
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = load i32*, i32** %7
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
%14 = load i32*, i32** %6
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = load i32*, i32** %7
%18 = getelementptr inbounds i32, i32* %17, i64 1
store i32 %16, i32* %18
%19 = load i32*, i32** %5
%20 = load i32*, i32** %7
%21 = call i32 @AESEncrypt(i32* %19, i32* %20)
%22 = load i32*, i32** %7
%23 = getelementptr inbounds i32, i32* %22, i64 0
%24 = load i32, i32* %23
%25 = xor i32 %24, 5
store i32 %25, i32* %23
%26 = load i32*, i32** %7
%27 = getelementptr inbounds i32, i32* %26, i64 2
%28 = load i32, i32* %27
%29 = load i32*, i32** %8
%30 = getelementptr inbounds i32, i32* %29, i64 0
store i32 %28, i32* %30
%31 = load i32*, i32** %7
%32 = getelementptr inbounds i32, i32* %31, i64 3
%33 = load i32, i32* %32
%34 = load i32*, i32** %8
%35 = getelementptr inbounds i32, i32* %34, i64 1
store i32 %33, i32* %35
ret void
}

LLVM IR (-O2):
define void @jambu_initialization(i32* %0, i32* nocapture %1, i32* %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %1
store i32 %5, i32* %2
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %7, i32* %8
%9 = tail call i32 @AESEncrypt(i32* %0, i32* %2)
%10 = load i32, i32* %2
%11 = xor i32 %10, 5
store i32 %11, i32* %2
%12 = getelementptr inbounds i32, i32* %2, i64 2
%13 = load i32, i32* %12
store i32 %13, i32* %3
%14 = getelementptr inbounds i32, i32* %2, i64 3
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %15, i32* %16
ret void
}