#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*/ FILE;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int is_ascii(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
char *strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strstr(char *, char *);
int ls_filetype(DIR *dir, struct dirent *dirent, struct stat fileStat,
                char *currDir) {
  currDir = strcat(currDir, "/");
  printf("File Name - File Type \n");
  while (NULL != (dirent = readdir(dir))) {
    if (strcmp(dirent->d_name, ".") != 0 && strcmp(dirent->d_name, "..") != 0) {
      int file;
      char path[1024];
      const char *ret;
      strcpy(path, currDir);
      strcat(path, dirent->d_name);
      char data[1000];
      int readingerror;
      FILE *fp;
      fp = fopen(path, "r");
      if (fgets(data, 100, fp) == NULL) {
        printf("%s", path);
        perror("Error opening file");
        return (-1);
      } else if ((ret = strstr(data, "%!PS-Adobe")) != NULL) {
        printf("%s - %s\n", dirent->d_name, "Postscript File");
      } else if ((ret = strstr(data, "\r\n")) != NULL) {
        printf("%s - %s\n", dirent->d_name, "DOS File");
      } else if ((data[0] == 127) && (data[1] == 'E') && (data[2] == 'L') &&
                 (data[3] == 'F')) {
        printf("%s - %s\n", dirent->d_name, "ELF File");
      } else if ((is_ascii(data)) == 1) {
        printf("%s - %s\n", dirent->d_name, "Regular File");
      } else {
        printf("%s - %s\n", dirent->d_name, "Unidentifiable Binary File");
      }
      memset(path, 0, 255);
    }
  }
}


