#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 O_APPEND;
int O_CREAT;
int O_RDONLY;
int O_RDWR;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ strcmp(char const *, char *);
int parse_mode(const char *mode) {
  if (!strcmp(mode, "r"))
    return O_RDONLY;
  if (!strcmp(mode, "rb"))
    return O_RDONLY | 0;
  if (!strcmp(mode, "r+"))
    return O_RDWR;
  if (!strcmp(mode, "rb+") || !strcmp(mode, "r+b"))
    return O_RDWR | 0;
  if (!strcmp(mode, "w"))
    return O_WRONLY | O_CREAT | O_TRUNC;
  if (!strcmp(mode, "wb"))
    return O_WRONLY | O_CREAT | O_TRUNC | 0;
  if (!strcmp(mode, "w+"))
    return O_RDWR | O_CREAT | O_TRUNC;
  if (!strcmp(mode, "wb+") || !strcmp(mode, "w+b"))
    return O_RDWR | O_CREAT | O_TRUNC | 0;
  if (!strcmp(mode, "a"))
    return O_WRONLY | O_CREAT | O_APPEND;
  if (!strcmp(mode, "ab"))
    return O_WRONLY | O_CREAT | O_APPEND | 0;
  if (!strcmp(mode, "a+"))
    return O_RDWR | O_CREAT | O_APPEND;
  if (!strcmp(mode, "ab+") || !strcmp(mode, "a+b"))
    return O_RDWR | O_CREAT | O_APPEND | 0;
  return -1;
}


