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


x86 assembly (clang, -O0):
<parse_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1154 <parse_mode+0x44>
mov    -0x10(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1181 <parse_mode+0x71>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    0x2e43(%rip),%rax
mov    (%rax),%eax
mov    0x2e32(%rip),%rcx
or     (%rcx),%eax
mov    0x2e81(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    13a9 <parse_mode+0x299>
mov    -0x10(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11cf <parse_mode+0xbf>
mov    -0x10(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11cf <parse_mode+0xbf>
mov    -0x10(%rbp),%rdi
lea    0xe4c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11fc <parse_mode+0xec>
mov    -0x18(%rbp),%rax
movl   $0x6,(%rax)
mov    0x2df8(%rip),%rax
mov    (%rax),%eax
mov    0x2db7(%rip),%rcx
or     (%rcx),%eax
mov    0x2e06(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    13a9 <parse_mode+0x299>
mov    -0x10(%rbp),%rdi
lea    0xe09(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1230 <parse_mode+0x120>
mov    -0x10(%rbp),%rdi
lea    0xdf1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    124b <parse_mode+0x13b>
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    0x2d8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13a9 <parse_mode+0x299>
mov    -0x10(%rbp),%rdi
lea    0xdbf(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1299 <parse_mode+0x189>
mov    -0x10(%rbp),%rdi
lea    0xda8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1299 <parse_mode+0x189>
mov    -0x10(%rbp),%rdi
lea    0xd92(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12b4 <parse_mode+0x1a4>
mov    -0x18(%rbp),%rax
movl   $0x6,(%rax)
mov    0x2d2e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13a9 <parse_mode+0x299>
mov    -0x10(%rbp),%rdi
lea    0xd61(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     12e8 <parse_mode+0x1d8>
mov    -0x10(%rbp),%rdi
lea    0xd49(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1315 <parse_mode+0x205>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    0x2caf(%rip),%rax
mov    (%rax),%eax
mov    0x2cf6(%rip),%rcx
or     (%rcx),%eax
mov    0x2ce5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    13a9 <parse_mode+0x299>
mov    -0x10(%rbp),%rdi
lea    0xd05(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1363 <parse_mode+0x253>
mov    -0x10(%rbp),%rdi
lea    0xcee(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1363 <parse_mode+0x253>
mov    -0x10(%rbp),%rdi
lea    0xcd8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1390 <parse_mode+0x280>
mov    -0x18(%rbp),%rax
movl   $0x6,(%rax)
mov    0x2c64(%rip),%rax
mov    (%rax),%eax
mov    0x2c7b(%rip),%rcx
or     (%rcx),%eax
mov    0x2c6a(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    13a9 <parse_mode+0x299>
mov    0x2c21(%rip),%rax
mov    (%rax),%ecx
mov    0x2c20(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_mode>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1298 <parse_mode+0x188>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1298 <parse_mode+0x188>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12a8 <parse_mode+0x198>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12a8 <parse_mode+0x198>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12a8 <parse_mode+0x198>
lea    0xe7a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12d2 <parse_mode+0x1c2>
lea    0xe64(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12d2 <parse_mode+0x1c2>
lea    0xe4f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12e4 <parse_mode+0x1d4>
lea    0xe3a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12e4 <parse_mode+0x1d4>
lea    0xe26(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12e4 <parse_mode+0x1d4>
lea    0xe12(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12f6 <parse_mode+0x1e6>
lea    0xdfc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12f6 <parse_mode+0x1e6>
lea    0xde7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1306 <parse_mode+0x1f6>
lea    0xdd2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1306 <parse_mode+0x1f6>
lea    0xdbe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1306 <parse_mode+0x1f6>
mov    0x2d32(%rip),%rax
mov    (%rax),%eax
mov    0x2d31(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
jmp    12ca <parse_mode+0x1ba>
movl   $0x4,(%r14)
mov    0x2d02(%rip),%rcx
jmp    12b6 <parse_mode+0x1a6>
movl   $0x6,(%r14)
mov    0x2d22(%rip),%rcx
mov    0x2ce3(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2d30(%rip),%rcx
or     (%rcx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
movl   $0x2,(%r14)
mov    0x2cf0(%rip),%rax
mov    (%rax),%eax
jmp    12ca <parse_mode+0x1ba>
movl   $0x6,(%r14)
mov    0x2ce6(%rip),%rax
mov    (%rax),%eax
jmp    12ca <parse_mode+0x1ba>
movl   $0x4,(%r14)
mov    0x2ca4(%rip),%rcx
jmp    1314 <parse_mode+0x204>
movl   $0x6,(%r14)
mov    0x2cc4(%rip),%rcx
mov    0x2cdd(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2cca(%rip),%rcx
jmp    12c8 <parse_mode+0x1b8>

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

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