x86 assembly (clang, -O0):
<ls_filetype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
mov    %edx,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe2b(%rip),%rsi
call   10c0 <strcat@plt>
mov    %rax,-0x20(%rbp)
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <readdir@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     1436 <ls_filetype+0x286>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe06(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1431 <ls_filetype+0x281>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xde8(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1431 <ls_filetype+0x281>
lea    -0x430(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
call   10c0 <strcat@plt>
lea    -0x430(%rbp),%rdi
lea    0xdab(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x830(%rbp)
lea    -0x820(%rbp),%rdi
mov    -0x830(%rbp),%rdx
mov    $0x64,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    12cd <ls_filetype+0x11d>
lea    -0x430(%rbp),%rsi
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd66(%rip),%rdi
call   10b0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1436 <ls_filetype+0x286>
lea    -0x820(%rbp),%rdi
lea    0xd5a(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x438(%rbp)
cmp    $0x0,%rax
je     1312 <ls_filetype+0x162>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xd41(%rip),%rdi
lea    0xd43(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1419 <ls_filetype+0x269>
lea    -0x820(%rbp),%rdi
lea    0xd39(%rip),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x438(%rbp)
cmp    $0x0,%rax
je     1357 <ls_filetype+0x1a7>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xcfc(%rip),%rdi
lea    0xd11(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1414 <ls_filetype+0x264>
movsbl -0x820(%rbp),%eax
cmp    $0x7f,%eax
jne    13b8 <ls_filetype+0x208>
movsbl -0x81f(%rbp),%eax
cmp    $0x45,%eax
jne    13b8 <ls_filetype+0x208>
movsbl -0x81e(%rbp),%eax
cmp    $0x4c,%eax
jne    13b8 <ls_filetype+0x208>
movsbl -0x81d(%rbp),%eax
cmp    $0x46,%eax
jne    13b8 <ls_filetype+0x208>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xc9b(%rip),%rdi
lea    0xcb9(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    140f <ls_filetype+0x25f>
lea    -0x820(%rbp),%rdi
call   1070 <is_ascii@plt>
cmp    $0x1,%eax
jne    13ee <ls_filetype+0x23e>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xc65(%rip),%rdi
lea    0xc8c(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    140a <ls_filetype+0x25a>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xc44(%rip),%rdi
lea    0xc78(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    140f <ls_filetype+0x25f>
jmp    1414 <ls_filetype+0x264>
jmp    1419 <ls_filetype+0x269>
jmp    141e <ls_filetype+0x26e>
lea    -0x430(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1050 <memset@plt>
jmp    11ec <ls_filetype+0x3c>
mov    -0x4(%rbp),%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_filetype>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7f8,%rsp
mov    %rcx,%r14
mov    %rdi,%rbx
mov    %rcx,%rdi
call   1050 <strlen@plt>
movw   $0x2f,(%r14,%rax,1)
lea    0xe7f(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   10b0 <readdir@plt>
test   %rax,%rax
je     138d <ls_filetype+0x1bd>
mov    %rax,%r12
lea    0xde4(%rip),%r15
lea    0x3f0(%rsp),%r13
mov    %rsp,%rbp
jmp    126c <ls_filetype+0x9c>
nopw   0x0(%rax,%rax,1)
mov    (%r12),%rsi
lea    0xdeb(%rip),%rdi
lea    0xded(%rip),%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1070 <memset@plt>
mov    %rbx,%rdi
call   10b0 <readdir@plt>
mov    %rax,%r12
test   %rax,%rax
je     138d <ls_filetype+0x1bd>
mov    (%r12),%rdi
mov    %r15,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1258 <ls_filetype+0x88>
mov    (%r12),%rdi
lea    0xd78(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1258 <ls_filetype+0x88>
mov    %r13,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    (%r12),%rsi
mov    %r13,%rdi
call   10e0 <strcat@plt>
mov    %r13,%rdi
lea    0xd50(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rbp,%rdi
mov    $0x64,%esi
mov    %rax,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     136b <ls_filetype+0x19b>
mov    %rbp,%rdi
lea    0xd40(%rip),%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
jne    1230 <ls_filetype+0x60>
mov    %rbp,%rdi
lea    0xd4c(%rip),%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
je     1314 <ls_filetype+0x144>
mov    (%r12),%rsi
lea    0xd1e(%rip),%rdi
lea    0xd33(%rip),%rdx
jmp    1242 <ls_filetype+0x72>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x464c457f,%eax
jne    133b <ls_filetype+0x16b>
mov    (%r12),%rsi
lea    0xcf7(%rip),%rdi
lea    0xd15(%rip),%rdx
jmp    1242 <ls_filetype+0x72>
mov    %rbp,%rdi
call   1090 <is_ascii@plt>
mov    (%r12),%rsi
lea    0xcd8(%rip),%rdi
cmp    $0x1,%eax
jne    135f <ls_filetype+0x18f>
lea    0xcfa(%rip),%rdx
jmp    1242 <ls_filetype+0x72>
lea    0xcfb(%rip),%rdx
jmp    1242 <ls_filetype+0x72>
lea    0xc93(%rip),%rdi
lea    0x3f0(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc80(%rip),%rdi
call   10d0 <perror@plt>
mov    $0xffffffff,%eax
add    $0x7f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32 }
@.str = [2 x i8] c"/\00"
@.str.1 = [24 x i8] c"File Name - File Type \0A\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [3 x i8] c"..\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [19 x i8] c"Error opening file\00"
@.str.7 = [11 x i8] c"%!PS-Adobe\00"
@.str.8 = [9 x i8] c"%s - %s\0A\00"
@.str.9 = [16 x i8] c"Postscript File\00"
@.str.10 = [3 x i8] c"\0D\0A\00"
@.str.11 = [9 x i8] c"DOS File\00"
@.str.12 = [9 x i8] c"ELF File\00"
@.str.13 = [13 x i8] c"Regular File\00"
@.str.14 = [27 x i8] c"Unidentifiable Binary File\00"
define i32 @ls_filetype(i32* %0, %struct.dirent* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca %struct.stat
%7 = alloca i32*
%8 = alloca %struct.dirent*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [1024 x i8]
%12 = alloca i8*
%13 = alloca [1000 x i8]
%14 = alloca i32
%15 = alloca i32*
%16 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
store i32 %2, i32* %16
store i32* %0, i32** %7
store %struct.dirent* %1, %struct.dirent** %8
store i8* %3, i8** %9
%17 = load i8*, i8** %9
%18 = call i8* @strcat(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %18, i8** %9
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %119, %4
%21 = load i32*, i32** %7
%22 = call %struct.dirent* @readdir(i32* %21)
store %struct.dirent* %22, %struct.dirent** %8
%23 = icmp ne %struct.dirent* null, %22
br i1 %23, label %24, label %120
24: ; preds = %20
%25 = load %struct.dirent*, %struct.dirent** %8
%26 = getelementptr inbounds %struct.dirent, %struct.dirent* %25, i32 0, i32 0
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %119
30: ; preds = %24
%31 = load %struct.dirent*, %struct.dirent** %8
%32 = getelementptr inbounds %struct.dirent, %struct.dirent* %31, i32 0, i32 0
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %119
36: ; preds = %30
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%38 = load i8*, i8** %9
%39 = call i32 @strcpy(i8* %37, i8* %38)
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%41 = load %struct.dirent*, %struct.dirent** %8
%42 = getelementptr inbounds %struct.dirent, %struct.dirent* %41, i32 0, i32 0
%43 = load i8*, i8** %42
%44 = call i8* @strcat(i8* %40, i8* %43)
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %46, i32** %15
%47 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 0
%48 = load i32*, i32** %15
%49 = call i32* @fgets(i8* %47, i32 100, i32* %48)
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %55
51: ; preds = %36
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %52)
%54 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %5
br label %120
55: ; preds = %36
%56 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 0
%57 = call i8* @strstr(i8* %56, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
store i8* %57, i8** %12
%58 = icmp ne i8* %57, null
br i1 %58, label %59, label %64
59: ; preds = %55
%60 = load %struct.dirent*, %struct.dirent** %8
%61 = getelementptr inbounds %struct.dirent, %struct.dirent* %60, i32 0, i32 0
%62 = load i8*, i8** %61
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %62, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
br label %115
64: ; preds = %55
%65 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 0
%66 = call i8* @strstr(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
store i8* %66, i8** %12
%67 = icmp ne i8* %66, null
br i1 %67, label %68, label %73
68: ; preds = %64
%69 = load %struct.dirent*, %struct.dirent** %8
%70 = getelementptr inbounds %struct.dirent, %struct.dirent* %69, i32 0, i32 0
%71 = load i8*, i8** %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %71, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
br label %114
73: ; preds = %64
%74 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 0
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 127
br i1 %77, label %78, label %98
78: ; preds = %73
%79 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 1
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 69
br i1 %82, label %83, label %98
83: ; preds = %78
%84 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 2
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = icmp eq i32 %86, 76
br i1 %87, label %88, label %98
88: ; preds = %83
%89 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 3
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp eq i32 %91, 70
br i1 %92, label %93, label %98
93: ; preds = %88
%94 = load %struct.dirent*, %struct.dirent** %8
%95 = getelementptr inbounds %struct.dirent, %struct.dirent* %94, i32 0, i32 0
%96 = load i8*, i8** %95
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %96, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
br label %113
98: ; preds = %88, %83, %78, %73
%99 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 0
%100 = call i32 @is_ascii(i8* %99)
%101 = icmp eq i32 %100, 1
br i1 %101, label %102, label %107
102: ; preds = %98
%103 = load %struct.dirent*, %struct.dirent** %8
%104 = getelementptr inbounds %struct.dirent, %struct.dirent* %103, i32 0, i32 0
%105 = load i8*, i8** %104
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %105, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
br label %112
107: ; preds = %98
%108 = load %struct.dirent*, %struct.dirent** %8
%109 = getelementptr inbounds %struct.dirent, %struct.dirent* %108, i32 0, i32 0
%110 = load i8*, i8** %109
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %110, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0))
br label %112
112: ; preds = %107, %102
br label %113
113: ; preds = %112, %93
br label %114
114: ; preds = %113, %68
br label %115
115: ; preds = %114, %59
br label %116
116: ; preds = %115
%117 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%118 = call i32 @memset(i8* %117, i32 0, i32 255)
br label %119
119: ; preds = %116, %30, %24
br label %20
120: ; preds = %51, %20
%121 = load i32, i32* %5
ret i32 %121
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str.2 = [2 x i8] c".\00"
@.str.3 = [3 x i8] c"..\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [19 x i8] c"Error opening file\00"
@.str.7 = [11 x i8] c"%!PS-Adobe\00"
@.str.8 = [9 x i8] c"%s - %s\0A\00"
@.str.9 = [16 x i8] c"Postscript File\00"
@.str.10 = [3 x i8] c"\0D\0A\00"
@.str.11 = [9 x i8] c"DOS File\00"
@.str.12 = [9 x i8] c"ELF File\00"
@.str.13 = [13 x i8] c"Regular File\00"
@.str.14 = [27 x i8] c"Unidentifiable Binary File\00"
@str = [23 x i8] c"File Name - File Type \00"
define i32 @ls_filetype(i32* %0, %struct.dirent* nocapture readnone %1, i32 %2, i8* %3) {
%5 = alloca [1024 x i8]
%6 = alloca [1000 x i8]
%7 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%8 = getelementptr i8, i8* %3, i64 %7
%9 = bitcast i8* %8 to i16*
store i16 47, i16* %9
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%11 = call %struct.dirent* @readdir(i32* %0)
%12 = icmp eq %struct.dirent* %11, null
br i1 %12, label %70, label %13
13: ; preds = %4
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%16 = bitcast [1000 x i8]* %6 to <4 x i8>*
br label %17
17: ; preds = %13, %67
%18 = phi %struct.dirent* [ %11, %13 ], [ %68, %67 ]
%19 = getelementptr inbounds %struct.dirent, %struct.dirent* %18, i64 0, i32 0
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %67, label %23
23: ; preds = %17
%24 = load i8*, i8** %19
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %67, label %27
27: ; preds = %23
%28 = call i32 @strcpy(i8* %14, i8* %3)
%29 = load i8*, i8** %19
%30 = call i8* @strcat(i8* %14, i8* dereferenceable(1) %29)
%31 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32* @fgets(i8* %15, i32 100, i32* %31)
%33 = icmp eq i32* %32, null
br i1 %33, label %64, label %34
34: ; preds = %27
%35 = call i8* @strstr(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%36 = icmp eq i8* %35, null
br i1 %36, label %40, label %37
37: ; preds = %34
%38 = load i8*, i8** %19
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %38, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
br label %62
40: ; preds = %34
%41 = call i8* @strstr(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%42 = icmp eq i8* %41, null
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load i8*, i8** %19
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %44, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
br label %62
46: ; preds = %40
%47 = load <4 x i8>, <4 x i8>* %16
%48 = freeze <4 x i8> %47
%49 = bitcast <4 x i8> %48 to i32
%50 = icmp eq i32 %49, 1179403647
br i1 %50, label %51, label %54
51: ; preds = %46
%52 = load i8*, i8** %19
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %52, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
br label %62
54: ; preds = %46
%55 = call i32 @is_ascii(i8* %15)
%56 = icmp eq i32 %55, 1
%57 = load i8*, i8** %19
br i1 %56, label %58, label %60
58: ; preds = %54
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %57, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
br label %62
60: ; preds = %54
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %57, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0))
br label %62
62: ; preds = %43, %58, %60, %51, %37
%63 = call i32 @memset(i8* %14, i32 0, i32 255)
br label %67
64: ; preds = %27
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %14)
%66 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %70
67: ; preds = %62, %23, %17
%68 = call %struct.dirent* @readdir(i32* %0)
%69 = icmp eq %struct.dirent* %68, null
br i1 %69, label %70, label %17
70: ; preds = %67, %4, %64
ret i32 -1
}