#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*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
FILE *open_file3() {
  FILE *out = NULL;
  out = fopen("epsg_inlined_prussian.c", "wb");
  if (out == NULL) {
    fprintf(
        stderr,
        "ERROR: unable to open the \"epsg_inlined_prussian.c\" output file\n");
    return NULL;
  }
  return out;
}


x86 assembly (clang, -O0):
<open_file3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <open_file3+0x54>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    117c <open_file3+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file3>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xee9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <open_file3+0x31>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"epsg_inlined_prussian.c\00"
@.str.1 = [3 x i8] c"wb\00"
@stderr = global i32 0
@.str.2 = [65 x i8] c"ERROR: unable to open the \22epsg_inlined_prussian.c\22 output file\0A\00"
define i32* @open_file3() {
%1 = alloca i32*
%2 = alloca i32*
store i32* null, i32** %2
%3 = call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
store i32* null, i32** %1
br label %11
9: ; preds = %0
%10 = load i32*, i32** %2
store i32* %10, i32** %1
br label %11
11: ; preds = %9, %6
%12 = load i32*, i32** %1
ret i32* %12
}

LLVM IR (-O2):
@.str = [24 x i8] c"epsg_inlined_prussian.c\00"
@.str.1 = [3 x i8] c"wb\00"
@stderr = global i32 0
@.str.2 = [65 x i8] c"ERROR: unable to open the \22epsg_inlined_prussian.c\22 output file\0A\00"
define noalias i32* @open_file3() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
ret i32* %1
}