#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 /*<<< orphan*/ F_OK;
int /*<<< orphan*/ R_OK;
int /*<<< orphan*/ W_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char *);
int fxor_stream_xor(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ *, char const *, char const *,
                    char const *);
int /*<<< orphan*/ safe_fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ warn(char *, char const *);
int fxor(const char *in_n, const char *key_n, const char *out_n,
         bool write_from_beginning) {
  FILE *in_fp, *key_fp, *out_fp;
  int r;
  if (access(in_n, R_OK) || access(key_n, R_OK) ||
      (out_n && !access(out_n, F_OK) && access(out_n, W_OK))) {
    if (access(in_n, R_OK)) {
      warn("%s", in_n);
    }
    if (access(key_n, R_OK)) {
      warn("%s", key_n);
    }
    if (out_n && (!access(out_n, F_OK) && access(out_n, W_OK))) {
      warn("%s", out_n);
    }
    return 66;
  }
  in_fp = fopen(in_n, "rb");
  key_fp = fopen(key_n, "rb");
  if (!in_fp || !key_fp) {
    if (!in_fp) {
      warn("%s", in_n);
    }
    if (!key_fp) {
      warn("%s", key_n);
    }
    r = 74;
  } else {
    if (out_n) {
      out_fp = write_from_beginning ? fopen(out_n, "rb+") : fopen(out_n, "wb");
      if (out_fp) {
        r = fxor_stream_xor(in_fp, key_fp, out_fp, in_n, key_n, out_n);
      } else {
        warn("%s", out_n);
        r = 74;
      }
      safe_fclose(out_fp);
    } else {
      r = fxor_stream_xor(in_fp, key_fp, stdout, in_n, key_n, "(stdout)");
    }
  }
  safe_fclose(in_fp);
  safe_fclose(key_fp);
  return r;
}


