#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*/ FILE;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ do_crypt(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int,
                            char *);
int /*<<< orphan*/ exit(int);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  int action = 0;
  int ifarg;
  int ofarg;
  FILE *inFile = NULL;
  FILE *outFile = NULL;
  char *key_str = NULL;
  if (argc < 3) {
    fprintf(stderr, "usage: %s %s\n", argv[0],
            "<type> <opt key phrase> <in path> <out path>");
    exit(EXIT_FAILURE);
  }
  if (!strcmp(argv[1], "-e")) {
    if (argc != 5) {
      fprintf(stderr, "usage: %s %s\n", argv[0],
              "-e <key phrase> <in path> <out path>");
      exit(EXIT_FAILURE);
    }
    key_str = argv[2];
    ifarg = 3;
    ofarg = 4;
    action = 1;
  } else if (!strcmp(argv[1], "-d")) {
    if (argc != 5) {
      fprintf(stderr, "usage: %s %s\n", argv[0],
              "-d <key phrase> <in path> <out path>");
      exit(EXIT_FAILURE);
    }
    key_str = argv[2];
    ifarg = 3;
    ofarg = 4;
    action = 0;
  } else if (!strcmp(argv[1], "-c")) {
    if (argc != 4) {
      fprintf(stderr, "usage: %s %s\n", argv[0], "-c <in path> <out path>");
      exit(EXIT_FAILURE);
    }
    key_str = NULL;
    ifarg = 2;
    ofarg = 3;
    action = -1;
  } else {
    fprintf(stderr, "Unkown action\n");
    exit(EXIT_FAILURE);
  }
  inFile = fopen(argv[ifarg], "rb");
  if (!inFile) {
    perror("infile fopen error");
    return EXIT_FAILURE;
  }
  outFile = fopen(argv[ofarg], "wb+");
  if (!outFile) {
    perror("outfile fopen error");
    return EXIT_FAILURE;
  }
  if (!do_crypt(inFile, outFile, action, key_str)) {
    fprintf(stderr, "do_crypt failed\n");
  }
  if (fclose(outFile)) {
    perror("outFile fclose error\n");
  }
  if (fclose(inFile)) {
    perror("inFile fclose error\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11e2 <main+0x72>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe3a(%rip),%rsi
lea    0xe41(%rip),%rcx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1262 <main+0xf2>
cmpl   $0x5,-0x8(%rbp)
je     123c <main+0xcc>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xde0(%rip),%rsi
lea    0xe17(%rip),%rcx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x4,-0x1c(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    138d <main+0x21d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12e2 <main+0x172>
cmpl   $0x5,-0x8(%rbp)
je     12bc <main+0x14c>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd60(%rip),%rsi
lea    0xdbf(%rip),%rcx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d23(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x4,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    1388 <main+0x218>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd9a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    135e <main+0x1ee>
cmpl   $0x4,-0x8(%rbp)
je     133c <main+0x1cc>
mov    0x2cd0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xce0(%rip),%rsi
lea    0xd67(%rip),%rcx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2ca3(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
movq   $0x0,-0x38(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
movl   $0xffffffff,-0x14(%rbp)
jmp    1383 <main+0x213>
mov    0x2c7b(%rip),%rax
mov    (%rax),%edi
lea    0xd38(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c5c(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    1388 <main+0x218>
jmp    138d <main+0x21d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd15(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    13d1 <main+0x261>
lea    0xcfd(%rip),%rdi
call   1070 <perror@plt>
mov    0x2c11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1493 <main+0x323>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xce7(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1415 <main+0x2a5>
lea    0xcd0(%rip),%rdi
call   1070 <perror@plt>
mov    0x2bcd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1493 <main+0x323>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x38(%rbp),%rcx
call   1090 <do_crypt@plt>
cmp    $0x0,%eax
jne    1449 <main+0x2d9>
mov    0x2ba7(%rip),%rax
mov    (%rax),%edi
lea    0xca1(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     1468 <main+0x2f8>
lea    0xc91(%rip),%rdi
call   1070 <perror@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     1487 <main+0x317>
lea    0xc88(%rip),%rdi
call   1070 <perror@plt>
mov    0x2b42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
cmp    $0x2,%edi
jle    12f4 <main+0x184>
mov    %edi,%ebp
mov    0x8(%r12),%rbx
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11e9 <main+0x79>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1214 <main+0xa4>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1311 <main+0x1a1>
cmp    $0x4,%ebp
jne    132a <main+0x1ba>
mov    $0x3,%ebx
mov    $0x2,%eax
mov    $0xffffffff,%r14d
xor    %r15d,%r15d
jmp    122f <main+0xbf>
mov    $0x1,%r14d
cmp    $0x5,%ebp
je     1220 <main+0xb0>
mov    0x2de5(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%rdx
lea    0xdf8(%rip),%rsi
lea    0xe2f(%rip),%rcx
jmp    1362 <main+0x1f2>
xor    %r14d,%r14d
cmp    $0x5,%ebp
jne    1347 <main+0x1d7>
mov    0x10(%r12),%r15
mov    $0x4,%ebx
mov    $0x3,%eax
mov    (%r12,%rax,8),%rdi
lea    0xe7b(%rip),%rsi
call   1060 <fopen@plt>
mov    0x2d92(%rip),%r13
test   %rax,%rax
je     12c6 <main+0x156>
mov    %rax,%rbp
mov    (%r12,%rbx,8),%rdi
lea    0xe72(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     12cf <main+0x15f>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    %rax,%rsi
mov    %r14d,%edx
mov    %r15,%rcx
call   1090 <do_crypt@plt>
test   %eax,%eax
jne    1292 <main+0x122>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
lea    0xe58(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
test   %rax,%rax
jne    12d8 <main+0x168>
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    0x2d22(%rip),%r13
test   %rax,%rax
jne    12e6 <main+0x176>
mov    0x0(%r13),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdeb(%rip),%rdi
jmp    12ed <main+0x17d>
lea    0xdf9(%rip),%rdi
jmp    12ed <main+0x17d>
lea    0xe15(%rip),%rdi
call   1070 <perror@plt>
jmp    129f <main+0x12f>
lea    0xe1d(%rip),%rdi
call   1070 <perror@plt>
jmp    12b3 <main+0x143>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%rdx
lea    0xcf8(%rip),%rsi
lea    0xcff(%rip),%rcx
jmp    1362 <main+0x1f2>
mov    0x2cc8(%rip),%rax
mov    (%rax),%edi
lea    0xd85(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1369 <main+0x1f9>
mov    0x2caf(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%rdx
lea    0xcc2(%rip),%rsi
lea    0xd49(%rip),%rcx
jmp    1362 <main+0x1f2>
mov    0x2c92(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%rdx
lea    0xca5(%rip),%rsi
lea    0xd04(%rip),%rcx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2c68(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"usage: %s %s\0A\00"
@.str.1 = [45 x i8] c"<type> <opt key phrase> <in path> <out path>\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [37 x i8] c"-e <key phrase> <in path> <out path>\00"
@.str.4 = [3 x i8] c"-d\00"
@.str.5 = [37 x i8] c"-d <key phrase> <in path> <out path>\00"
@.str.6 = [3 x i8] c"-c\00"
@.str.7 = [24 x i8] c"-c <in path> <out path>\00"
@.str.8 = [15 x i8] c"Unkown action\0A\00"
@.str.9 = [3 x i8] c"rb\00"
@.str.10 = [19 x i8] c"infile fopen error\00"
@.str.11 = [4 x i8] c"wb+\00"
@.str.12 = [20 x i8] c"outfile fopen error\00"
@.str.13 = [17 x i8] c"do_crypt failed\0A\00"
@.str.14 = [22 x i8] c"outFile fclose error\0A\00"
@.str.15 = [21 x i8] c"inFile fclose error\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32* null, i32** %9
store i32* null, i32** %10
store i8* null, i8** %11
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %22
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %18, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %43, label %28
28: ; preds = %22
%29 = load i32, i32* %4
%30 = icmp ne i32 %29, 5
br i1 %30, label %31, label %39
31: ; preds = %28
%32 = load i32, i32* @stderr
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 0
%35 = load i8*, i8** %34
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %35, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %28
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 2
%42 = load i8*, i8** %41
store i8* %42, i8** %11
store i32 3, i32* %7
store i32 4, i32* %8
store i32 1, i32* %6
br label %89
43: ; preds = %22
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = call i32 @strcmp(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%48 = icmp ne i32 %47, 0
br i1 %48, label %64, label %49
49: ; preds = %43
%50 = load i32, i32* %4
%51 = icmp ne i32 %50, 5
br i1 %51, label %52, label %60
52: ; preds = %49
%53 = load i32, i32* @stderr
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 0
%56 = load i8*, i8** %55
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %56, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%58 = load i32, i32* @EXIT_FAILURE
%59 = call i32 @exit(i32 %58)
unreachable
60: ; preds = %49
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 2
%63 = load i8*, i8** %62
store i8* %63, i8** %11
store i32 3, i32* %7
store i32 4, i32* %8
store i32 0, i32* %6
br label %88
64: ; preds = %43
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i32 @strcmp(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%69 = icmp ne i32 %68, 0
br i1 %69, label %82, label %70
70: ; preds = %64
%71 = load i32, i32* %4
%72 = icmp ne i32 %71, 4
br i1 %72, label %73, label %81
73: ; preds = %70
%74 = load i32, i32* @stderr
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 0
%77 = load i8*, i8** %76
%78 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %77, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%79 = load i32, i32* @EXIT_FAILURE
%80 = call i32 @exit(i32 %79)
unreachable
81: ; preds = %70
store i8* null, i8** %11
store i32 2, i32* %7
store i32 3, i32* %8
store i32 -1, i32* %6
br label %87
82: ; preds = %64
%83 = load i32, i32* @stderr
%84 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%85 = load i32, i32* @EXIT_FAILURE
%86 = call i32 @exit(i32 %85)
unreachable
87: ; preds = %81
br label %88
88: ; preds = %87, %60
br label %89
89: ; preds = %88, %39
%90 = load i8**, i8*** %5
%91 = load i32, i32* %7
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8*, i8** %90, i64 %92
%94 = load i8*, i8** %93
%95 = call i32* @fopen(i8* %94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %95, i32** %9
%96 = load i32*, i32** %9
%97 = icmp ne i32* %96, null
br i1 %97, label %101, label %98
98: ; preds = %89
%99 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%100 = load i32, i32* @EXIT_FAILURE
store i32 %100, i32* %3
br label %137
101: ; preds = %89
%102 = load i8**, i8*** %5
%103 = load i32, i32* %8
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8*, i8** %102, i64 %104
%106 = load i8*, i8** %105
%107 = call i32* @fopen(i8* %106, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
store i32* %107, i32** %10
%108 = load i32*, i32** %10
%109 = icmp ne i32* %108, null
br i1 %109, label %113, label %110
110: ; preds = %101
%111 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
%112 = load i32, i32* @EXIT_FAILURE
store i32 %112, i32* %3
br label %137
113: ; preds = %101
%114 = load i32*, i32** %9
%115 = load i32*, i32** %10
%116 = load i32, i32* %6
%117 = load i8*, i8** %11
%118 = call i32 @do_crypt(i32* %114, i32* %115, i32 %116, i8* %117)
%119 = icmp ne i32 %118, 0
br i1 %119, label %123, label %120
120: ; preds = %113
%121 = load i32, i32* @stderr
%122 = call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
br label %123
123: ; preds = %120, %113
%124 = load i32*, i32** %10
%125 = call i64 @fclose(i32* %124)
%126 = icmp ne i64 %125, 0
br i1 %126, label %127, label %129
127: ; preds = %123
%128 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0))
br label %129
129: ; preds = %127, %123
%130 = load i32*, i32** %9
%131 = call i64 @fclose(i32* %130)
%132 = icmp ne i64 %131, 0
br i1 %132, label %133, label %135
133: ; preds = %129
%134 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %135
135: ; preds = %133, %129
%136 = load i32, i32* @EXIT_SUCCESS
store i32 %136, i32* %3
br label %137
137: ; preds = %135, %110, %98
%138 = load i32, i32* %3
ret i32 %138
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"usage: %s %s\0A\00"
@.str.1 = [45 x i8] c"<type> <opt key phrase> <in path> <out path>\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"-e\00"
@.str.3 = [37 x i8] c"-e <key phrase> <in path> <out path>\00"
@.str.4 = [3 x i8] c"-d\00"
@.str.5 = [37 x i8] c"-d <key phrase> <in path> <out path>\00"
@.str.6 = [3 x i8] c"-c\00"
@.str.7 = [24 x i8] c"-c <in path> <out path>\00"
@.str.8 = [15 x i8] c"Unkown action\0A\00"
@.str.9 = [3 x i8] c"rb\00"
@.str.10 = [19 x i8] c"infile fopen error\00"
@.str.11 = [4 x i8] c"wb+\00"
@.str.12 = [20 x i8] c"outfile fopen error\00"
@.str.13 = [17 x i8] c"do_crypt failed\0A\00"
@.str.14 = [22 x i8] c"outFile fclose error\0A\00"
@.str.15 = [21 x i8] c"inFile fclose error\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %10
%16 = icmp eq i32 %0, 5
br i1 %16, label %50, label %17
17: ; preds = %15
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %1
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %19, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
%22 = tail call i32 @exit(i32 %21)
unreachable
23: ; preds = %10
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = icmp eq i32 %0, 5
br i1 %27, label %50, label %28
28: ; preds = %26
%29 = load i32, i32* @stderr
%30 = load i8*, i8** %1
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %30, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%32 = load i32, i32* @EXIT_FAILURE
%33 = tail call i32 @exit(i32 %32)
unreachable
34: ; preds = %23
%35 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %45
37: ; preds = %34
%38 = icmp eq i32 %0, 4
br i1 %38, label %54, label %39
39: ; preds = %37
%40 = load i32, i32* @stderr
%41 = load i8*, i8** %1
%42 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %41, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%43 = load i32, i32* @EXIT_FAILURE
%44 = tail call i32 @exit(i32 %43)
unreachable
45: ; preds = %34
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%48 = load i32, i32* @EXIT_FAILURE
%49 = tail call i32 @exit(i32 %48)
unreachable
50: ; preds = %26, %15
%51 = phi i32 [ 1, %15 ], [ 0, %26 ]
%52 = getelementptr inbounds i8*, i8** %1, i64 2
%53 = load i8*, i8** %52
br label %54
54: ; preds = %50, %37
%55 = phi i32 [ -1, %37 ], [ %51, %50 ]
%56 = phi i64 [ 2, %37 ], [ 3, %50 ]
%57 = phi i64 [ 3, %37 ], [ 4, %50 ]
%58 = phi i8* [ null, %37 ], [ %53, %50 ]
%59 = getelementptr inbounds i8*, i8** %1, i64 %56
%60 = load i8*, i8** %59
%61 = tail call i32* @fopen(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%62 = icmp eq i32* %61, null
br i1 %62, label %82, label %63
63: ; preds = %54
%64 = getelementptr inbounds i8*, i8** %1, i64 %57
%65 = load i8*, i8** %64
%66 = tail call i32* @fopen(i8* %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%67 = icmp eq i32* %66, null
br i1 %67, label %82, label %68
68: ; preds = %63
%69 = tail call i32 @do_crypt(i32* %61, i32* %66, i32 %55, i8* %58)
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %68
%72 = load i32, i32* @stderr
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
br label %74
74: ; preds = %71, %68
%75 = tail call i64 @fclose(i32* %66)
%76 = icmp eq i64 %75, 0
br i1 %76, label %79, label %77
77: ; preds = %74
%78 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0))
br label %79
79: ; preds = %77, %74
%80 = tail call i64 @fclose(i32* %61)
%81 = icmp eq i64 %80, 0
br i1 %81, label %86, label %82
82: ; preds = %79, %63, %54
%83 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), %54 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), %63 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), %79 ]
%84 = phi i32* [ @EXIT_FAILURE, %54 ], [ @EXIT_FAILURE, %63 ], [ @EXIT_SUCCESS, %79 ]
%85 = tail call i32 @perror(i8* %83)
br label %86
86: ; preds = %82, %79
%87 = phi i32* [ @EXIT_SUCCESS, %79 ], [ %84, %82 ]
%88 = load i32, i32* %87
ret i32 %88
}