#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 */
scalar_t__ ENOENT;
scalar_t__ errno;
int fattr_delete(char const *);
int /*<<< orphan*/ lprintf(int, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(scalar_t__);
void updater_deletefile(const char *path) {
  int error;
  error = fattr_delete(path);
  if (error && errno != ENOENT) {
    lprintf(-1, "Cannot delete \"%s\": %s\n", path, strerror(errno));
  }
}


x86 assembly (clang, -O0):
<updater_deletefile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fattr_delete@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     119a <updater_deletefile+0x6a>
mov    0x2e87(%rip),%rax
mov    (%rax),%rax
mov    0x2e6d(%rip),%rcx
cmp    (%rcx),%rax
je     119a <updater_deletefile+0x6a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e65(%rip),%rax
mov    (%rax),%rdi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
mov    $0xffffffff,%edi
lea    0xe6b(%rip),%rsi
call   1040 <lprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updater_deletefile>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fattr_delete@plt>
test   %eax,%eax
je     1153 <updater_deletefile+0x23>
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdi
mov    0x2e82(%rip),%rax
cmp    (%rax),%rdi
jne    1155 <updater_deletefile+0x25>
pop    %rbx
ret
call   1050 <strerror@plt>
lea    0xe9f(%rip),%rsi
mov    $0xffffffff,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
jmp    1040 <lprintf@plt>

LLVM IR (-O0):
@errno = global i64 0
@ENOENT = global i64 0
@.str = [24 x i8] c"Cannot delete \22%s\22: %s\0A\00"
define void @updater_deletefile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @fattr_delete(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i64, i64* @errno
%10 = load i64, i64* @ENOENT
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i64, i64* @errno
%15 = call i32 @strerror(i64 %14)
%16 = call i32 @lprintf(i32 -1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %15)
br label %17
17: ; preds = %12, %8, %1
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@ENOENT = global i64 0
@.str = [24 x i8] c"Cannot delete \22%s\22: %s\0A\00"
define void @updater_deletefile(i8* %0) {
%2 = tail call i32 @fattr_delete(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @ENOENT
%7 = icmp eq i64 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = tail call i32 @strerror(i64 %5)
%10 = tail call i32 @lprintf(i32 -1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %9)
br label %11
11: ; preds = %8, %4, %1
ret void
}