x86 assembly (clang, -O0):
<parse_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1146 <parse_mode+0x36>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1173 <parse_mode+0x63>
mov    0x2e6a(%rip),%rax
mov    (%rax),%eax
or     $0x0,%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    119d <parse_mode+0x8d>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     11cf <parse_mode+0xbf>
mov    -0x10(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11e3 <parse_mode+0xd3>
mov    0x2e02(%rip),%rax
mov    (%rax),%eax
or     $0x0,%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xe22(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    121f <parse_mode+0x10f>
mov    0x2db5(%rip),%rax
mov    (%rax),%eax
mov    0x2dec(%rip),%rcx
or     (%rcx),%eax
mov    0x2ddb(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xde8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    125e <parse_mode+0x14e>
mov    0x2d79(%rip),%rax
mov    (%rax),%eax
mov    0x2db0(%rip),%rcx
or     (%rcx),%eax
mov    0x2d9f(%rip),%rcx
or     (%rcx),%eax
or     $0x0,%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xdac(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    129a <parse_mode+0x18a>
mov    0x2d5a(%rip),%rax
mov    (%rax),%eax
mov    0x2d71(%rip),%rcx
or     (%rcx),%eax
mov    0x2d60(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xd73(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     12cc <parse_mode+0x1bc>
mov    -0x10(%rbp),%rdi
lea    0xd5e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    12f2 <parse_mode+0x1e2>
mov    0x2d05(%rip),%rax
mov    (%rax),%eax
mov    0x2d1c(%rip),%rcx
or     (%rcx),%eax
mov    0x2d0b(%rip),%rcx
or     (%rcx),%eax
or     $0x0,%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xd23(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    132e <parse_mode+0x21e>
mov    0x2ca6(%rip),%rax
mov    (%rax),%eax
mov    0x2cdd(%rip),%rcx
or     (%rcx),%eax
mov    0x2c8c(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xce9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    136d <parse_mode+0x25d>
mov    0x2c6a(%rip),%rax
mov    (%rax),%eax
mov    0x2ca1(%rip),%rcx
or     (%rcx),%eax
mov    0x2c50(%rip),%rcx
or     (%rcx),%eax
or     $0x0,%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xcad(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    13a9 <parse_mode+0x299>
mov    0x2c4b(%rip),%rax
mov    (%rax),%eax
mov    0x2c62(%rip),%rcx
or     (%rcx),%eax
mov    0x2c11(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
mov    -0x10(%rbp),%rdi
lea    0xc74(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     13db <parse_mode+0x2cb>
mov    -0x10(%rbp),%rdi
lea    0xc5f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1401 <parse_mode+0x2f1>
mov    0x2bf6(%rip),%rax
mov    (%rax),%eax
mov    0x2c0d(%rip),%rcx
or     (%rcx),%eax
mov    0x2bbc(%rip),%rcx
or     (%rcx),%eax
or     $0x0,%eax
mov    %eax,-0x4(%rbp)
jmp    1408 <parse_mode+0x2f8>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_mode>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     126e <parse_mode+0x15e>
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     126e <parse_mode+0x15e>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1277 <parse_mode+0x167>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1277 <parse_mode+0x167>
lea    0xe98(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1277 <parse_mode+0x167>
lea    0xe85(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1282 <parse_mode+0x172>
lea    0xe70(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1282 <parse_mode+0x172>
lea    0xe5c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     128b <parse_mode+0x17b>
lea    0xe48(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     128b <parse_mode+0x17b>
lea    0xe35(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     128b <parse_mode+0x17b>
lea    0xe22(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12a8 <parse_mode+0x198>
lea    0xe0d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12a8 <parse_mode+0x198>
lea    0xdf9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1265 <parse_mode+0x155>
lea    0xde9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1265 <parse_mode+0x155>
lea    0xdda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
jne    12a6 <parse_mode+0x196>
mov    0x2d6c(%rip),%rcx
jmp    12af <parse_mode+0x19f>
mov    0x2d5b(%rip),%rax
jmp    127e <parse_mode+0x16e>
mov    0x2d5a(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret
mov    0x2d2f(%rip),%rcx
jmp    1292 <parse_mode+0x182>
mov    0x2d46(%rip),%rcx
mov    0x2d5f(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2d4c(%rip),%rcx
or     (%rcx),%eax
pop    %rbx
ret
mov    0x2d09(%rip),%rcx
mov    0x2d42(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2cef(%rip),%rcx
jmp    12a4 <parse_mode+0x194>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@O_RDONLY = global i32 0
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"r+\00"
@O_RDWR = global i32 0
@.str.3 = [4 x i8] c"rb+\00"
@.str.4 = [4 x i8] c"r+b\00"
@.str.5 = [2 x i8] c"w\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@.str.6 = [3 x i8] c"wb\00"
@.str.7 = [3 x i8] c"w+\00"
@.str.8 = [4 x i8] c"wb+\00"
@.str.9 = [4 x i8] c"w+b\00"
@.str.10 = [2 x i8] c"a\00"
@O_APPEND = global i32 0
@.str.11 = [3 x i8] c"ab\00"
@.str.12 = [3 x i8] c"a+\00"
@.str.13 = [4 x i8] c"ab+\00"
@.str.14 = [4 x i8] c"a+b\00"
define i32 @parse_mode(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32, i32* @O_RDONLY
store i32 %8, i32* %2
br label %126
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %9
%14 = load i32, i32* @O_RDONLY
%15 = or i32 %14, 0
store i32 %15, i32* %2
br label %126
16: ; preds = %9
%17 = load i8*, i8** %3
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %16
%21 = load i32, i32* @O_RDWR
store i32 %21, i32* %2
br label %126
22: ; preds = %16
%23 = load i8*, i8** %3
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8*, i8** %3
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %26, %22
%31 = load i32, i32* @O_RDWR
%32 = or i32 %31, 0
store i32 %32, i32* %2
br label %126
33: ; preds = %26
%34 = load i8*, i8** %3
%35 = call i32 @strcmp(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp ne i32 %35, 0
br i1 %36, label %43, label %37
37: ; preds = %33
%38 = load i32, i32* @O_WRONLY
%39 = load i32, i32* @O_CREAT
%40 = or i32 %38, %39
%41 = load i32, i32* @O_TRUNC
%42 = or i32 %40, %41
store i32 %42, i32* %2
br label %126
43: ; preds = %33
%44 = load i8*, i8** %3
%45 = call i32 @strcmp(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %54, label %47
47: ; preds = %43
%48 = load i32, i32* @O_WRONLY
%49 = load i32, i32* @O_CREAT
%50 = or i32 %48, %49
%51 = load i32, i32* @O_TRUNC
%52 = or i32 %50, %51
%53 = or i32 %52, 0
store i32 %53, i32* %2
br label %126
54: ; preds = %43
%55 = load i8*, i8** %3
%56 = call i32 @strcmp(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%57 = icmp ne i32 %56, 0
br i1 %57, label %64, label %58
58: ; preds = %54
%59 = load i32, i32* @O_RDWR
%60 = load i32, i32* @O_CREAT
%61 = or i32 %59, %60
%62 = load i32, i32* @O_TRUNC
%63 = or i32 %61, %62
store i32 %63, i32* %2
br label %126
64: ; preds = %54
%65 = load i8*, i8** %3
%66 = call i32 @strcmp(i8* %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %64
%69 = load i8*, i8** %3
%70 = call i32 @strcmp(i8* %69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%71 = icmp ne i32 %70, 0
br i1 %71, label %79, label %72
72: ; preds = %68, %64
%73 = load i32, i32* @O_RDWR
%74 = load i32, i32* @O_CREAT
%75 = or i32 %73, %74
%76 = load i32, i32* @O_TRUNC
%77 = or i32 %75, %76
%78 = or i32 %77, 0
store i32 %78, i32* %2
br label %126
79: ; preds = %68
%80 = load i8*, i8** %3
%81 = call i32 @strcmp(i8* %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%82 = icmp ne i32 %81, 0
br i1 %82, label %89, label %83
83: ; preds = %79
%84 = load i32, i32* @O_WRONLY
%85 = load i32, i32* @O_CREAT
%86 = or i32 %84, %85
%87 = load i32, i32* @O_APPEND
%88 = or i32 %86, %87
store i32 %88, i32* %2
br label %126
89: ; preds = %79
%90 = load i8*, i8** %3
%91 = call i32 @strcmp(i8* %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%92 = icmp ne i32 %91, 0
br i1 %92, label %100, label %93
93: ; preds = %89
%94 = load i32, i32* @O_WRONLY
%95 = load i32, i32* @O_CREAT
%96 = or i32 %94, %95
%97 = load i32, i32* @O_APPEND
%98 = or i32 %96, %97
%99 = or i32 %98, 0
store i32 %99, i32* %2
br label %126
100: ; preds = %89
%101 = load i8*, i8** %3
%102 = call i32 @strcmp(i8* %101, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%103 = icmp ne i32 %102, 0
br i1 %103, label %110, label %104
104: ; preds = %100
%105 = load i32, i32* @O_RDWR
%106 = load i32, i32* @O_CREAT
%107 = or i32 %105, %106
%108 = load i32, i32* @O_APPEND
%109 = or i32 %107, %108
store i32 %109, i32* %2
br label %126
110: ; preds = %100
%111 = load i8*, i8** %3
%112 = call i32 @strcmp(i8* %111, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %118
114: ; preds = %110
%115 = load i8*, i8** %3
%116 = call i32 @strcmp(i8* %115, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%117 = icmp ne i32 %116, 0
br i1 %117, label %125, label %118
118: ; preds = %114, %110
%119 = load i32, i32* @O_RDWR
%120 = load i32, i32* @O_CREAT
%121 = or i32 %119, %120
%122 = load i32, i32* @O_APPEND
%123 = or i32 %121, %122
%124 = or i32 %123, 0
store i32 %124, i32* %2
br label %126
125: ; preds = %114
store i32 -1, i32* %2
br label %126
126: ; preds = %125, %118, %104, %93, %83, %72, %58, %47, %37, %30, %20, %13, %7
%127 = load i32, i32* %2
ret i32 %127
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@O_RDONLY = global i32 0
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"r+\00"
@O_RDWR = global i32 0
@.str.3 = [4 x i8] c"rb+\00"
@.str.4 = [4 x i8] c"r+b\00"
@.str.5 = [2 x i8] c"w\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@.str.6 = [3 x i8] c"wb\00"
@.str.7 = [3 x i8] c"w+\00"
@.str.8 = [4 x i8] c"wb+\00"
@.str.9 = [4 x i8] c"w+b\00"
@.str.10 = [2 x i8] c"a\00"
@O_APPEND = global i32 0
@.str.11 = [3 x i8] c"ab\00"
@.str.12 = [3 x i8] c"a+\00"
@.str.13 = [4 x i8] c"ab+\00"
@.str.14 = [4 x i8] c"a+b\00"
define i32 @parse_mode(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32, i32* @O_RDONLY
br label %102
6: ; preds = %1
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i32, i32* @O_RDONLY
br label %102
11: ; preds = %6
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32, i32* @O_RDWR
br label %102
16: ; preds = %11
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19, %16
%23 = load i32, i32* @O_RDWR
br label %102
24: ; preds = %19
%25 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32, i32* @O_WRONLY
%29 = load i32, i32* @O_CREAT
%30 = or i32 %29, %28
%31 = load i32, i32* @O_TRUNC
%32 = or i32 %30, %31
br label %102
33: ; preds = %24
%34 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %42
36: ; preds = %33
%37 = load i32, i32* @O_WRONLY
%38 = load i32, i32* @O_CREAT
%39 = or i32 %38, %37
%40 = load i32, i32* @O_TRUNC
%41 = or i32 %39, %40
br label %102
42: ; preds = %33
%43 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %42
%46 = load i32, i32* @O_RDWR
%47 = load i32, i32* @O_CREAT
%48 = or i32 %47, %46
%49 = load i32, i32* @O_TRUNC
%50 = or i32 %48, %49
br label %102
51: ; preds = %42
%52 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %51
%55 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %63
57: ; preds = %54, %51
%58 = load i32, i32* @O_RDWR
%59 = load i32, i32* @O_CREAT
%60 = or i32 %59, %58
%61 = load i32, i32* @O_TRUNC
%62 = or i32 %60, %61
br label %102
63: ; preds = %54
%64 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %72
66: ; preds = %63
%67 = load i32, i32* @O_WRONLY
%68 = load i32, i32* @O_CREAT
%69 = or i32 %68, %67
%70 = load i32, i32* @O_APPEND
%71 = or i32 %69, %70
br label %102
72: ; preds = %63
%73 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %81
75: ; preds = %72
%76 = load i32, i32* @O_WRONLY
%77 = load i32, i32* @O_CREAT
%78 = or i32 %77, %76
%79 = load i32, i32* @O_APPEND
%80 = or i32 %78, %79
br label %102
81: ; preds = %72
%82 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %90
84: ; preds = %81
%85 = load i32, i32* @O_RDWR
%86 = load i32, i32* @O_CREAT
%87 = or i32 %86, %85
%88 = load i32, i32* @O_APPEND
%89 = or i32 %87, %88
br label %102
90: ; preds = %81
%91 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%92 = icmp eq i32 %91, 0
br i1 %92, label %96, label %93
93: ; preds = %90
%94 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%95 = icmp eq i32 %94, 0
br i1 %95, label %96, label %102
96: ; preds = %93, %90
%97 = load i32, i32* @O_RDWR
%98 = load i32, i32* @O_CREAT
%99 = or i32 %98, %97
%100 = load i32, i32* @O_APPEND
%101 = or i32 %99, %100
br label %102
102: ; preds = %93, %96, %84, %75, %66, %57, %45, %36, %27, %22, %14, %9, %4
%103 = phi i32 [ %101, %96 ], [ %89, %84 ], [ %80, %75 ], [ %71, %66 ], [ %62, %57 ], [ %50, %45 ], [ %41, %36 ], [ %32, %27 ], [ %23, %22 ], [ %15, %14 ], [ %10, %9 ], [ %5, %4 ], [ -1, %93 ]
ret i32 %103
}