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

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


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

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

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

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