#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*/ cparsepp_file_fd(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *r_sandbox_fopen(char const *, char *);
void cparsepp_file(const char *infile, const char *outfile) {
  FILE *in = r_sandbox_fopen(infile, "r");
  FILE *out = r_sandbox_fopen(outfile, "w");
  if (in && out)
    cparsepp_file_fd(in, out);
  fclose(in);
  fclose(out);
}


x86 assembly (clang, -O0):
<cparsepp_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <r_sandbox_fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <r_sandbox_fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118b <cparsepp_file+0x5b>
cmpq   $0x0,-0x20(%rbp)
je     118b <cparsepp_file+0x5b>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <cparsepp_file_fd@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cparsepp_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xec2(%rip),%rsi
call   1030 <r_sandbox_fopen@plt>
mov    %rax,%r14
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <r_sandbox_fopen@plt>
mov    %rax,%rbx
test   %r14,%r14
je     116d <cparsepp_file+0x3d>
test   %rbx,%rbx
je     116d <cparsepp_file+0x3d>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <cparsepp_file_fd@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"w\00"
define void @cparsepp_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32* @r_sandbox_fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = call i32* @r_sandbox_fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %20
13: ; preds = %2
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i32*, i32** %5
%18 = load i32*, i32** %6
%19 = call i32 @cparsepp_file_fd(i32* %17, i32* %18)
br label %20
20: ; preds = %16, %13, %2
%21 = load i32*, i32** %5
%22 = call i32 @fclose(i32* %21)
%23 = load i32*, i32** %6
%24 = call i32 @fclose(i32* %23)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"w\00"
define void @cparsepp_file(i8* %0, i8* %1) {
%3 = tail call i32* @r_sandbox_fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32* @r_sandbox_fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i32* %3, null
%6 = icmp ne i32* %4, null
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @cparsepp_file_fd(i32* %3, i32* %4)
br label %10
10: ; preds = %8, %2
%11 = tail call i32 @fclose(i32* %3)
%12 = tail call i32 @fclose(i32* %4)
ret void
}