#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 *);
int test_decrypt_cbc();
int test_decrypt_ctr();
int test_decrypt_ecb();
int test_encrypt_cbc();
int test_encrypt_ctr();
int test_encrypt_ecb();
int /*<<< orphan*/ test_encrypt_ecb_verbose();
int main(void) {
  int exit;
  printf("\nTesting AES256\n\n");
  exit = test_encrypt_cbc() + test_decrypt_cbc() + test_encrypt_ctr() +
         test_decrypt_ctr() + test_decrypt_ecb() + test_encrypt_ecb();
  test_encrypt_ecb_verbose();
  return exit;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe6a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <test_encrypt_cbc@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1070 <test_decrypt_cbc@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1090 <test_encrypt_ctr@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <test_decrypt_ctr@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_decrypt_ecb@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1080 <test_encrypt_ecb@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   10a0 <test_encrypt_ecb_verbose@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test_encrypt_cbc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <test_decrypt_cbc@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1090 <test_encrypt_ctr@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1060 <test_decrypt_ctr@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1040 <test_decrypt_ecb@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1080 <test_encrypt_ecb@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   10a0 <test_encrypt_ecb_verbose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0ATesting AES256\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @test_encrypt_cbc()
%5 = call i32 (...) @test_decrypt_cbc()
%6 = add nsw i32 %4, %5
%7 = call i32 (...) @test_encrypt_ctr()
%8 = add nsw i32 %6, %7
%9 = call i32 (...) @test_decrypt_ctr()
%10 = add nsw i32 %8, %9
%11 = call i32 (...) @test_decrypt_ecb()
%12 = add nsw i32 %10, %11
%13 = call i32 (...) @test_encrypt_ecb()
%14 = add nsw i32 %12, %13
store i32 %14, i32* %2
%15 = call i32 (...) @test_encrypt_ecb_verbose()
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@str = [17 x i8] c"\0ATesting AES256\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_encrypt_cbc()
%3 = tail call i32 (...) @test_decrypt_cbc()
%4 = add nsw i32 %3, %2
%5 = tail call i32 (...) @test_encrypt_ctr()
%6 = add nsw i32 %4, %5
%7 = tail call i32 (...) @test_decrypt_ctr()
%8 = add nsw i32 %6, %7
%9 = tail call i32 (...) @test_decrypt_ecb()
%10 = add nsw i32 %8, %9
%11 = tail call i32 (...) @test_encrypt_ecb()
%12 = add nsw i32 %10, %11
%13 = tail call i32 (...) @test_encrypt_ecb_verbose()
ret i32 %12
}