#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 */
typedef int /*<<< orphan*/ plaintext;
typedef int /*<<< orphan*/ key;
typedef int /*<<< orphan*/ ciphertext;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int KEYLENGTH(int);
int RKLENGTH(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int getchar();
int /*<<< orphan*/ rijndaelEncrypt(unsigned long *, int, unsigned char *,
                                   unsigned char *);
int rijndaelSetupEncrypt(unsigned long *, unsigned char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  unsigned long rk[RKLENGTH(256)];
  unsigned char key[KEYLENGTH(256)];
  int i;
  int nrounds;
  char *password;
  FILE *output;
  if (argc < 2) {
    fputs("Missing argument\n", stderr);
    return 1;
  }
  password = "123456789HGBHNJNMHJMKJOUJKPPK";
  for (i = 0; i < sizeof(key); i++)
    key[i] = *password != 0 ? *password++ : 0;
  output = fopen(argv[1], "wb");
  if (output == NULL) {
    fputs("File write error", stderr);
    return 1;
  }
  nrounds = rijndaelSetupEncrypt(rk, key, 256);
  while (!feof(stdin)) {
    unsigned char plaintext[16];
    unsigned char ciphertext[16];
    int j;
    for (j = 0; j < sizeof(plaintext); j++) {
      int c = getchar();
      if (c == EOF)
        break;
      plaintext[j] = c;
    }
    if (j == 0)
      break;
    for (; j < sizeof(plaintext); j++)
      plaintext[j] = ' ';
    rijndaelEncrypt(rk, nrounds, plaintext, ciphertext);
    if (fwrite(ciphertext, sizeof(ciphertext), 1, output) != 1) {
      fclose(output);
      fputs("File write error", stderr);
      return 1;
    }
  }
  fclose(output);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x100,%edi
mov    %edi,-0x94(%rbp)
call   10b0 <RKLENGTH@plt>
mov    -0x94(%rbp),%edi
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
call   1070 <KEYLENGTH@plt>
mov    %eax,%eax
mov    %rax,-0x88(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1254 <main+0xb4>
mov    0x2d9d(%rip),%rax
mov    (%rax),%esi
lea    0xdc4(%rip),%rdi
call   1060 <fputs@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x44(%rbp)
jmp    1462 <main+0x2c2>
lea    0xdb7(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x88(%rbp),%rcx
movslq -0x2c(%rbp),%rax
cmp    %rcx,%rax
jae    12d5 <main+0x135>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12a7 <main+0x107>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x98(%rbp)
jmp    12b4 <main+0x114>
xor    %eax,%eax
mov    %eax,-0x98(%rbp)
jmp    12b4 <main+0x114>
mov    -0x80(%rbp),%rax
mov    -0x98(%rbp),%ecx
mov    %cl,%dl
movslq -0x2c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1266 <main+0xc6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd4c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1320 <main+0x180>
mov    0x2cd1(%rip),%rax
mov    (%rax),%esi
lea    0xd2b(%rip),%rdi
call   1060 <fputs@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x44(%rbp)
jmp    1462 <main+0x2c2>
mov    -0x80(%rbp),%rsi
mov    -0x90(%rbp),%rdi
mov    $0x100,%edx
call   1030 <rijndaelSetupEncrypt@plt>
mov    %eax,-0x30(%rbp)
mov    0x2ca9(%rip),%rax
mov    (%rax),%edi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    135b <main+0x1bb>
jmp    1452 <main+0x2b2>
movl   $0x0,-0x74(%rbp)
movslq -0x74(%rbp),%rax
cmp    $0x10,%rax
jae    13ac <main+0x20c>
mov    $0x0,%al
call   1080 <getchar@plt>
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    0x2c5c(%rip),%rcx
cmp    (%rcx),%eax
jne    1391 <main+0x1f1>
jmp    13ac <main+0x20c>
mov    -0x78(%rbp),%eax
mov    %al,%cl
movslq -0x74(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1362 <main+0x1c2>
cmpl   $0x0,-0x74(%rbp)
jne    13bb <main+0x21b>
jmp    1452 <main+0x2b2>
jmp    13c0 <main+0x220>
movslq -0x74(%rbp),%rax
cmp    $0x10,%rax
jae    13e5 <main+0x245>
movslq -0x74(%rbp),%rax
movb   $0x20,-0x60(%rbp,%rax,1)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    13c0 <main+0x220>
mov    -0x90(%rbp),%rdi
mov    -0x30(%rbp),%esi
lea    -0x60(%rbp),%rdx
lea    -0x70(%rbp),%rcx
call   1040 <rijndaelEncrypt@plt>
lea    -0x70(%rbp),%rdi
mov    -0x40(%rbp),%rcx
mov    $0x10,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
cmp    $0x1,%eax
je     144d <main+0x2ad>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    0x2ba4(%rip),%rax
mov    (%rax),%esi
lea    0xbfe(%rip),%rdi
call   1060 <fputs@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x44(%rbp)
jmp    1462 <main+0x2c2>
jmp    1338 <main+0x198>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x100,%edi
call   10c0 <RKLENGTH@plt>
mov    %eax,%eax
mov    %rsp,%r12
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    $0x100,%edi
call   1080 <KEYLENGTH@plt>
mov    %eax,%esi
mov    %rsp,%r13
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
cmp    $0x2,%r15d
jge    1220 <main+0x70>
mov    0x2dbe(%rip),%rax
mov    (%rax),%esi
lea    0xde5(%rip),%rdi
jmp    14df <main+0x32f>
test   %rsi,%rsi
je     12b5 <main+0x105>
lea    -0x1(%rsi),%rcx
mov    %esi,%edi
and    $0x3,%edi
cmp    $0x3,%rcx
jae    1243 <main+0x93>
lea    0xdd3(%rip),%rcx
xor    %edx,%edx
jmp    1292 <main+0xe2>
and    $0xfffffffc,%esi
lea    0xdc5(%rip),%rcx
xor    %edx,%edx
nop
movzbl (%rcx),%eax
cmp    $0x1,%al
sbb    $0xffffffffffffffff,%rcx
mov    %al,0x0(%r13,%rdx,1)
movzbl (%rcx),%eax
cmp    $0x1,%al
sbb    $0xffffffffffffffff,%rcx
mov    %al,0x1(%r13,%rdx,1)
movzbl (%rcx),%eax
cmp    $0x1,%al
sbb    $0xffffffffffffffff,%rcx
movzbl (%rcx),%ebx
cmp    $0x1,%bl
sbb    $0xffffffffffffffff,%rcx
mov    %al,0x2(%r13,%rdx,1)
mov    %bl,0x3(%r13,%rdx,1)
add    $0x4,%rdx
cmp    %rdx,%rsi
jne    1250 <main+0xa0>
test   %rdi,%rdi
je     12b5 <main+0x105>
add    %r13,%rdx
xor    %esi,%esi
nopl   0x0(%rax)
movzbl (%rcx),%eax
cmp    $0x1,%al
sbb    $0xffffffffffffffff,%rcx
mov    %al,(%rdx,%rsi,1)
add    $0x1,%rsi
cmp    %rsi,%rdi
jne    12a0 <main+0xf0>
mov    0x8(%r14),%rdi
lea    0xd70(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     14cf <main+0x31f>
mov    %rax,%r14
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x100,%edx
call   1030 <rijndaelSetupEncrypt@plt>
mov    %eax,%r15d
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
call   10a0 <feof@plt>
test   %eax,%eax
je     1305 <main+0x155>
mov    %r14,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
jmp    14e9 <main+0x339>
mov    0x2cd4(%rip),%rbx
lea    -0x50(%rbp),%r13
xor    %eax,%eax
call   1090 <getchar@plt>
cmp    (%rbx),%eax
je     12f6 <main+0x146>
mov    %al,-0x40(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0x1,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x3f(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0x2,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x3e(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0x3,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x3d(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0x4,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x3c(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0x5,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x3b(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0x6,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x3a(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0x7,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x39(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0x8,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x38(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0x9,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x37(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0xa,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x36(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0xb,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x35(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0xc,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x34(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0xd,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x33(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0xe,%ecx
cmp    (%rbx),%eax
je     1460 <main+0x2b0>
mov    %al,-0x32(%rbp)
xor    %eax,%eax
call   1090 <getchar@plt>
mov    $0xf,%ecx
cmp    (%rbx),%eax
jne    14c2 <main+0x312>
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
lea    (%rax,%rbp,1),%rdi
add    $0xffffffffffffffc0,%rdi
mov    $0x10,%edx
sub    %ecx,%edx
mov    $0x20,%esi
call   1070 <memset@plt>
mov    %r12,%rdi
mov    %r15d,%esi
lea    -0x40(%rbp),%rdx
mov    %r13,%rcx
call   1040 <rijndaelEncrypt@plt>
mov    %r13,%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10d0 <fwrite@plt>
cmp    $0x1,%eax
jne    14c7 <main+0x317>
mov    0x2b3a(%rip),%rax
mov    (%rax),%edi
call   10a0 <feof@plt>
test   %eax,%eax
je     1310 <main+0x160>
jmp    12f6 <main+0x146>
mov    %al,-0x31(%rbp)
jmp    147b <main+0x2cb>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    0x2afa(%rip),%rax
mov    (%rax),%esi
lea    0xb54(%rip),%rdi
call   1060 <fputs@plt>
mov    $0x1,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Missing argument\0A\00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"123456789HGBHNJNMHJMKJOUJKPPK\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [17 x i8] c"File write error\00"
@stdin = global i32 0
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca [16 x i8]
%15 = alloca [16 x i8]
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = call i32 @RKLENGTH(i32 256)
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %6
%21 = alloca i64, i64 %19
store i64 %19, i64* %7
%22 = call i32 @KEYLENGTH(i32 256)
%23 = zext i32 %22 to i64
%24 = alloca i8, i64 %23
store i64 %23, i64* %8
%25 = load i32, i32* %4
%26 = icmp slt i32 %25, 2
br i1 %26, label %27, label %30
27: ; preds = %2
%28 = load i32, i32* @stderr
%29 = call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %28)
store i32 1, i32* %3
store i32 1, i32* %13
br label %126
30: ; preds = %2
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8** %11
store i32 0, i32* %9
br label %31
31: ; preds = %52, %30
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = icmp ult i64 %33, %23
br i1 %34, label %35, label %55
35: ; preds = %31
%36 = load i8*, i8** %11
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %45
40: ; preds = %35
%41 = load i8*, i8** %11
%42 = getelementptr inbounds i8, i8* %41, i32 1
store i8* %42, i8** %11
%43 = load i8, i8* %41
%44 = sext i8 %43 to i32
br label %46
45: ; preds = %35
br label %46
46: ; preds = %45, %40
%47 = phi i32 [ %44, %40 ], [ 0, %45 ]
%48 = trunc i32 %47 to i8
%49 = load i32, i32* %9
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %24, i64 %50
store i8 %48, i8* %51
br label %52
52: ; preds = %46
%53 = load i32, i32* %9
%54 = add nsw i32 %53, 1
store i32 %54, i32* %9
br label %31
55: ; preds = %31
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 1
%58 = load i8*, i8** %57
%59 = call i32* @fopen(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %59, i32** %12
%60 = load i32*, i32** %12
%61 = icmp eq i32* %60, null
br i1 %61, label %62, label %65
62: ; preds = %55
%63 = load i32, i32* @stderr
%64 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %63)
store i32 1, i32* %3
store i32 1, i32* %13
br label %126
65: ; preds = %55
%66 = call i32 @rijndaelSetupEncrypt(i64* %21, i8* %24, i32 256)
store i32 %66, i32* %10
br label %67
67: ; preds = %122, %65
%68 = load i32, i32* @stdin
%69 = call i32 @feof(i32 %68)
%70 = icmp ne i32 %69, 0
%71 = xor i1 %70, true
br i1 %71, label %72, label %123
72: ; preds = %67
store i32 0, i32* %16
br label %73
73: ; preds = %89, %72
%74 = load i32, i32* %16
%75 = sext i32 %74 to i64
%76 = icmp ult i64 %75, 16
br i1 %76, label %77, label %92
77: ; preds = %73
%78 = call i32 (...) @getchar()
store i32 %78, i32* %17
%79 = load i32, i32* %17
%80 = load i32, i32* @EOF
%81 = icmp eq i32 %79, %80
br i1 %81, label %82, label %83
82: ; preds = %77
br label %92
83: ; preds = %77
%84 = load i32, i32* %17
%85 = trunc i32 %84 to i8
%86 = load i32, i32* %16
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [16 x i8], [16 x i8]* %14, i64 0, i64 %87
store i8 %85, i8* %88
br label %89
89: ; preds = %83
%90 = load i32, i32* %16
%91 = add nsw i32 %90, 1
store i32 %91, i32* %16
br label %73
92: ; preds = %82, %73
%93 = load i32, i32* %16
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %96
95: ; preds = %92
br label %123
96: ; preds = %92
br label %97
97: ; preds = %105, %96
%98 = load i32, i32* %16
%99 = sext i32 %98 to i64
%100 = icmp ult i64 %99, 16
br i1 %100, label %101, label %108
101: ; preds = %97
%102 = load i32, i32* %16
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [16 x i8], [16 x i8]* %14, i64 0, i64 %103
store i8 32, i8* %104
br label %105
105: ; preds = %101
%106 = load i32, i32* %16
%107 = add nsw i32 %106, 1
store i32 %107, i32* %16
br label %97
108: ; preds = %97
%109 = load i32, i32* %10
%110 = getelementptr inbounds [16 x i8], [16 x i8]* %14, i64 0, i64 0
%111 = getelementptr inbounds [16 x i8], [16 x i8]* %15, i64 0, i64 0
%112 = call i32 @rijndaelEncrypt(i64* %21, i32 %109, i8* %110, i8* %111)
%113 = getelementptr inbounds [16 x i8], [16 x i8]* %15, i64 0, i64 0
%114 = load i32*, i32** %12
%115 = call i32 @fwrite(i8* %113, i32 16, i32 1, i32* %114)
%116 = icmp ne i32 %115, 1
br i1 %116, label %117, label %122
117: ; preds = %108
%118 = load i32*, i32** %12
%119 = call i32 @fclose(i32* %118)
%120 = load i32, i32* @stderr
%121 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %120)
store i32 1, i32* %3
store i32 1, i32* %13
br label %126
122: ; preds = %108
br label %67
123: ; preds = %95, %67
%124 = load i32*, i32** %12
%125 = call i32 @fclose(i32* %124)
store i32 0, i32* %13
br label %126
126: ; preds = %123, %117, %62, %27
%127 = load i8*, i8** %6
%128 = load i32, i32* %13
switch i32 %128, label %131 [
i32 0, label %129
i32 1, label %129
]
129: ; preds = %126, %126
%130 = load i32, i32* %3
ret i32 %130
131: ; preds = %126
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"Missing argument\0A\00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"123456789HGBHNJNMHJMKJOUJKPPK\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [17 x i8] c"File write error\00"
@stdin = global i32 0
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = tail call i32 @RKLENGTH(i32 256)
%6 = zext i32 %5 to i64
%7 = alloca i64, i64 %6
%8 = tail call i32 @KEYLENGTH(i32 256)
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
%11 = icmp slt i32 %0, 2
br i1 %11, label %20, label %12
12: ; preds = %2
%13 = icmp eq i32 %8, 0
br i1 %13, label %69, label %14
14: ; preds = %12
%15 = add nsw i64 %9, -1
%16 = and i64 %9, 3
%17 = icmp ult i64 %15, 3
br i1 %17, label %53, label %18
18: ; preds = %14
%19 = and i64 %9, 4294967292
br label %23
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = tail call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %202
23: ; preds = %23, %18
%24 = phi i64 [ 0, %18 ], [ %50, %23 ]
%25 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), %18 ], [ %48, %23 ]
%26 = phi i64 [ 0, %18 ], [ %51, %23 ]
%27 = load i8, i8* %25
%28 = icmp ne i8 %27, 0
%29 = zext i1 %28 to i64
%30 = getelementptr i8, i8* %25, i64 %29
%31 = getelementptr inbounds i8, i8* %10, i64 %24
store i8 %27, i8* %31
%32 = or i64 %24, 1
%33 = load i8, i8* %30
%34 = icmp ne i8 %33, 0
%35 = zext i1 %34 to i64
%36 = getelementptr i8, i8* %30, i64 %35
%37 = getelementptr inbounds i8, i8* %10, i64 %32
store i8 %33, i8* %37
%38 = or i64 %24, 2
%39 = load i8, i8* %36
%40 = icmp ne i8 %39, 0
%41 = zext i1 %40 to i64
%42 = getelementptr i8, i8* %36, i64 %41
%43 = getelementptr inbounds i8, i8* %10, i64 %38
store i8 %39, i8* %43
%44 = or i64 %24, 3
%45 = load i8, i8* %42
%46 = icmp ne i8 %45, 0
%47 = zext i1 %46 to i64
%48 = getelementptr i8, i8* %42, i64 %47
%49 = getelementptr inbounds i8, i8* %10, i64 %44
store i8 %45, i8* %49
%50 = add nuw nsw i64 %24, 4
%51 = add i64 %26, 4
%52 = icmp eq i64 %51, %19
br i1 %52, label %53, label %23
53: ; preds = %23, %14
%54 = phi i64 [ 0, %14 ], [ %50, %23 ]
%55 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), %14 ], [ %48, %23 ]
%56 = icmp eq i64 %16, 0
br i1 %56, label %69, label %57
57: ; preds = %53, %57
%58 = phi i64 [ %66, %57 ], [ %54, %53 ]
%59 = phi i8* [ %64, %57 ], [ %55, %53 ]
%60 = phi i64 [ %67, %57 ], [ 0, %53 ]
%61 = load i8, i8* %59
%62 = icmp ne i8 %61, 0
%63 = zext i1 %62 to i64
%64 = getelementptr i8, i8* %59, i64 %63
%65 = getelementptr inbounds i8, i8* %10, i64 %58
store i8 %61, i8* %65
%66 = add nuw nsw i64 %58, 1
%67 = add i64 %60, 1
%68 = icmp eq i64 %67, %16
br i1 %68, label %69, label %57
69: ; preds = %53, %57, %12
%70 = getelementptr inbounds i8*, i8** %1, i64 1
%71 = load i8*, i8** %70
%72 = tail call i32* @fopen(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%73 = icmp eq i32* %72, null
br i1 %73, label %74, label %77
74: ; preds = %69
%75 = load i32, i32* @stderr
%76 = tail call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %75)
br label %202
77: ; preds = %69
%78 = call i32 @rijndaelSetupEncrypt(i64* %7, i8* %10, i32 256)
%79 = load i32, i32* @stdin
%80 = call i32 @feof(i32 %79)
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %200
82: ; preds = %77
%83 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%84 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%85 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 1
%86 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 2
%87 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 3
%88 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 4
%89 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 5
%90 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 6
%91 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 7
%92 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 8
%93 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 9
%94 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 10
%95 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 11
%96 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 12
%97 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 13
%98 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 14
%99 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 15
br label %100
100: ; preds = %82, %196
%101 = call i32 (...) @getchar()
%102 = load i32, i32* @EOF
%103 = icmp eq i32 %101, %102
br i1 %103, label %187, label %104
104: ; preds = %100
%105 = trunc i32 %101 to i8
store i8 %105, i8* %83
%106 = call i32 (...) @getchar()
%107 = load i32, i32* @EOF
%108 = icmp eq i32 %106, %107
br i1 %108, label %181, label %109
109: ; preds = %104
%110 = trunc i32 %106 to i8
store i8 %110, i8* %85
%111 = call i32 (...) @getchar()
%112 = load i32, i32* @EOF
%113 = icmp eq i32 %111, %112
br i1 %113, label %181, label %114
114: ; preds = %109
%115 = trunc i32 %111 to i8
store i8 %115, i8* %86
%116 = call i32 (...) @getchar()
%117 = load i32, i32* @EOF
%118 = icmp eq i32 %116, %117
br i1 %118, label %181, label %119
119: ; preds = %114
%120 = trunc i32 %116 to i8
store i8 %120, i8* %87
%121 = call i32 (...) @getchar()
%122 = load i32, i32* @EOF
%123 = icmp eq i32 %121, %122
br i1 %123, label %181, label %124
124: ; preds = %119
%125 = trunc i32 %121 to i8
store i8 %125, i8* %88
%126 = call i32 (...) @getchar()
%127 = load i32, i32* @EOF
%128 = icmp eq i32 %126, %127
br i1 %128, label %181, label %129
129: ; preds = %124
%130 = trunc i32 %126 to i8
store i8 %130, i8* %89
%131 = call i32 (...) @getchar()
%132 = load i32, i32* @EOF
%133 = icmp eq i32 %131, %132
br i1 %133, label %181, label %134
134: ; preds = %129
%135 = trunc i32 %131 to i8
store i8 %135, i8* %90
%136 = call i32 (...) @getchar()
%137 = load i32, i32* @EOF
%138 = icmp eq i32 %136, %137
br i1 %138, label %181, label %139
139: ; preds = %134
%140 = trunc i32 %136 to i8
store i8 %140, i8* %91
%141 = call i32 (...) @getchar()
%142 = load i32, i32* @EOF
%143 = icmp eq i32 %141, %142
br i1 %143, label %181, label %144
144: ; preds = %139
%145 = trunc i32 %141 to i8
store i8 %145, i8* %92
%146 = call i32 (...) @getchar()
%147 = load i32, i32* @EOF
%148 = icmp eq i32 %146, %147
br i1 %148, label %181, label %149
149: ; preds = %144
%150 = trunc i32 %146 to i8
store i8 %150, i8* %93
%151 = call i32 (...) @getchar()
%152 = load i32, i32* @EOF
%153 = icmp eq i32 %151, %152
br i1 %153, label %181, label %154
154: ; preds = %149
%155 = trunc i32 %151 to i8
store i8 %155, i8* %94
%156 = call i32 (...) @getchar()
%157 = load i32, i32* @EOF
%158 = icmp eq i32 %156, %157
br i1 %158, label %181, label %159
159: ; preds = %154
%160 = trunc i32 %156 to i8
store i8 %160, i8* %95
%161 = call i32 (...) @getchar()
%162 = load i32, i32* @EOF
%163 = icmp eq i32 %161, %162
br i1 %163, label %181, label %164
164: ; preds = %159
%165 = trunc i32 %161 to i8
store i8 %165, i8* %96
%166 = call i32 (...) @getchar()
%167 = load i32, i32* @EOF
%168 = icmp eq i32 %166, %167
br i1 %168, label %181, label %169
169: ; preds = %164
%170 = trunc i32 %166 to i8
store i8 %170, i8* %97
%171 = call i32 (...) @getchar()
%172 = load i32, i32* @EOF
%173 = icmp eq i32 %171, %172
br i1 %173, label %181, label %174
174: ; preds = %169
%175 = trunc i32 %171 to i8
store i8 %175, i8* %98
%176 = call i32 (...) @getchar()
%177 = load i32, i32* @EOF
%178 = icmp eq i32 %176, %177
br i1 %178, label %181, label %179
179: ; preds = %174
%180 = trunc i32 %176 to i8
store i8 %180, i8* %99
br label %188
181: ; preds = %104, %109, %114, %119, %124, %129, %134, %139, %144, %149, %154, %159, %164, %169, %174
%182 = phi i32 [ 15, %174 ], [ 14, %169 ], [ 13, %164 ], [ 12, %159 ], [ 11, %154 ], [ 10, %149 ], [ 9, %144 ], [ 8, %139 ], [ 7, %134 ], [ 6, %129 ], [ 5, %124 ], [ 4, %119 ], [ 3, %114 ], [ 2, %109 ], [ 1, %104 ]
%183 = zext i32 %182 to i64
%184 = getelementptr [16 x i8], [16 x i8]* %3, i64 0, i64 %183
%185 = sub nuw nsw i32 16, %182
%186 = zext i32 %185 to i64
br label %188
187: ; preds = %100
br label %200
188: ; preds = %179, %181
%189 = call i32 @rijndaelEncrypt(i64* %7, i32 %78, i8* %83, i8* %84)
%190 = call i32 @fwrite(i8* %84, i32 16, i32 1, i32* %72)
%191 = icmp eq i32 %190, 1
br i1 %191, label %196, label %192
192: ; preds = %188
%193 = call i32 @fclose(i32* %72)
%194 = load i32, i32* @stderr
%195 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %194)
br label %202
196: ; preds = %188
%197 = load i32, i32* @stdin
%198 = call i32 @feof(i32 %197)
%199 = icmp eq i32 %198, 0
br i1 %199, label %100, label %200
200: ; preds = %196, %77, %187
%201 = call i32 @fclose(i32* %72)
br label %202
202: ; preds = %192, %200, %74, %20
%203 = phi i32 [ 1, %20 ], [ 1, %74 ], [ 0, %200 ], [ 1, %192 ]
ret i32 %203
}