#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*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int remove(char *);
void deleteFile() {
  int status;
  status = remove("person_database.bin");
  if (status == 0)
    printf("%s file deleted successfully.\n", "person_database.bin");
  else {
    printf("Unable to delete the file\n");
    perror("Error");
  }
}


x86 assembly (clang, -O0):
<deleteFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <remove@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    116b <deleteFile+0x3b>
lea    0xebc(%rip),%rdi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1185 <deleteFile+0x55>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteFile>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <remove@plt>
test   %eax,%eax
jne    1167 <deleteFile+0x27>
lea    0xebc(%rip),%rdi
lea    0xea1(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1050 <printf@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1060 <perror@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"person_database.bin\00"
@.str.1 = [31 x i8] c"%s file deleted successfully.\0A\00"
@.str.2 = [27 x i8] c"Unable to delete the file\0A\00"
@.str.3 = [6 x i8] c"Error\00"
define void @deleteFile() {
%1 = alloca i32
%2 = call i32 @remove(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"person_database.bin\00"
@.str.1 = [31 x i8] c"%s file deleted successfully.\0A\00"
@.str.3 = [6 x i8] c"Error\00"
@str = [26 x i8] c"Unable to delete the file\00"
define void @deleteFile() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %8
8: ; preds = %5, %3
ret void
}