#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*/ app_error(char *, int, char *, int);
int /*<<< orphan*/ configfile_parse(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void configfile_process(char *config_file_fullpath) {
  FILE *config_file = fopen(config_file_fullpath, "r");
  if (!config_file)
    app_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/mpmumau/peabot/refs/heads/master/src/"
              "config_file.c",
              32, "Could not open config file.", 1);
  configfile_parse(config_file);
  fclose(config_file);
}


x86 assembly (clang, -O0):
<configfile_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1188 <configfile_process+0x48>
lea    0xe90(%rip),%rdi
mov    $0x20,%esi
lea    0xf11(%rip),%rdx
mov    $0x1,%ecx
call   1040 <app_error@plt>
mov    -0x10(%rbp),%rdi
call   1050 <configfile_parse@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configfile_process>:
push   %rbx
lea    0xeb8(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1172 <configfile_process+0x32>
lea    0xea6(%rip),%rdi
lea    0xf2c(%rip),%rdx
mov    $0x20,%esi
mov    $0x1,%ecx
call   1040 <app_error@plt>
mov    %rbx,%rdi
call   1050 <configfile_parse@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mpmumau/peabot/refs/heads/master/src/config_file.c\00"
@.str.2 = [28 x i8] c"Could not open config file.\00"
define void @configfile_process(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 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @app_error(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %10
10: ; preds = %8, %1
%11 = load i32*, i32** %3
%12 = call i32 @configfile_parse(i32* %11)
%13 = load i32*, i32** %3
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mpmumau/peabot/refs/heads/master/src/config_file.c\00"
@.str.2 = [28 x i8] c"Could not open config file.\00"
define void @configfile_process(i8* nocapture %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 %6
4: ; preds = %1
%5 = tail call i32 @app_error(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @configfile_parse(i32* %2)
%8 = tail call i32 @fclose(i32* %2)
ret void
}