#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 chirp_stat {
  int dummy;
};
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_stat(char const *, struct chirp_stat *);
int64_t chirp_fs_hdfs_lstat(const char *path, struct chirp_stat *buf) {
  char resolved_path[1024];
  if (chirp_fs_hdfs_resolve(path, resolved_path) == -1)
    return -1;
  path = resolved_path;
  cctools_debug((1LL << 32), "lstat %s", path);
  return do_stat(path, buf);
}


x86 assembly (clang, -O0):
<chirp_fs_hdfs_lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
call   1030 <chirp_fs_hdfs_resolve@plt>
cmp    $0xffffffff,%eax
jne    1168 <chirp_fs_hdfs_lstat+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <chirp_fs_hdfs_lstat+0x6d>
lea    -0x420(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
movabs $0x100000000,%rdi
lea    0xe78(%rip),%rsi
call   1040 <cctools_debug@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <do_stat@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_fs_hdfs_lstat>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
call   1030 <chirp_fs_hdfs_resolve@plt>
cmp    $0xffffffff,%eax
je     1173 <chirp_fs_hdfs_lstat+0x43>
lea    0xeaf(%rip),%rsi
movabs $0x100000000,%rdi
mov    %rsp,%r14
mov    %r14,%rdx
call   1040 <cctools_debug@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <do_stat@plt>
jmp    1178 <chirp_fs_hdfs_lstat+0x48>
mov    $0xffffffff,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

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

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