#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 {
  int st_uid;
  int st_gid;
  int st_blksize;
  int st_blocks;
  int st_ino;
  int st_size;
  int st_nlink;
  int st_mode;
  int /*<<< orphan*/ st_mtime;
  int /*<<< orphan*/ st_atime;
};

/* Variables and functions */
int S_IFDIR;
int S_IFREG;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
scalar_t__ S_ISDIR(int);
int S_IWGRP;
int S_IWOTH;
int S_IWUSR;
int S_IXGRP;
int S_IXOTH;
int S_IXUSR;
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int stat(char *, struct stat *);
int main(int argc, char *argv[]) {
  struct stat file;
  int n;
  if (argc != 2) {
    printf("Number of Arguements provided != 2 \n");
    printf("Arguements Required: \n");
    printf("Filename \n");
    exit(-1);
  }
  if ((n = stat(argv[1], &file)) == -1) {
    perror(argv[1]);
    exit(-1);
  }
  printf("User ID : %d \n", file.st_uid);
  printf("Group ID : %d \n", file.st_gid);
  printf("Block Size : %d\n", file.st_blksize);
  printf("Blocks Allocated : %d\n", file.st_blocks);
  printf("i-Node Number : %d \n", file.st_ino);
  printf("\n");
  printf("Last Accessed : %s", ctime(&(file.st_atime)));
  printf("Last Modified : %s", ctime(&(file.st_mtime)));
  printf("\n");
  printf("File Size : %d Bytes \n", file.st_size);
  printf("Number Of Links : %d \n", file.st_nlink);
  printf("Directory : ");
  printf((S_ISDIR(file.st_mode)) ? "d " : "- ");
  printf("\n");
  printf("Permissions : \n");
  printf("User : ");
  printf((file.st_mode & S_IRUSR) ? "r " : "- ");
  printf((file.st_mode & S_IWUSR) ? "w " : "- ");
  printf((file.st_mode & S_IXUSR) ? "x " : "- ");
  printf("\n");
  printf("Group : ");
  printf((file.st_mode & S_IRGRP) ? "r " : "- ");
  printf((file.st_mode & S_IWGRP) ? "w " : "- ");
  printf((file.st_mode & S_IXGRP) ? "x " : "- ");
  printf("\n");
  printf("Other : ");
  printf((file.st_mode & S_IROTH) ? "r " : "- ");
  printf((file.st_mode & S_IWOTH) ? "w " : "- ");
  printf((file.st_mode & S_IXOTH) ? "x " : "- ");
  printf("\n");
  if (file.st_mode & S_IFREG) {
    printf("Type : Regular \n");
  }
  if (file.st_mode & S_IFDIR) {
    printf("Type : Directory \n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11b4 <main+0x54>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x38(%rbp),%rsi
call   1060 <stat@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0xffffffff,%eax
jne    11e8 <main+0x88>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <perror@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
mov    -0x38(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x38(%rbp),%rdi
add    $0x24,%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x38(%rbp),%rdi
add    $0x20,%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%edi
call   1050 <S_ISDIR@plt>
mov    %rax,%rcx
lea    0xe30(%rip),%rdi
lea    0xe26(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    0x2c7f(%rip),%rax
and    (%rax),%ecx
lea    0xddd(%rip),%rdi
lea    0xdf1(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    0x2c7f(%rip),%rax
and    (%rax),%ecx
lea    0xdb5(%rip),%rdi
lea    0xdcc(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    0x2c6f(%rip),%rax
and    (%rax),%ecx
lea    0xd8d(%rip),%rdi
lea    0xda7(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    0x2bfb(%rip),%rax
and    (%rax),%ecx
lea    0xd49(%rip),%rdi
lea    0xd5d(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    0x2bf3(%rip),%rax
and    (%rax),%ecx
lea    0xd21(%rip),%rdi
lea    0xd38(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    0x2bbb(%rip),%rax
and    (%rax),%ecx
lea    0xcf9(%rip),%rdi
lea    0xd13(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcfc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    0x2b5f(%rip),%rax
and    (%rax),%ecx
lea    0xcb5(%rip),%rdi
lea    0xcc9(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    0x2b1f(%rip),%rax
and    (%rax),%ecx
lea    0xc8d(%rip),%rdi
lea    0xca4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    0x2b4f(%rip),%rax
and    (%rax),%ecx
lea    0xc65(%rip),%rdi
lea    0xc7f(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    0x2b09(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     14e8 <main+0x388>
lea    0xc5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    0x2a96(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     150b <main+0x3ab>
lea    0xc4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x2,%edi
jne    1450 <main+0x2d0>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    %rsp,%rsi
call   1080 <stat@plt>
cmp    $0xffffffff,%eax
je     147e <main+0x2fe>
mov    (%rsp),%esi
lea    0xe4a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe47(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xe44(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x24(%rsp),%rdi
call   1050 <ctime@plt>
lea    0xe3c(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x20(%rsp),%rdi
call   1050 <ctime@plt>
lea    0xe34(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x14(%rsp),%esi
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%esi
lea    0xe2d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x1c(%rsp),%edi
call   1070 <S_ISDIR@plt>
test   %rax,%rax
lea    0xe2c(%rip),%r12
lea    0xe22(%rip),%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe2c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe00(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2ccf(%rip),%rax
mov    (%rax),%eax
and    0x1c(%rsp),%eax
lea    0xe33(%rip),%r14
mov    %r14,%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2cd5(%rip),%rax
mov    (%rax),%eax
and    0x1c(%rsp),%eax
lea    0xdcb(%rip),%r15
mov    %r15,%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2ccb(%rip),%rax
mov    (%rax),%eax
and    0x1c(%rsp),%eax
lea    0xdac(%rip),%rbx
mov    %rbx,%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd90(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c61(%rip),%rax
mov    (%rax),%eax
and    0x1c(%rsp),%eax
mov    %r14,%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c66(%rip),%rax
mov    (%rax),%eax
and    0x1c(%rsp),%eax
mov    %r15,%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c3b(%rip),%rax
mov    (%rax),%eax
and    0x1c(%rsp),%eax
mov    %rbx,%rdi
cmove  %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd30(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2bf0(%rip),%rax
mov    (%rax),%eax
and    0x1c(%rsp),%eax
cmove  %r12,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2bbd(%rip),%rax
mov    (%rax),%eax
and    0x1c(%rsp),%eax
cmove  %r12,%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2bfa(%rip),%rax
mov    (%rax),%eax
and    0x1c(%rsp),%eax
cmove  %r12,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x1c(%rsp),%eax
mov    0x2bc1(%rip),%rcx
test   %eax,(%rcx)
je     142b <main+0x2ab>
lea    0xce2(%rip),%rdi
call   1040 <puts@plt>
mov    0x1c(%rsp),%eax
mov    0x2b56(%rip),%rcx
test   %eax,(%rcx)
je     1442 <main+0x2c2>
lea    0xcb5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xcbd(%rip),%rdi
call   1040 <puts@plt>
lea    0xcd5(%rip),%rdi
call   1040 <puts@plt>
lea    0xcdf(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
mov    0x8(%rbx),%rdi
call   1090 <perror@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [37 x i8] c"Number of Arguements provided != 2 \0A\00"
@.str.1 = [23 x i8] c"Arguements Required: \0A\00"
@.str.2 = [11 x i8] c"Filename \0A\00"
@.str.3 = [15 x i8] c"User ID : %d \0A\00"
@.str.4 = [16 x i8] c"Group ID : %d \0A\00"
@.str.5 = [17 x i8] c"Block Size : %d\0A\00"
@.str.6 = [23 x i8] c"Blocks Allocated : %d\0A\00"
@.str.7 = [21 x i8] c"i-Node Number : %d \0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [19 x i8] c"Last Accessed : %s\00"
@.str.10 = [19 x i8] c"Last Modified : %s\00"
@.str.11 = [23 x i8] c"File Size : %d Bytes \0A\00"
@.str.12 = [23 x i8] c"Number Of Links : %d \0A\00"
@.str.13 = [13 x i8] c"Directory : \00"
@.str.14 = [3 x i8] c"d \00"
@.str.15 = [3 x i8] c"- \00"
@.str.16 = [16 x i8] c"Permissions : \0A\00"
@.str.17 = [8 x i8] c"User : \00"
@S_IRUSR = global i32 0
@.str.18 = [3 x i8] c"r \00"
@S_IWUSR = global i32 0
@.str.19 = [3 x i8] c"w \00"
@S_IXUSR = global i32 0
@.str.20 = [3 x i8] c"x \00"
@.str.21 = [9 x i8] c"Group : \00"
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IXGRP = global i32 0
@.str.22 = [9 x i8] c"Other : \00"
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_IXOTH = global i32 0
@S_IFREG = global i32 0
@.str.23 = [17 x i8] c"Type : Regular \0A\00"
@S_IFDIR = global i32 0
@.str.24 = [19 x i8] c"Type : Directory \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.stat
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @stat(i8* %18, %struct.stat* %6)
store i32 %19, i32* %7
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %27
21: ; preds = %15
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @perror(i8* %24)
%26 = call i32 @exit(i32 -1)
unreachable
27: ; preds = %15
%28 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 1
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 2
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 3
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 4
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%44 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 9
%45 = call i8* @ctime(i32* %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %45)
%47 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 8
%48 = call i8* @ctime(i32* %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* %48)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%51 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 5
%52 = load i32, i32* %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i32 %52)
%54 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 6
%55 = load i32, i32* %54
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%58 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%59 = load i32, i32* %58
%60 = call i64 @S_ISDIR(i32 %59)
%61 = icmp ne i64 %60, 0
%62 = zext i1 %61 to i64
%63 = select i1 %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%64 = call i32 (i8*, ...) @printf(i8* %63)
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0))
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%68 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%69 = load i32, i32* %68
%70 = load i32, i32* @S_IRUSR
%71 = and i32 %69, %70
%72 = icmp ne i32 %71, 0
%73 = zext i1 %72 to i64
%74 = select i1 %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%75 = call i32 (i8*, ...) @printf(i8* %74)
%76 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%77 = load i32, i32* %76
%78 = load i32, i32* @S_IWUSR
%79 = and i32 %77, %78
%80 = icmp ne i32 %79, 0
%81 = zext i1 %80 to i64
%82 = select i1 %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%83 = call i32 (i8*, ...) @printf(i8* %82)
%84 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%85 = load i32, i32* %84
%86 = load i32, i32* @S_IXUSR
%87 = and i32 %85, %86
%88 = icmp ne i32 %87, 0
%89 = zext i1 %88 to i64
%90 = select i1 %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%91 = call i32 (i8*, ...) @printf(i8* %90)
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0))
%94 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%95 = load i32, i32* %94
%96 = load i32, i32* @S_IRGRP
%97 = and i32 %95, %96
%98 = icmp ne i32 %97, 0
%99 = zext i1 %98 to i64
%100 = select i1 %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%101 = call i32 (i8*, ...) @printf(i8* %100)
%102 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%103 = load i32, i32* %102
%104 = load i32, i32* @S_IWGRP
%105 = and i32 %103, %104
%106 = icmp ne i32 %105, 0
%107 = zext i1 %106 to i64
%108 = select i1 %106, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%109 = call i32 (i8*, ...) @printf(i8* %108)
%110 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%111 = load i32, i32* %110
%112 = load i32, i32* @S_IXGRP
%113 = and i32 %111, %112
%114 = icmp ne i32 %113, 0
%115 = zext i1 %114 to i64
%116 = select i1 %114, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%117 = call i32 (i8*, ...) @printf(i8* %116)
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0))
%120 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%121 = load i32, i32* %120
%122 = load i32, i32* @S_IROTH
%123 = and i32 %121, %122
%124 = icmp ne i32 %123, 0
%125 = zext i1 %124 to i64
%126 = select i1 %124, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%127 = call i32 (i8*, ...) @printf(i8* %126)
%128 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%129 = load i32, i32* %128
%130 = load i32, i32* @S_IWOTH
%131 = and i32 %129, %130
%132 = icmp ne i32 %131, 0
%133 = zext i1 %132 to i64
%134 = select i1 %132, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%135 = call i32 (i8*, ...) @printf(i8* %134)
%136 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%137 = load i32, i32* %136
%138 = load i32, i32* @S_IXOTH
%139 = and i32 %137, %138
%140 = icmp ne i32 %139, 0
%141 = zext i1 %140 to i64
%142 = select i1 %140, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0)
%143 = call i32 (i8*, ...) @printf(i8* %142)
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%145 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%146 = load i32, i32* %145
%147 = load i32, i32* @S_IFREG
%148 = and i32 %146, %147
%149 = icmp ne i32 %148, 0
br i1 %149, label %150, label %152
150: ; preds = %27
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0))
br label %152
152: ; preds = %150, %27
%153 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%154 = load i32, i32* %153
%155 = load i32, i32* @S_IFDIR
%156 = and i32 %154, %155
%157 = icmp ne i32 %156, 0
br i1 %157, label %158, label %160
158: ; preds = %152
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.24, i64 0, i64 0))
br label %160
160: ; preds = %158, %152
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str.3 = [15 x i8] c"User ID : %d \0A\00"
@.str.4 = [16 x i8] c"Group ID : %d \0A\00"
@.str.5 = [17 x i8] c"Block Size : %d\0A\00"
@.str.6 = [23 x i8] c"Blocks Allocated : %d\0A\00"
@.str.7 = [21 x i8] c"i-Node Number : %d \0A\00"
@.str.9 = [19 x i8] c"Last Accessed : %s\00"
@.str.10 = [19 x i8] c"Last Modified : %s\00"
@.str.11 = [23 x i8] c"File Size : %d Bytes \0A\00"
@.str.12 = [23 x i8] c"Number Of Links : %d \0A\00"
@.str.13 = [13 x i8] c"Directory : \00"
@.str.14 = [3 x i8] c"d \00"
@.str.15 = [3 x i8] c"- \00"
@.str.17 = [8 x i8] c"User : \00"
@S_IRUSR = global i32 0
@.str.18 = [3 x i8] c"r \00"
@S_IWUSR = global i32 0
@.str.19 = [3 x i8] c"w \00"
@S_IXUSR = global i32 0
@.str.20 = [3 x i8] c"x \00"
@.str.21 = [9 x i8] c"Group : \00"
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IXGRP = global i32 0
@.str.22 = [9 x i8] c"Other : \00"
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_IXOTH = global i32 0
@S_IFREG = global i32 0
@S_IFDIR = global i32 0
@str = [15 x i8] c"Permissions : \00"
@str.25 = [18 x i8] c"Type : Directory \00"
@str.26 = [16 x i8] c"Type : Regular \00"
@str.27 = [36 x i8] c"Number of Arguements provided != 2 \00"
@str.28 = [22 x i8] c"Arguements Required: \00"
@str.29 = [10 x i8] c"Filename \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.27, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.28, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.29, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @stat(i8* %13, %struct.stat* %3)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i8*, i8** %12
%18 = tail call i32 @perror(i8* %17)
%19 = tail call i32 @exit(i32 -1)
unreachable
20: ; preds = %11
%21 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%22 = load i32, i32* %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%25 = load i32, i32* %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 2
%28 = load i32, i32* %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 3
%31 = load i32, i32* %30
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %31)
%33 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 4
%34 = load i32, i32* %33
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %34)
%36 = tail call i32 @putchar(i32 10)
%37 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 9
%38 = call i8* @ctime(i32* %37)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %38)
%40 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 8
%41 = call i8* @ctime(i32* %40)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* %41)
%43 = call i32 @putchar(i32 10)
%44 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 5
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 6
%48 = load i32, i32* %47
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %48)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%51 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 7
%52 = load i32, i32* %51
%53 = call i64 @S_ISDIR(i32 %52)
%54 = icmp eq i64 %53, 0
%55 = select i1 %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %55)
%57 = call i32 @putchar(i32 10)
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%60 = load i32, i32* %51
%61 = load i32, i32* @S_IRUSR
%62 = and i32 %61, %60
%63 = icmp eq i32 %62, 0
%64 = select i1 %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %64)
%66 = load i32, i32* %51
%67 = load i32, i32* @S_IWUSR
%68 = and i32 %67, %66
%69 = icmp eq i32 %68, 0
%70 = select i1 %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %70)
%72 = load i32, i32* %51
%73 = load i32, i32* @S_IXUSR
%74 = and i32 %73, %72
%75 = icmp eq i32 %74, 0
%76 = select i1 %75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %76)
%78 = call i32 @putchar(i32 10)
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0))
%80 = load i32, i32* %51
%81 = load i32, i32* @S_IRGRP
%82 = and i32 %81, %80
%83 = icmp eq i32 %82, 0
%84 = select i1 %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0)
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %84)
%86 = load i32, i32* %51
%87 = load i32, i32* @S_IWGRP
%88 = and i32 %87, %86
%89 = icmp eq i32 %88, 0
%90 = select i1 %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0)
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %90)
%92 = load i32, i32* %51
%93 = load i32, i32* @S_IXGRP
%94 = and i32 %93, %92
%95 = icmp eq i32 %94, 0
%96 = select i1 %95, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0)
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %96)
%98 = call i32 @putchar(i32 10)
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0))
%100 = load i32, i32* %51
%101 = load i32, i32* @S_IROTH
%102 = and i32 %101, %100
%103 = icmp eq i32 %102, 0
%104 = select i1 %103, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0)
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %104)
%106 = load i32, i32* %51
%107 = load i32, i32* @S_IWOTH
%108 = and i32 %107, %106
%109 = icmp eq i32 %108, 0
%110 = select i1 %109, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0)
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %110)
%112 = load i32, i32* %51
%113 = load i32, i32* @S_IXOTH
%114 = and i32 %113, %112
%115 = icmp eq i32 %114, 0
%116 = select i1 %115, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0)
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %116)
%118 = call i32 @putchar(i32 10)
%119 = load i32, i32* %51
%120 = load i32, i32* @S_IFREG
%121 = and i32 %120, %119
%122 = icmp eq i32 %121, 0
br i1 %122, label %126, label %123
123: ; preds = %20
%124 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.26, i64 0, i64 0))
%125 = load i32, i32* %51
br label %126
126: ; preds = %123, %20
%127 = phi i32 [ %125, %123 ], [ %119, %20 ]
%128 = load i32, i32* @S_IFDIR
%129 = and i32 %128, %127
%130 = icmp eq i32 %129, 0
br i1 %130, label %133, label %131
131: ; preds = %126
%132 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.25, i64 0, i64 0))
br label %133
133: ; preds = %131, %126
ret i32 0
}