#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 */
scalar_t__ encrypt_read();
scalar_t__ encrypt_write();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  int ret = -1;
  ret = -1;
  if (!strcmp(argv[1], "w")) {
    if (!strcmp(argv[2], "r")) {
      if (!strcmp(argv[3], "i")) {
        if (!strcmp(argv[4], "t")) {
          if (!strcmp(argv[5], "e")) {
            printf("encrypt_write\n");
            if (encrypt_write() == 0) {
              ret = 0;
            }
          }
        }
      }
    }
  } else {
    if (!strcmp(argv[1], "r")) {
      if (!strcmp(argv[2], "e")) {
        if (!strcmp(argv[3], "a")) {
          if (!strcmp(argv[4], "d")) {
            printf("encrypt_read\n");
            if (encrypt_read() == 0) {
              ret = 0;
            }
          }
        }
      }
    }
  }
  printf("ret=%d\n", ret);
  return ret;
}


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)
movl   $0xffffffff,-0x14(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1234 <main+0xf4>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe72(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    122f <main+0xef>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe57(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    122a <main+0xea>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xe3c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1225 <main+0xe5>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
lea    0xe21(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1220 <main+0xe0>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <encrypt_write@plt>
cmp    $0x0,%rax
jne    121b <main+0xdb>
movl   $0x0,-0x14(%rbp)
jmp    1220 <main+0xe0>
jmp    1225 <main+0xe5>
jmp    122a <main+0xea>
jmp    122f <main+0xef>
jmp    12e7 <main+0x1a7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdbf(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12e2 <main+0x1a2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xda8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12dd <main+0x19d>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd9c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12d8 <main+0x198>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xd81(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12d3 <main+0x193>
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <encrypt_read@plt>
cmp    $0x0,%rax
jne    12ce <main+0x18e>
movl   $0x0,-0x14(%rbp)
jmp    12d3 <main+0x193>
jmp    12d8 <main+0x198>
jmp    12dd <main+0x19d>
jmp    12e2 <main+0x1a2>
jmp    12e7 <main+0x1a7>
mov    -0x14(%rbp),%esi
lea    0xd3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rbp
lea    0xe9f(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     11e6 <main+0x96>
lea    0xe8e(%rip),%rsi
mov    %rbp,%rdi
call   1060 <strcmp@plt>
mov    $0xffffffff,%ebp
test   %eax,%eax
jne    1253 <main+0x103>
mov    0x10(%rbx),%rdi
lea    0xe8a(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1253 <main+0x103>
mov    0x18(%rbx),%rdi
lea    0xe5c(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1253 <main+0x103>
mov    0x20(%rbx),%rdi
lea    0xe67(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1253 <main+0x103>
lea    0xe48(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <encrypt_read@plt>
jmp    124e <main+0xfe>
mov    0x10(%rbx),%rdi
lea    0xe11(%rip),%rsi
call   1060 <strcmp@plt>
mov    $0xffffffff,%ebp
test   %eax,%eax
jne    1253 <main+0x103>
mov    0x18(%rbx),%rdi
lea    0xdfa(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1253 <main+0x103>
mov    0x20(%rbx),%rdi
lea    0xde8(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1253 <main+0x103>
mov    0x28(%rbx),%rdi
lea    0xdec(%rip),%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1253 <main+0x103>
lea    0xdd0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <encrypt_write@plt>
neg    %rax
sbb    %ebp,%ebp
lea    0xdb0(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"i\00"
@.str.3 = [2 x i8] c"t\00"
@.str.4 = [2 x i8] c"e\00"
@.str.5 = [15 x i8] c"encrypt_write\0A\00"
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [2 x i8] c"d\00"
@.str.8 = [14 x i8] c"encrypt_read\0A\00"
@.str.9 = [8 x i8] c"ret=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
store i32 -1, i32* %6
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %46, label %12
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @strcmp(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
br i1 %17, label %45, label %18
18: ; preds = %12
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 3
%21 = load i8*, i8** %20
%22 = call i32 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %44, label %24
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 4
%27 = load i8*, i8** %26
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %43, label %30
30: ; preds = %24
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 5
%33 = load i8*, i8** %32
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %42, label %36
36: ; preds = %30
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%38 = call i64 (...) @encrypt_write()
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %36
store i32 0, i32* %6
br label %41
41: ; preds = %40, %36
br label %42
42: ; preds = %41, %30
br label %43
43: ; preds = %42, %24
br label %44
44: ; preds = %43, %18
br label %45
45: ; preds = %44, %12
br label %80
46: ; preds = %2
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = call i32 @strcmp(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%51 = icmp ne i32 %50, 0
br i1 %51, label %79, label %52
52: ; preds = %46
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 2
%55 = load i8*, i8** %54
%56 = call i32 @strcmp(i8* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp ne i32 %56, 0
br i1 %57, label %78, label %58
58: ; preds = %52
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 3
%61 = load i8*, i8** %60
%62 = call i32 @strcmp(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%63 = icmp ne i32 %62, 0
br i1 %63, label %77, label %64
64: ; preds = %58
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 4
%67 = load i8*, i8** %66
%68 = call i32 @strcmp(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%69 = icmp ne i32 %68, 0
br i1 %69, label %76, label %70
70: ; preds = %64
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%72 = call i64 (...) @encrypt_read()
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %75
74: ; preds = %70
store i32 0, i32* %6
br label %75
75: ; preds = %74, %70
br label %76
76: ; preds = %75, %64
br label %77
77: ; preds = %76, %58
br label %78
78: ; preds = %77, %52
br label %79
79: ; preds = %78, %46
br label %80
80: ; preds = %79, %45
%81 = load i32, i32* %6
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %81)
%83 = load i32, i32* %6
ret i32 %83
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"i\00"
@.str.3 = [2 x i8] c"t\00"
@.str.4 = [2 x i8] c"e\00"
@.str.6 = [2 x i8] c"a\00"
@.str.7 = [2 x i8] c"d\00"
@.str.9 = [8 x i8] c"ret=%d\0A\00"
@str = [14 x i8] c"encrypt_write\00"
@str.10 = [13 x i8] c"encrypt_read\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %32
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %9, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %55
12: ; preds = %7
%13 = getelementptr inbounds i8*, i8** %1, i64 3
%14 = load i8*, i8** %13
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %14, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %55
17: ; preds = %12
%18 = getelementptr inbounds i8*, i8** %1, i64 4
%19 = load i8*, i8** %18
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %19, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %55
22: ; preds = %17
%23 = getelementptr inbounds i8*, i8** %1, i64 5
%24 = load i8*, i8** %23
%25 = tail call i32 @strcmp(i8* dereferenceable(1) %24, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %55
27: ; preds = %22
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%29 = tail call i64 (...) @encrypt_write()
%30 = icmp ne i64 %29, 0
%31 = sext i1 %30 to i32
br label %55
32: ; preds = %2
%33 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %55
35: ; preds = %32
%36 = getelementptr inbounds i8*, i8** %1, i64 2
%37 = load i8*, i8** %36
%38 = tail call i32 @strcmp(i8* dereferenceable(1) %37, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %55
40: ; preds = %35
%41 = getelementptr inbounds i8*, i8** %1, i64 3
%42 = load i8*, i8** %41
%43 = tail call i32 @strcmp(i8* dereferenceable(1) %42, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %55
45: ; preds = %40
%46 = getelementptr inbounds i8*, i8** %1, i64 4
%47 = load i8*, i8** %46
%48 = tail call i32 @strcmp(i8* dereferenceable(1) %47, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %55
50: ; preds = %45
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.10, i64 0, i64 0))
%52 = tail call i64 (...) @encrypt_read()
%53 = icmp ne i64 %52, 0
%54 = sext i1 %53 to i32
br label %55
55: ; preds = %50, %27, %32, %40, %45, %35, %7, %17, %22, %12
%56 = phi i32 [ -1, %32 ], [ -1, %35 ], [ -1, %40 ], [ -1, %45 ], [ -1, %7 ], [ -1, %12 ], [ -1, %17 ], [ -1, %22 ], [ %31, %27 ], [ %54, %50 ]
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %56)
ret i32 %56
}