#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*/ encipher_file(char *);
int /*<<< orphan*/ init_mach();
int /*<<< orphan*/ read_keyfile(char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  char *infile;
  if ((argc < 2) || (argc > 3)) {
    usage(argv[0]);
    return 1;
  }
  if (argc == 2) {
    infile = argv[1];
  } else {
    infile = argv[2];
    read_keyfile(argv[1]);
  }
  init_mach();
  encipher_file(infile);
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
jl     116a <main+0x2a>
cmpl   $0x3,-0x8(%rbp)
jle    1182 <main+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    11cd <main+0x8d>
cmpl   $0x2,-0x8(%rbp)
jne    119d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    11b6 <main+0x76>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <read_keyfile@plt>
mov    $0x0,%al
call   1050 <init_mach@plt>
mov    -0x18(%rbp),%rdi
call   1030 <encipher_file@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    -0x4(%rdi),%eax
cmp    $0xfffffffd,%eax
ja     115a <main+0x1a>
mov    (%rsi),%rdi
call   1060 <usage@plt>
mov    $0x1,%ebp
jmp    1183 <main+0x43>
cmp    $0x2,%edi
jne    1165 <main+0x25>
mov    0x8(%rsi),%rbx
jmp    1172 <main+0x32>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rbx
call   1040 <read_keyfile@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <init_mach@plt>
mov    %rbx,%rdi
call   1030 <encipher_file@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 3
br i1 %11, label %12, label %17
12: ; preds = %9, %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @usage(i8* %15)
store i32 1, i32* %3
br label %36
17: ; preds = %9
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
store i8* %23, i8** %6
br label %32
24: ; preds = %17
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
store i8* %27, i8** %6
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @read_keyfile(i8* %30)
br label %32
32: ; preds = %24, %20
%33 = call i32 (...) @init_mach()
%34 = load i8*, i8** %6
%35 = call i32 @encipher_file(i8* %34)
store i32 0, i32* %3
br label %36
36: ; preds = %32, %12
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add i32 %0, -4
%4 = icmp ult i32 %3, -2
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @usage(i8* %6)
br label %23
8: ; preds = %2
%9 = icmp eq i32 %0, 2
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
br label %19
13: ; preds = %8
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @read_keyfile(i8* %17)
br label %19
19: ; preds = %13, %10
%20 = phi i8* [ %12, %10 ], [ %15, %13 ]
%21 = tail call i32 (...) @init_mach()
%22 = tail call i32 @encipher_file(i8* %20)
br label %23
23: ; preds = %19, %5
%24 = phi i32 [ 1, %5 ], [ 0, %19 ]
ret i32 %24
}