#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 /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ tgt;
struct stat {
  int st_mode;
  int /*<<< orphan*/ st_gid;
  int /*<<< orphan*/ st_uid;
  scalar_t__ st_size;
  scalar_t__ st_nlink;
  int /*<<< orphan*/ st_ctime;
  int /*<<< orphan*/ st_atime;
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
int S_IFLNK;
scalar_t__ S_ISBLK(int);
scalar_t__ S_ISCHR(int);
scalar_t__ S_ISDIR(int);
scalar_t__ S_ISFIFO(int);
scalar_t__ S_ISLNK(int);
scalar_t__ S_ISREG(int);
scalar_t__ S_ISSOCK(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ lstat(char *, struct stat *);
int /*<<< orphan*/ print_group(int /*<<< orphan*/);
int /*<<< orphan*/ print_user(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ readlink(char *, char *, int);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  struct stat sb;
  if (argc < 2) {
    fprintf(stderr, "Error: %s <PATH>\n", argv[0]);
    exit(-2);
  }
  if (lstat(argv[1], &sb) == 0) {
    if (sb.st_mode & S_IFLNK) {
      char tgt[4096];
      if (readlink(argv[1], tgt, sizeof(tgt)) > 0) {
        printf("link\ts\t%s\n", tgt);
      }
    }
  }
  time_t now = time(NULL);
  if (stat(argv[1], &sb) == 0) {
    printf("exists\tL\t1\n");
    do {
      printf("m"
             "time\tL\t%ld\n",
             sb.st_mtime);
      printf("m"
             "age\tL\t%ld\n",
             now - sb.st_mtime);
    } while (0);
    do {
      printf("a"
             "time\tL\t%ld\n",
             sb.st_atime);
      printf("a"
             "age\tL\t%ld\n",
             now - sb.st_atime);
    } while (0);
    do {
      printf("c"
             "time\tL\t%ld\n",
             sb.st_ctime);
      printf("c"
             "age\tL\t%ld\n",
             now - sb.st_ctime);
    } while (0);
    printf("hardlinks\tL\t%lu\n", (unsigned long)sb.st_nlink);
    printf("size\tL\t%llu\n", (unsigned long long)sb.st_size);
    printf("permissions\ts\t%04o\n", 0xfff & sb.st_mode);
    printf("type\ts\t%c\n", S_ISREG(sb.st_mode)    ? 'f'
                            : S_ISDIR(sb.st_mode)  ? 'd'
                            : S_ISLNK(sb.st_mode)  ? 'l'
                            : S_ISBLK(sb.st_mode)  ? 'b'
                            : S_ISCHR(sb.st_mode)  ? 'c'
                            : S_ISFIFO(sb.st_mode) ? 'p'
                            : S_ISSOCK(sb.st_mode) ? 's'
                                                   : '?');
    print_user(sb.st_uid);
    print_group(sb.st_gid);
  } else {
    printf("exists\tL\t1\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1060,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1249 <main+0x49>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdc6(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1120 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x40(%rbp),%rsi
call   1090 <lstat@plt>
cmp    $0x0,%rax
jne    12bb <main+0xbb>
mov    -0x40(%rbp),%eax
mov    0x2d7a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12b6 <main+0xb6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x1040(%rbp),%rsi
mov    $0x1000,%edx
call   1040 <readlink@plt>
cmp    $0x0,%rax
jle    12b1 <main+0xb1>
lea    -0x1040(%rbp),%rsi
lea    0xd68(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    12b6 <main+0xb6>
jmp    12bb <main+0xbb>
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <time@plt>
mov    %eax,-0x1044(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x40(%rbp),%rsi
call   10b0 <stat@plt>
cmp    $0x0,%rax
jne    1503 <main+0x303>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x1044(%rbp),%esi
sub    -0x18(%rbp),%esi
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1320 <main+0x120>
mov    -0x1c(%rbp),%esi
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x1044(%rbp),%esi
sub    -0x1c(%rbp),%esi
lea    0xd0e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    134d <main+0x14d>
mov    -0x20(%rbp),%esi
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x1044(%rbp),%esi
sub    -0x20(%rbp),%esi
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xcf4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%esi
and    $0xfff,%esi
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%edi
call   10d0 <S_ISREG@plt>
cmp    $0x0,%rax
je     13d2 <main+0x1d2>
mov    $0x66,%eax
mov    %eax,-0x1048(%rbp)
jmp    14da <main+0x2da>
mov    -0x40(%rbp),%edi
call   1080 <S_ISDIR@plt>
cmp    $0x0,%rax
je     13f4 <main+0x1f4>
mov    $0x64,%eax
mov    %eax,-0x104c(%rbp)
jmp    14ce <main+0x2ce>
mov    -0x40(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
je     1416 <main+0x216>
mov    $0x6c,%eax
mov    %eax,-0x1050(%rbp)
jmp    14c2 <main+0x2c2>
mov    -0x40(%rbp),%edi
call   1100 <S_ISBLK@plt>
cmp    $0x0,%rax
je     1438 <main+0x238>
mov    $0x62,%eax
mov    %eax,-0x1054(%rbp)
jmp    14b6 <main+0x2b6>
mov    -0x40(%rbp),%edi
call   10e0 <S_ISCHR@plt>
cmp    $0x0,%rax
je     145a <main+0x25a>
mov    $0x63,%eax
mov    %eax,-0x1058(%rbp)
jmp    14aa <main+0x2aa>
mov    -0x40(%rbp),%edi
call   1050 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     147c <main+0x27c>
mov    $0x70,%eax
mov    %eax,-0x105c(%rbp)
jmp    149e <main+0x29e>
mov    -0x40(%rbp),%edi
call   1060 <S_ISSOCK@plt>
mov    %rax,%rdx
mov    $0x3f,%eax
mov    $0x73,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x105c(%rbp)
mov    -0x105c(%rbp),%eax
mov    %eax,-0x1058(%rbp)
mov    -0x1058(%rbp),%eax
mov    %eax,-0x1054(%rbp)
mov    -0x1054(%rbp),%eax
mov    %eax,-0x1050(%rbp)
mov    -0x1050(%rbp),%eax
mov    %eax,-0x104c(%rbp)
mov    -0x104c(%rbp),%eax
mov    %eax,-0x1048(%rbp)
mov    -0x1048(%rbp),%esi
lea    0xbbf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x38(%rbp),%edi
call   1110 <print_user@plt>
mov    -0x3c(%rbp),%edi
call   10f0 <print_group@plt>
jmp    1511 <main+0x311>
lea    0xb13(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x1038,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jle    13ff <main+0x1ef>
mov    0x8(%rbx),%rdi
mov    %rsp,%rsi
call   10a0 <lstat@plt>
test   %rax,%rax
je     1261 <main+0x51>
xor    %edi,%edi
call   10d0 <time@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
mov    %rsp,%rsi
call   10c0 <stat@plt>
lea    0xe53(%rip),%rdi
test   %rax,%rax
je     129c <main+0x8c>
call   1040 <puts@plt>
jmp    13f3 <main+0x1e3>
mov    0x2d80(%rip),%rax
mov    (%rax),%eax
test   %eax,(%rsp)
je     1236 <main+0x26>
mov    0x8(%rbx),%rdi
lea    0x30(%rsp),%rsi
mov    $0x1000,%edx
call   1050 <readlink@plt>
test   %rax,%rax
jle    1236 <main+0x26>
lea    0xd84(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1236 <main+0x26>
call   1040 <puts@plt>
mov    0x28(%rsp),%esi
lea    0xd71(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %ebp,%esi
sub    0x28(%rsp),%esi
lea    0xd6a(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x24(%rsp),%esi
lea    0xd64(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %ebp,%esi
sub    0x24(%rsp),%esi
lea    0xd5d(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x20(%rsp),%esi
lea    0xd57(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
sub    0x20(%rsp),%ebp
lea    0xd52(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rsp),%rsi
lea    0xd49(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xd47(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xfff,%esi
and    (%rsp),%esi
lea    0xd3e(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%rsp),%edi
call   10e0 <S_ISREG@plt>
mov    $0x66,%esi
test   %rax,%rax
jne    13d3 <main+0x1c3>
mov    (%rsp),%edi
call   1090 <S_ISDIR@plt>
mov    $0x64,%esi
test   %rax,%rax
jne    13d3 <main+0x1c3>
mov    (%rsp),%edi
call   1030 <S_ISLNK@plt>
mov    $0x6c,%esi
test   %rax,%rax
jne    13d3 <main+0x1c3>
mov    (%rsp),%edi
call   1110 <S_ISBLK@plt>
mov    $0x62,%esi
test   %rax,%rax
jne    13d3 <main+0x1c3>
mov    (%rsp),%edi
call   10f0 <S_ISCHR@plt>
mov    $0x63,%esi
test   %rax,%rax
jne    13d3 <main+0x1c3>
mov    (%rsp),%edi
call   1060 <S_ISFIFO@plt>
mov    $0x70,%esi
test   %rax,%rax
jne    13d3 <main+0x1c3>
mov    (%rsp),%edi
call   1070 <S_ISSOCK@plt>
test   %rax,%rax
mov    $0x3f,%eax
mov    $0x73,%esi
cmove  %eax,%esi
lea    0xcc0(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x8(%rsp),%edi
call   1120 <print_user@plt>
mov    0x4(%rsp),%edi
call   1100 <print_group@plt>
xor    %eax,%eax
add    $0x1038,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2bd2(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xbee(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i64, i64, i32, i32, i32 }
@stderr = global i32 0
@.str = [18 x i8] c"Error: %s <PATH>\0A\00"
@S_IFLNK = global i32 0
@.str.1 = [11 x i8] c"link\09s\09%s\0A\00"
@.str.2 = [12 x i8] c"exists\09L\091\0A\00"
@.str.3 = [13 x i8] c"mtime\09L\09%ld\0A\00"
@.str.4 = [12 x i8] c"mage\09L\09%ld\0A\00"
@.str.5 = [13 x i8] c"atime\09L\09%ld\0A\00"
@.str.6 = [12 x i8] c"aage\09L\09%ld\0A\00"
@.str.7 = [13 x i8] c"ctime\09L\09%ld\0A\00"
@.str.8 = [12 x i8] c"cage\09L\09%ld\0A\00"
@.str.9 = [17 x i8] c"hardlinks\09L\09%lu\0A\00"
@.str.10 = [13 x i8] c"size\09L\09%llu\0A\00"
@.str.11 = [20 x i8] c"permissions\09s\09%04o\0A\00"
@.str.12 = [11 x i8] c"type\09s\09%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.stat
%7 = alloca [4096 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 -2)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i64 @lstat(i8* %21, %struct.stat* %6)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %42
24: ; preds = %18
%25 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%26 = load i32, i32* %25
%27 = load i32, i32* @S_IFLNK
%28 = and i32 %26, %27
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %41
30: ; preds = %24
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%35 = call i64 @readlink(i8* %33, i8* %34, i32 4096)
%36 = icmp sgt i64 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %30
%38 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %38)
br label %40
40: ; preds = %37, %30
br label %41
41: ; preds = %40, %24
br label %42
42: ; preds = %41, %18
%43 = call i32 @time(i32* null)
store i32 %43, i32* %8
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = call i64 @stat(i8* %46, %struct.stat* %6)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %152
49: ; preds = %42
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %49
%52 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %53)
%55 = load i32, i32* %8
%56 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%57 = load i32, i32* %56
%58 = sub nsw i32 %55, %57
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %51
br label %61
61: ; preds = %60
%62 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 6
%63 = load i32, i32* %62
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %63)
%65 = load i32, i32* %8
%66 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 6
%67 = load i32, i32* %66
%68 = sub nsw i32 %65, %67
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %68)
br label %70
70: ; preds = %61
br label %71
71: ; preds = %70
%72 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 5
%73 = load i32, i32* %72
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %73)
%75 = load i32, i32* %8
%76 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 5
%77 = load i32, i32* %76
%78 = sub nsw i32 %75, %77
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %78)
br label %80
80: ; preds = %71
%81 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 4
%82 = load i64, i64* %81
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i64 %82)
%84 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 3
%85 = load i64, i64* %84
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i64 %85)
%87 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%88 = load i32, i32* %87
%89 = and i32 4095, %88
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %89)
%91 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%92 = load i32, i32* %91
%93 = call i64 @S_ISREG(i32 %92)
%94 = icmp ne i64 %93, 0
br i1 %94, label %95, label %96
95: ; preds = %80
br label %143
96: ; preds = %80
%97 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%98 = load i32, i32* %97
%99 = call i64 @S_ISDIR(i32 %98)
%100 = icmp ne i64 %99, 0
br i1 %100, label %101, label %102
101: ; preds = %96
br label %141
102: ; preds = %96
%103 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%104 = load i32, i32* %103
%105 = call i64 @S_ISLNK(i32 %104)
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %108
107: ; preds = %102
br label %139
108: ; preds = %102
%109 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%110 = load i32, i32* %109
%111 = call i64 @S_ISBLK(i32 %110)
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %114
113: ; preds = %108
br label %137
114: ; preds = %108
%115 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%116 = load i32, i32* %115
%117 = call i64 @S_ISCHR(i32 %116)
%118 = icmp ne i64 %117, 0
br i1 %118, label %119, label %120
119: ; preds = %114
br label %135
120: ; preds = %114
%121 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%122 = load i32, i32* %121
%123 = call i64 @S_ISFIFO(i32 %122)
%124 = icmp ne i64 %123, 0
br i1 %124, label %125, label %126
125: ; preds = %120
br label %133
126: ; preds = %120
%127 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%128 = load i32, i32* %127
%129 = call i64 @S_ISSOCK(i32 %128)
%130 = icmp ne i64 %129, 0
%131 = zext i1 %130 to i64
%132 = select i1 %130, i32 115, i32 63
br label %133
133: ; preds = %126, %125
%134 = phi i32 [ 112, %125 ], [ %132, %126 ]
br label %135
135: ; preds = %133, %119
%136 = phi i32 [ 99, %119 ], [ %134, %133 ]
br label %137
137: ; preds = %135, %113
%138 = phi i32 [ 98, %113 ], [ %136, %135 ]
br label %139
139: ; preds = %137, %107
%140 = phi i32 [ 108, %107 ], [ %138, %137 ]
br label %141
141: ; preds = %139, %101
%142 = phi i32 [ 100, %101 ], [ %140, %139 ]
br label %143
143: ; preds = %141, %95
%144 = phi i32 [ 102, %95 ], [ %142, %141 ]
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32 %144)
%146 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 2
%147 = load i32, i32* %146
%148 = call i32 @print_user(i32 %147)
%149 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 1
%150 = load i32, i32* %149
%151 = call i32 @print_group(i32 %150)
br label %154
152: ; preds = %42
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %154
154: ; preds = %152, %143
%155 = load i32, i32* %3
ret i32 %155
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i64, i64, i32, i32, i32 }
@stderr = global i32 0
@.str = [18 x i8] c"Error: %s <PATH>\0A\00"
@S_IFLNK = global i32 0
@.str.1 = [11 x i8] c"link\09s\09%s\0A\00"
@.str.3 = [13 x i8] c"mtime\09L\09%ld\0A\00"
@.str.4 = [12 x i8] c"mage\09L\09%ld\0A\00"
@.str.5 = [13 x i8] c"atime\09L\09%ld\0A\00"
@.str.6 = [12 x i8] c"aage\09L\09%ld\0A\00"
@.str.7 = [13 x i8] c"ctime\09L\09%ld\0A\00"
@.str.8 = [12 x i8] c"cage\09L\09%ld\0A\00"
@.str.9 = [17 x i8] c"hardlinks\09L\09%lu\0A\00"
@.str.10 = [13 x i8] c"size\09L\09%llu\0A\00"
@.str.11 = [20 x i8] c"permissions\09s\09%04o\0A\00"
@.str.12 = [11 x i8] c"type\09s\09%c\0A\00"
@str.13 = [11 x i8] c"exists\09L\091\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca [4096 x i8]
%5 = bitcast %struct.stat* %3 to i8*
%6 = icmp slt i32 %0, 2
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %1
%10 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i32 @exit(i32 -2)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @lstat(i8* %14, %struct.stat* %3)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %31
17: ; preds = %12
%18 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%19 = load i32, i32* %18
%20 = load i32, i32* @S_IFLNK
%21 = and i32 %20, %19
%22 = icmp eq i32 %21, 0
br i1 %22, label %31, label %23
23: ; preds = %17
%24 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%25 = load i8*, i8** %13
%26 = call i64 @readlink(i8* %25, i8* %24, i32 4096)
%27 = icmp sgt i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %24)
br label %30
30: ; preds = %28, %23
br label %31
31: ; preds = %17, %30, %12
%32 = call i32 @time(i32* null)
%33 = load i8*, i8** %13
%34 = call i64 @stat(i8* %33, %struct.stat* %3)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %103
36: ; preds = %31
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.13, i64 0, i64 0))
%38 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 7
%39 = load i32, i32* %38
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %38
%42 = sub nsw i32 %32, %41
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 6
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %44
%48 = sub nsw i32 %32, %47
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 5
%51 = load i32, i32* %50
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %50
%54 = sub nsw i32 %32, %53
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 4
%57 = load i64, i64* %56
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i64 %57)
%59 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 3
%60 = load i64, i64* %59
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i64 %60)
%62 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%63 = load i32, i32* %62
%64 = and i32 %63, 4095
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %64)
%66 = load i32, i32* %62
%67 = call i64 @S_ISREG(i32 %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %94
69: ; preds = %36
%70 = load i32, i32* %62
%71 = call i64 @S_ISDIR(i32 %70)
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %94
73: ; preds = %69
%74 = load i32, i32* %62
%75 = call i64 @S_ISLNK(i32 %74)
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %94
77: ; preds = %73
%78 = load i32, i32* %62
%79 = call i64 @S_ISBLK(i32 %78)
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %94
81: ; preds = %77
%82 = load i32, i32* %62
%83 = call i64 @S_ISCHR(i32 %82)
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %94
85: ; preds = %81
%86 = load i32, i32* %62
%87 = call i64 @S_ISFIFO(i32 %86)
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %94
89: ; preds = %85
%90 = load i32, i32* %62
%91 = call i64 @S_ISSOCK(i32 %90)
%92 = icmp eq i64 %91, 0
%93 = select i1 %92, i32 63, i32 115
br label %94
94: ; preds = %69, %77, %89, %85, %81, %73, %36
%95 = phi i32 [ 102, %36 ], [ 100, %69 ], [ 108, %73 ], [ 98, %77 ], [ 99, %81 ], [ %93, %89 ], [ 112, %85 ]
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32 %95)
%97 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 2
%98 = load i32, i32* %97
%99 = call i32 @print_user(i32 %98)
%100 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%101 = load i32, i32* %100
%102 = call i32 @print_group(i32 %101)
br label %105
103: ; preds = %31
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.13, i64 0, i64 0))
br label %105
105: ; preds = %103, %94
ret i32 0
}