#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*/ _err_msg(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ *fopen(char *, char *);
int pass_init(char *file, FILE **fp) {
  if ((*fp = fopen(file, "r")) == NULL) {
    _err_msg(errno,
             "["
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/zh1149277309/fms/refs/heads/master/"
             "server/auth.c"
             ",%d] "
             "fopen",
             145);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<pass_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <fopen@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1177 <pass_init+0x57>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
mov    $0x91,%edx
call   1040 <_err_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <pass_init+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pass_init>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rcx
mov    %rax,(%rbx)
xor    %eax,%eax
test   %rcx,%rcx
je     113f <pass_init+0x1f>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
mov    $0x91,%edx
call   1040 <_err_msg@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@errno = global i32 0
@.str.1 = [150 x i8] c"[/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zh1149277309/fms/refs/heads/master/server/auth.c,%d] fopen\00"
define i32 @pass_init(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 i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i32**, i32*** %5
store i32* %7, i32** %8
%9 = icmp eq i32* %7, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @errno
%12 = call i32 @_err_msg(i32 %11, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 145)
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@errno = global i32 0
@.str.1 = [150 x i8] c"[/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zh1149277309/fms/refs/heads/master/server/auth.c,%d] fopen\00"
define i32 @pass_init(i8* nocapture %0, i32** nocapture writeonly %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %3, i32** %1
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @_err_msg(i32 %6, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 145)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %9
}