#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 */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ cctools_debug(long long, char *, char const *);
int chirp_fs_hdfs_resolve(char const *, char *);
int do_unlink(char const *, int /*<<< orphan*/);
int64_t chirp_fs_hdfs_unlink(const char *path) {
  char resolved_path[1024];
  if (chirp_fs_hdfs_resolve(path, resolved_path) == -1)
    return -1;
  path = resolved_path;
  cctools_debug((1LL << 32), "unlink %s", path);
  return do_unlink(path, 0);
}


x86 assembly (clang, -O0):
<chirp_fs_hdfs_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1030 <chirp_fs_hdfs_resolve@plt>
cmp    $0xffffffff,%eax
jne    1164 <chirp_fs_hdfs_unlink+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1197 <chirp_fs_hdfs_unlink+0x67>
lea    -0x410(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
movabs $0x100000000,%rdi
lea    0xe7c(%rip),%rsi
call   1040 <cctools_debug@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <do_unlink@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_fs_hdfs_unlink>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rsi
call   1030 <chirp_fs_hdfs_resolve@plt>
cmp    $0xffffffff,%eax
je     116d <chirp_fs_hdfs_unlink+0x3d>
lea    0xeb4(%rip),%rsi
movabs $0x100000000,%rdi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <cctools_debug@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <do_unlink@plt>
jmp    1172 <chirp_fs_hdfs_unlink+0x42>
mov    $0xffffffff,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"unlink %s\00"
define i32 @chirp_fs_hdfs_unlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [1024 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = call i32 @chirp_fs_hdfs_resolve(i8* %5, i8* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %16
10: ; preds = %1
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @cctools_debug(i64 4294967296, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @do_unlink(i8* %14, i32 0)
store i32 %15, i32* %2
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [10 x i8] c"unlink %s\00"
define i32 @chirp_fs_hdfs_unlink(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @chirp_fs_hdfs_resolve(i8* %0, i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @cctools_debug(i64 4294967296, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%8 = call i32 @do_unlink(i8* %3, i32 0)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ -1, %1 ]
ret i32 %10
}