x86 assembly (clang, -O0):
<fxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e5e(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
jne    11e2 <fxor+0x92>
mov    -0x18(%rbp),%rdi
mov    0x2e42(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
jne    11e2 <fxor+0x92>
cmpq   $0x0,-0x20(%rbp)
je     1299 <fxor+0x149>
mov    -0x20(%rbp),%rdi
mov    0x2e0b(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
jne    1299 <fxor+0x149>
mov    -0x20(%rbp),%rdi
mov    0x2e17(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
je     1299 <fxor+0x149>
mov    -0x10(%rbp),%rdi
mov    0x2de3(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
je     120e <fxor+0xbe>
mov    -0x10(%rbp),%rsi
lea    0xdf7(%rip),%rdi
call   1030 <warn@plt>
mov    -0x18(%rbp),%rdi
mov    0x2db7(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
je     123a <fxor+0xea>
mov    -0x18(%rbp),%rsi
lea    0xdcb(%rip),%rdi
call   1030 <warn@plt>
cmpq   $0x0,-0x20(%rbp)
je     128d <fxor+0x13d>
mov    -0x20(%rbp),%rdi
mov    0x2d70(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
jne    128d <fxor+0x13d>
mov    -0x20(%rbp),%rdi
mov    0x2d7c(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
je     128d <fxor+0x13d>
mov    -0x20(%rbp),%rsi
lea    0xd78(%rip),%rdi
call   1030 <warn@plt>
movl   $0x42,-0x4(%rbp)
jmp    13fe <fxor+0x2ae>
mov    -0x10(%rbp),%rdi
lea    0xd5f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xd4b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     12d7 <fxor+0x187>
cmpq   $0x0,-0x38(%rbp)
jne    1319 <fxor+0x1c9>
cmpq   $0x0,-0x30(%rbp)
jne    12f2 <fxor+0x1a2>
mov    -0x10(%rbp),%rsi
lea    0xd13(%rip),%rdi
call   1030 <warn@plt>
cmpq   $0x0,-0x38(%rbp)
jne    130d <fxor+0x1bd>
mov    -0x18(%rbp),%rsi
lea    0xcf8(%rip),%rdi
call   1030 <warn@plt>
movl   $0x4a,-0x44(%rbp)
jmp    13e6 <fxor+0x296>
cmpq   $0x0,-0x20(%rbp)
je     13b8 <fxor+0x268>
cmpl   $0x0,-0x24(%rbp)
je     1347 <fxor+0x1f7>
mov    -0x20(%rbp),%rdi
lea    0xccd(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x50(%rbp)
jmp    135b <fxor+0x20b>
mov    -0x20(%rbp),%rdi
lea    0xcb8(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1393 <fxor+0x243>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1040 <fxor_stream_xor@plt>
mov    %eax,-0x44(%rbp)
jmp    13aa <fxor+0x25a>
mov    -0x20(%rbp),%rsi
lea    0xc62(%rip),%rdi
call   1030 <warn@plt>
movl   $0x4a,-0x44(%rbp)
mov    -0x40(%rbp),%rdi
call   1070 <safe_fclose@plt>
jmp    13e1 <fxor+0x291>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    0x2c11(%rip),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xc34(%rip),%r9
call   1040 <fxor_stream_xor@plt>
mov    %eax,-0x44(%rbp)
jmp    13e6 <fxor+0x296>
mov    -0x30(%rbp),%rdi
call   1070 <safe_fclose@plt>
mov    -0x38(%rbp),%rdi
call   1070 <safe_fclose@plt>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0x2e62(%rip),%rbp
mov    0x0(%rbp),%esi
call   1050 <access@plt>
test   %rax,%rax
jne    118f <fxor+0x3f>
mov    0x0(%rbp),%esi
mov    %r15,%rdi
call   1050 <access@plt>
test   %rax,%rax
je     1223 <fxor+0xd3>
mov    0x0(%rbp),%esi
mov    %rbx,%rdi
call   1050 <access@plt>
test   %rax,%rax
je     11ae <fxor+0x5e>
lea    0xe5a(%rip),%rdi
mov    %rbx,%rsi
call   1030 <warn@plt>
mov    0x0(%rbp),%esi
mov    %r15,%rdi
call   1050 <access@plt>
test   %rax,%rax
je     11cd <fxor+0x7d>
lea    0xe3b(%rip),%rdi
mov    %r15,%rsi
call   1030 <warn@plt>
mov    $0x42,%ebx
test   %r14,%r14
je     135f <fxor+0x20f>
mov    0x2dde(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1050 <access@plt>
test   %rax,%rax
jne    135f <fxor+0x20f>
mov    0x2dec(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1050 <access@plt>
test   %rax,%rax
je     135f <fxor+0x20f>
lea    0xdea(%rip),%rdi
mov    %r14,%rsi
call   1030 <warn@plt>
jmp    135f <fxor+0x20f>
test   %r14,%r14
je     1242 <fxor+0xf2>
mov    0x2d91(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1050 <access@plt>
test   %rax,%rax
je     12ee <fxor+0x19e>
lea    0xdba(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <fopen@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    %r13,%rsi
call   1060 <fopen@plt>
mov    %rax,%r13
test   %rbp,%rbp
je     12bf <fxor+0x16f>
test   %r13,%r13
je     12bf <fxor+0x16f>
test   %r14,%r14
je     130d <fxor+0x1bd>
test   %r12d,%r12d
lea    0xd88(%rip),%rax
lea    0xd7d(%rip),%rsi
cmove  %rax,%rsi
mov    %r14,%rdi
call   1060 <fopen@plt>
mov    %rax,%r12
test   %rax,%rax
je     1333 <fxor+0x1e3>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1040 <fxor_stream_xor@plt>
mov    %eax,%ebx
jmp    1347 <fxor+0x1f7>
test   %rbp,%rbp
jne    12d3 <fxor+0x183>
lea    0xd35(%rip),%rdi
mov    %rbx,%rsi
call   1030 <warn@plt>
mov    $0x4a,%ebx
test   %r13,%r13
jne    134f <fxor+0x1ff>
lea    0xd1c(%rip),%rdi
mov    %r15,%rsi
call   1030 <warn@plt>
jmp    134f <fxor+0x1ff>
mov    0x2cf3(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1050 <access@plt>
test   %rax,%rax
jne    118f <fxor+0x3f>
jmp    1242 <fxor+0xf2>
mov    0x2cc4(%rip),%rax
mov    (%rax),%rdx
lea    0xcef(%rip),%r9
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %rbx,%rcx
mov    %r15,%r8
call   1040 <fxor_stream_xor@plt>
mov    %eax,%ebx
jmp    134f <fxor+0x1ff>
lea    0xcc6(%rip),%rdi
mov    %r14,%rsi
call   1030 <warn@plt>
mov    $0x4a,%ebx
mov    %r12,%rdi
call   1070 <safe_fclose@plt>
mov    %rbp,%rdi
call   1070 <safe_fclose@plt>
mov    %r13,%rdi
call   1070 <safe_fclose@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@R_OK = global i32 0
@F_OK = global i32 0
@W_OK = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [4 x i8] c"rb+\00"
@.str.3 = [3 x i8] c"wb\00"
@stdout = global i32* null
@.str.4 = [9 x i8] c"(stdout)\00"
define i32 @fxor(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = load i32, i32* @R_OK
%6 = tail call i64 @access(i8* %0, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %4
%9 = load i32, i32* @R_OK
%10 = tail call i64 @access(i8* %1, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = icmp eq i8* %2, null
br i1 %13, label %46, label %14
14: ; preds = %12
%15 = load i32, i32* @F_OK
%16 = tail call i64 @access(i8* %2, i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %46
18: ; preds = %14
%19 = load i32, i32* @W_OK
%20 = tail call i64 @access(i8* %2, i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %46, label %22
22: ; preds = %18, %8, %4
%23 = load i32, i32* @R_OK
%24 = tail call i64 @access(i8* %0, i32 %23)
%25 = icmp eq i64 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = tail call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %28
28: ; preds = %26, %22
%29 = load i32, i32* @R_OK
%30 = tail call i64 @access(i8* %1, i32 %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %28
%33 = tail call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %34
34: ; preds = %32, %28
%35 = icmp eq i8* %2, null
br i1 %35, label %78, label %36
36: ; preds = %34
%37 = load i32, i32* @F_OK
%38 = tail call i64 @access(i8* %2, i32 %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %78
40: ; preds = %36
%41 = load i32, i32* @W_OK
%42 = tail call i64 @access(i8* %2, i32 %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %78, label %44
44: ; preds = %40
%45 = tail call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %78
46: ; preds = %18, %14, %12
%47 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%48 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%49 = icmp ne i32* %47, null
%50 = icmp ne i32* %48, null
%51 = and i1 %49, %50
br i1 %51, label %58, label %52
52: ; preds = %46
br i1 %49, label %55, label %53
53: ; preds = %52
%54 = tail call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %55
55: ; preds = %53, %52
br i1 %50, label %74, label %56
56: ; preds = %55
%57 = tail call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %74
58: ; preds = %46
br i1 %13, label %71, label %59
59: ; preds = %58
%60 = icmp eq i32 %3, 0
%61 = select i1 %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%62 = tail call i32* @fopen(i8* %2, i8* %61)
%63 = icmp eq i32* %62, null
br i1 %63, label %66, label %64
64: ; preds = %59
%65 = tail call i32 @fxor_stream_xor(i32* %47, i32* %48, i32* %62, i8* %0, i8* %1, i8* %2)
br label %68
66: ; preds = %59
%67 = tail call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %68
68: ; preds = %66, %64
%69 = phi i32 [ %65, %64 ], [ 74, %66 ]
%70 = tail call i32 @safe_fclose(i32* %62)
br label %74
71: ; preds = %58
%72 = load i32*, i32** @stdout
%73 = tail call i32 @fxor_stream_xor(i32* %47, i32* %48, i32* %72, i8* %0, i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %74
74: ; preds = %55, %56, %68, %71
%75 = phi i32 [ %69, %68 ], [ %73, %71 ], [ 74, %56 ], [ 74, %55 ]
%76 = tail call i32 @safe_fclose(i32* %47)
%77 = tail call i32 @safe_fclose(i32* %48)
br label %78
78: ; preds = %34, %36, %40, %44, %74
%79 = phi i32 [ %75, %74 ], [ 66, %44 ], [ 66, %40 ], [ 66, %36 ], [ 66, %34 ]
ret i32 %79
}