#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;
int chaz_OS_remove(char const *);
int /*<<< orphan*/ chaz_Util_warn(char *, char const *, int /*<<< orphan*/,
                                  char *, int);
scalar_t__ errno;
int /*<<< orphan*/ strerror(scalar_t__);
int chaz_Util_remove_and_verify(const char *file_path) {
  int result = chaz_OS_remove(file_path);
  if (result || errno == ENOENT) {
    return 1;
  }
  chaz_Util_warn("Failed to remove '%s': %s at %s line %d", file_path,
                 strerror(errno), "src/Charmonizer/Core/Util.c", 195);
  return 0;
}


x86 assembly (clang, -O0):
<chaz_Util_remove_and_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <chaz_OS_remove@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116c <chaz_Util_remove_and_verify+0x3c>
mov    0x2e87(%rip),%rax
mov    (%rax),%rax
mov    0x2e6d(%rip),%rcx
cmp    (%rcx),%rax
jne    1178 <chaz_Util_remove_and_verify+0x48>
movl   $0x1,-0x4(%rbp)
jmp    11b5 <chaz_Util_remove_and_verify+0x85>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e59(%rip),%rax
mov    (%rax),%rdi
call   1050 <strerror@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe64(%rip),%rdi
lea    0xe85(%rip),%rcx
mov    $0xc3,%r8d
call   1030 <chaz_Util_warn@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_Util_remove_and_verify>:
push   %rbx
mov    %rdi,%rbx
call   1040 <chaz_OS_remove@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1146 <chaz_Util_remove_and_verify+0x16>
pop    %rbx
ret
mov    0x2e93(%rip),%rcx
mov    (%rcx),%rdi
mov    0x2e79(%rip),%rcx
cmp    (%rcx),%rdi
je     1144 <chaz_Util_remove_and_verify+0x14>
call   1050 <strerror@plt>
lea    0xe98(%rip),%rdi
lea    0xeb9(%rip),%rcx
mov    %rbx,%rsi
mov    %eax,%edx
mov    $0xc3,%r8d
call   1030 <chaz_Util_warn@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@ENOENT = global i64 0
@.str = [40 x i8] c"Failed to remove '%s': %s at %s line %d\00"
@.str.1 = [28 x i8] c"src/Charmonizer/Core/Util.c\00"
define i32 @chaz_Util_remove_and_verify(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @chaz_OS_remove(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = load i64, i64* @ENOENT
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i32 1, i32* %2
br label %19
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i64, i64* @errno
%17 = call i32 @strerror(i64 %16)
%18 = call i32 @chaz_Util_warn(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %17, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 195)
store i32 0, i32* %2
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@errno = global i64 0
@ENOENT = global i64 0
@.str = [40 x i8] c"Failed to remove '%s': %s at %s line %d\00"
@.str.1 = [28 x i8] c"src/Charmonizer/Core/Util.c\00"
define i32 @chaz_Util_remove_and_verify(i8* %0) {
%2 = tail call i32 @chaz_OS_remove(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
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 @chaz_Util_warn(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 195)
br label %11
11: ; preds = %1, %4, %8
%12 = phi i32 [ 0, %8 ], [ 1, %4 ], [ 1, %1 ]
ret i32 %12
}