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

/* Variables and functions */
int /*<<< orphan*/ chomp(char *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *openMaplist();
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printf(char *, char *);
struct dirent *readdir(int /*<<< orphan*/ *);
scalar_t__ sisdigit(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  FILE *MAPLIST;
  char *line;
  char buff[1024];
  int count, start;
  int last;
  DIR *d;
  struct dirent *de;
  char dirs[64][255];
  MAPLIST = openMaplist();
  count = 0;
  while ((feof(MAPLIST) == 0) && (64 > count)) {
    line = fgets(buff, sizeof(buff), MAPLIST);
    chomp(line);
    strcpy(dirs[count], line);
    count++;
  }
  count = 0;
  start = 20;
  last = 0;
  while ((64 > count) && (!last)) {
    printf("ll: %s\n", dirs[start]);
    if ((d = opendir(dirs[start])) != NULL) {
      while (de = readdir(d)) {
        if (sisdigit(de->d_name)) {
          printf("yy: -%s-\n", de->d_name);
        }
      }
      closedir(d);
    }
    if (start == 64) {
      start = 0;
    }
    ++start;
    ++count;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   10c0 <openMaplist@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x424(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <feof@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x4401(%rbp)
jne    1200 <main+0x60>
mov    $0x40,%eax
cmp    -0x424(%rbp),%eax
setg   %al
mov    %al,-0x4401(%rbp)
mov    -0x4401(%rbp),%al
test   $0x1,%al
jne    1213 <main+0x73>
jmp    126a <main+0xca>
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   10b0 <chomp@plt>
movslq -0x424(%rbp),%rax
lea    -0x4400(%rbp),%rdi
imul   $0xff,%rax,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    11ce <main+0x2e>
movl   $0x0,-0x424(%rbp)
movl   $0x14,-0x428(%rbp)
movl   $0x0,-0x42c(%rbp)
xor    %eax,%eax
mov    $0x40,%ecx
cmp    -0x424(%rbp),%ecx
mov    %al,-0x4402(%rbp)
jle    12b3 <main+0x113>
cmpl   $0x0,-0x42c(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x4402(%rbp)
mov    -0x4402(%rbp),%al
test   $0x1,%al
jne    12c6 <main+0x126>
jmp    13b4 <main+0x214>
movslq -0x428(%rbp),%rax
lea    -0x4400(%rbp),%rsi
imul   $0xff,%rax,%rax
add    %rax,%rsi
lea    0xd1b(%rip),%rdi
call   1050 <printf@plt>
movslq -0x428(%rbp),%rax
lea    -0x4400(%rbp),%rdi
imul   $0xff,%rax,%rax
add    %rax,%rdi
call   1040 <opendir@plt>
mov    %rax,-0x438(%rbp)
cmp    $0x0,%rax
je     137a <main+0x1da>
jmp    131d <main+0x17d>
mov    -0x438(%rbp),%rdi
call   10a0 <readdir@plt>
mov    %rax,-0x440(%rbp)
cmp    $0x0,%rax
je     136e <main+0x1ce>
mov    -0x440(%rbp),%rax
mov    (%rax),%rdi
call   1080 <sisdigit@plt>
cmp    $0x0,%rax
je     1369 <main+0x1c9>
mov    -0x440(%rbp),%rax
mov    (%rax),%rsi
lea    0xca4(%rip),%rdi
call   1050 <printf@plt>
jmp    131d <main+0x17d>
mov    -0x438(%rbp),%rdi
call   1060 <closedir@plt>
cmpl   $0x40,-0x428(%rbp)
jne    1391 <main+0x1f1>
movl   $0x0,-0x428(%rbp)
mov    -0x428(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x428(%rbp)
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    1288 <main+0xe8>
mov    -0x4(%rbp),%eax
add    $0x4410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x43c8,%rsp
xor    %ebp,%ebp
xor    %eax,%eax
call   10c0 <openMaplist@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1090 <feof@plt>
test   %rax,%rax
jne    1227 <main+0x87>
lea    0x400(%rsp),%rbx
xor    %r13d,%r13d
mov    %rsp,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1070 <fgets@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   10b0 <chomp@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1090 <feof@plt>
test   %rax,%rax
jne    1227 <main+0x87>
lea    0x1(%r13),%rax
add    $0xff,%rbx
cmp    $0x3f,%r13
mov    %rax,%r13
jb     11e0 <main+0x40>
mov    $0x14,%r13d
lea    0xdcc(%rip),%r14
lea    0xdcd(%rip),%r15
jmp    1263 <main+0xc3>
nopl   (%rax)
mov    %r12,%rdi
call   1060 <closedir@plt>
cmp    $0x40,%r13d
lea    0x1(%r13),%eax
mov    $0x1,%ecx
cmove  %ecx,%eax
add    $0x1,%ebp
mov    %eax,%r13d
cmp    $0x40,%ebp
je     12da <main+0x13a>
movslq %r13d,%rax
mov    %rax,%rcx
shl    $0x8,%rcx
sub    %rax,%rcx
lea    (%rsp,%rcx,1),%rbx
add    $0x400,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <opendir@plt>
test   %rax,%rax
je     1248 <main+0xa8>
mov    %rax,%r12
mov    %rax,%rdi
call   10a0 <readdir@plt>
test   %rax,%rax
je     1240 <main+0xa0>
mov    %rax,%rbx
jmp    12c0 <main+0x120>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   10a0 <readdir@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1240 <main+0xa0>
mov    (%rbx),%rdi
call   1080 <sisdigit@plt>
test   %rax,%rax
je     12b0 <main+0x110>
mov    (%rbx),%rsi
mov    %r15,%rdi
call   1050 <printf@plt>
jmp    12b0 <main+0x110>
xor    %eax,%eax
add    $0x43c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
@.str = [8 x i8] c"ll: %s\0A\00"
@.str.1 = [10 x i8] c"yy: -%s-\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca [1024 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca %struct.dirent*
%14 = alloca [64 x [255 x i8]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = call i32* (...) @openMaplist()
store i32* %15, i32** %6
store i32 0, i32* %9
br label %16
16: ; preds = %25, %2
%17 = load i32*, i32** %6
%18 = call i64 @feof(i32* %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %9
%22 = icmp sgt i32 64, %21
br label %23
23: ; preds = %20, %16
%24 = phi i1 [ false, %16 ], [ %22, %20 ]
br i1 %24, label %25, label %39
25: ; preds = %23
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%27 = load i32*, i32** %6
%28 = call i8* @fgets(i8* %26, i32 1024, i32* %27)
store i8* %28, i8** %7
%29 = load i8*, i8** %7
%30 = call i32 @chomp(i8* %29)
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %14, i64 0, i64 %32
%34 = getelementptr inbounds [255 x i8], [255 x i8]* %33, i64 0, i64 0
%35 = load i8*, i8** %7
%36 = call i32 @strcpy(i8* %34, i8* %35)
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
store i32 %38, i32* %9
br label %16
39: ; preds = %23
store i32 0, i32* %9
store i32 20, i32* %10
store i32 0, i32* %11
br label %40
40: ; preds = %85, %39
%41 = load i32, i32* %9
%42 = icmp sgt i32 64, %41
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = load i32, i32* %11
%45 = icmp ne i32 %44, 0
%46 = xor i1 %45, true
br label %47
47: ; preds = %43, %40
%48 = phi i1 [ false, %40 ], [ %46, %43 ]
br i1 %48, label %49, label %90
49: ; preds = %47
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %14, i64 0, i64 %51
%53 = getelementptr inbounds [255 x i8], [255 x i8]* %52, i64 0, i64 0
%54 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %53)
%55 = load i32, i32* %10
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %14, i64 0, i64 %56
%58 = getelementptr inbounds [255 x i8], [255 x i8]* %57, i64 0, i64 0
%59 = call i32* @opendir(i8* %58)
store i32* %59, i32** %12
%60 = icmp ne i32* %59, null
br i1 %60, label %61, label %81
61: ; preds = %49
br label %62
62: ; preds = %77, %61
%63 = load i32*, i32** %12
%64 = call %struct.dirent* @readdir(i32* %63)
store %struct.dirent* %64, %struct.dirent** %13
%65 = icmp ne %struct.dirent* %64, null
br i1 %65, label %66, label %78
66: ; preds = %62
%67 = load %struct.dirent*, %struct.dirent** %13
%68 = getelementptr inbounds %struct.dirent, %struct.dirent* %67, i32 0, i32 0
%69 = load i8*, i8** %68
%70 = call i64 @sisdigit(i8* %69)
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %77
72: ; preds = %66
%73 = load %struct.dirent*, %struct.dirent** %13
%74 = getelementptr inbounds %struct.dirent, %struct.dirent* %73, i32 0, i32 0
%75 = load i8*, i8** %74
%76 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %75)
br label %77
77: ; preds = %72, %66
br label %62
78: ; preds = %62
%79 = load i32*, i32** %12
%80 = call i32 @closedir(i32* %79)
br label %81
81: ; preds = %78, %49
%82 = load i32, i32* %10
%83 = icmp eq i32 %82, 64
br i1 %83, label %84, label %85
84: ; preds = %81
store i32 0, i32* %10
br label %85
85: ; preds = %84, %81
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
store i32 %87, i32* %10
%88 = load i32, i32* %9
%89 = add nsw i32 %88, 1
store i32 %89, i32* %9
br label %40
90: ; preds = %47
%91 = load i32, i32* %3
ret i32 %91
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [8 x i8] c"ll: %s\0A\00"
@.str.1 = [10 x i8] c"yy: -%s-\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = alloca [64 x [255 x i8]]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %4, i64 0, i64 0, i64 0
%7 = tail call i32* (...) @openMaplist()
%8 = call i64 @feof(i32* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %2, %10
%11 = phi i64 [ %16, %10 ], [ 0, %2 ]
%12 = call i8* @fgets(i8* %5, i32 1024, i32* %7)
%13 = call i32 @chomp(i8* %12)
%14 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %4, i64 0, i64 %11, i64 0
%15 = call i32 @strcpy(i8* %14, i8* %12)
%16 = add nuw nsw i64 %11, 1
%17 = call i64 @feof(i32* %7)
%18 = icmp eq i64 %17, 0
%19 = icmp ult i64 %11, 63
%20 = select i1 %18, i1 %19, i1 false
br i1 %20, label %10, label %21
21: ; preds = %10, %2
br label %22
22: ; preds = %21, %47
%23 = phi i32 [ %51, %47 ], [ 0, %21 ]
%24 = phi i32 [ %50, %47 ], [ 20, %21 ]
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %4, i64 0, i64 %25, i64 0
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = call i32* @opendir(i8* %26)
%29 = icmp eq i32* %28, null
br i1 %29, label %47, label %30
30: ; preds = %22
%31 = call %struct.dirent* @readdir(i32* %28)
%32 = icmp eq %struct.dirent* %31, null
br i1 %32, label %45, label %33
33: ; preds = %30, %42
%34 = phi %struct.dirent* [ %43, %42 ], [ %31, %30 ]
%35 = getelementptr inbounds %struct.dirent, %struct.dirent* %34, i64 0, i32 0
%36 = load i8*, i8** %35
%37 = call i64 @sisdigit(i8* %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %33
%40 = load i8*, i8** %35
%41 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %40)
br label %42
42: ; preds = %39, %33
%43 = call %struct.dirent* @readdir(i32* %28)
%44 = icmp eq %struct.dirent* %43, null
br i1 %44, label %45, label %33
45: ; preds = %42, %30
%46 = call i32 @closedir(i32* %28)
br label %47
47: ; preds = %45, %22
%48 = icmp eq i32 %24, 64
%49 = add nsw i32 %24, 1
%50 = select i1 %48, i32 1, i32 %49
%51 = add nuw nsw i32 %23, 1
%52 = icmp eq i32 %51, 64
br i1 %52, label %53, label %22
53: ; preds = %47
ret i32 0
}