#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_mode;
  int st_nlink;
  int st_rdev;
  int st_size;
  int /*<<< orphan*/ st_mtime;
  int /*<<< orphan*/ st_gid;
  int /*<<< orphan*/ st_uid;
};

/* Variables and functions */
#define S_IFBLK 133
#define S_IFCHR 132
#define S_IFDIR 131
#define S_IFIFO 130
#define S_IFLNK 129
int S_IFMT;
#define S_IFREG 128
int S_ISGID;
int S_ISUID;
int S_ISVTX;
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int lstat(char *, struct stat *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ printugid(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct stat statv;
  char xtable[10] = "rwxrwxrwx";
  int st_m, k;
  if (argc > 1) {
    k = lstat(argv[1], &statv);
    if (k == -1) {
      printf("File does not exist\n");
      exit(0);
    }
    st_m = statv.st_mode;
    switch (st_m & S_IFMT) {
    case S_IFREG:
      printf("-");
      break;
    case S_IFDIR:
      printf("d");
      break;
    case S_IFBLK:
      printf("b");
      break;
    case S_IFCHR:
      printf("c");
      break;
    case S_IFIFO:
      printf("p");
      break;
    case S_IFLNK:
      printf("l");
      break;
    }
    char amode[10];
    int i, j;
    for (i = 0, j = 1 << 8; i < 9; i++, j >>= 1) {
      amode[i] = st_m & j ? xtable[i] : '-';
    }
    if (st_m & S_ISUID)
      amode[2] == 'x' ? (amode[2] = 'S') : (amode[2] = 's');
    if (st_m & S_ISGID)
      amode[5] == 'x' ? (amode[5] = 'G') : (amode[5] = 'g');
    if (st_m & S_ISVTX)
      amode[9] == 'x' ? (amode[9] = 'T') : (amode[9] = 't');
    amode[9] = '\0';
    printf("%s\t", amode);
    printf("%d ", statv.st_nlink);
    printugid(statv.st_uid, statv.st_gid);
    if ((st_m & S_IFMT == S_IFBLK) || (st_m & S_IFMT == S_IFCHR)) {
      printf(" %d  ", statv.st_rdev >> 8);
      printf(" %d  ", statv.st_rdev & 0x00FF);
    } else {
      printf(" %d  ", statv.st_size);
    }
    printf(" %s ", ctime(&statv.st_mtime));
    printf(" %s  ", argv[1]);
    printf("\n");
  } else {
    printf("Invalid number of arguments\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x3a(%rbp)
mov    0xea8(%rip),%ax
mov    %ax,-0x32(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1458 <main+0x308>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <lstat@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xffffffff,-0x44(%rbp)
jne    11b9 <main+0x69>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    0x2e07(%rip),%rcx
mov    (%rcx),%ecx
and    %ecx,%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x60(%rbp)
sub    $0x5,%eax
ja     1260 <main+0x110>
mov    -0x60(%rbp),%rax
lea    0xe16(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1260 <main+0x110>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1260 <main+0x110>
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1260 <main+0x110>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1260 <main+0x110>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1260 <main+0x110>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x54(%rbp)
movl   $0x100,-0x58(%rbp)
cmpl   $0x9,-0x54(%rbp)
jge    12c9 <main+0x179>
mov    -0x40(%rbp),%eax
and    -0x58(%rbp),%eax
cmp    $0x0,%eax
je     1298 <main+0x148>
movslq -0x54(%rbp),%rax
movsbl -0x3a(%rbp,%rax,1),%eax
mov    %eax,-0x64(%rbp)
jmp    12a5 <main+0x155>
mov    $0x2d,%eax
mov    %eax,-0x64(%rbp)
jmp    12a5 <main+0x155>
mov    -0x64(%rbp),%eax
mov    %al,%cl
movslq -0x54(%rbp),%rax
mov    %cl,-0x4e(%rbp,%rax,1)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x58(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    126e <main+0x11e>
mov    -0x40(%rbp),%eax
mov    0x2d0d(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12f8 <main+0x1a8>
movsbl -0x4c(%rbp),%eax
cmp    $0x78,%eax
jne    12f4 <main+0x1a4>
movb   $0x53,-0x4c(%rbp)
jmp    12f8 <main+0x1a8>
movb   $0x73,-0x4c(%rbp)
mov    -0x40(%rbp),%eax
mov    0x2cc6(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1327 <main+0x1d7>
movsbl -0x49(%rbp),%eax
cmp    $0x78,%eax
jne    1323 <main+0x1d3>
movb   $0x47,-0x49(%rbp)
jmp    1327 <main+0x1d7>
movb   $0x67,-0x49(%rbp)
mov    -0x40(%rbp),%eax
mov    0x2cb7(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1356 <main+0x206>
movsbl -0x45(%rbp),%eax
cmp    $0x78,%eax
jne    1352 <main+0x202>
movb   $0x54,-0x45(%rbp)
jmp    1356 <main+0x206>
movb   $0x74,-0x45(%rbp)
movb   $0x0,-0x45(%rbp)
lea    -0x4e(%rbp),%rsi
lea    0xcde(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <printugid@plt>
mov    -0x40(%rbp),%eax
mov    0x2c3e(%rip),%rcx
cmpl   $0x85,(%rcx)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    13d0 <main+0x280>
mov    -0x40(%rbp),%eax
mov    0x2c1a(%rip),%rcx
cmpl   $0x84,(%rcx)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1400 <main+0x2b0>
mov    -0x28(%rbp),%esi
sar    $0x8,%esi
lea    0xc6e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%esi
and    $0xff,%esi
lea    0xc57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1411 <main+0x2c1>
mov    -0x24(%rbp),%esi
lea    0xc41(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
add    $0x10,%rdi
call   1040 <ctime@plt>
mov    %rax,%rsi
lea    0xc29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xc18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc2b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1466 <main+0x316>
lea    0xbfd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
cmp    $0x2,%edi
jl     134e <main+0x1de>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0x10(%rsp),%rsi
call   1080 <lstat@plt>
cmp    $0xffffffff,%eax
je     136b <main+0x1fb>
mov    0x10(%rsp),%ebp
mov    0x2e32(%rip),%r14
mov    (%r14),%eax
and    %ebp,%eax
add    $0xffffff80,%eax
cmp    $0x5,%eax
ja     11c4 <main+0x54>
cltq
lea    0xe90(%rip),%rcx
mov    (%rcx,%rax,4),%edi
call   1030 <putchar@plt>
test   $0x100,%ebp
mov    $0x2d,%eax
mov    $0x72,%ecx
cmove  %eax,%ecx
mov    $0x72,%edx
mov    %cl,0x6(%rsp)
test   $0x80,%bpl
mov    $0x77,%ecx
mov    $0x77,%esi
cmove  %eax,%esi
mov    %sil,0x7(%rsp)
test   $0x40,%bpl
mov    $0x78,%edi
cmove  %eax,%edi
mov    $0x78,%esi
mov    %dil,0x8(%rsp)
test   $0x20,%bpl
mov    $0x72,%edi
cmove  %eax,%edi
mov    %dil,0x9(%rsp)
test   $0x10,%bpl
mov    $0x77,%edi
cmove  %eax,%edi
mov    %dil,0xa(%rsp)
test   $0x8,%bpl
mov    $0x78,%edi
cmove  %eax,%edi
mov    %dil,0xb(%rsp)
test   $0x4,%bpl
cmove  %eax,%edx
mov    %dl,0xc(%rsp)
test   $0x2,%bpl
cmove  %eax,%ecx
mov    %cl,0xd(%rsp)
test   $0x1,%bpl
cmove  %eax,%esi
mov    %sil,0xe(%rsp)
mov    0x2d80(%rip),%rax
test   %ebp,(%rax)
je     127c <main+0x10c>
test   $0x40,%bpl
sete   %al
shl    $0x5,%al
or     $0x53,%al
mov    %al,0x8(%rsp)
mov    0x2d4d(%rip),%rax
test   %ebp,(%rax)
je     1297 <main+0x127>
test   $0x8,%bpl
sete   %al
shl    $0x5,%al
or     $0x47,%al
mov    %al,0xb(%rsp)
movb   $0x0,0xf(%rsp)
lea    0xd5d(%rip),%rdi
lea    0x6(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x14(%rsp),%esi
lea    0xd4a(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x24(%rsp),%esi
mov    0x28(%rsp),%edi
call   1050 <printugid@plt>
mov    (%r14),%eax
cmp    $0x85,%eax
sete   %cl
test   %cl,%bpl
jne    12ec <main+0x17c>
xor    %ecx,%ecx
cmp    $0x84,%eax
sete   %cl
test   %ecx,%ebp
je     1365 <main+0x1f5>
mov    0x18(%rsp),%ebp
mov    %ebp,%esi
sar    $0x8,%esi
lea    0xd0c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl %bpl,%esi
lea    0xcfa(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x20(%rsp),%rdi
call   1060 <ctime@plt>
lea    0xce8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xcd8(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    135a <main+0x1ea>
lea    0xcc4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x1c(%rsp),%esi
jmp    1307 <main+0x197>
lea    0xcc3(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32 }
@__const.main.xtable = [10 x i8] c"rwxrwxrwx\00"
@.str = [21 x i8] c"File does not exist\0A\00"
@S_IFMT = global i32 0
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [2 x i8] c"d\00"
@.str.3 = [2 x i8] c"b\00"
@.str.4 = [2 x i8] c"c\00"
@.str.5 = [2 x i8] c"p\00"
@.str.6 = [2 x i8] c"l\00"
@S_ISUID = global i32 0
@S_ISGID = global i32 0
@S_ISVTX = global i32 0
@.str.7 = [4 x i8] c"%s\09\00"
@.str.8 = [4 x i8] c"%d \00"
@.str.9 = [6 x i8] c" %d \00"
@.str.10 = [5 x i8] c" %s \00"
@.str.11 = [6 x i8] c" %s \00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [29 x i8] c"Invalid number of arguments\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.stat
%7 = alloca [10 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca [10 x i8]
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = bitcast [10 x i8]* %7 to i8*
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 1
br i1 %15, label %16, label %166
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @lstat(i8* %19, %struct.stat* %6)
store i32 %20, i32* %9
%21 = load i32, i32* %9
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %26
23: ; preds = %16
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%25 = call i32 @exit(i32 0)
unreachable
26: ; preds = %16
%27 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%28 = load i32, i32* %27
store i32 %28, i32* %8
%29 = load i32, i32* %8
%30 = load i32, i32* @S_IFMT
%31 = and i32 %29, %30
switch i32 %31, label %44 [
i32 128, label %32
i32 131, label %34
i32 133, label %36
i32 132, label %38
i32 130, label %40
i32 129, label %42
]
32: ; preds = %26
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %44
34: ; preds = %26
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %44
36: ; preds = %26
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %44
38: ; preds = %26
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %44
40: ; preds = %26
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %44
42: ; preds = %26
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %44
44: ; preds = %26, %42, %40, %38, %36, %34, %32
store i32 0, i32* %11
store i32 256, i32* %12
br label %45
45: ; preds = %66, %44
%46 = load i32, i32* %11
%47 = icmp slt i32 %46, 9
br i1 %47, label %48, label %71
48: ; preds = %45
%49 = load i32, i32* %8
%50 = load i32, i32* %12
%51 = and i32 %49, %50
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %59
53: ; preds = %48
%54 = load i32, i32* %11
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
br label %60
59: ; preds = %48
br label %60
60: ; preds = %59, %53
%61 = phi i32 [ %58, %53 ], [ 45, %59 ]
%62 = trunc i32 %61 to i8
%63 = load i32, i32* %11
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 %64
store i8 %62, i8* %65
br label %66
66: ; preds = %60
%67 = load i32, i32* %11
%68 = add nsw i32 %67, 1
store i32 %68, i32* %11
%69 = load i32, i32* %12
%70 = ashr i32 %69, 1
store i32 %70, i32* %12
br label %45
71: ; preds = %45
%72 = load i32, i32* %8
%73 = load i32, i32* @S_ISUID
%74 = and i32 %72, %73
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %87
76: ; preds = %71
%77 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 2
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 120
br i1 %80, label %81, label %83
81: ; preds = %76
%82 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 2
store i8 83, i8* %82
br label %85
83: ; preds = %76
%84 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 2
store i8 115, i8* %84
br label %85
85: ; preds = %83, %81
%86 = phi i32 [ 83, %81 ], [ 115, %83 ]
br label %87
87: ; preds = %85, %71
%88 = load i32, i32* %8
%89 = load i32, i32* @S_ISGID
%90 = and i32 %88, %89
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %103
92: ; preds = %87
%93 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 5
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 120
br i1 %96, label %97, label %99
97: ; preds = %92
%98 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 5
store i8 71, i8* %98
br label %101
99: ; preds = %92
%100 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 5
store i8 103, i8* %100
br label %101
101: ; preds = %99, %97
%102 = phi i32 [ 71, %97 ], [ 103, %99 ]
br label %103
103: ; preds = %101, %87
%104 = load i32, i32* %8
%105 = load i32, i32* @S_ISVTX
%106 = and i32 %104, %105
%107 = icmp ne i32 %106, 0
br i1 %107, label %108, label %119
108: ; preds = %103
%109 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 9
%110 = load i8, i8* %109
%111 = sext i8 %110 to i32
%112 = icmp eq i32 %111, 120
br i1 %112, label %113, label %115
113: ; preds = %108
%114 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 9
store i8 84, i8* %114
br label %117
115: ; preds = %108
%116 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 9
store i8 116, i8* %116
br label %117
117: ; preds = %115, %113
%118 = phi i32 [ 84, %113 ], [ 116, %115 ]
br label %119
119: ; preds = %117, %103
%120 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 9
store i8 0, i8* %120
%121 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %121)
%123 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 1
%124 = load i32, i32* %123
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %124)
%126 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 6
%127 = load i32, i32* %126
%128 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 5
%129 = load i32, i32* %128
%130 = call i32 @printugid(i32 %127, i32 %129)
%131 = load i32, i32* %8
%132 = load i32, i32* @S_IFMT
%133 = icmp eq i32 %132, 133
%134 = zext i1 %133 to i32
%135 = and i32 %131, %134
%136 = icmp ne i32 %135, 0
br i1 %136, label %144, label %137
137: ; preds = %119
%138 = load i32, i32* %8
%139 = load i32, i32* @S_IFMT
%140 = icmp eq i32 %139, 132
%141 = zext i1 %140 to i32
%142 = and i32 %138, %141
%143 = icmp ne i32 %142, 0
br i1 %143, label %144, label %153
144: ; preds = %137, %119
%145 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 2
%146 = load i32, i32* %145
%147 = ashr i32 %146, 8
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %147)
%149 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 2
%150 = load i32, i32* %149
%151 = and i32 %150, 255
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %151)
br label %157
153: ; preds = %137
%154 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 3
%155 = load i32, i32* %154
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %155)
br label %157
157: ; preds = %153, %144
%158 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 4
%159 = call i8* @ctime(i32* %158)
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %159)
%161 = load i8**, i8*** %5
%162 = getelementptr inbounds i8*, i8** %161, i64 1
%163 = load i8*, i8** %162
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %163)
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %168
166: ; preds = %2
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
br label %168
168: ; preds = %166, %157
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32 }
@S_IFMT = global i32 0
@S_ISUID = global i32 0
@S_ISGID = global i32 0
@S_ISVTX = global i32 0
@.str.7 = [4 x i8] c"%s\09\00"
@.str.8 = [4 x i8] c"%d \00"
@.str.9 = [6 x i8] c" %d \00"
@.str.10 = [5 x i8] c" %s \00"
@.str.11 = [6 x i8] c" %s \00"
@str = [28 x i8] c"Invalid number of arguments\00"
@str.14 = [20 x i8] c"File does not exist\00"
@switch.table.main = [6 x i32] [i32 45, i32 108, i32 112, i32 100, i32 99, i32 98]
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca [10 x i8]
%5 = bitcast %struct.stat* %3 to i8*
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %114
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @lstat(i8* %9, %struct.stat* %3)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.14, i64 0, i64 0))
%14 = tail call i32 @exit(i32 0)
unreachable
15: ; preds = %7
%16 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%17 = load i32, i32* %16
%18 = load i32, i32* @S_IFMT
%19 = and i32 %18, %17
%20 = add i32 %19, -128
%21 = icmp ult i32 %20, 6
br i1 %21, label %22, label %27
22: ; preds = %15
%23 = sext i32 %20 to i64
%24 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.main, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = tail call i32 @putchar(i32 %25)
br label %27
27: ; preds = %15, %22
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%29 = and i32 %17, 256
%30 = icmp eq i32 %29, 0
%31 = select i1 %30, i8 45, i8 114
store i8 %31, i8* %28
%32 = and i32 %17, 128
%33 = icmp eq i32 %32, 0
%34 = select i1 %33, i8 45, i8 119
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 1
store i8 %34, i8* %35
%36 = and i32 %17, 64
%37 = icmp eq i32 %36, 0
%38 = select i1 %37, i8 45, i8 120
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 2
store i8 %38, i8* %39
%40 = and i32 %17, 32
%41 = icmp eq i32 %40, 0
%42 = select i1 %41, i8 45, i8 114
%43 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 3
store i8 %42, i8* %43
%44 = and i32 %17, 16
%45 = icmp eq i32 %44, 0
%46 = select i1 %45, i8 45, i8 119
%47 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 4
store i8 %46, i8* %47
%48 = and i32 %17, 8
%49 = icmp eq i32 %48, 0
%50 = select i1 %49, i8 45, i8 120
%51 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 5
store i8 %50, i8* %51
%52 = and i32 %17, 4
%53 = icmp eq i32 %52, 0
%54 = select i1 %53, i8 45, i8 114
%55 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 6
store i8 %54, i8* %55
%56 = and i32 %17, 2
%57 = icmp eq i32 %56, 0
%58 = select i1 %57, i8 45, i8 119
%59 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 7
store i8 %58, i8* %59
%60 = and i32 %17, 1
%61 = icmp eq i32 %60, 0
%62 = select i1 %61, i8 45, i8 120
%63 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 8
store i8 %62, i8* %63
%64 = load i32, i32* @S_ISUID
%65 = and i32 %64, %17
%66 = icmp eq i32 %65, 0
br i1 %66, label %69, label %67
67: ; preds = %27
%68 = select i1 %37, i8 115, i8 83
store i8 %68, i8* %39
br label %69
69: ; preds = %67, %27
%70 = load i32, i32* @S_ISGID
%71 = and i32 %70, %17
%72 = icmp eq i32 %71, 0
br i1 %72, label %75, label %73
73: ; preds = %69
%74 = select i1 %49, i8 103, i8 71
store i8 %74, i8* %51
br label %75
75: ; preds = %73, %69
%76 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 9
store i8 0, i8* %76
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %28)
%78 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%79 = load i32, i32* %78
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %79)
%81 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 6
%82 = load i32, i32* %81
%83 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 5
%84 = load i32, i32* %83
%85 = call i32 @printugid(i32 %82, i32 %84)
%86 = load i32, i32* @S_IFMT
%87 = icmp eq i32 %86, 133
%88 = zext i1 %87 to i32
%89 = and i32 %17, %88
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %96
91: ; preds = %75
%92 = icmp eq i32 %86, 132
%93 = zext i1 %92 to i32
%94 = and i32 %17, %93
%95 = icmp eq i32 %94, 0
br i1 %95, label %102, label %96
96: ; preds = %91, %75
%97 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 2
%98 = load i32, i32* %97
%99 = ashr i32 %98, 8
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %99)
%101 = and i32 %98, 255
br label %105
102: ; preds = %91
%103 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 3
%104 = load i32, i32* %103
br label %105
105: ; preds = %102, %96
%106 = phi i32 [ %104, %102 ], [ %101, %96 ]
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %106)
%108 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 4
%109 = call i8* @ctime(i32* %108)
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %109)
%111 = load i8*, i8** %8
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %111)
%113 = call i32 @putchar(i32 10)
br label %116
114: ; preds = %2
%115 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %116
116: ; preds = %114, %105
ret i32 0
}