#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 dummy;
};
struct dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int EXIT_FAILURE;
int chdir(char *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int lstat(char *, struct stat *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printType(struct stat);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char **argv) {
  DIR *dp;
  struct dirent *dirp;
  if (argc != 2) {
    fprintf(stderr, "usage: %s dir_name\n", argv[0]);
    exit(1);
  }
  if ((dp = opendir(argv[1])) == NULL) {
    fprintf(stderr, "can't open '%s'\n", argv[1]);
    exit(1);
  }
  if (chdir(argv[1]) == -1) {
    fprintf(stderr, "can't chdir to '%s': %s\n", argv[1], strerror(errno));
    exit(EXIT_FAILURE);
  }
  while ((dirp = readdir(dp)) != NULL) {
    struct stat sb;
    if (stat(dirp->d_name, &sb) == -1) {
      fprintf(stderr, "Can't stat %s: %s\n", dirp->d_name, strerror(errno));
      if (lstat(dirp->d_name, &sb) == -1) {
        fprintf(stderr, "Can't stat %s: %s\n", dirp->d_name, strerror(errno));
        continue;
      }
    }
    printf("%s (", dirp->d_name);
    printType(sb);
    printf(" - ");
    if (lstat(dirp->d_name, &sb) == -1) {
      fprintf(stderr, "Can't stat %s: %s\n", dirp->d_name, strerror(errno));
      continue;
    }
    printType(sb);
    printf(")\n");
  }
  closedir(dp);
  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)
cmpl   $0x2,-0x8(%rbp)
je     11f8 <main+0x48>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe19(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    123c <main+0x8c>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xde9(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <chdir@plt>
cmp    $0xffffffff,%eax
jne    129e <main+0xee>
mov    0x2d87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rdx
mov    %rax,%rcx
lea    0xd9c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
jmp    12a3 <main+0xf3>
mov    -0x18(%rbp),%rdi
call   10b0 <readdir@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1411 <main+0x261>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    -0x28(%rbp),%rsi
call   10a0 <stat@plt>
cmp    $0xffffffff,%eax
jne    1370 <main+0x1c0>
mov    0x2d06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    0x2ce7(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%rdx
mov    %rax,%rcx
lea    0xd35(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    -0x28(%rbp),%rsi
call   1080 <lstat@plt>
cmp    $0xffffffff,%eax
jne    136b <main+0x1bb>
mov    0x2cb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
mov    0x2c91(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x54(%rbp),%edi
mov    -0x50(%rbp),%rdx
mov    %rax,%rcx
lea    0xcdf(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    12a3 <main+0xf3>
jmp    1370 <main+0x1c0>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xcd3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%edi
call   1030 <printType@plt>
lea    0xcc2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    -0x28(%rbp),%rsi
call   1080 <lstat@plt>
cmp    $0xffffffff,%eax
jne    13f6 <main+0x246>
mov    0x2c25(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    0x2c06(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rdx
mov    %rax,%rcx
lea    0xc54(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    12a3 <main+0xf3>
mov    -0x28(%rbp),%edi
call   1030 <printType@plt>
lea    0xc55(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12a3 <main+0xf3>
mov    -0x18(%rbp),%rdi
call   1070 <closedir@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1342 <main+0x182>
mov    0x8(%rbx),%rdi
call   1050 <opendir@plt>
test   %rax,%rax
je     1357 <main+0x197>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
call   1060 <chdir@plt>
cmp    $0xffffffff,%eax
je     137c <main+0x1bc>
mov    %r14,%rdi
call   10c0 <readdir@plt>
test   %rax,%rax
je     1329 <main+0x169>
mov    %rax,%rbp
mov    %rsp,%rbx
mov    0x2dc4(%rip),%r15
lea    0xe2e(%rip),%r12
jmp    1270 <main+0xb0>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15),%r13d
mov    0x0(%rbp),%rbp
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    %r13d,%edi
lea    0xdef(%rip),%rsi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %r14,%rdi
call   10c0 <readdir@plt>
mov    %rax,%rbp
test   %rax,%rax
je     1329 <main+0x169>
mov    0x0(%rbp),%rdi
mov    %rbx,%rsi
call   10b0 <stat@plt>
cmp    $0xffffffff,%eax
jne    12d7 <main+0x117>
mov    %r15,%rbx
mov    (%r15),%r15d
mov    %r14,%r13
mov    %r12,%r14
mov    0x0(%rbp),%r12
mov    0x2d40(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    %r15d,%edi
mov    %rbx,%r15
lea    0xd92(%rip),%rsi
mov    %r12,%rdx
mov    %r14,%r12
mov    %r13,%r14
mov    %rsp,%rbx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x0(%rbp),%rdi
mov    %rbx,%rsi
call   1090 <lstat@plt>
cmp    $0xffffffff,%eax
je     1230 <main+0x70>
mov    0x0(%rbp),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%rsp),%edi
call   1030 <printType@plt>
lea    0xd62(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x0(%rbp),%rdi
mov    %rbx,%rsi
call   1090 <lstat@plt>
cmp    $0xffffffff,%eax
je     1230 <main+0x70>
mov    (%rsp),%edi
call   1030 <printType@plt>
lea    0xd3b(%rip),%rdi
call   1040 <puts@plt>
jmp    125c <main+0x9c>
mov    %r14,%rdi
call   1080 <closedir@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c97(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xcab(%rip),%rsi
jmp    136b <main+0x1ab>
mov    0x2c82(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xca9(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    0x2c5d(%rip),%rax
mov    (%rax),%ebp
mov    0x8(%rbx),%rbx
mov    0x2c48(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xc87(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2c1c(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s dir_name\0A\00"
@.str.1 = [17 x i8] c"can't open '%s'\0A\00"
@.str.2 = [25 x i8] c"can't chdir to '%s': %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.3 = [19 x i8] c"Can't stat %s: %s\0A\00"
@.str.4 = [5 x i8] c"%s (\00"
@.str.5 = [4 x i8] c" - \00"
@.str.6 = [3 x i8] c")\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca %struct.dirent*
%8 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32* @opendir(i8* %21)
store i32* %22, i32** %6
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %31
24: ; preds = %18
%25 = load i32, i32* @stderr
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %18
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 @chdir(i8* %34)
%36 = icmp eq i32 %35, -1
br i1 %36, label %37, label %47
37: ; preds = %31
%38 = load i32, i32* @stderr
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = load i32, i32* @errno
%43 = call i8* @strerror(i32 %42)
%44 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %41, i8* %43)
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %31
br label %48
48: ; preds = %102, %94, %71, %47
%49 = load i32*, i32** %6
%50 = call %struct.dirent* @readdir(i32* %49)
store %struct.dirent* %50, %struct.dirent** %7
%51 = icmp ne %struct.dirent* %50, null
br i1 %51, label %52, label %107
52: ; preds = %48
%53 = load %struct.dirent*, %struct.dirent** %7
%54 = getelementptr inbounds %struct.dirent, %struct.dirent* %53, i32 0, i32 0
%55 = load i8*, i8** %54
%56 = call i32 @stat(i8* %55, %struct.stat* %8)
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %80
58: ; preds = %52
%59 = load i32, i32* @stderr
%60 = load %struct.dirent*, %struct.dirent** %7
%61 = getelementptr inbounds %struct.dirent, %struct.dirent* %60, i32 0, i32 0
%62 = load i8*, i8** %61
%63 = load i32, i32* @errno
%64 = call i8* @strerror(i32 %63)
%65 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %62, i8* %64)
%66 = load %struct.dirent*, %struct.dirent** %7
%67 = getelementptr inbounds %struct.dirent, %struct.dirent* %66, i32 0, i32 0
%68 = load i8*, i8** %67
%69 = call i32 @lstat(i8* %68, %struct.stat* %8)
%70 = icmp eq i32 %69, -1
br i1 %70, label %71, label %79
71: ; preds = %58
%72 = load i32, i32* @stderr
%73 = load %struct.dirent*, %struct.dirent** %7
%74 = getelementptr inbounds %struct.dirent, %struct.dirent* %73, i32 0, i32 0
%75 = load i8*, i8** %74
%76 = load i32, i32* @errno
%77 = call i8* @strerror(i32 %76)
%78 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %75, i8* %77)
br label %48
79: ; preds = %58
br label %80
80: ; preds = %79, %52
%81 = load %struct.dirent*, %struct.dirent** %7
%82 = getelementptr inbounds %struct.dirent, %struct.dirent* %81, i32 0, i32 0
%83 = load i8*, i8** %82
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %83)
%85 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%86 = load i32, i32* %85
%87 = call i32 @printType(i32 %86)
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%89 = load %struct.dirent*, %struct.dirent** %7
%90 = getelementptr inbounds %struct.dirent, %struct.dirent* %89, i32 0, i32 0
%91 = load i8*, i8** %90
%92 = call i32 @lstat(i8* %91, %struct.stat* %8)
%93 = icmp eq i32 %92, -1
br i1 %93, label %94, label %102
94: ; preds = %80
%95 = load i32, i32* @stderr
%96 = load %struct.dirent*, %struct.dirent** %7
%97 = getelementptr inbounds %struct.dirent, %struct.dirent* %96, i32 0, i32 0
%98 = load i8*, i8** %97
%99 = load i32, i32* @errno
%100 = call i8* @strerror(i32 %99)
%101 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %98, i8* %100)
br label %48
102: ; preds = %80
%103 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%104 = load i32, i32* %103
%105 = call i32 @printType(i32 %104)
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %48
107: ; preds = %48
%108 = load i32*, i32** %6
%109 = call i32 @closedir(i32* %108)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s dir_name\0A\00"
@.str.1 = [17 x i8] c"can't open '%s'\0A\00"
@.str.2 = [25 x i8] c"can't chdir to '%s': %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.3 = [19 x i8] c"Can't stat %s: %s\0A\00"
@.str.4 = [5 x i8] c"%s (\00"
@.str.5 = [4 x i8] c" - \00"
@str = [2 x i8] c")\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = icmp eq i32 %0, 2
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @opendir(i8* %12)
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %11
%18 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %10
%21 = load i8*, i8** %11
%22 = tail call i32 @chdir(i8* %21)
%23 = icmp eq i32 %22, -1
br i1 %23, label %30, label %24
24: ; preds = %20
%25 = tail call %struct.dirent* @readdir(i32* %13)
%26 = icmp eq %struct.dirent* %25, null
br i1 %26, label %81, label %27
27: ; preds = %24
%28 = bitcast %struct.stat* %3 to i8*
%29 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
br label %38
30: ; preds = %20
%31 = load i32, i32* @stderr
%32 = load i8*, i8** %11
%33 = load i32, i32* @errno
%34 = tail call i8* @strerror(i32 %33)
%35 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %32, i8* %34)
%36 = load i32, i32* @EXIT_FAILURE
%37 = tail call i32 @exit(i32 %36)
unreachable
38: ; preds = %27, %78
%39 = phi %struct.dirent* [ %25, %27 ], [ %79, %78 ]
%40 = getelementptr inbounds %struct.dirent, %struct.dirent* %39, i64 0, i32 0
%41 = load i8*, i8** %40
%42 = call i32 @stat(i8* %41, %struct.stat* %3)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %59
44: ; preds = %38
%45 = load i32, i32* @stderr
%46 = load i8*, i8** %40
%47 = load i32, i32* @errno
%48 = tail call i8* @strerror(i32 %47)
%49 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %46, i8* %48)
%50 = load i8*, i8** %40
%51 = call i32 @lstat(i8* %50, %struct.stat* %3)
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %59
53: ; preds = %44
%54 = load i32, i32* @stderr
%55 = load i8*, i8** %40
%56 = load i32, i32* @errno
%57 = tail call i8* @strerror(i32 %56)
%58 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %55, i8* %57)
br label %78
59: ; preds = %44, %38
%60 = load i8*, i8** %40
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %60)
%62 = load i32, i32* %29
%63 = tail call i32 @printType(i32 %62)
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%65 = load i8*, i8** %40
%66 = call i32 @lstat(i8* %65, %struct.stat* %3)
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %74
68: ; preds = %59
%69 = load i32, i32* @stderr
%70 = load i8*, i8** %40
%71 = load i32, i32* @errno
%72 = tail call i8* @strerror(i32 %71)
%73 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %70, i8* %72)
br label %78
74: ; preds = %59
%75 = load i32, i32* %29
%76 = tail call i32 @printType(i32 %75)
%77 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %78
78: ; preds = %74, %68, %53
%79 = tail call %struct.dirent* @readdir(i32* %13)
%80 = icmp eq %struct.dirent* %79, null
br i1 %80, label %81, label %38
81: ; preds = %78, %24
%82 = tail call i32 @closedir(i32* %13)
ret i32 0
}