#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 */
struct file_cache {
  int dummy;
};

/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ cached_name(struct file_cache *, char const *, char *);
int /*<<< orphan*/ cctools_debug(long long, char *, char const *, char *);
int unlink(char *);
int file_cache_delete(struct file_cache *f, const char *path) {
  char lpath[PATH_MAX];
  cached_name(f, path, lpath);
  cctools_debug((1LL << 30), "remove %s %s", path, lpath);
  return unlink(lpath);
}


x86 assembly (clang, -O0):
<file_cache_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <cached_name@plt>
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rdx
mov    $0x40000000,%edi
lea    0xe73(%rip),%rsi
call   1040 <cctools_debug@plt>
mov    -0x28(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_cache_delete>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdx
call   1050 <cached_name@plt>
lea    0xe9d(%rip),%rsi
mov    $0x40000000,%edi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1040 <cctools_debug@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.file_cache = type { i32 }
@PATH_MAX = global i32 0
@.str = [13 x i8] c"remove %s %s\00"
define i32 @file_cache_delete(%struct.file_cache* %0, i8* %1) {
%3 = alloca %struct.file_cache*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store %struct.file_cache* %0, %struct.file_cache** %3
store i8* %1, i8** %4
%7 = load i32, i32* @PATH_MAX
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load %struct.file_cache*, %struct.file_cache** %3
%12 = load i8*, i8** %4
%13 = call i32 @cached_name(%struct.file_cache* %11, i8* %12, i8* %10)
%14 = load i8*, i8** %4
%15 = call i32 @cctools_debug(i64 1073741824, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %10)
%16 = call i32 @unlink(i8* %10)
%17 = load i8*, i8** %5
ret i32 %16
}

LLVM IR (-O2):
%struct.file_cache = type { i32 }
@PATH_MAX = global i32 0
@.str = [13 x i8] c"remove %s %s\00"
define i32 @file_cache_delete(%struct.file_cache* %0, i8* %1) {
%3 = load i32, i32* @PATH_MAX
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @cached_name(%struct.file_cache* %0, i8* %1, i8* %5)
%7 = call i32 @cctools_debug(i64 1073741824, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %5)
%8 = call i32 @unlink(i8* %5)
ret i32 %8
}