#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 stat {
  char *st_size;
  char *st_nlink;
  char *st_ino;
  int st_mode;
};

/* Variables and functions */
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
scalar_t__ S_ISDIR(int);
scalar_t__ S_ISLNK(int);
int S_IWGRP;
int S_IWOTH;
int S_IWUSR;
int S_IXGRP;
int S_IXOTH;
int S_IXUSR;
scalar_t__ lstat(char *, struct stat *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  char msg[200] = "";
  if (argc != 2)
    return 1;
  struct stat fileStat;
  if (lstat(argv[1], &fileStat) < 0) {
    strcpy(msg, argv[0]);
    strcat(msg, ": Cannon stat \"");
    strcat(msg, argv[1]);
    strcat(msg, "\"");
    perror(msg);
    return 1;
  }
  printf("Information for %s\n", argv[1]);
  printf("---------------------------\n");
  printf("File Size: \t\t%ld bytes\n", fileStat.st_size);
  printf("Number of Links: \t%ld\n", fileStat.st_nlink);
  printf("File inode: \t\t%lu\n", fileStat.st_ino);
  printf("File Permissions: \t");
  printf((S_ISDIR(fileStat.st_mode)) ? "d" : "-");
  printf((fileStat.st_mode & S_IRUSR) ? "r" : "-");
  printf((fileStat.st_mode & S_IWUSR) ? "w" : "-");
  printf((fileStat.st_mode & S_IXUSR) ? "x" : "-");
  printf((fileStat.st_mode & S_IRGRP) ? "r" : "-");
  printf((fileStat.st_mode & S_IWGRP) ? "w" : "-");
  printf((fileStat.st_mode & S_IXGRP) ? "x" : "-");
  printf((fileStat.st_mode & S_IROTH) ? "r" : "-");
  printf((fileStat.st_mode & S_IWOTH) ? "w" : "-");
  printf((fileStat.st_mode & S_IXOTH) ? "x" : "-");
  printf("\n\n");
  printf("The file %s a symbolic link\n",
         (S_ISLNK(fileStat.st_mode)) ? "is" : "is not");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1070 <memset@plt>
cmpl   $0x2,-0x8(%rbp)
je     11c2 <main+0x42>
movl   $0x1,-0x4(%rbp)
jmp    14ab <main+0x32b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x100(%rbp),%rsi
call   1080 <lstat@plt>
cmp    $0x0,%rax
jge    1245 <main+0xc5>
lea    -0xe0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcpy@plt>
lea    -0xe0(%rbp),%rdi
lea    0xdff(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0xe0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   10a0 <strcat@plt>
lea    -0xe0(%rbp),%rdi
lea    0xde6(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0xe0(%rbp),%rdi
call   1090 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14ab <main+0x32b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x100(%rbp),%rsi
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xf8(%rbp),%rsi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xf0(%rbp),%rsi
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%edi
call   1060 <S_ISDIR@plt>
mov    %rax,%rcx
lea    0xdce(%rip),%rdi
lea    0xdc5(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%ecx
mov    0x2cba(%rip),%rax
and    (%rax),%ecx
lea    0xda2(%rip),%rdi
lea    0xd9d(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%ecx
mov    0x2cb7(%rip),%rax
and    (%rax),%ecx
lea    0xd77(%rip),%rdi
lea    0xd74(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%ecx
mov    0x2c9c(%rip),%rax
and    (%rax),%ecx
lea    0xd4c(%rip),%rdi
lea    0xd4b(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%ecx
mov    0x2c49(%rip),%rax
and    (%rax),%ecx
lea    0xd21(%rip),%rdi
lea    0xd1c(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%ecx
mov    0x2c3e(%rip),%rax
and    (%rax),%ecx
lea    0xcf6(%rip),%rdi
lea    0xcf3(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%ecx
mov    0x2c03(%rip),%rax
and    (%rax),%ecx
lea    0xccb(%rip),%rdi
lea    0xcca(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%ecx
mov    0x2bc0(%rip),%rax
and    (%rax),%ecx
lea    0xca0(%rip),%rdi
lea    0xc9b(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%ecx
mov    0x2b7d(%rip),%rax
and    (%rax),%ecx
lea    0xc75(%rip),%rdi
lea    0xc72(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%ecx
mov    0x2ba2(%rip),%rax
and    (%rax),%ecx
lea    0xc4a(%rip),%rdi
lea    0xc49(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc36(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xe8(%rbp),%edi
call   1040 <S_ISLNK@plt>
mov    %rax,%rcx
lea    0xc3d(%rip),%rsi
lea    0xc33(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xc07(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movq   $0x0,0xe0(%rsp)
mov    $0x1,%r14d
cmp    $0x2,%edi
jne    13cf <main+0x24f>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    %rsp,%rsi
call   1080 <lstat@plt>
test   %rax,%rax
js     13e4 <main+0x264>
mov    0x8(%rbx),%rsi
lea    0xdf0(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe78(%rip),%rdi
call   1050 <puts@plt>
mov    (%rsp),%rsi
lea    0xde3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xde8(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xdec(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdf1(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%ebp
mov    %ebp,%edi
call   1070 <S_ISDIR@plt>
test   %rax,%rax
lea    0xe32(%rip),%r13
lea    0xde2(%rip),%rdi
cmove  %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2cfe(%rip),%rax
mov    (%rax),%eax
and    %ebp,%eax
lea    0xdc7(%rip),%r15
mov    %r15,%rdi
cmove  %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2d06(%rip),%rax
mov    (%rax),%eax
and    %ebp,%eax
lea    0xda9(%rip),%r12
mov    %r12,%rdi
cmove  %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2cf6(%rip),%rax
mov    (%rax),%eax
and    %ebp,%eax
lea    0xd8b(%rip),%rbx
mov    %rbx,%rdi
cmove  %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2cae(%rip),%rax
mov    (%rax),%eax
and    %ebp,%eax
mov    %r15,%rdi
cmove  %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2cb5(%rip),%rax
mov    (%rax),%eax
and    %ebp,%eax
mov    %r12,%rdi
cmove  %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c8c(%rip),%rax
mov    (%rax),%eax
and    %ebp,%eax
mov    %rbx,%rdi
cmove  %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c5b(%rip),%rax
mov    (%rax),%eax
and    %ebp,%eax
cmove  %r13,%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c2a(%rip),%rax
mov    (%rax),%eax
and    %ebp,%eax
cmove  %r13,%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c61(%rip),%rax
mov    (%rax),%eax
and    %ebp,%eax
cmove  %r13,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xcb1(%rip),%rdi
call   1050 <puts@plt>
mov    %ebp,%edi
call   1040 <S_ISLNK@plt>
test   %rax,%rax
lea    0xcec(%rip),%rax
lea    0xce2(%rip),%rsi
cmove  %rax,%rsi
lea    0xcba(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <strcpy@plt>
lea    0xc05(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
mov    0x8(%rbx),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
lea    0xbf8(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <strcat@plt>
mov    %rbp,%rdi
call   1090 <perror@plt>
mov    $0x1,%r14d
jmp    13cf <main+0x24f>

LLVM IR (-O0):
%struct.stat = type { i8*, i8*, i8*, i32 }
@.str = [16 x i8] c": Cannon stat \22\00"
@.str.1 = [2 x i8] c"\22\00"
@.str.2 = [20 x i8] c"Information for %s\0A\00"
@.str.3 = [29 x i8] c"---------------------------\0A\00"
@.str.4 = [24 x i8] c"File Size: \09\09%ld bytes\0A\00"
@.str.5 = [23 x i8] c"Number of Links: \09%ld\0A\00"
@.str.6 = [19 x i8] c"File inode: \09\09%lu\0A\00"
@.str.7 = [20 x i8] c"File Permissions: \09\00"
@.str.8 = [2 x i8] c"d\00"
@.str.9 = [2 x i8] c"-\00"
@S_IRUSR = global i32 0
@.str.10 = [2 x i8] c"r\00"
@S_IWUSR = global i32 0
@.str.11 = [2 x i8] c"w\00"
@S_IXUSR = global i32 0
@.str.12 = [2 x i8] c"x\00"
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_IXOTH = global i32 0
@.str.13 = [3 x i8] c"\0A\0A\00"
@.str.14 = [29 x i8] c"The file %s a symbolic link\0A\00"
@.str.15 = [3 x i8] c"is\00"
@.str.16 = [7 x i8] c"is not\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [200 x i8]
%7 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [200 x i8]* %6 to i8*
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %138
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @lstat(i8* %15, %struct.stat* %7)
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %12
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 @strcpy(i8* %19, i8* %22)
%24 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%25 = call i32 @strcat(i8* %24, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%26 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @strcat(i8* %26, i8* %29)
%31 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%32 = call i32 @strcat(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%33 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%34 = call i32 @perror(i8* %33)
store i32 1, i32* %3
br label %138
35: ; preds = %12
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%41 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%42 = load i8*, i8** %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %42)
%44 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 1
%45 = load i8*, i8** %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %45)
%47 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 2
%48 = load i8*, i8** %47
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %48)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%51 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%52 = load i32, i32* %51
%53 = call i64 @S_ISDIR(i32 %52)
%54 = icmp ne i64 %53, 0
%55 = zext i1 %54 to i64
%56 = select i1 %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%57 = call i32 (i8*, ...) @printf(i8* %56)
%58 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%59 = load i32, i32* %58
%60 = load i32, i32* @S_IRUSR
%61 = and i32 %59, %60
%62 = icmp ne i32 %61, 0
%63 = zext i1 %62 to i64
%64 = select i1 %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%65 = call i32 (i8*, ...) @printf(i8* %64)
%66 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%67 = load i32, i32* %66
%68 = load i32, i32* @S_IWUSR
%69 = and i32 %67, %68
%70 = icmp ne i32 %69, 0
%71 = zext i1 %70 to i64
%72 = select i1 %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%73 = call i32 (i8*, ...) @printf(i8* %72)
%74 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%75 = load i32, i32* %74
%76 = load i32, i32* @S_IXUSR
%77 = and i32 %75, %76
%78 = icmp ne i32 %77, 0
%79 = zext i1 %78 to i64
%80 = select i1 %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%81 = call i32 (i8*, ...) @printf(i8* %80)
%82 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%83 = load i32, i32* %82
%84 = load i32, i32* @S_IRGRP
%85 = and i32 %83, %84
%86 = icmp ne i32 %85, 0
%87 = zext i1 %86 to i64
%88 = select i1 %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%89 = call i32 (i8*, ...) @printf(i8* %88)
%90 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%91 = load i32, i32* %90
%92 = load i32, i32* @S_IWGRP
%93 = and i32 %91, %92
%94 = icmp ne i32 %93, 0
%95 = zext i1 %94 to i64
%96 = select i1 %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%97 = call i32 (i8*, ...) @printf(i8* %96)
%98 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%99 = load i32, i32* %98
%100 = load i32, i32* @S_IXGRP
%101 = and i32 %99, %100
%102 = icmp ne i32 %101, 0
%103 = zext i1 %102 to i64
%104 = select i1 %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%105 = call i32 (i8*, ...) @printf(i8* %104)
%106 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%107 = load i32, i32* %106
%108 = load i32, i32* @S_IROTH
%109 = and i32 %107, %108
%110 = icmp ne i32 %109, 0
%111 = zext i1 %110 to i64
%112 = select i1 %110, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%113 = call i32 (i8*, ...) @printf(i8* %112)
%114 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%115 = load i32, i32* %114
%116 = load i32, i32* @S_IWOTH
%117 = and i32 %115, %116
%118 = icmp ne i32 %117, 0
%119 = zext i1 %118 to i64
%120 = select i1 %118, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%121 = call i32 (i8*, ...) @printf(i8* %120)
%122 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%123 = load i32, i32* %122
%124 = load i32, i32* @S_IXOTH
%125 = and i32 %123, %124
%126 = icmp ne i32 %125, 0
%127 = zext i1 %126 to i64
%128 = select i1 %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
%129 = call i32 (i8*, ...) @printf(i8* %128)
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%131 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 3
%132 = load i32, i32* %131
%133 = call i64 @S_ISLNK(i32 %132)
%134 = icmp ne i64 %133, 0
%135 = zext i1 %134 to i64
%136 = select i1 %134, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0)
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), i8* %136)
store i32 0, i32* %3
br label %138
138: ; preds = %35, %18, %11
%139 = load i32, i32* %3
ret i32 %139
}

LLVM IR (-O2):
%struct.stat = type { i8*, i8*, i8*, i32 }
@.str = [16 x i8] c": Cannon stat \22\00"
@.str.1 = [2 x i8] c"\22\00"
@.str.2 = [20 x i8] c"Information for %s\0A\00"
@.str.4 = [24 x i8] c"File Size: \09\09%ld bytes\0A\00"
@.str.5 = [23 x i8] c"Number of Links: \09%ld\0A\00"
@.str.6 = [19 x i8] c"File inode: \09\09%lu\0A\00"
@.str.7 = [20 x i8] c"File Permissions: \09\00"
@.str.8 = [2 x i8] c"d\00"
@.str.9 = [2 x i8] c"-\00"
@S_IRUSR = global i32 0
@.str.10 = [2 x i8] c"r\00"
@S_IWUSR = global i32 0
@.str.11 = [2 x i8] c"w\00"
@S_IXUSR = global i32 0
@.str.12 = [2 x i8] c"x\00"
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_IXOTH = global i32 0
@.str.14 = [29 x i8] c"The file %s a symbolic link\0A\00"
@.str.15 = [3 x i8] c"is\00"
@.str.16 = [7 x i8] c"is not\00"
@str = [28 x i8] c"---------------------------\00"
@str.17 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [200 x i8]
%4 = alloca %struct.stat
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = icmp eq i32 %0, 2
br i1 %6, label %7, label %93
7: ; preds = %2
%8 = bitcast %struct.stat* %4 to i8*
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @lstat(i8* %10, %struct.stat* %4)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %7
%14 = load i8*, i8** %1
%15 = call i32 @strcpy(i8* %5, i8* %14)
%16 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %9
%18 = call i32 @strcat(i8* %5, i8* %17)
%19 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @perror(i8* %5)
br label %91
21: ; preds = %7
%22 = load i8*, i8** %9
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%25 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%26 = load i8*, i8** %25
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 1
%29 = load i8*, i8** %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 2
%32 = load i8*, i8** %31
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %32)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%35 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 3
%36 = load i32, i32* %35
%37 = tail call i64 @S_ISDIR(i32 %36)
%38 = icmp eq i64 %37, 0
%39 = select i1 %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0)
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %39)
%41 = load i32, i32* @S_IRUSR
%42 = and i32 %41, %36
%43 = icmp eq i32 %42, 0
%44 = select i1 %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0)
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %44)
%46 = load i32, i32* @S_IWUSR
%47 = and i32 %46, %36
%48 = icmp eq i32 %47, 0
%49 = select i1 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0)
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %49)
%51 = load i32, i32* @S_IXUSR
%52 = and i32 %51, %36
%53 = icmp eq i32 %52, 0
%54 = select i1 %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0)
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %54)
%56 = load i32, i32* @S_IRGRP
%57 = and i32 %56, %36
%58 = icmp eq i32 %57, 0
%59 = select i1 %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0)
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %59)
%61 = load i32, i32* @S_IWGRP
%62 = and i32 %61, %36
%63 = icmp eq i32 %62, 0
%64 = select i1 %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0)
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %64)
%66 = load i32, i32* @S_IXGRP
%67 = and i32 %66, %36
%68 = icmp eq i32 %67, 0
%69 = select i1 %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0)
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %69)
%71 = load i32, i32* @S_IROTH
%72 = and i32 %71, %36
%73 = icmp eq i32 %72, 0
%74 = select i1 %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0)
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %74)
%76 = load i32, i32* @S_IWOTH
%77 = and i32 %76, %36
%78 = icmp eq i32 %77, 0
%79 = select i1 %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0)
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %79)
%81 = load i32, i32* @S_IXOTH
%82 = and i32 %81, %36
%83 = icmp eq i32 %82, 0
%84 = select i1 %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0)
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %84)
%86 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.17, i64 0, i64 0))
%87 = tail call i64 @S_ISLNK(i32 %36)
%88 = icmp eq i64 %87, 0
%89 = select i1 %88, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), i8* %89)
br label %91
91: ; preds = %21, %13
%92 = phi i32 [ 1, %13 ], [ 0, %21 ]
br label %93
93: ; preds = %2, %91
%94 = phi i32 [ %92, %91 ], [ 1, %2 ]
ret i32 %94
}