#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*/ makeKATs(char *, char *, char *, char *);
int /*<<< orphan*/ makeMCTs(char *, char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rijndaelSpeed(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ stdout;
int main(void) {
  makeKATs("ecb_vk.txt", "ecb_vt.txt", "ecb_tbl.txt", "ecb_iv.txt");
  makeMCTs("ecb_e_m.txt", "ecb_d_m.txt", "cbc_e_m.txt", "cbc_d_m.txt");
  printf("ECB:\n");
  rijndaelSpeed(stdout, 128, 1, 1000000);
  rijndaelSpeed(stdout, 192, 1, 1000000);
  rijndaelSpeed(stdout, 256, 1, 1000000);
  printf("CFB1:\n");
  rijndaelSpeed(stdout, 128, 3, 10000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeae(%rip),%rsi
lea    0xeb2(%rip),%rdx
lea    0xeb7(%rip),%rcx
call   1050 <makeKATs@plt>
lea    0xeb6(%rip),%rdi
lea    0xebb(%rip),%rsi
lea    0xec0(%rip),%rdx
lea    0xec5(%rip),%rcx
call   1060 <makeMCTs@plt>
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
mov    $0x80,%esi
mov    $0x1,%edx
mov    $0xf4240,%ecx
call   1030 <rijndaelSpeed@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
mov    $0xc0,%esi
mov    $0x1,%edx
mov    $0xf4240,%ecx
call   1030 <rijndaelSpeed@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
mov    $0x100,%esi
mov    $0x1,%edx
mov    $0xf4240,%ecx
call   1030 <rijndaelSpeed@plt>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
mov    $0x80,%esi
mov    $0x3,%edx
mov    $0x2710,%ecx
call   1030 <rijndaelSpeed@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xebc(%rip),%rsi
lea    0xec0(%rip),%rdx
lea    0xec5(%rip),%rcx
call   1050 <makeKATs@plt>
lea    0xec4(%rip),%rdi
lea    0xec9(%rip),%rsi
lea    0xece(%rip),%rdx
lea    0xed3(%rip),%rcx
call   1060 <makeMCTs@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e4a(%rip),%rbx
mov    (%rbx),%edi
mov    $0x80,%esi
mov    $0x1,%edx
mov    $0xf4240,%ecx
call   1030 <rijndaelSpeed@plt>
mov    (%rbx),%edi
mov    $0xc0,%esi
mov    $0x1,%edx
mov    $0xf4240,%ecx
call   1030 <rijndaelSpeed@plt>
mov    (%rbx),%edi
mov    $0x100,%esi
mov    $0x1,%edx
mov    $0xf4240,%ecx
call   1030 <rijndaelSpeed@plt>
lea    0xe83(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%edi
mov    $0x80,%esi
mov    $0x3,%edx
mov    $0x2710,%ecx
call   1030 <rijndaelSpeed@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"ecb_vk.txt\00"
@.str.1 = [11 x i8] c"ecb_vt.txt\00"
@.str.2 = [12 x i8] c"ecb_tbl.txt\00"
@.str.3 = [11 x i8] c"ecb_iv.txt\00"
@.str.4 = [12 x i8] c"ecb_e_m.txt\00"
@.str.5 = [12 x i8] c"ecb_d_m.txt\00"
@.str.6 = [12 x i8] c"cbc_e_m.txt\00"
@.str.7 = [12 x i8] c"cbc_d_m.txt\00"
@.str.8 = [6 x i8] c"ECB:\0A\00"
@stdout = global i32 0
@.str.9 = [7 x i8] c"CFB1:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @makeKATs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @makeMCTs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @rijndaelSpeed(i32 %5, i32 128, i32 1, i32 1000000)
%7 = load i32, i32* @stdout
%8 = call i32 @rijndaelSpeed(i32 %7, i32 192, i32 1, i32 1000000)
%9 = load i32, i32* @stdout
%10 = call i32 @rijndaelSpeed(i32 %9, i32 256, i32 1, i32 1000000)
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%12 = load i32, i32* @stdout
%13 = call i32 @rijndaelSpeed(i32 %12, i32 128, i32 3, i32 10000)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"ecb_vk.txt\00"
@.str.1 = [11 x i8] c"ecb_vt.txt\00"
@.str.2 = [12 x i8] c"ecb_tbl.txt\00"
@.str.3 = [11 x i8] c"ecb_iv.txt\00"
@.str.4 = [12 x i8] c"ecb_e_m.txt\00"
@.str.5 = [12 x i8] c"ecb_d_m.txt\00"
@.str.6 = [12 x i8] c"cbc_e_m.txt\00"
@.str.7 = [12 x i8] c"cbc_d_m.txt\00"
@stdout = global i32 0
@str = [5 x i8] c"ECB:\00"
@str.10 = [6 x i8] c"CFB1:\00"
define i32 @main() {
%1 = tail call i32 @makeKATs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 @makeMCTs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @rijndaelSpeed(i32 %4, i32 128, i32 1, i32 1000000)
%6 = load i32, i32* @stdout
%7 = tail call i32 @rijndaelSpeed(i32 %6, i32 192, i32 1, i32 1000000)
%8 = load i32, i32* @stdout
%9 = tail call i32 @rijndaelSpeed(i32 %8, i32 256, i32 1, i32 1000000)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.10, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = tail call i32 @rijndaelSpeed(i32 %11, i32 128, i32 3, i32 10000)
ret i32 0
}