#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*/ *aml_fio_strip_comments(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
FILE *aml_fio_open_file_and_strip_comments(char *fN) {
  FILE *f;
  if (!(f = fopen(fN, "r"))) {
    fprintf(stderr, "%s:%d: Error opening \"%s\" for reading\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/staropram/ffn/refs/heads/master/fio.c",
            113, fN);
    exit(1);
  }
  return aml_fio_strip_comments(f);
}


x86 assembly (clang, -O0):
<aml_fio_open_file_and_strip_comments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1199 <aml_fio_open_file_and_strip_comments+0x59>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%r8
lea    0xe84(%rip),%rsi
lea    0xea4(%rip),%rdx
mov    $0x71,%ecx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1030 <aml_fio_strip_comments@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aml_fio_open_file_and_strip_comments>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115e <aml_fio_open_file_and_strip_comments+0x1e>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <aml_fio_strip_comments@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
lea    0xeb4(%rip),%rdx
mov    $0x71,%ecx
mov    %rbx,%r8
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [39 x i8] c"%s:%d: Error opening \22%s\22 for reading\0A\00"
@.str.2 = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/staropram/ffn/refs/heads/master/fio.c\00"
define i32* @aml_fio_open_file_and_strip_comments(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.2, i64 0, i64 0), i32 113, i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i32*, i32** %3
%14 = call i32* @aml_fio_strip_comments(i32* %13)
ret i32* %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [39 x i8] c"%s:%d: Error opening \22%s\22 for reading\0A\00"
@.str.2 = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/staropram/ffn/refs/heads/master/fio.c\00"
define i32* @aml_fio_open_file_and_strip_comments(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.2, i64 0, i64 0), i32 113, i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = tail call i32* @aml_fio_strip_comments(i32* %2)
ret i32* %9
}