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

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
scalar_t__ S_ISLNK(int /*<<< orphan*/);
int *active_processes();
int /*<<< orphan*/ err_exit(char *, char *, ...);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int lstat(char *, struct stat *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
int readlink(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int, ...);
scalar_t__ strcmp(char *, char *);
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int *procs_list = NULL;
  int i = 0;
  DIR *dirp;
  char dirname[128];
  char link[128];
  char path[128];
  struct stat buf;
  ssize_t num_bytes_in_buf;
  struct dirent *direntp;
  if (argc == 2 && strcmp(argv[1], "--help") == 0) {
    err_exit("Usage: %s [file_path]\n", argv[0]);
  }
  procs_list = active_processes();
  for (i = 1; i <= procs_list[0] + 1; i++) {
    sprintf(dirname, "/proc/%d/fd", procs_list[i]);
    dirp = opendir(dirname);
    if (dirp != NULL) {
      while ((direntp = readdir(dirp)) != NULL) {
        sprintf(link, "/proc/%d/fd/%s", procs_list[i], direntp->d_name);
        if (lstat(link, &buf) != -1) {
          if (S_ISLNK(buf.st_mode)) {
            if ((num_bytes_in_buf = readlink(link, path, 128)) != -1) {
              path[num_bytes_in_buf] = '\0';
              if (argc == 2 && strcmp(argv[1], path) == 0) {
                printf("PID: %d\n", procs_list[i]);
              } else if (argc == 1) {
                printf("PID: %d SYMLINK: %s PATH: %s\n", procs_list[i], link,
                       path);
              }
            } else {
              printf("%s (readlink: %s)\n", link, strerror(errno));
            }
          }
        } else {
          err_exit("Error on lstat: %s, linen no: %d\n", strerror(errno), 152);
        }
      }
    }
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1225 <main+0x65>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdff(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1225 <main+0x65>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   10b0 <err_exit@plt>
mov    $0x0,%al
call   1030 <active_processes@plt>
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1436 <main+0x276>
lea    -0xb0(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xdba(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0xb0(%rbp),%rdi
call   1060 <opendir@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1423 <main+0x263>
jmp    128b <main+0xcb>
mov    -0x28(%rbp),%rdi
call   10a0 <readdir@plt>
mov    %rax,-0x1c8(%rbp)
cmp    $0x0,%rax
je     141e <main+0x25e>
lea    -0x130(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x1c8(%rbp),%rax
mov    (%rax),%rcx
lea    0xd62(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x130(%rbp),%rdi
lea    -0x1b8(%rbp),%rsi
call   1080 <lstat@plt>
cmp    $0xffffffff,%eax
je     13f5 <main+0x235>
mov    -0x1b8(%rbp),%edi
call   1040 <S_ISLNK@plt>
cmp    $0x0,%rax
je     13f0 <main+0x230>
lea    -0x130(%rbp),%rdi
lea    -0x1b0(%rbp),%rsi
mov    $0x80,%edx
call   1050 <readlink@plt>
mov    %eax,-0x1bc(%rbp)
cmp    $0xffffffff,%eax
je     13b7 <main+0x1f7>
movslq -0x1bc(%rbp),%rax
movb   $0x0,-0x1b0(%rbp,%rax,1)
cmpl   $0x2,-0x8(%rbp)
jne    137c <main+0x1bc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x1b0(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    137c <main+0x1bc>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    13b2 <main+0x1f2>
cmpl   $0x1,-0x8(%rbp)
jne    13ad <main+0x1ed>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    -0x130(%rbp),%rdx
lea    -0x1b0(%rbp),%rcx
lea    0xc9c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    13b2 <main+0x1f2>
jmp    13eb <main+0x22b>
lea    -0x130(%rbp),%rax
mov    %rax,-0x1d0(%rbp)
mov    0x2c14(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x1d0(%rbp),%rsi
mov    %rax,%rdx
lea    0xc7c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    13f0 <main+0x230>
jmp    1419 <main+0x259>
mov    0x2be4(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    %rax,%rsi
lea    0xc66(%rip),%rdi
mov    $0x98,%edx
mov    $0x0,%al
call   10b0 <err_exit@plt>
jmp    128b <main+0xcb>
jmp    1423 <main+0x263>
jmp    1428 <main+0x268>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1237 <main+0x77>
mov    0x2b9b(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
cmp    $0x2,%edi
jne    1203 <main+0x43>
mov    0x8(%rbx),%rdi
lea    0xe18(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1203 <main+0x43>
mov    (%rbx),%rsi
lea    0xe0b(%rip),%rdi
xor    %eax,%eax
call   10b0 <err_exit@plt>
mov    %rbx,0x8(%rsp)
xor    %eax,%eax
call   1030 <active_processes@plt>
cmpl   $0x0,(%rax)
jns    1222 <main+0x62>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    %rax,%rbx
mov    $0x1,%r13d
lea    0xdf8(%rip),%rbp
lea    0x90(%rsp),%r15
mov    %rsp,%r12
jmp    124f <main+0x8f>
nop
lea    0x1(%r13),%rax
movslq (%rbx),%rcx
cmp    %rcx,%r13
mov    %rax,%r13
jg     1214 <main+0x54>
mov    (%rbx,%r13,4),%edx
mov    %rbp,%r14
lea    0x110(%rsp),%rbp
mov    %rbp,%rdi
lea    0xdb6(%rip),%rsi
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %rbp,%rdi
mov    %r14,%rbp
call   1060 <opendir@plt>
test   %rax,%rax
je     1240 <main+0x80>
mov    %rax,%r14
jmp    12b4 <main+0xf4>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xdce(%rip),%rdi
mov    %rax,%rsi
mov    $0x98,%edx
xor    %eax,%eax
call   10b0 <err_exit@plt>
mov    %r14,%rdi
call   10a0 <readdir@plt>
test   %rax,%rax
je     1240 <main+0x80>
mov    (%rbx,%r13,4),%edx
mov    (%rax),%rcx
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1080 <lstat@plt>
cmp    $0xffffffff,%eax
je     1290 <main+0xd0>
mov    (%rsp),%edi
call   1040 <S_ISLNK@plt>
test   %rax,%rax
je     12b4 <main+0xf4>
mov    %r15,%rdi
lea    0x10(%rsp),%rsi
mov    $0x80,%edx
call   1050 <readlink@plt>
cmp    $0xffffffff,%eax
je     1350 <main+0x190>
cltq
movb   $0x0,0x10(%rsp,%rax,1)
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jne    1377 <main+0x1b7>
mov    0x8(%rsp),%rax
mov    0x8(%rax),%rdi
lea    0x10(%rsp),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    12b4 <main+0xf4>
mov    (%rbx,%r13,4),%esi
lea    0xcf5(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    12b4 <main+0xf4>
mov    0x2c89(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xcfb(%rip),%rdi
mov    %r15,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    12b4 <main+0xf4>
cmp    $0x1,%eax
jne    12b4 <main+0xf4>
mov    (%rbx,%r13,4),%esi
lea    0xcb7(%rip),%rdi
mov    %r15,%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    12b4 <main+0xf4>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@.str = [7 x i8] c"--help\00"
@.str.1 = [23 x i8] c"Usage: %s [file_path]\0A\00"
@.str.2 = [12 x i8] c"/proc/%d/fd\00"
@.str.3 = [15 x i8] c"/proc/%d/fd/%s\00"
@.str.4 = [9 x i8] c"PID: %d\0A\00"
@.str.5 = [30 x i8] c"PID: %d SYMLINK: %s PATH: %s\0A\00"
@.str.6 = [19 x i8] c"%s (readlink: %s)\0A\00"
@errno = global i32 0
@.str.7 = [34 x i8] c"Error on lstat: %s, linen no: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca [128 x i8]
%10 = alloca [128 x i8]
%11 = alloca [128 x i8]
%12 = alloca %struct.stat
%13 = alloca i32
%14 = alloca %struct.dirent*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32 0, i32* %7
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %28
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %17
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 (i8*, i8*, ...) @err_exit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %23, %17, %2
%29 = call i32* (...) @active_processes()
store i32* %29, i32** %6
store i32 1, i32* %7
br label %30
30: ; preds = %126, %28
%31 = load i32, i32* %7
%32 = load i32*, i32** %6
%33 = getelementptr inbounds i32, i32* %32, i64 0
%34 = load i32, i32* %33
%35 = add nsw i32 %34, 1
%36 = icmp sle i32 %31, %35
br i1 %36, label %37, label %129
37: ; preds = %30
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%39 = load i32*, i32** %6
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %38, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %43)
%45 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%46 = call i32* @opendir(i8* %45)
store i32* %46, i32** %8
%47 = load i32*, i32** %8
%48 = icmp ne i32* %47, null
br i1 %48, label %49, label %125
49: ; preds = %37
br label %50
50: ; preds = %123, %49
%51 = load i32*, i32** %8
%52 = call %struct.dirent* @readdir(i32* %51)
store %struct.dirent* %52, %struct.dirent** %14
%53 = icmp ne %struct.dirent* %52, null
br i1 %53, label %54, label %124
54: ; preds = %50
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%56 = load i32*, i32** %6
%57 = load i32, i32* %7
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i32, i32* %56, i64 %58
%60 = load i32, i32* %59
%61 = load %struct.dirent*, %struct.dirent** %14
%62 = getelementptr inbounds %struct.dirent, %struct.dirent* %61, i32 0, i32 0
%63 = load i8*, i8** %62
%64 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %55, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %60, i8* %63)
%65 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%66 = call i32 @lstat(i8* %65, %struct.stat* %12)
%67 = icmp ne i32 %66, -1
br i1 %67, label %68, label %119
68: ; preds = %54
%69 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%70 = load i32, i32* %69
%71 = call i64 @S_ISLNK(i32 %70)
%72 = icmp ne i64 %71, 0
br i1 %72, label %73, label %118
73: ; preds = %68
%74 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%76 = call i32 @readlink(i8* %74, i8* %75, i32 128)
store i32 %76, i32* %13
%77 = icmp ne i32 %76, -1
br i1 %77, label %78, label %112
78: ; preds = %73
%79 = load i32, i32* %13
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 %80
store i8 0, i8* %81
%82 = load i32, i32* %4
%83 = icmp eq i32 %82, 2
br i1 %83, label %84, label %98
84: ; preds = %78
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 1
%87 = load i8*, i8** %86
%88 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%89 = call i64 @strcmp(i8* %87, i8* %88)
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %98
91: ; preds = %84
%92 = load i32*, i32** %6
%93 = load i32, i32* %7
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32, i32* %92, i64 %94
%96 = load i32, i32* %95
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %96)
br label %111
98: ; preds = %84, %78
%99 = load i32, i32* %4
%100 = icmp eq i32 %99, 1
br i1 %100, label %101, label %110
101: ; preds = %98
%102 = load i32*, i32** %6
%103 = load i32, i32* %7
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i32, i32* %102, i64 %104
%106 = load i32, i32* %105
%107 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%108 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %106, i8* %107, i8* %108)
br label %110
110: ; preds = %101, %98
br label %111
111: ; preds = %110, %91
br label %117
112: ; preds = %73
%113 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%114 = load i32, i32* @errno
%115 = call i8* @strerror(i32 %114)
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %113, i8* %115)
br label %117
117: ; preds = %112, %111
br label %118
118: ; preds = %117, %68
br label %123
119: ; preds = %54
%120 = load i32, i32* @errno
%121 = call i8* @strerror(i32 %120)
%122 = call i32 (i8*, i8*, ...) @err_exit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %121, i32 152)
br label %123
123: ; preds = %119, %118
br label %50
124: ; preds = %50
br label %125
125: ; preds = %124, %37
br label %126
126: ; preds = %125
%127 = load i32, i32* %7
%128 = add nsw i32 %127, 1
store i32 %128, i32* %7
br label %30
129: ; preds = %30
%130 = load i32, i32* @EXIT_SUCCESS
%131 = call i32 @exit(i32 %130)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@.str = [7 x i8] c"--help\00"
@.str.1 = [23 x i8] c"Usage: %s [file_path]\0A\00"
@.str.2 = [12 x i8] c"/proc/%d/fd\00"
@.str.3 = [15 x i8] c"/proc/%d/fd/%s\00"
@.str.4 = [9 x i8] c"PID: %d\0A\00"
@.str.5 = [30 x i8] c"PID: %d SYMLINK: %s PATH: %s\0A\00"
@.str.6 = [19 x i8] c"%s (readlink: %s)\0A\00"
@errno = global i32 0
@.str.7 = [34 x i8] c"Error on lstat: %s, linen no: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = alloca [128 x i8]
%6 = alloca %struct.stat
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%10 = bitcast %struct.stat* %6 to i8*
%11 = icmp eq i32 %0, 2
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i8*, i8** %1
%19 = tail call i32 (i8*, i8*, ...) @err_exit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %17, %12, %2
%21 = tail call i32* (...) @active_processes()
%22 = load i32, i32* %21
%23 = icmp slt i32 %22, 0
br i1 %23, label %83, label %24
24: ; preds = %20
%25 = getelementptr inbounds %struct.stat, %struct.stat* %6, i64 0, i32 0
%26 = icmp eq i32 %0, 1
%27 = getelementptr inbounds i8*, i8** %1, i64 1
br label %28
28: ; preds = %24, %78
%29 = phi i64 [ 1, %24 ], [ %79, %78 ]
%30 = getelementptr inbounds i32, i32* %21, i64 %29
%31 = load i32, i32* %30
%32 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %31)
%33 = call i32* @opendir(i8* %7)
%34 = icmp eq i32* %33, null
br i1 %34, label %78, label %35
35: ; preds = %28
%36 = call %struct.dirent* @readdir(i32* %33)
%37 = icmp eq %struct.dirent* %36, null
br i1 %37, label %78, label %38
38: ; preds = %35, %75
%39 = phi %struct.dirent* [ %76, %75 ], [ %36, %35 ]
%40 = load i32, i32* %30
%41 = getelementptr inbounds %struct.dirent, %struct.dirent* %39, i64 0, i32 0
%42 = load i8*, i8** %41
%43 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %40, i8* %42)
%44 = call i32 @lstat(i8* %8, %struct.stat* %6)
%45 = icmp eq i32 %44, -1
br i1 %45, label %71, label %46
46: ; preds = %38
%47 = load i32, i32* %25
%48 = call i64 @S_ISLNK(i32 %47)
%49 = icmp eq i64 %48, 0
br i1 %49, label %75, label %50
50: ; preds = %46
%51 = call i32 @readlink(i8* %8, i8* %9, i32 128)
%52 = icmp eq i32 %51, -1
br i1 %52, label %67, label %53
53: ; preds = %50
%54 = sext i32 %51 to i64
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 %54
store i8 0, i8* %55
br i1 %11, label %56, label %63
56: ; preds = %53
%57 = load i8*, i8** %27
%58 = call i64 @strcmp(i8* %57, i8* %9)
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %75
60: ; preds = %56
%61 = load i32, i32* %30
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %61)
br label %75
63: ; preds = %53
br i1 %26, label %64, label %75
64: ; preds = %63
%65 = load i32, i32* %30
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %65, i8* %8, i8* %9)
br label %75
67: ; preds = %50
%68 = load i32, i32* @errno
%69 = call i8* @strerror(i32 %68)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %8, i8* %69)
br label %75
71: ; preds = %38
%72 = load i32, i32* @errno
%73 = call i8* @strerror(i32 %72)
%74 = call i32 (i8*, i8*, ...) @err_exit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %73, i32 152)
br label %75
75: ; preds = %56, %46, %60, %64, %63, %67, %71
%76 = call %struct.dirent* @readdir(i32* %33)
%77 = icmp eq %struct.dirent* %76, null
br i1 %77, label %78, label %38
78: ; preds = %75, %35, %28
%79 = add nuw nsw i64 %29, 1
%80 = load i32, i32* %21
%81 = sext i32 %80 to i64
%82 = icmp sgt i64 %29, %81
br i1 %82, label %83, label %28
83: ; preds = %78, %20
%84 = load i32, i32* @EXIT_SUCCESS
%85 = call i32 @exit(i32 %84)
unreachable
}