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

/* Variables and functions */
int PATH_MAX;
scalar_t__ S_ISDIR(int);
scalar_t__ S_ISREG(int);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
int stat(char *, struct stat *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strerror(int /*<<< orphan*/);
int main() {
  char DirectoryPath[] = "/home/loongson/EFI-MIPS/test/tdir";
  DIR *Directory;
  struct dirent *DirectoryEntry;
  char FileName[PATH_MAX];
  struct stat FileStatus;
  if ((Directory = opendir(DirectoryPath)) == NULL) {
    printf("Open directory error\n");
    return -1;
  }
  while ((DirectoryEntry = readdir(Directory)) != NULL) {
    printf("%s\n", DirectoryEntry->d_name);
    if ((strcmp(DirectoryEntry->d_name, ".") == 0) ||
        (strcmp(DirectoryEntry->d_name, "..") == 0)) {
      continue;
    }
    memset(FileName, 0x00, PATH_MAX);
    strcpy(FileName, DirectoryPath);
    strcat(FileName, "/");
    strcat(FileName, DirectoryEntry->d_name);
    printf("         %s\n", FileName);
    if (stat(FileName, &FileStatus) == -1) {
      printf("Get stat on %s error: %s\n", DirectoryEntry->d_name,
             strerror(errno));
      closedir(Directory);
      return -1;
    }
    printf("Mode = 0x%x\n", FileStatus.st_mode);
    printf("Mode = %d\n", FileStatus.st_mode);
    printf("Mode&170000 = %d\n", FileStatus.st_mode & 170000);
    if (S_ISDIR(FileStatus.st_mode)) {
      printf("is DIR\n");
    } else if (S_ISREG(FileStatus.st_mode)) {
      printf("is File\n");
    } else {
      printf("is special file\n");
    }
  }
  closedir(Directory);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movaps 0xe3a(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
movaps 0xe1f(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movw   $0x72,-0x10(%rbp)
mov    0x2dfe(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    124f <main+0x8f>
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
jmp    1424 <main+0x264>
jmp    1254 <main+0x94>
mov    -0x38(%rbp),%rdi
call   10c0 <readdir@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     140d <main+0x24d>
mov    -0x40(%rbp),%rax
mov    (%rax),%rsi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%rax
mov    (%rax),%rdi
lea    0xdab(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     12ba <main+0xfa>
mov    -0x40(%rbp),%rax
mov    (%rax),%rdi
lea    0xd8d(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12bf <main+0xff>
jmp    1254 <main+0x94>
mov    -0x68(%rbp),%rdi
mov    0x2d26(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x68(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x68(%rbp),%rdi
lea    0xd50(%rip),%rsi
call   10d0 <strcat@plt>
mov    -0x68(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    (%rax),%rsi
call   10d0 <strcat@plt>
mov    -0x68(%rbp),%rsi
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x68(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   10a0 <stat@plt>
cmp    $0xffffffff,%eax
jne    1372 <main+0x1b2>
mov    -0x40(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x70(%rbp)
mov    0x2c9e(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x70(%rbp),%rsi
mov    %rax,%rdx
lea    0xcfb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1080 <closedir@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
jmp    1424 <main+0x264>
mov    -0x58(%rbp),%esi
lea    0xce8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%esi
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%esi
and    $0x29810,%esi
lea    0xcd8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%edi
call   1060 <S_ISDIR@plt>
cmp    $0x0,%rax
je     13d0 <main+0x210>
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1408 <main+0x248>
mov    -0x58(%rbp),%edi
call   10b0 <S_ISREG@plt>
cmp    $0x0,%rax
je     13f5 <main+0x235>
lea    0xcad(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1403 <main+0x243>
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1408 <main+0x248>
jmp    1254 <main+0x94>
mov    -0x38(%rbp),%rdi
call   1080 <closedir@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsp,%rbx
movaps 0xe25(%rip),%xmm0
movaps %xmm0,-0x50(%rbp)
movaps 0xe0a(%rip),%xmm0
movaps %xmm0,-0x60(%rbp)
movw   $0x72,-0x40(%rbp)
mov    0x2de9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r12
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
lea    -0x60(%rbp),%rdi
call   1050 <opendir@plt>
test   %rax,%rax
je     1379 <main+0x1a9>
mov    %rax,%r14
mov    %rbx,-0x38(%rbp)
mov    %rax,%rdi
call   10d0 <readdir@plt>
test   %rax,%rax
je     1369 <main+0x199>
mov    %rax,%r13
lea    0xdd5(%rip),%r15
jmp    1269 <main+0x99>
call   1040 <puts@plt>
mov    %r14,%rdi
call   10d0 <readdir@plt>
mov    %rax,%r13
test   %rax,%rax
je     1369 <main+0x199>
mov    0x0(%r13),%rdi
call   1040 <puts@plt>
mov    0x0(%r13),%rdi
mov    %r15,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1255 <main+0x85>
mov    0x0(%r13),%rdi
lea    0xd94(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1255 <main+0x85>
mov    0x2d51(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    %r12,%rdi
lea    -0x60(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
lea    0xd64(%rip),%rsi
call   10e0 <strcat@plt>
mov    0x0(%r13),%rsi
mov    %r12,%rdi
call   10e0 <strcat@plt>
lea    0xd4e(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
lea    -0x30(%rbp),%rsi
call   10b0 <stat@plt>
cmp    $0xffffffff,%eax
je     139c <main+0x1cc>
mov    -0x30(%rbp),%ebx
lea    0xd4c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd49(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%esi
and    $0x29810,%esi
lea    0xd3c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%edi
call   1070 <S_ISDIR@plt>
lea    0xd51(%rip),%rdi
test   %rax,%rax
jne    1250 <main+0x80>
mov    %ebx,%edi
call   10c0 <S_ISREG@plt>
test   %rax,%rax
lea    0xd2f(%rip),%rdi
lea    0xd18(%rip),%rax
cmove  %rax,%rdi
jmp    1250 <main+0x80>
mov    %r14,%rdi
call   1090 <closedir@plt>
xor    %eax,%eax
mov    -0x38(%rbp),%rbx
jmp    138a <main+0x1ba>
lea    0xd17(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%eax
mov    %rbx,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x0(%r13),%rbx
mov    0x2c31(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
lea    0xc7f(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1090 <closedir@plt>
mov    $0xffffffff,%eax
jmp    1373 <main+0x1a3>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32 }
@__const.main.DirectoryPath = [34 x i8] c"/home/loongson/EFI-MIPS/test/tdir\00"
@PATH_MAX = global i32 0
@.str = [22 x i8] c"Open directory error\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [3 x i8] c"..\00"
@.str.4 = [2 x i8] c"/\00"
@.str.5 = [13 x i8] c" %s\0A\00"
@.str.6 = [26 x i8] c"Get stat on %s error: %s\0A\00"
@errno = global i32 0
@.str.7 = [13 x i8] c"Mode = 0x%x\0A\00"
@.str.8 = [11 x i8] c"Mode = %d\0A\00"
@.str.9 = [18 x i8] c"Mode&170000 = %d\0A\00"
@.str.10 = [8 x i8] c"is DIR\0A\00"
@.str.11 = [9 x i8] c"is File\0A\00"
@.str.12 = [17 x i8] c"is special file\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [34 x i8]
%3 = alloca i32*
%4 = alloca %struct.dirent*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.stat
%8 = alloca i32
store i32 0, i32* %1
%9 = bitcast [34 x i8]* %2 to i8*
%10 = load i32, i32* @PATH_MAX
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %5
%13 = alloca i8, i64 %11
store i64 %11, i64* %6
%14 = getelementptr inbounds [34 x i8], [34 x i8]* %2, i64 0, i64 0
%15 = call i32* @opendir(i8* %14)
store i32* %15, i32** %3
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
store i32 1, i32* %8
br label %94
19: ; preds = %0
br label %20
20: ; preds = %90, %40, %19
%21 = load i32*, i32** %3
%22 = call %struct.dirent* @readdir(i32* %21)
store %struct.dirent* %22, %struct.dirent** %4
%23 = icmp ne %struct.dirent* %22, null
br i1 %23, label %24, label %91
24: ; preds = %20
%25 = load %struct.dirent*, %struct.dirent** %4
%26 = getelementptr inbounds %struct.dirent, %struct.dirent* %25, i32 0, i32 0
%27 = load i8*, i8** %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = load %struct.dirent*, %struct.dirent** %4
%30 = getelementptr inbounds %struct.dirent, %struct.dirent* %29, i32 0, i32 0
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %40, label %34
34: ; preds = %24
%35 = load %struct.dirent*, %struct.dirent** %4
%36 = getelementptr inbounds %struct.dirent, %struct.dirent* %35, i32 0, i32 0
%37 = load i8*, i8** %36
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %34, %24
br label %20
41: ; preds = %34
%42 = load i32, i32* @PATH_MAX
%43 = call i32 @memset(i8* %13, i32 0, i32 %42)
%44 = getelementptr inbounds [34 x i8], [34 x i8]* %2, i64 0, i64 0
%45 = call i32 @strcpy(i8* %13, i8* %44)
%46 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%47 = load %struct.dirent*, %struct.dirent** %4
%48 = getelementptr inbounds %struct.dirent, %struct.dirent* %47, i32 0, i32 0
%49 = load i8*, i8** %48
%50 = call i32 @strcat(i8* %13, i8* %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%52 = call i32 @stat(i8* %13, %struct.stat* %7)
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %63
54: ; preds = %41
%55 = load %struct.dirent*, %struct.dirent** %4
%56 = getelementptr inbounds %struct.dirent, %struct.dirent* %55, i32 0, i32 0
%57 = load i8*, i8** %56
%58 = load i32, i32* @errno
%59 = call i8* @strerror(i32 %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %57, i8* %59)
%61 = load i32*, i32** %3
%62 = call i32 @closedir(i32* %61)
store i32 -1, i32* %1
store i32 1, i32* %8
br label %94
63: ; preds = %41
%64 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%65 = load i32, i32* %64
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %65)
%67 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%68 = load i32, i32* %67
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %68)
%70 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%71 = load i32, i32* %70
%72 = and i32 %71, 170000
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %72)
%74 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%75 = load i32, i32* %74
%76 = call i64 @S_ISDIR(i32 %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %63
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %90
80: ; preds = %63
%81 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%82 = load i32, i32* %81
%83 = call i64 @S_ISREG(i32 %82)
%84 = icmp ne i64 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %80
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
br label %89
87: ; preds = %80
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
br label %89
89: ; preds = %87, %85
br label %90
90: ; preds = %89, %78
br label %20
91: ; preds = %20
%92 = load i32*, i32** %3
%93 = call i32 @closedir(i32* %92)
store i32 0, i32* %1
store i32 1, i32* %8
br label %94
94: ; preds = %91, %54, %17
%95 = load i8*, i8** %5
%96 = load i32, i32* %1
ret i32 %96
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@__const.main.DirectoryPath = [34 x i8] c"/home/loongson/EFI-MIPS/test/tdir\00"
@PATH_MAX = global i32 0
@.str.2 = [2 x i8] c".\00"
@.str.3 = [3 x i8] c"..\00"
@.str.4 = [2 x i8] c"/\00"
@.str.5 = [13 x i8] c" %s\0A\00"
@.str.6 = [26 x i8] c"Get stat on %s error: %s\0A\00"
@errno = global i32 0
@.str.7 = [13 x i8] c"Mode = 0x%x\0A\00"
@.str.8 = [11 x i8] c"Mode = %d\0A\00"
@.str.9 = [18 x i8] c"Mode&170000 = %d\0A\00"
@str = [16 x i8] c"is special file\00"
@str.13 = [8 x i8] c"is File\00"
@str.14 = [7 x i8] c"is DIR\00"
@str.15 = [21 x i8] c"Open directory error\00"
define i32 @main() {
%1 = alloca [34 x i8]
%2 = alloca %struct.stat
%3 = getelementptr inbounds [34 x i8], [34 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @PATH_MAX
%5 = zext i32 %4 to i64
%6 = tail call i8* @llvm.stacksave()
%7 = alloca i8, i64 %5
%8 = bitcast %struct.stat* %2 to i8*
%9 = call i32* @opendir(i8* %3)
%10 = icmp eq i32* %9, null
br i1 %10, label %16, label %11
11: ; preds = %0
%12 = call %struct.dirent* @readdir(i32* %9)
%13 = icmp eq %struct.dirent* %12, null
br i1 %13, label %64, label %14
14: ; preds = %11
%15 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
br label %18
16: ; preds = %0
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.15, i64 0, i64 0))
br label %66
18: ; preds = %14, %33
%19 = phi %struct.dirent* [ %12, %14 ], [ %34, %33 ]
%20 = getelementptr inbounds %struct.dirent, %struct.dirent* %19, i64 0, i32 0
%21 = load i8*, i8** %20
%22 = call i32 @puts(i8* dereferenceable(1) %21)
%23 = load i8*, i8** %20
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %33, label %26
26: ; preds = %18
%27 = load i8*, i8** %20
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %33, label %36
30: ; preds = %60, %52
%31 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.14, i64 0, i64 0), %52 ], [ %63, %60 ]
%32 = call i32 @puts(i8* dereferenceable(1) %31)
br label %33
33: ; preds = %30, %18, %26
%34 = call %struct.dirent* @readdir(i32* %9)
%35 = icmp eq %struct.dirent* %34, null
br i1 %35, label %64, label %18
36: ; preds = %26
%37 = load i32, i32* @PATH_MAX
%38 = call i32 @memset(i8* %7, i32 0, i32 %37)
%39 = call i32 @strcpy(i8* %7, i8* %3)
%40 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%41 = load i8*, i8** %20
%42 = call i32 @strcat(i8* %7, i8* %41)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%44 = call i32 @stat(i8* %7, %struct.stat* %2)
%45 = icmp eq i32 %44, -1
br i1 %45, label %46, label %52
46: ; preds = %36
%47 = load i8*, i8** %20
%48 = load i32, i32* @errno
%49 = call i8* @strerror(i32 %48)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %47, i8* %49)
%51 = call i32 @closedir(i32* %9)
br label %66
52: ; preds = %36
%53 = load i32, i32* %15
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %53)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %53)
%56 = and i32 %53, 170000
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %56)
%58 = call i64 @S_ISDIR(i32 %53)
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %30
60: ; preds = %52
%61 = call i64 @S_ISREG(i32 %53)
%62 = icmp eq i64 %61, 0
%63 = select i1 %62, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.13, i64 0, i64 0)
br label %30
64: ; preds = %33, %11
%65 = call i32 @closedir(i32* %9)
br label %66
66: ; preds = %64, %46, %16
%67 = phi i32 [ -1, %16 ], [ -1, %46 ], [ 0, %64 ]
ret i32 %67
}