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

/* Variables and functions */
int /*<<< orphan*/
_mm_set_epi8(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/, int, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_srli_si128(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ aes_enc_128(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void jambu_enc_aut_msg_full(__m128i *key, __m128i *stateS, __m128i *stateR) {
  __m128i msgtmp =
      _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0, 0);
  aes_enc_128(stateS, key);
  *stateS = _mm_xor_si128(*stateS, _mm_srli_si128(*stateR, 8));
  *stateS = _mm_xor_si128(*stateS, msgtmp);
  *stateR = _mm_xor_si128(*stateS, *stateR);
}


x86 assembly (clang, -O0):
<jambu_enc_aut_msg_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x80,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x38(%rsp)
movl   $0x0,0x40(%rsp)
movl   $0x0,0x48(%rsp)
call   1050 <_mm_set_epi8@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <aes_enc_128@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    $0x8,%esi
call   1040 <_mm_srli_si128@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1060 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%esi
call   1060 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1060 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jambu_enc_aut_msg_full>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x80
push   $0x0
call   1050 <_mm_set_epi8@plt>
add    $0x50,%rsp
mov    %eax,%r12d
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <aes_enc_128@plt>
mov    (%rbx),%ebp
mov    (%r14),%edi
mov    $0x8,%esi
call   1040 <_mm_srli_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1060 <_mm_xor_si128@plt>
mov    %eax,(%rbx)
mov    %eax,%edi
mov    %r12d,%esi
call   1060 <_mm_xor_si128@plt>
mov    %eax,(%rbx)
mov    (%r14),%esi
mov    %eax,%edi
call   1060 <_mm_xor_si128@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
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*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = call i32 @_mm_set_epi8(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 128, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %8, i32* %7
%9 = load i32*, i32** %5
%10 = load i32*, i32** %4
%11 = call i32 @aes_enc_128(i32* %9, i32* %10)
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = call i32 @_mm_srli_si128(i32 %15, i32 8)
%17 = call i32 @_mm_xor_si128(i32 %13, i32 %16)
%18 = load i32*, i32** %5
store i32 %17, i32* %18
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = load i32, i32* %7
%22 = call i32 @_mm_xor_si128(i32 %20, i32 %21)
%23 = load i32*, i32** %5
store i32 %22, i32* %23
%24 = load i32*, i32** %5
%25 = load i32, i32* %24
%26 = load i32*, i32** %6
%27 = load i32, i32* %26
%28 = call i32 @_mm_xor_si128(i32 %25, i32 %27)
%29 = load i32*, i32** %6
store i32 %28, i32* %29
ret void
}

LLVM IR (-O2):
define void @jambu_enc_aut_msg_full(i32* %0, i32* %1, i32* nocapture %2) {
%4 = tail call i32 @_mm_set_epi8(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 128, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%5 = tail call i32 @aes_enc_128(i32* %1, i32* %0)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = tail call i32 @_mm_srli_si128(i32 %7, i32 8)
%9 = tail call i32 @_mm_xor_si128(i32 %6, i32 %8)
store i32 %9, i32* %1
%10 = tail call i32 @_mm_xor_si128(i32 %9, i32 %4)
store i32 %10, i32* %1
%11 = load i32, i32* %2
%12 = tail call i32 @_mm_xor_si128(i32 %10, i32 %11)
store i32 %12, i32* %2
ret void
}