#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*/ aes_cipher(char **, char **);
int /*<<< orphan*/ aes_inv_cipher(char **, char **);
int /*<<< orphan*/ aes_print_state(char **);
int aes_test(void) {
  char s[4][4] = {
      0x74, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00,
      0x73, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00,
  };
  char k[4][4] = {
      0x68, 0x6f, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00,
      0x6c, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
  };
  aes_print_state(s);
  aes_cipher(s, k);
  aes_print_state(s);
  aes_inv_cipher(s, k);
  aes_print_state(s);
  return 0;
}


x86 assembly (clang, -O0):
<aes_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <aes_print_state@plt>
lea    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <aes_cipher@plt>
lea    -0x10(%rbp),%rdi
call   1030 <aes_print_state@plt>
lea    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <aes_inv_cipher@plt>
lea    -0x10(%rbp),%rdi
call   1030 <aes_print_state@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_test>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <aes_print_state@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <aes_cipher@plt>
mov    %rbx,%rdi
call   1030 <aes_print_state@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <aes_inv_cipher@plt>
mov    %rbx,%rdi
call   1030 <aes_print_state@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.aes_test.s = [4 x [4 x i8]] [[4 x i8] c"t\00\00\00", [4 x i8] c"e\00\00\00", [4 x i8] c"s\00\00\00", [4 x i8] c"t\00\00\00"]
@__const.aes_test.k = [4 x [4 x i8]] [[4 x i8] c"ho\00\00", [4 x i8] c"e\00\00\00", [4 x i8] c"l\00\00\00", [4 x i8] c"l\00\00\00"]
define i32 @aes_test() {
%1 = alloca [4 x [4 x i8]]
%2 = alloca [4 x [4 x i8]]
%3 = bitcast [4 x [4 x i8]]* %1 to i8*
%4 = bitcast [4 x [4 x i8]]* %2 to i8*
%5 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %1, i64 0, i64 0
%6 = bitcast [4 x i8]* %5 to i8**
%7 = call i32 @aes_print_state(i8** %6)
%8 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %1, i64 0, i64 0
%9 = bitcast [4 x i8]* %8 to i8**
%10 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %2, i64 0, i64 0
%11 = bitcast [4 x i8]* %10 to i8**
%12 = call i32 @aes_cipher(i8** %9, i8** %11)
%13 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %1, i64 0, i64 0
%14 = bitcast [4 x i8]* %13 to i8**
%15 = call i32 @aes_print_state(i8** %14)
%16 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %1, i64 0, i64 0
%17 = bitcast [4 x i8]* %16 to i8**
%18 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %2, i64 0, i64 0
%19 = bitcast [4 x i8]* %18 to i8**
%20 = call i32 @aes_inv_cipher(i8** %17, i8** %19)
%21 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %1, i64 0, i64 0
%22 = bitcast [4 x i8]* %21 to i8**
%23 = call i32 @aes_print_state(i8** %22)
ret i32 0
}

LLVM IR (-O2):
@__const.aes_test.s = [4 x [4 x i8]] [[4 x i8] c"t\00\00\00", [4 x i8] c"e\00\00\00", [4 x i8] c"s\00\00\00", [4 x i8] c"t\00\00\00"]
@__const.aes_test.k = [4 x [4 x i8]] [[4 x i8] c"ho\00\00", [4 x i8] c"e\00\00\00", [4 x i8] c"l\00\00\00", [4 x i8] c"l\00\00\00"]
define i32 @aes_test() {
%1 = alloca [4 x [4 x i8]]
%2 = alloca [4 x [4 x i8]]
%3 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %2, i64 0, i64 0, i64 0
%5 = bitcast [4 x [4 x i8]]* %1 to i8**
%6 = call i32 @aes_print_state(i8** %5)
%7 = bitcast [4 x [4 x i8]]* %2 to i8**
%8 = call i32 @aes_cipher(i8** %5, i8** %7)
%9 = call i32 @aes_print_state(i8** %5)
%10 = call i32 @aes_inv_cipher(i8** %5, i8** %7)
%11 = call i32 @aes_print_state(i8** %5)
ret i32 0
}