#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*/ printf(char *, char *);
scalar_t__ test_aes_128_add_round_key();
int test_aes_128_decrypt();
int test_aes_128_encrypt();
scalar_t__ test_aes_128_inv_mix_columns();
scalar_t__ test_aes_128_inv_shift_rows();
scalar_t__ test_aes_128_inv_sub_bytes();
scalar_t__ test_aes_128_key_schedule();
scalar_t__ test_aes_128_mix_columns();
scalar_t__ test_aes_128_shift_rows();
scalar_t__ test_aes_128_sub_bytes();
int main(int argc, char *argv[]) {
  printf("test_aes_128_key_schedule : %s \n",
         test_aes_128_key_schedule() ? "OK" : "KO");
  printf("test_aes_128_add_round_key : %s \n",
         test_aes_128_add_round_key() ? "OK" : "KO");
  printf("test_aes_128_mix_columns : %s \n",
         test_aes_128_mix_columns() ? "OK" : "KO");
  printf("test_aes_inv_128_mix_columns : %s \n",
         test_aes_128_inv_mix_columns() ? "OK" : "KO");
  printf("test_aes_128_sub_bytes : %s \n",
         test_aes_128_sub_bytes() ? "OK" : "KO");
  printf("test_aes_128_inv_sub_bytes : %s \n",
         test_aes_128_inv_sub_bytes() ? "OK" : "KO");
  printf("test_aes_128_shift_rows : %s \n",
         test_aes_128_shift_rows() ? "OK" : "KO");
  printf("test_aes_128_inv_shift_rows : %s \n",
         test_aes_128_inv_shift_rows() ? "OK" : "KO");
  printf("test_aes_128_encrypt : %s \n",
         52 == test_aes_128_encrypt() ? "OK" : "KO");
  printf("test_aes_128_decrypt : %s \n",
         52 == test_aes_128_decrypt() ? "OK" : "KO");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_aes_128_key_schedule@plt>
mov    %rax,%rcx
lea    0xe4d(%rip),%rsi
lea    0xe43(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe13(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <test_aes_128_add_round_key@plt>
mov    %rax,%rcx
lea    0xe21(%rip),%rsi
lea    0xe17(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe0e(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10a0 <test_aes_128_mix_columns@plt>
mov    %rax,%rcx
lea    0xdf5(%rip),%rsi
lea    0xdeb(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe04(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10c0 <test_aes_128_inv_mix_columns@plt>
mov    %rax,%rcx
lea    0xdc9(%rip),%rsi
lea    0xdbf(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xdf8(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <test_aes_128_sub_bytes@plt>
mov    %rax,%rcx
lea    0xd9d(%rip),%rsi
lea    0xd93(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xdf0(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10d0 <test_aes_128_inv_sub_bytes@plt>
mov    %rax,%rcx
lea    0xd71(%rip),%rsi
lea    0xd67(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xde2(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1050 <test_aes_128_shift_rows@plt>
mov    %rax,%rcx
lea    0xd45(%rip),%rsi
lea    0xd3b(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xdd8(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1080 <test_aes_128_inv_shift_rows@plt>
mov    %rax,%rcx
lea    0xd19(%rip),%rsi
lea    0xd0f(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xdcb(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1070 <test_aes_128_encrypt@plt>
mov    %eax,%edx
mov    $0x34,%ecx
lea    0xce9(%rip),%rsi
lea    0xcdf(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rsi
lea    0xdc0(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <test_aes_128_decrypt@plt>
mov    %eax,%edx
mov    $0x34,%ecx
lea    0xcbb(%rip),%rsi
lea    0xcb1(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rsi
lea    0xdae(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <test_aes_128_key_schedule@plt>
test   %rax,%rax
lea    0xe5f(%rip),%rbx
lea    0xe55(%rip),%r14
mov    %r14,%rsi
cmove  %rbx,%rsi
lea    0xe26(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1090 <test_aes_128_add_round_key@plt>
test   %rax,%rax
mov    %r14,%rsi
cmove  %rbx,%rsi
lea    0xe30(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   10a0 <test_aes_128_mix_columns@plt>
test   %rax,%rax
mov    %r14,%rsi
cmove  %rbx,%rsi
lea    0xe35(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   10c0 <test_aes_128_inv_mix_columns@plt>
test   %rax,%rax
mov    %r14,%rsi
cmove  %rbx,%rsi
lea    0xe38(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1030 <test_aes_128_sub_bytes@plt>
test   %rax,%rax
mov    %r14,%rsi
cmove  %rbx,%rsi
lea    0xe3f(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   10d0 <test_aes_128_inv_sub_bytes@plt>
test   %rax,%rax
mov    %r14,%rsi
cmove  %rbx,%rsi
lea    0xe40(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1050 <test_aes_128_shift_rows@plt>
test   %rax,%rax
mov    %r14,%rsi
cmove  %rbx,%rsi
lea    0xe45(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1080 <test_aes_128_inv_shift_rows@plt>
test   %rax,%rax
mov    %r14,%rsi
cmove  %rbx,%rsi
lea    0xe47(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <test_aes_128_encrypt@plt>
cmp    $0x34,%eax
mov    %rbx,%rsi
cmove  %r14,%rsi
lea    0xe4d(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   10b0 <test_aes_128_decrypt@plt>
cmp    $0x34,%eax
cmove  %r14,%rbx
lea    0xe4f(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"test_aes_128_key_schedule : %s \0A\00"
@.str.1 = [3 x i8] c"OK\00"
@.str.2 = [3 x i8] c"KO\00"
@.str.3 = [34 x i8] c"test_aes_128_add_round_key : %s \0A\00"
@.str.4 = [32 x i8] c"test_aes_128_mix_columns : %s \0A\00"
@.str.5 = [36 x i8] c"test_aes_inv_128_mix_columns : %s \0A\00"
@.str.6 = [30 x i8] c"test_aes_128_sub_bytes : %s \0A\00"
@.str.7 = [34 x i8] c"test_aes_128_inv_sub_bytes : %s \0A\00"
@.str.8 = [31 x i8] c"test_aes_128_shift_rows : %s \0A\00"
@.str.9 = [35 x i8] c"test_aes_128_inv_shift_rows : %s \0A\00"
@.str.10 = [28 x i8] c"test_aes_128_encrypt : %s \0A\00"
@.str.11 = [28 x i8] c"test_aes_128_decrypt : %s \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @test_aes_128_key_schedule()
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i64 (...) @test_aes_128_add_round_key()
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* %14)
%16 = call i64 (...) @test_aes_128_mix_columns()
%17 = icmp ne i64 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%20 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i8* %19)
%21 = call i64 (...) @test_aes_128_inv_mix_columns()
%22 = icmp ne i64 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%25 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %24)
%26 = call i64 (...) @test_aes_128_sub_bytes()
%27 = icmp ne i64 %26, 0
%28 = zext i1 %27 to i64
%29 = select i1 %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%30 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %29)
%31 = call i64 (...) @test_aes_128_inv_sub_bytes()
%32 = icmp ne i64 %31, 0
%33 = zext i1 %32 to i64
%34 = select i1 %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%35 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %34)
%36 = call i64 (...) @test_aes_128_shift_rows()
%37 = icmp ne i64 %36, 0
%38 = zext i1 %37 to i64
%39 = select i1 %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%40 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i8* %39)
%41 = call i64 (...) @test_aes_128_inv_shift_rows()
%42 = icmp ne i64 %41, 0
%43 = zext i1 %42 to i64
%44 = select i1 %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%45 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i8* %44)
%46 = call i32 (...) @test_aes_128_encrypt()
%47 = icmp eq i32 52, %46
%48 = zext i1 %47 to i64
%49 = select i1 %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%50 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* %49)
%51 = call i32 (...) @test_aes_128_decrypt()
%52 = icmp eq i32 52, %51
%53 = zext i1 %52 to i64
%54 = select i1 %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%55 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i8* %54)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"test_aes_128_key_schedule : %s \0A\00"
@.str.1 = [3 x i8] c"OK\00"
@.str.2 = [3 x i8] c"KO\00"
@.str.3 = [34 x i8] c"test_aes_128_add_round_key : %s \0A\00"
@.str.4 = [32 x i8] c"test_aes_128_mix_columns : %s \0A\00"
@.str.5 = [36 x i8] c"test_aes_inv_128_mix_columns : %s \0A\00"
@.str.6 = [30 x i8] c"test_aes_128_sub_bytes : %s \0A\00"
@.str.7 = [34 x i8] c"test_aes_128_inv_sub_bytes : %s \0A\00"
@.str.8 = [31 x i8] c"test_aes_128_shift_rows : %s \0A\00"
@.str.9 = [35 x i8] c"test_aes_128_inv_shift_rows : %s \0A\00"
@.str.10 = [28 x i8] c"test_aes_128_encrypt : %s \0A\00"
@.str.11 = [28 x i8] c"test_aes_128_decrypt : %s \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @test_aes_128_key_schedule()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i64 (...) @test_aes_128_add_round_key()
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%11 = tail call i64 (...) @test_aes_128_mix_columns()
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%15 = tail call i64 (...) @test_aes_128_inv_mix_columns()
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %17)
%19 = tail call i64 (...) @test_aes_128_sub_bytes()
%20 = icmp eq i64 %19, 0
%21 = select i1 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %21)
%23 = tail call i64 (...) @test_aes_128_inv_sub_bytes()
%24 = icmp eq i64 %23, 0
%25 = select i1 %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %25)
%27 = tail call i64 (...) @test_aes_128_shift_rows()
%28 = icmp eq i64 %27, 0
%29 = select i1 %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%30 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i8* %29)
%31 = tail call i64 (...) @test_aes_128_inv_shift_rows()
%32 = icmp eq i64 %31, 0
%33 = select i1 %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%34 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i8* %33)
%35 = tail call i32 (...) @test_aes_128_encrypt()
%36 = icmp eq i32 %35, 52
%37 = select i1 %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%38 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* %37)
%39 = tail call i32 (...) @test_aes_128_decrypt()
%40 = icmp eq i32 %39, 52
%41 = select i1 %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%42 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i8* %41)
ret i32 0
}