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

/* Variables and functions */
scalar_t__ DT_REG;
int /*<<< orphan*/ LLVMFuzzerTestOneInput(int *, size_t);
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
scalar_t__ chdir(char *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
char *cs_fuzz_arch(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(int *, size_t, int, int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  FILE *fp;
  uint8_t Data[0x1000];
  size_t Size;
  DIR *d;
  struct dirent *dir;
  int r = 0;
  int i;
  if (argc != 2) {
    return 1;
  }
  d = opendir(argv[1]);
  if (d == NULL) {
    printf("Invalid directory\n");
    return 2;
  }
  if (chdir(argv[1]) != 0) {
    closedir(d);
    printf("Invalid directory\n");
    return 2;
  }
  while ((dir = readdir(d)) != NULL) {
    if (dir->d_type != DT_REG) {
      continue;
    }
    printf("Running %s\n", dir->d_name);
    fflush(stdout);
    fp = fopen(dir->d_name, "rb");
    if (fp == NULL) {
      r = 3;
      break;
    }
    if (fseek(fp, 0L, SEEK_END) != 0) {
      fclose(fp);
      r = 4;
      break;
    }
    Size = ftell(fp);
    if (Size == (size_t)-1) {
      fclose(fp);
      r = 5;
      break;
    } else if (Size > 0x1000) {
      fclose(fp);
      continue;
    }
    if (fseek(fp, 0L, SEEK_SET) != 0) {
      fclose(fp);
      r = 7;
      break;
    }
    if (fread(Data, Size, 1, fp) != 1) {
      fclose(fp);
      r = 8;
      break;
    }
    if (Size > 0) {
      printf("command cstool %s\n", cs_fuzz_arch(Data[0]));
    }
    for (i = 0; i < Size; i++) {
      printf("%02x", Data[i]);
    }
    printf("\n");
    LLVMFuzzerTestOneInput(Data, Size);
    fclose(fp);
  }
  closedir(d);
  printf("Ok : whole directory finished\n");
  return r;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x403c(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1209 <main+0x39>
movl   $0x1,-0x4(%rbp)
jmp    14f0 <main+0x320>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <opendir@plt>
mov    %rax,-0x4030(%rbp)
cmpq   $0x0,-0x4030(%rbp)
jne    1245 <main+0x75>
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    14f0 <main+0x320>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <chdir@plt>
cmp    $0x0,%rax
je     1282 <main+0xb2>
mov    -0x4030(%rbp),%rdi
call   1090 <closedir@plt>
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    14f0 <main+0x320>
jmp    1287 <main+0xb7>
mov    -0x4030(%rbp),%rdi
call   10b0 <readdir@plt>
mov    %rax,-0x4038(%rbp)
cmp    $0x0,%rax
je     14cd <main+0x2fd>
mov    -0x4038(%rbp),%rax
mov    (%rax),%rax
mov    0x2d23(%rip),%rcx
cmp    (%rcx),%rax
je     12c3 <main+0xf3>
jmp    1287 <main+0xb7>
mov    -0x4038(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd3e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
mov    -0x4038(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd23(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    131f <main+0x14f>
movl   $0x3,-0x403c(%rbp)
jmp    14cd <main+0x2fd>
mov    -0x18(%rbp),%rdi
mov    0x2cbe(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10d0 <fseek@plt>
cmp    $0x0,%rax
je     1357 <main+0x187>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x4,-0x403c(%rbp)
jmp    14cd <main+0x2fd>
mov    -0x18(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %rax,-0x4028(%rbp)
cmpq   $0xffffffffffffffff,-0x4028(%rbp)
ff
jne    138d <main+0x1bd>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x5,-0x403c(%rbp)
jmp    14cd <main+0x2fd>
cmpq   $0x1000,-0x4028(%rbp)
jbe    13ac <main+0x1dc>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1287 <main+0xb7>
jmp    13b1 <main+0x1e1>
mov    -0x18(%rbp),%rdi
mov    0x2c14(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10d0 <fseek@plt>
cmp    $0x0,%rax
je     13e9 <main+0x219>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x7,-0x403c(%rbp)
jmp    14cd <main+0x2fd>
lea    -0x4020(%rbp),%rdi
mov    -0x4028(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     1426 <main+0x256>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x8,-0x403c(%rbp)
jmp    14cd <main+0x2fd>
cmpq   $0x0,-0x4028(%rbp)
jbe    1450 <main+0x280>
mov    -0x4020(%rbp),%edi
call   10f0 <cs_fuzz_arch@plt>
mov    %rax,%rsi
lea    0xbd9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4040(%rbp)
movslq -0x4040(%rbp),%rax
cmp    -0x4028(%rbp),%rax
jae    149e <main+0x2ce>
movslq -0x4040(%rbp),%rax
mov    -0x4020(%rbp,%rax,4),%esi
lea    0xbb2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x4040(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4040(%rbp)
jmp    145a <main+0x28a>
lea    0xbb2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x4020(%rbp),%rdi
mov    -0x4028(%rbp),%rsi
call   1080 <LLVMFuzzerTestOneInput@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1287 <main+0xb7>
mov    -0x4030(%rbp),%rdi
call   1090 <closedir@plt>
lea    0xb5a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x403c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4008,%rsp
mov    $0x1,%ebp
cmp    $0x2,%edi
jne    13dc <main+0x1ec>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1070 <opendir@plt>
test   %rax,%rax
je     1239 <main+0x49>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
call   1080 <chdir@plt>
test   %rax,%rax
je     124f <main+0x5f>
mov    %r14,%rdi
call   10b0 <closedir@plt>
lea    0xe05(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%ebp
jmp    13dc <main+0x1ec>
mov    %r14,%rdi
call   10d0 <readdir@plt>
test   %rax,%rax
je     139b <main+0x1ab>
mov    %rax,%rbx
mov    0x2d6e(%rip),%r15
lea    0xdb1(%rip),%rbp
jmp    12a4 <main+0xb4>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
mov    %r12,%rsi
call   10a0 <LLVMFuzzerTestOneInput@plt>
mov    %r13,%rdi
call   1060 <fclose@plt>
mov    %r14,%rdi
call   10d0 <readdir@plt>
mov    %rax,%rbx
test   %rax,%rax
je     139b <main+0x1ab>
mov    (%rbx),%rax
cmp    (%r15),%rax
jne    1290 <main+0xa0>
mov    0x8(%rbx),%rsi
lea    0xd49(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2d03(%rip),%rax
mov    (%rax),%edi
call   10e0 <fflush@plt>
mov    0x8(%rbx),%rdi
lea    0xd35(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     139f <main+0x1af>
mov    %rax,%r13
mov    0x2cf9(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
xor    %esi,%esi
call   10f0 <fseek@plt>
test   %rax,%rax
jne    13a6 <main+0x1b6>
mov    %r13,%rdi
call   10c0 <ftell@plt>
cmp    $0xffffffffffffffff,%rax
je     13ad <main+0x1bd>
mov    %rax,%r12
cmp    $0x1001,%rax
jae    1288 <main+0x98>
mov    0x2ca4(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
xor    %esi,%esi
call   10f0 <fseek@plt>
test   %rax,%rax
jne    13b4 <main+0x1c4>
mov    %rsp,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
mov    %r13,%rcx
call   1050 <fread@plt>
cmp    $0x1,%eax
jne    13bb <main+0x1cb>
test   %r12,%r12
je     1273 <main+0x83>
mov    (%rsp),%edi
call   1110 <cs_fuzz_arch@plt>
lea    0xca2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%rsp,%rbx,4),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1380 <main+0x190>
jmp    1273 <main+0x83>
xor    %ebp,%ebp
jmp    13c8 <main+0x1d8>
mov    $0x3,%ebp
jmp    13c8 <main+0x1d8>
mov    $0x4,%ebp
jmp    13c0 <main+0x1d0>
mov    $0x5,%ebp
jmp    13c0 <main+0x1d0>
mov    $0x7,%ebp
jmp    13c0 <main+0x1d0>
mov    $0x8,%ebp
mov    %r13,%rdi
call   1060 <fclose@plt>
mov    %r14,%rdi
call   10b0 <closedir@plt>
lea    0xc50(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%eax
add    $0x4008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i64, i8* }
@.str = [19 x i8] c"Invalid directory\0A\00"
@DT_REG = global i64 0
@.str.1 = [12 x i8] c"Running %s\0A\00"
@stdout = global i32 0
@.str.2 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [19 x i8] c"command cstool %s\0A\00"
@.str.4 = [5 x i8] c"%02x\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [31 x i8] c"Ok : whole directory finished\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [4096 x i32]
%8 = alloca i64
%9 = alloca i32*
%10 = alloca %struct.dirent*
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %11
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %136
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32* @opendir(i8* %19)
store i32* %20, i32** %9
%21 = load i32*, i32** %9
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %25
23: ; preds = %16
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %3
br label %136
25: ; preds = %16
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i64 @chdir(i8* %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %25
%32 = load i32*, i32** %9
%33 = call i32 @closedir(i32* %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %3
br label %136
35: ; preds = %25
br label %36
36: ; preds = %124, %80, %46, %35
%37 = load i32*, i32** %9
%38 = call %struct.dirent* @readdir(i32* %37)
store %struct.dirent* %38, %struct.dirent** %10
%39 = icmp ne %struct.dirent* %38, null
br i1 %39, label %40, label %131
40: ; preds = %36
%41 = load %struct.dirent*, %struct.dirent** %10
%42 = getelementptr inbounds %struct.dirent, %struct.dirent* %41, i32 0, i32 0
%43 = load i64, i64* %42
%44 = load i64, i64* @DT_REG
%45 = icmp ne i64 %43, %44
br i1 %45, label %46, label %47
46: ; preds = %40
br label %36
47: ; preds = %40
%48 = load %struct.dirent*, %struct.dirent** %10
%49 = getelementptr inbounds %struct.dirent, %struct.dirent* %48, i32 0, i32 1
%50 = load i8*, i8** %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %50)
%52 = load i32, i32* @stdout
%53 = call i32 @fflush(i32 %52)
%54 = load %struct.dirent*, %struct.dirent** %10
%55 = getelementptr inbounds %struct.dirent, %struct.dirent* %54, i32 0, i32 1
%56 = load i8*, i8** %55
%57 = call i32* @fopen(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %57, i32** %6
%58 = load i32*, i32** %6
%59 = icmp eq i32* %58, null
br i1 %59, label %60, label %61
60: ; preds = %47
store i32 3, i32* %11
br label %131
61: ; preds = %47
%62 = load i32*, i32** %6
%63 = load i32, i32* @SEEK_END
%64 = call i64 @fseek(i32* %62, i64 0, i32 %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %61
%67 = load i32*, i32** %6
%68 = call i32 @fclose(i32* %67)
store i32 4, i32* %11
br label %131
69: ; preds = %61
%70 = load i32*, i32** %6
%71 = call i64 @ftell(i32* %70)
store i64 %71, i64* %8
%72 = load i64, i64* %8
%73 = icmp eq i64 %72, -1
br i1 %73, label %74, label %77
74: ; preds = %69
%75 = load i32*, i32** %6
%76 = call i32 @fclose(i32* %75)
store i32 5, i32* %11
br label %131
77: ; preds = %69
%78 = load i64, i64* %8
%79 = icmp ugt i64 %78, 4096
br i1 %79, label %80, label %83
80: ; preds = %77
%81 = load i32*, i32** %6
%82 = call i32 @fclose(i32* %81)
br label %36
83: ; preds = %77
br label %84
84: ; preds = %83
%85 = load i32*, i32** %6
%86 = load i32, i32* @SEEK_SET
%87 = call i64 @fseek(i32* %85, i64 0, i32 %86)
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %84
%90 = load i32*, i32** %6
%91 = call i32 @fclose(i32* %90)
store i32 7, i32* %11
br label %131
92: ; preds = %84
%93 = getelementptr inbounds [4096 x i32], [4096 x i32]* %7, i64 0, i64 0
%94 = load i64, i64* %8
%95 = load i32*, i32** %6
%96 = call i32 @fread(i32* %93, i64 %94, i32 1, i32* %95)
%97 = icmp ne i32 %96, 1
br i1 %97, label %98, label %101
98: ; preds = %92
%99 = load i32*, i32** %6
%100 = call i32 @fclose(i32* %99)
store i32 8, i32* %11
br label %131
101: ; preds = %92
%102 = load i64, i64* %8
%103 = icmp ugt i64 %102, 0
br i1 %103, label %104, label %109
104: ; preds = %101
%105 = getelementptr inbounds [4096 x i32], [4096 x i32]* %7, i64 0, i64 0
%106 = load i32, i32* %105
%107 = call i8* @cs_fuzz_arch(i32 %106)
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %107)
br label %109
109: ; preds = %104, %101
store i32 0, i32* %12
br label %110
110: ; preds = %121, %109
%111 = load i32, i32* %12
%112 = sext i32 %111 to i64
%113 = load i64, i64* %8
%114 = icmp ult i64 %112, %113
br i1 %114, label %115, label %124
115: ; preds = %110
%116 = load i32, i32* %12
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [4096 x i32], [4096 x i32]* %7, i64 0, i64 %117
%119 = load i32, i32* %118
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %119)
br label %121
121: ; preds = %115
%122 = load i32, i32* %12
%123 = add nsw i32 %122, 1
store i32 %123, i32* %12
br label %110
124: ; preds = %110
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%126 = getelementptr inbounds [4096 x i32], [4096 x i32]* %7, i64 0, i64 0
%127 = load i64, i64* %8
%128 = call i32 @LLVMFuzzerTestOneInput(i32* %126, i64 %127)
%129 = load i32*, i32** %6
%130 = call i32 @fclose(i32* %129)
br label %36
131: ; preds = %98, %89, %74, %66, %60, %36
%132 = load i32*, i32** %9
%133 = call i32 @closedir(i32* %132)
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%135 = load i32, i32* %11
store i32 %135, i32* %3
br label %136
136: ; preds = %131, %31, %23, %15
%137 = load i32, i32* %3
ret i32 %137
}

LLVM IR (-O2):
%struct.dirent = type { i64, i8* }
@DT_REG = global i64 0
@.str.1 = [12 x i8] c"Running %s\0A\00"
@stdout = global i32 0
@.str.2 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [19 x i8] c"command cstool %s\0A\00"
@.str.4 = [5 x i8] c"%02x\00"
@str = [30 x i8] c"Ok : whole directory finished\00"
@str.8 = [18 x i8] c"Invalid directory\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i32]
%4 = bitcast [4096 x i32]* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %84
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32* @opendir(i8* %8)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
br label %84
13: ; preds = %6
%14 = load i8*, i8** %7
%15 = tail call i64 @chdir(i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = call %struct.dirent* @readdir(i32* %9)
%19 = icmp eq %struct.dirent* %18, null
br i1 %19, label %80, label %20
20: ; preds = %17
%21 = getelementptr inbounds [4096 x i32], [4096 x i32]* %3, i64 0, i64 0
br label %25
22: ; preds = %13
%23 = tail call i32 @closedir(i32* %9)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
br label %84
25: ; preds = %20, %51
%26 = phi %struct.dirent* [ %18, %20 ], [ %52, %51 ]
%27 = getelementptr inbounds %struct.dirent, %struct.dirent* %26, i64 0, i32 0
%28 = load i64, i64* %27
%29 = load i64, i64* @DT_REG
%30 = icmp eq i64 %28, %29
br i1 %30, label %31, label %51
31: ; preds = %25
%32 = getelementptr inbounds %struct.dirent, %struct.dirent* %26, i64 0, i32 1
%33 = load i8*, i8** %32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %33)
%35 = load i32, i32* @stdout
%36 = call i32 @fflush(i32 %35)
%37 = load i8*, i8** %32
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%39 = icmp eq i32* %38, null
br i1 %39, label %80, label %40
40: ; preds = %31
%41 = load i32, i32* @SEEK_END
%42 = call i64 @fseek(i32* %38, i64 0, i32 %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %77
44: ; preds = %40
%45 = call i64 @ftell(i32* %38)
%46 = icmp eq i64 %45, -1
br i1 %46, label %77, label %47
47: ; preds = %44
%48 = icmp ugt i64 %45, 4096
br i1 %48, label %49, label %54
49: ; preds = %47, %74
%50 = call i32 @fclose(i32* %38)
br label %51
51: ; preds = %49, %25
%52 = call %struct.dirent* @readdir(i32* %9)
%53 = icmp eq %struct.dirent* %52, null
br i1 %53, label %80, label %25
54: ; preds = %47
%55 = load i32, i32* @SEEK_SET
%56 = call i64 @fseek(i32* %38, i64 0, i32 %55)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %77
58: ; preds = %54
%59 = call i32 @fread(i32* %21, i64 %45, i32 1, i32* %38)
%60 = icmp eq i32 %59, 1
br i1 %60, label %61, label %77
61: ; preds = %58
%62 = icmp eq i64 %45, 0
br i1 %62, label %74, label %63
63: ; preds = %61
%64 = load i32, i32* %21
%65 = call i8* @cs_fuzz_arch(i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %65)
br label %67
67: ; preds = %63, %67
%68 = phi i64 [ 0, %63 ], [ %72, %67 ]
%69 = getelementptr inbounds [4096 x i32], [4096 x i32]* %3, i64 0, i64 %68
%70 = load i32, i32* %69
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %70)
%72 = add nuw i64 %68, 1
%73 = icmp eq i64 %72, %45
br i1 %73, label %74, label %67
74: ; preds = %67, %61
%75 = call i32 @putchar(i32 10)
%76 = call i32 @LLVMFuzzerTestOneInput(i32* %21, i64 %45)
br label %49
77: ; preds = %58, %54, %44, %40
%78 = phi i32 [ 4, %40 ], [ 5, %44 ], [ 7, %54 ], [ 8, %58 ]
%79 = call i32 @fclose(i32* %38)
br label %80
80: ; preds = %51, %31, %77, %17
%81 = phi i32 [ 0, %17 ], [ %78, %77 ], [ 0, %51 ], [ 3, %31 ]
%82 = call i32 @closedir(i32* %9)
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %84
84: ; preds = %2, %80, %22, %11
%85 = phi i32 [ 2, %11 ], [ 2, %22 ], [ %81, %80 ], [ 1, %2 ]
ret i32 %85
}