#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_enc_aut_msg_full(const unsigned int *rk, unsigned int *stateS,
                            unsigned int *stateR) {
  AESEncrypt(rk, stateS);
  stateS[0] ^= stateR[0];
  stateS[1] ^= stateR[1];
  stateS[2] ^= 0x80;
  stateR[0] ^= stateS[2];
  stateR[1] ^= stateS[3];
  return;
}


x86 assembly (clang, -O0):
<jambu_enc_aut_msg_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
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_enc_aut_msg_full>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <AESEncrypt@plt>
mov    (%r14),%eax
xor    %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_enc_aut_msg_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 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = xor i32 %15, %12
store i32 %16, i32* %14
%17 = load i32*, i32** %6
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 1
%22 = load i32, i32* %21
%23 = xor i32 %22, %19
store i32 %23, i32* %21
%24 = load i32*, i32** %5
%25 = getelementptr inbounds i32, i32* %24, i64 2
%26 = load i32, i32* %25
%27 = xor i32 %26, 128
store i32 %27, i32* %25
%28 = load i32*, i32** %5
%29 = getelementptr inbounds i32, i32* %28, i64 2
%30 = load i32, i32* %29
%31 = load i32*, i32** %6
%32 = getelementptr inbounds i32, i32* %31, i64 0
%33 = load i32, i32* %32
%34 = xor i32 %33, %30
store i32 %34, i32* %32
%35 = load i32*, i32** %5
%36 = getelementptr inbounds i32, i32* %35, i64 3
%37 = load i32, i32* %36
%38 = load i32*, i32** %6
%39 = getelementptr inbounds i32, i32* %38, i64 1
%40 = load i32, i32* %39
%41 = xor i32 %40, %37
store i32 %41, i32* %39
ret void
}

LLVM IR (-O2):
define void @jambu_enc_aut_msg_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 %6, %5
store i32 %7, i32* %1
%8 = getelementptr inbounds i32, i32* %2, i64 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %1, i64 1
%11 = load i32, i32* %10
%12 = xor i32 %11, %9
store i32 %12, i32* %10
%13 = getelementptr inbounds i32, i32* %1, i64 2
%14 = load i32, i32* %13
%15 = xor i32 %14, 128
store i32 %15, i32* %13
%16 = load i32, i32* %2
%17 = xor i32 %16, %15
store i32 %17, i32* %2
%18 = getelementptr inbounds i32, i32* %1, i64 3
%19 = load i32, i32* %18
%20 = load i32, i32* %8
%21 = xor i32 %20, %19
store i32 %21, i32* %8
ret void
}