#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;
struct stat {
  int st_mode;
  int st_nlink;
  int st_uid;
  int st_gid;
  scalar_t__ st_size;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
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 S_IWGRP;
int S_IWOTH;
int S_IWUSR;
int S_IXGRP;
int S_IXOTH;
int S_IXUSR;
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int strlen(char *);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  struct stat buf;
  time_t t;
  char *str_time;
  if (argc < 2) {
    fprintf(stderr, "Uso: %s <filename>\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  if (stat(argv[1], &buf) < 0) {
    fprintf(stderr, "Err.(%s) stat() failed\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
  if (time(&t) < 0) {
    fprintf(stderr, "Err.(%s) time() failed\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
  if ((str_time = ctime(&t)) == NULL) {
    fprintf(stderr, "Err.(%s) ctime() failed\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
  str_time[strlen(str_time) - 1] = '\0';
  if (S_ISREG(buf.st_mode))
    printf("-");
  else if (S_ISDIR(buf.st_mode))
    printf("d");
  else if (S_ISCHR(buf.st_mode))
    printf("c");
  else if (S_ISBLK(buf.st_mode))
    printf("b");
  else if (S_ISFIFO(buf.st_mode))
    printf("f");
  else if (S_ISLNK(buf.st_mode))
    printf("l");
  else if (S_ISSOCK(buf.st_mode))
    printf("s");
  else
    printf("u");
  if (S_IRUSR & buf.st_mode)
    printf("r");
  else
    printf("-");
  if (S_IWUSR & buf.st_mode)
    printf("w");
  else
    printf("-");
  if (S_IXUSR & buf.st_mode)
    printf("x");
  else
    printf("-");
  if (S_IRGRP & buf.st_mode)
    printf("r");
  else
    printf("-");
  if (S_IWGRP & buf.st_mode)
    printf("w");
  else
    printf("-");
  if (S_IXGRP & buf.st_mode)
    printf("x");
  else
    printf("-");
  if (S_IROTH & buf.st_mode)
    printf("r");
  else
    printf("-");
  if (S_IWOTH & buf.st_mode)
    printf("w");
  else
    printf("-");
  if (S_IXOTH & buf.st_mode)
    printf("x");
  else
    printf("-");
  printf(" %d", buf.st_nlink);
  printf(" %d", buf.st_uid);
  printf(" %d", buf.st_gid);
  printf(" %d ", (int)buf.st_size);
  printf(" %s %s", str_time, argv[1]);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    123a <main+0x4a>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdd9(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d65(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
call   10b0 <stat@plt>
cmp    $0x0,%rax
jge    128f <main+0x9f>
mov    0x2d5c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0x3c(%rbp),%edi
mov    %rax,%rdx
lea    0xd98(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d10(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    -0x2c(%rbp),%rdi
call   10c0 <time@plt>
cmp    $0x0,%rax
jge    12dc <main+0xec>
mov    0x2d0f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x2cfb(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0x40(%rbp),%edi
mov    %rax,%rdx
lea    0xd63(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    -0x2c(%rbp),%rdi
call   1040 <ctime@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    132d <main+0x13d>
mov    0x2cbe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2caa(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0x44(%rbp),%edi
mov    %rax,%rdx
lea    0xd2a(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2c72(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%edi
call   10d0 <S_ISREG@plt>
cmp    $0x0,%rax
je     1373 <main+0x183>
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    147d <main+0x28d>
mov    -0x28(%rbp),%edi
call   1090 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1398 <main+0x1a8>
lea    0xce5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1478 <main+0x288>
mov    -0x28(%rbp),%edi
call   10e0 <S_ISCHR@plt>
cmp    $0x0,%rax
je     13bd <main+0x1cd>
lea    0xcae(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1473 <main+0x283>
mov    -0x28(%rbp),%edi
call   10f0 <S_ISBLK@plt>
cmp    $0x0,%rax
je     13e2 <main+0x1f2>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    146e <main+0x27e>
mov    -0x28(%rbp),%edi
call   1060 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     1407 <main+0x217>
lea    0xc68(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1469 <main+0x279>
mov    -0x28(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
je     142c <main+0x23c>
lea    0xc45(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1464 <main+0x274>
mov    -0x28(%rbp),%edi
call   1070 <S_ISSOCK@plt>
cmp    $0x0,%rax
je     1451 <main+0x261>
lea    0xc38(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    145f <main+0x26f>
lea    0xc0f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1464 <main+0x274>
jmp    1469 <main+0x279>
jmp    146e <main+0x27e>
jmp    1473 <main+0x283>
jmp    1478 <main+0x288>
jmp    147d <main+0x28d>
mov    0x2b0c(%rip),%rax
mov    (%rax),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     14a5 <main+0x2b5>
lea    0xbd0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    14b3 <main+0x2c3>
lea    0xbb1(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2b16(%rip),%rax
mov    (%rax),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     14db <main+0x2eb>
lea    0xb9c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    14e9 <main+0x2f9>
lea    0xb7b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2af0(%rip),%rax
mov    (%rax),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     1511 <main+0x321>
lea    0xb68(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    151f <main+0x32f>
lea    0xb45(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2a82(%rip),%rax
mov    (%rax),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     1547 <main+0x357>
lea    0xb2e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1555 <main+0x365>
lea    0xb0f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2a7c(%rip),%rax
mov    (%rax),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     157d <main+0x38d>
lea    0xafa(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    158b <main+0x39b>
lea    0xad9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2a36(%rip),%rax
mov    (%rax),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     15b3 <main+0x3c3>
lea    0xac6(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    15c1 <main+0x3d1>
lea    0xaa3(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x29d8(%rip),%rax
mov    (%rax),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     15e9 <main+0x3f9>
lea    0xa8c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    15f7 <main+0x407>
lea    0xa6d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x297a(%rip),%rax
mov    (%rax),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     161f <main+0x42f>
lea    0xa58(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    162d <main+0x43d>
lea    0xa37(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x29b4(%rip),%rax
mov    (%rax),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     1655 <main+0x465>
lea    0xa24(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1663 <main+0x473>
lea    0xa01(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xa02(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0x9f1(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0x9e0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0x9d0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x9bb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x28bd(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
cmp    $0x1,%edi
jle    1469 <main+0x269>
mov    0x8(%r14),%rdi
lea    0x8(%rsp),%rsi
call   10c0 <stat@plt>
test   %rax,%rax
js     147e <main+0x27e>
lea    0x24(%rsp),%rdi
call   10d0 <time@plt>
test   %rax,%rax
js     149e <main+0x29e>
lea    0x24(%rsp),%rdi
call   1050 <ctime@plt>
test   %rax,%rax
je     14be <main+0x2be>
mov    %rax,%r15
mov    %rax,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r15,1)
mov    0x8(%rsp),%edi
call   10e0 <S_ISREG@plt>
mov    $0x2d,%r13d
mov    $0x2d,%edi
test   %rax,%rax
jne    12f9 <main+0xf9>
mov    0x8(%rsp),%edi
call   10a0 <S_ISDIR@plt>
mov    $0x64,%edi
test   %rax,%rax
jne    12f9 <main+0xf9>
mov    0x8(%rsp),%edi
call   10f0 <S_ISCHR@plt>
mov    $0x63,%edi
test   %rax,%rax
jne    12f9 <main+0xf9>
mov    0x8(%rsp),%edi
call   1100 <S_ISBLK@plt>
mov    $0x62,%edi
test   %rax,%rax
jne    12f9 <main+0xf9>
mov    0x8(%rsp),%edi
call   1070 <S_ISFIFO@plt>
mov    $0x66,%edi
test   %rax,%rax
jne    12f9 <main+0xf9>
mov    0x8(%rsp),%edi
call   1040 <S_ISLNK@plt>
mov    $0x6c,%edi
test   %rax,%rax
jne    12f9 <main+0xf9>
mov    0x8(%rsp),%edi
call   1080 <S_ISSOCK@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,1),%edi
add    $0x73,%edi
call   1030 <putchar@plt>
mov    0x2c8b(%rip),%rax
mov    0x8(%rsp),%ecx
and    (%rax),%ecx
mov    $0x72,%r12d
mov    $0x72,%edi
cmove  %r13d,%edi
call   1030 <putchar@plt>
mov    0x2caa(%rip),%rax
mov    0x8(%rsp),%ecx
and    (%rax),%ecx
mov    $0x77,%ebx
mov    $0x77,%edi
cmove  %r13d,%edi
call   1030 <putchar@plt>
mov    0x2c9a(%rip),%rax
mov    0x8(%rsp),%ecx
and    (%rax),%ecx
mov    $0x78,%ebp
mov    $0x78,%edi
cmove  %r13d,%edi
call   1030 <putchar@plt>
mov    0x2c42(%rip),%rax
mov    0x8(%rsp),%ecx
and    (%rax),%ecx
mov    $0x72,%edi
cmove  %r13d,%edi
call   1030 <putchar@plt>
mov    0x2c57(%rip),%rax
mov    0x8(%rsp),%ecx
and    (%rax),%ecx
mov    $0x77,%edi
cmove  %r13d,%edi
call   1030 <putchar@plt>
mov    0x2c2c(%rip),%rax
mov    0x8(%rsp),%ecx
and    (%rax),%ecx
mov    $0x78,%edi
cmove  %r13d,%edi
call   1030 <putchar@plt>
mov    0x2be9(%rip),%rax
mov    0x8(%rsp),%ecx
and    (%rax),%ecx
cmove  %r13d,%r12d
mov    %r12d,%edi
call   1030 <putchar@plt>
mov    0x2ba8(%rip),%rax
mov    0x8(%rsp),%ecx
and    (%rax),%ecx
cmove  %r13d,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    0x2c00(%rip),%rax
mov    0x8(%rsp),%ecx
and    (%rax),%ecx
cmove  %r13d,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%esi
lea    0xc59(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x18(%rsp),%esi
lea    0xc2c(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x8(%r14),%rdx
lea    0xc1f(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2b30(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b48(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xb84(%rip),%rsi
jmp    14e1 <main+0x2e1>
mov    0x2b33(%rip),%rax
mov    (%rax),%ebx
mov    0x2b22(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xb78(%rip),%rsi
jmp    14dc <main+0x2dc>
mov    0x2b13(%rip),%rax
mov    (%rax),%ebx
mov    0x2b02(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xb70(%rip),%rsi
jmp    14dc <main+0x2dc>
mov    0x2af3(%rip),%rax
mov    (%rax),%ebx
mov    0x2ae2(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xb68(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   10b0 <fprintf@plt>
mov    0x2aab(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32, i64 }
@stderr = global i32 0
@.str = [20 x i8] c"Uso: %s <filename>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [24 x i8] c"Err.(%s) stat() failed\0A\00"
@errno = global i32 0
@.str.2 = [24 x i8] c"Err.(%s) time() failed\0A\00"
@.str.3 = [25 x i8] c"Err.(%s) ctime() failed\0A\00"
@.str.4 = [2 x i8] c"-\00"
@.str.5 = [2 x i8] c"d\00"
@.str.6 = [2 x i8] c"c\00"
@.str.7 = [2 x i8] c"b\00"
@.str.8 = [2 x i8] c"f\00"
@.str.9 = [2 x i8] c"l\00"
@.str.10 = [2 x i8] c"s\00"
@.str.11 = [2 x i8] c"u\00"
@S_IRUSR = global i32 0
@.str.12 = [2 x i8] c"r\00"
@S_IWUSR = global i32 0
@.str.13 = [2 x i8] c"w\00"
@S_IXUSR = global i32 0
@.str.14 = [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.15 = [4 x i8] c" %d\00"
@.str.16 = [5 x i8] c" %d \00"
@.str.17 = [7 x i8] c" %s %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.stat
%7 = alloca i32
%8 = alloca i8*
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 %19
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 ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @stat(i8* %22, %struct.stat* %6)
%24 = icmp slt i64 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %19
%26 = load i32, i32* @stderr
%27 = load i32, i32* @errno
%28 = call i8* @strerror(i32 %27)
%29 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %19
%33 = call i64 @time(i32* %7)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %42
35: ; preds = %32
%36 = load i32, i32* @stderr
%37 = load i32, i32* @errno
%38 = call i8* @strerror(i32 %37)
%39 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %38)
%40 = load i32, i32* @EXIT_FAILURE
%41 = call i32 @exit(i32 %40)
unreachable
42: ; preds = %32
%43 = call i8* @ctime(i32* %7)
store i8* %43, i8** %8
%44 = icmp eq i8* %43, null
br i1 %44, label %45, label %52
45: ; preds = %42
%46 = load i32, i32* @stderr
%47 = load i32, i32* @errno
%48 = call i8* @strerror(i32 %47)
%49 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %48)
%50 = load i32, i32* @EXIT_FAILURE
%51 = call i32 @exit(i32 %50)
unreachable
52: ; preds = %42
%53 = load i8*, i8** %8
%54 = load i8*, i8** %8
%55 = call i32 @strlen(i8* %54)
%56 = sub nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %53, i64 %57
store i8 0, i8* %58
%59 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%60 = load i32, i32* %59
%61 = call i64 @S_ISREG(i32 %60)
%62 = icmp ne i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %52
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %115
65: ; preds = %52
%66 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%67 = load i32, i32* %66
%68 = call i64 @S_ISDIR(i32 %67)
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %65
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %114
72: ; preds = %65
%73 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%74 = load i32, i32* %73
%75 = call i64 @S_ISCHR(i32 %74)
%76 = icmp ne i64 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %72
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %113
79: ; preds = %72
%80 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%81 = load i32, i32* %80
%82 = call i64 @S_ISBLK(i32 %81)
%83 = icmp ne i64 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %79
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %112
86: ; preds = %79
%87 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%88 = load i32, i32* %87
%89 = call i64 @S_ISFIFO(i32 %88)
%90 = icmp ne i64 %89, 0
br i1 %90, label %91, label %93
91: ; preds = %86
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %111
93: ; preds = %86
%94 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%95 = load i32, i32* %94
%96 = call i64 @S_ISLNK(i32 %95)
%97 = icmp ne i64 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %93
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %110
100: ; preds = %93
%101 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%102 = load i32, i32* %101
%103 = call i64 @S_ISSOCK(i32 %102)
%104 = icmp ne i64 %103, 0
br i1 %104, label %105, label %107
105: ; preds = %100
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %109
107: ; preds = %100
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %109
109: ; preds = %107, %105
br label %110
110: ; preds = %109, %98
br label %111
111: ; preds = %110, %91
br label %112
112: ; preds = %111, %84
br label %113
113: ; preds = %112, %77
br label %114
114: ; preds = %113, %70
br label %115
115: ; preds = %114, %63
%116 = load i32, i32* @S_IRUSR
%117 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%118 = load i32, i32* %117
%119 = and i32 %116, %118
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %123
121: ; preds = %115
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %125
123: ; preds = %115
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %125
125: ; preds = %123, %121
%126 = load i32, i32* @S_IWUSR
%127 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%128 = load i32, i32* %127
%129 = and i32 %126, %128
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %133
131: ; preds = %125
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %135
133: ; preds = %125
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %135
135: ; preds = %133, %131
%136 = load i32, i32* @S_IXUSR
%137 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%138 = load i32, i32* %137
%139 = and i32 %136, %138
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %143
141: ; preds = %135
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %145
143: ; preds = %135
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %145
145: ; preds = %143, %141
%146 = load i32, i32* @S_IRGRP
%147 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%148 = load i32, i32* %147
%149 = and i32 %146, %148
%150 = icmp ne i32 %149, 0
br i1 %150, label %151, label %153
151: ; preds = %145
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %155
153: ; preds = %145
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %155
155: ; preds = %153, %151
%156 = load i32, i32* @S_IWGRP
%157 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%158 = load i32, i32* %157
%159 = and i32 %156, %158
%160 = icmp ne i32 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %155
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %165
163: ; preds = %155
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %165
165: ; preds = %163, %161
%166 = load i32, i32* @S_IXGRP
%167 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%168 = load i32, i32* %167
%169 = and i32 %166, %168
%170 = icmp ne i32 %169, 0
br i1 %170, label %171, label %173
171: ; preds = %165
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %175
173: ; preds = %165
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %175
175: ; preds = %173, %171
%176 = load i32, i32* @S_IROTH
%177 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%178 = load i32, i32* %177
%179 = and i32 %176, %178
%180 = icmp ne i32 %179, 0
br i1 %180, label %181, label %183
181: ; preds = %175
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %185
183: ; preds = %175
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %185
185: ; preds = %183, %181
%186 = load i32, i32* @S_IWOTH
%187 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%188 = load i32, i32* %187
%189 = and i32 %186, %188
%190 = icmp ne i32 %189, 0
br i1 %190, label %191, label %193
191: ; preds = %185
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %195
193: ; preds = %185
%194 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %195
195: ; preds = %193, %191
%196 = load i32, i32* @S_IXOTH
%197 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%198 = load i32, i32* %197
%199 = and i32 %196, %198
%200 = icmp ne i32 %199, 0
br i1 %200, label %201, label %203
201: ; preds = %195
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %205
203: ; preds = %195
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %205
205: ; preds = %203, %201
%206 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 1
%207 = load i32, i32* %206
%208 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %207)
%209 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 2
%210 = load i32, i32* %209
%211 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %210)
%212 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 3
%213 = load i32, i32* %212
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %213)
%215 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 4
%216 = load i64, i64* %215
%217 = trunc i64 %216 to i32
%218 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i32 %217)
%219 = load i8*, i8** %8
%220 = load i8**, i8*** %5
%221 = getelementptr inbounds i8*, i8** %220, i64 1
%222 = load i8*, i8** %221
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* %219, i8* %222)
%224 = load i32, i32* @EXIT_SUCCESS
ret i32 %224
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32, i64 }
@stderr = global i32 0
@.str = [20 x i8] c"Uso: %s <filename>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [24 x i8] c"Err.(%s) stat() failed\0A\00"
@errno = global i32 0
@.str.2 = [24 x i8] c"Err.(%s) time() failed\0A\00"
@.str.3 = [25 x i8] c"Err.(%s) ctime() failed\0A\00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@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.15 = [4 x i8] c" %d\00"
@.str.16 = [5 x i8] c" %d \00"
@.str.17 = [7 x i8] c" %s %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca i32
%5 = bitcast %struct.stat* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @stat(i8* %16, %struct.stat* %3)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %14
%20 = load i32, i32* @stderr
%21 = load i32, i32* @errno
%22 = call i8* @strerror(i32 %21)
%23 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @exit(i32 %24)
unreachable
26: ; preds = %14
%27 = call i64 @time(i32* %4)
%28 = icmp slt i64 %27, 0
br i1 %28, label %29, label %36
29: ; preds = %26
%30 = load i32, i32* @stderr
%31 = load i32, i32* @errno
%32 = call i8* @strerror(i32 %31)
%33 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %32)
%34 = load i32, i32* @EXIT_FAILURE
%35 = call i32 @exit(i32 %34)
unreachable
36: ; preds = %26
%37 = call i8* @ctime(i32* %4)
%38 = icmp eq i8* %37, null
br i1 %38, label %39, label %46
39: ; preds = %36
%40 = load i32, i32* @stderr
%41 = load i32, i32* @errno
%42 = call i8* @strerror(i32 %41)
%43 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %42)
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %36
%47 = call i32 @strlen(i8* %37)
%48 = add nsw i32 %47, -1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %37, i64 %49
store i8 0, i8* %50
%51 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%52 = load i32, i32* %51
%53 = call i64 @S_ISREG(i32 %52)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %80
55: ; preds = %46
%56 = load i32, i32* %51
%57 = call i64 @S_ISDIR(i32 %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %80
59: ; preds = %55
%60 = load i32, i32* %51
%61 = call i64 @S_ISCHR(i32 %60)
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %80
63: ; preds = %59
%64 = load i32, i32* %51
%65 = call i64 @S_ISBLK(i32 %64)
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %80
67: ; preds = %63
%68 = load i32, i32* %51
%69 = call i64 @S_ISFIFO(i32 %68)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %80
71: ; preds = %67
%72 = load i32, i32* %51
%73 = call i64 @S_ISLNK(i32 %72)
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %80
75: ; preds = %71
%76 = load i32, i32* %51
%77 = call i64 @S_ISSOCK(i32 %76)
%78 = icmp eq i64 %77, 0
%79 = select i1 %78, i32 117, i32 115
br label %80
80: ; preds = %75, %71, %67, %63, %59, %55, %46
%81 = phi i32 [ 45, %46 ], [ 100, %55 ], [ 99, %59 ], [ 98, %63 ], [ 102, %67 ], [ 108, %71 ], [ %79, %75 ]
%82 = call i32 @putchar(i32 %81)
%83 = load i32, i32* @S_IRUSR
%84 = load i32, i32* %51
%85 = and i32 %84, %83
%86 = icmp eq i32 %85, 0
%87 = select i1 %86, i32 45, i32 114
%88 = call i32 @putchar(i32 %87)
%89 = load i32, i32* @S_IWUSR
%90 = load i32, i32* %51
%91 = and i32 %90, %89
%92 = icmp eq i32 %91, 0
%93 = select i1 %92, i32 45, i32 119
%94 = call i32 @putchar(i32 %93)
%95 = load i32, i32* @S_IXUSR
%96 = load i32, i32* %51
%97 = and i32 %96, %95
%98 = icmp eq i32 %97, 0
%99 = select i1 %98, i32 45, i32 120
%100 = call i32 @putchar(i32 %99)
%101 = load i32, i32* @S_IRGRP
%102 = load i32, i32* %51
%103 = and i32 %102, %101
%104 = icmp eq i32 %103, 0
%105 = select i1 %104, i32 45, i32 114
%106 = call i32 @putchar(i32 %105)
%107 = load i32, i32* @S_IWGRP
%108 = load i32, i32* %51
%109 = and i32 %108, %107
%110 = icmp eq i32 %109, 0
%111 = select i1 %110, i32 45, i32 119
%112 = call i32 @putchar(i32 %111)
%113 = load i32, i32* @S_IXGRP
%114 = load i32, i32* %51
%115 = and i32 %114, %113
%116 = icmp eq i32 %115, 0
%117 = select i1 %116, i32 45, i32 120
%118 = call i32 @putchar(i32 %117)
%119 = load i32, i32* @S_IROTH
%120 = load i32, i32* %51
%121 = and i32 %120, %119
%122 = icmp eq i32 %121, 0
%123 = select i1 %122, i32 45, i32 114
%124 = call i32 @putchar(i32 %123)
%125 = load i32, i32* @S_IWOTH
%126 = load i32, i32* %51
%127 = and i32 %126, %125
%128 = icmp eq i32 %127, 0
%129 = select i1 %128, i32 45, i32 119
%130 = call i32 @putchar(i32 %129)
%131 = load i32, i32* @S_IXOTH
%132 = load i32, i32* %51
%133 = and i32 %132, %131
%134 = icmp eq i32 %133, 0
%135 = select i1 %134, i32 45, i32 120
%136 = call i32 @putchar(i32 %135)
%137 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%138 = load i32, i32* %137
%139 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %138)
%140 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 2
%141 = load i32, i32* %140
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %141)
%143 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 3
%144 = load i32, i32* %143
%145 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %144)
%146 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 4
%147 = load i64, i64* %146
%148 = trunc i64 %147 to i32
%149 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i32 %148)
%150 = load i8*, i8** %15
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* %37, i8* %150)
%152 = load i32, i32* @EXIT_SUCCESS
ret i32 %152
}