#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 */

/* Variables and functions */
int /*<<< orphan*/ ExportFailure(char *, char *, int, char *);
int /*<<< orphan*/ fclose(void *);
void File_CloseHandle(void *file_handle) {
  do {
    if (!(file_handle)) {
      ExportFailure("file_handle",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/MuggleWei/Muggle_Toy/"
                    "refs/heads/master/src/base/file_utility.c",
                    158, "Try to close empty file handle");
    }
  } while (0);
  fclose(file_handle);
}


x86 assembly (clang, -O0):
<File_CloseHandle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <File_CloseHandle+0x36>
lea    0xec2(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    $0x9e,%edx
lea    0xf54(%rip),%rcx
call   1040 <ExportFailure@plt>
jmp    115b <File_CloseHandle+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_CloseHandle>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1148 <File_CloseHandle+0x28>
lea    0xed0(%rip),%rdi
lea    0xed5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x9e,%edx
call   1040 <ExportFailure@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"file_handle\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MuggleWei/Muggle_Toy/refs/heads/master/src/base/file_utility.c\00"
@.str.2 = [31 x i8] c"Try to close empty file handle\00"
define void @File_CloseHandle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = call i32 @ExportFailure(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
br label %9
9: ; preds = %8
%10 = load i8*, i8** %2
%11 = call i32 @fclose(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"file_handle\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MuggleWei/Muggle_Toy/refs/heads/master/src/base/file_utility.c\00"
@.str.2 = [31 x i8] c"Try to close empty file handle\00"
define void @File_CloseHandle(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @ExportFailure(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = tail call i32 @fclose(i8* %0)
ret void
}