int main(int argc, char *argv[]) {
  printf("CSE 178 AES Implementation\n\n");
  unsigned char input_1[16] = {'\x32', '\x43', '\xf6', '\xa8', '\x88', '\x5a',
                               '\x30', '\x8d', '\x31', '\x31', '\x98', '\xa2',
                               '\xe0', '\x37', '\x07', '\x34'};
  unsigned char key_1[16] = {'\x2b', '\x7e', '\x15', '\x16', '\x28', '\xae',
                             '\xd2', '\xa6', '\xab', '\xf7', '\x15', '\x88',
                             '\x09', '\xcf', '\x4f', '\x3c'};
  printf("Input is: ");
  __printblock(input_1);
  printf("Key is: ");
  __printblock(key_1);
  encryptablock(input_1, key_1);
  printf("Output: ");
  __printblock(input_1);
  unsigned char input_2[16] = {"abcdefghijklmno"};
  unsigned char key_2[16] = {"passwordpassword"};
  printf("Input is: ");
  __printblock(input_2);
  printf("Key is: ");
  __printblock(key_2);
  encryptablock(input_2, key_2);
  printf("Output: ");
  __printblock(input_2);
  printf("%c", '\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0xee5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xedc(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <__printblock@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1040 <__printblock@plt>
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1030 <encryptablock@plt>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <__printblock@plt>
mov    0xe8f(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe8c(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe69(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe66(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1040 <__printblock@plt>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x0,%al
call   1040 <__printblock@plt>
lea    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x0,%al
call   1030 <encryptablock@plt>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1040 <__printblock@plt>
lea    0xdd3(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0xee9(%rip),%rdi
call   1050 <puts@plt>
movaps 0xe90(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xea8(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x30(%rsp),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <__printblock@plt>
lea    0xe93(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <__printblock@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <encryptablock@plt>
lea    0xe6f(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <__printblock@plt>
movaps 0xe80(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe24(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <__printblock@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <__printblock@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <encryptablock@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <__printblock@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [29 x i8] c"CSE 178 AES Implementation\0A\0A\00"
@__const.main.input_1 = [16 x i8] c"2C\F6\A8\88Z0\8D11\98\A2\E07\074"
@__const.main.key_1 = [16 x i8] c"+~\15\16(\AE\D2\A6\AB\F7\15\88\09\CFO<"
@.str.1 = [11 x i8] c"Input is: \00"
@.str.2 = [9 x i8] c"Key is: \00"
@.str.3 = [9 x i8] c"Output: \00"
@__const.main.input_2 = [16 x i8] c"abcdefghijklmno\00"
@__const.main.key_2 = [16 x i8] c"passwordpassword"
@.str.4 = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca [16 x i8]
%8 = alloca [16 x i8]
%9 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = bitcast [16 x i8]* %6 to i8*
%12 = bitcast [16 x i8]* %7 to i8*
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %17)
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%21 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @encryptablock to i32 (i8*, i8*, ...)*)(i8* %19, i8* %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%24 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %23)
%25 = bitcast [16 x i8]* %8 to i8*
%26 = bitcast [16 x i8]* %9 to i8*
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%29 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%31 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %31)
%33 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%35 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @encryptablock to i32 (i8*, i8*, ...)*)(i8* %33, i8* %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%38 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.input_1 = [16 x i8] c"2C\F6\A8\88Z0\8D11\98\A2\E07\074"
@__const.main.key_1 = [16 x i8] c"+~\15\16(\AE\D2\A6\AB\F7\15\88\09\CFO<"
@.str.1 = [11 x i8] c"Input is: \00"
@.str.2 = [9 x i8] c"Key is: \00"
@.str.3 = [9 x i8] c"Output: \00"
@__const.main.input_2 = [16 x i8] c"abcdefghijklmno\00"
@__const.main.key_2 = [16 x i8] c"passwordpassword"
@str = [28 x i8] c"CSE 178 AES Implementation\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %8)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %9)
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @encryptablock to i32 (i8*, i8*, ...)*)(i8* %8, i8* %9)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %8)
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %17)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %18)
%23 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @encryptablock to i32 (i8*, i8*, ...)*)(i8* %17, i8* %18)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @__printblock to i32 (i8*, ...)*)(i8* %17)
%26 = call i32 @putchar(i32 10)
ret i32 0
}