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


x86 assembly (clang, -O0):
<deleteFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    117e <deleteFile+0x4e>
mov    -0x8(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1198 <deleteFile+0x68>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1050 <perror@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteFile>:
push   %rbx
mov    %rdi,%rbx
lea    0xee8(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
test   %eax,%eax
jne    117a <deleteFile+0x3a>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xef5(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xe92(%rip),%rdi
call   1060 <perror@plt>
jmp    116d <deleteFile+0x2d>

LLVM IR (-O0):
@.str = [29 x i8] c"start deleteFile() Function\0A\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 = [20 x i8] c"Error deleting file\00"
@.str.4 = [27 x i8] c"end deleteFile() Function\0A\00"
define void @deleteFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @remove(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %15
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %12, %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
ret void
}

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