#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 EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ aes_file(int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int parse_input(int, char **, char **, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  char *password = NULL;
  int operation = -1;
  int err = 0;
  err = parse_input(argc, argv, &password, &operation);
  if (err < 0) {
    return EXIT_FAILURE;
  }
  if (err > 0) {
    return EXIT_SUCCESS;
  }
  if (aes_file(stdin, stdout, password, operation) < 0) {
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <parse_input@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    117e <main+0x5e>
mov    0x2e64(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11de <main+0xbe>
cmpl   $0x0,-0x20(%rbp)
jle    1199 <main+0x79>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11de <main+0xbe>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
mov    0x2e27(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <aes_file@plt>
cmp    $0x0,%rax
jge    11d2 <main+0xb2>
mov    0x2e10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11de <main+0xbe>
mov    0x2def(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <parse_input@plt>
test   %eax,%eax
js     116f <main+0x4f>
jne    1178 <main+0x58>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
mov    0x10(%rsp),%rdx
mov    0xc(%rsp),%ecx
call   1030 <aes_file@plt>
test   %rax,%rax
jns    1178 <main+0x58>
mov    0x2e62(%rip),%rax
jmp    117f <main+0x5f>
mov    0x2e49(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@stdin = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i32 -1, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @parse_input(i32 %9, i8** %10, i8** %6, i32* %7)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i32, i32* @EXIT_FAILURE
store i32 %15, i32* %3
br label %32
16: ; preds = %2
%17 = load i32, i32* %8
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load i32, i32* @EXIT_SUCCESS
store i32 %20, i32* %3
br label %32
21: ; preds = %16
%22 = load i32, i32* @stdin
%23 = load i32, i32* @stdout
%24 = load i8*, i8** %6
%25 = load i32, i32* %7
%26 = call i64 @aes_file(i32 %22, i32 %23, i8* %24, i32 %25)
%27 = icmp slt i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %21
%29 = load i32, i32* @EXIT_FAILURE
store i32 %29, i32* %3
br label %32
30: ; preds = %21
%31 = load i32, i32* @EXIT_SUCCESS
store i32 %31, i32* %3
br label %32
32: ; preds = %30, %28, %19, %14
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@stdin = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%6 = bitcast i32* %4 to i8*
store i32 -1, i32* %4
%7 = call i32 @parse_input(i32 %0, i8** %1, i8** %3, i32* %4)
%8 = icmp slt i32 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %2
%10 = icmp eq i32 %7, 0
br i1 %10, label %11, label %19
11: ; preds = %9
%12 = load i32, i32* @stdin
%13 = load i32, i32* @stdout
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = call i64 @aes_file(i32 %12, i32 %13, i8* %14, i32 %15)
%17 = icmp slt i64 %16, 0
%18 = select i1 %17, i32* @EXIT_FAILURE, i32* @EXIT_SUCCESS
br label %19
19: ; preds = %11, %9, %2
%20 = phi i32* [ @EXIT_FAILURE, %2 ], [ @EXIT_SUCCESS, %9 ], [ %18, %11 ]
%21 = load i32, i32* %20
ret i32 %21
}