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

/* Variables and functions */
int EOF;
int EXIT_FAILURE;
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ openPict(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *opendir(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strrchr(char *, char);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  DIR *folder = NULL;
  FILE *fileList = NULL;
  FILE *folderList = NULL;
  FILE *picture = NULL;
  FILE *log = NULL;
  FILE *descriptorBase = NULL;
  char folderReadFromList[100] = {};
  char fileReadFromList[100] = {};
  char pathFolder[100] = {};
  struct dirent *readdingFile = NULL;
  int isEndOfFile = 0, isAlreadyContain = 0;
  if (argc < 2) {
    fprintf(stderr, "\033[31m");
    fprintf(stderr, "> Bad utilisation: need filename\n");
    fprintf(stderr, "\033[00m");
    return EXIT_FAILURE;
  }
  folder = opendir(argv[1]);
  descriptorBase = fopen("Bases/liste_base_image.base", "a+");
  if (descriptorBase == NULL) {
    system("mkdir Bases");
    descriptorBase = fopen("Bases/liste_base_image.base", "a+");
  }
  log = fopen("log.log", "a");
  fileList = fopen("Temp/liste_fichiers.list", "a+");
  if (fileList == NULL) {
    system("mkdir Temp");
    fileList = fopen("Temp/liste_fichiers.list", "a+");
  }
  folderList = fopen("Temp/liste_dossiers.list", "a+");
  srand(time(NULL));
  while ((readdingFile = readdir(folder)) != NULL) {
    if (strcmp(readdingFile->d_name, ".") != 0 &&
        strcmp(readdingFile->d_name, "..") != 0 &&
        strchr(readdingFile->d_name, '~') == NULL) {
      if ((strchr(readdingFile->d_name, '.')) == NULL) {
        do {
          isEndOfFile = fscanf(folderList, "%s\n", folderReadFromList);
          if (strcmp(folderReadFromList, readdingFile->d_name) == 0) {
            isAlreadyContain = 1;
          }
        } while (isEndOfFile != EOF && isAlreadyContain == 0);
        if (!isAlreadyContain) {
          fprintf(folderList, "%s\n", readdingFile->d_name);
        }
        isAlreadyContain = 0;
      } else {
        if (strrchr(readdingFile->d_name, 't') != 0) {
          do {
            isEndOfFile = fscanf(fileList, "%s\n", fileReadFromList);
            if (strcmp(fileReadFromList, readdingFile->d_name) == 0) {
              isAlreadyContain = 1;
            }
          } while (isEndOfFile != EOF && isAlreadyContain == 0);
          if (!isAlreadyContain) {
            fprintf(fileList, "%s\n", readdingFile->d_name);
          }
        }
      }
    }
  }
  rewind(fileList);
  while (fscanf(fileList, "%s\n", fileReadFromList) != EOF) {
    strcpy(pathFolder, argv[1]);
    strcat(pathFolder, "/");
    strcat(pathFolder, fileReadFromList);
    picture = fopen(pathFolder, "r");
    if (picture != NULL) {
      fprintf(log, "> Openning success: %s\n", pathFolder);
      openPict(picture, log, descriptorBase, pathFolder);
      fprintf(log, "> Indexation of '%s' done!\n", argv[1]);
      fclose(picture);
      fprintf(log, "> Closing: %s\n", pathFolder);
    } else if (picture == NULL) {
      fprintf(log, "> ERROR: can't open picture\n");
    }
  }
  fclose(descriptorBase);
  fclose(log);
  fclose(fileList);
  fclose(folderList);
  closedir(folder);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
lea    -0x190(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
movq   $0x0,-0x198(%rbp)
movl   $0x0,-0x19c(%rbp)
movl   $0x0,-0x1a0(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1324 <main+0x104>
mov    0x2d06(%rip),%rax
mov    (%rax),%rdi
lea    0xd24(%rip),%rsi
mov    $0x0,%al
call   1100 <fprintf@plt>
mov    0x2cee(%rip),%rax
mov    (%rax),%rdi
lea    0xd12(%rip),%rsi
mov    $0x0,%al
call   1100 <fprintf@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%rdi
lea    0xd1c(%rip),%rsi
mov    $0x0,%al
call   1100 <fprintf@plt>
mov    0x2cb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    178f <main+0x56f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <opendir@plt>
mov    %rax,-0x18(%rbp)
lea    0xcf2(%rip),%rdi
lea    0xd07(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    137a <main+0x15a>
lea    0xcef(%rip),%rdi
call   1070 <system@plt>
lea    0xcc4(%rip),%rdi
lea    0xcd9(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x40(%rbp)
lea    0xcd8(%rip),%rdi
lea    0xcd9(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x38(%rbp)
lea    0xccb(%rip),%rdi
lea    0xcab(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    13d6 <main+0x1b6>
lea    0xcc2(%rip),%rdi
call   1070 <system@plt>
lea    0xc9d(%rip),%rdi
lea    0xc7d(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xcaa(%rip),%rdi
lea    0xc66(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1110 <time@plt>
mov    %eax,%edi
call   10e0 <srand@plt>
mov    -0x18(%rbp),%rdi
call   1120 <readdir@plt>
mov    %rax,-0x198(%rbp)
cmp    $0x0,%rax
je     163e <main+0x41e>
mov    -0x198(%rbp),%rax
mov    (%rax),%rdi
lea    0xc79(%rip),%rsi
call   10f0 <strcmp@plt>
cmp    $0x0,%rax
je     1639 <main+0x419>
mov    -0x198(%rbp),%rax
mov    (%rax),%rdi
lea    0xc58(%rip),%rsi
call   10f0 <strcmp@plt>
cmp    $0x0,%rax
je     1639 <main+0x419>
mov    -0x198(%rbp),%rax
mov    (%rax),%rdi
mov    $0x7e,%esi
call   1080 <strchr@plt>
cmp    $0x0,%rax
jne    1639 <main+0x419>
mov    -0x198(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2e,%esi
call   1080 <strchr@plt>
cmp    $0x0,%rax
jne    1557 <main+0x337>
jmp    1498 <main+0x278>
mov    -0x28(%rbp),%rdi
lea    -0xb0(%rbp),%rdx
lea    0xc3c(%rip),%rsi
call   10c0 <fscanf@plt>
mov    %eax,-0x19c(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x198(%rbp),%rax
mov    (%rax),%rsi
call   10f0 <strcmp@plt>
cmp    $0x0,%rax
jne    14df <main+0x2bf>
movl   $0x1,-0x1a0(%rbp)
jmp    14e4 <main+0x2c4>
mov    -0x19c(%rbp),%ecx
xor    %eax,%eax
mov    0x2af5(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x1a1(%rbp)
je     1511 <main+0x2f1>
cmpl   $0x0,-0x1a0(%rbp)
sete   %al
mov    %al,-0x1a1(%rbp)
mov    -0x1a1(%rbp),%al
test   $0x1,%al
jne    1498 <main+0x278>
cmpl   $0x0,-0x1a0(%rbp)
jne    1548 <main+0x328>
mov    -0x28(%rbp),%rdi
mov    -0x198(%rbp),%rax
mov    (%rax),%rdx
lea    0xba5(%rip),%rsi
mov    $0x0,%al
call   1100 <fprintf@plt>
movl   $0x0,-0x1a0(%rbp)
jmp    1634 <main+0x414>
mov    -0x198(%rbp),%rax
mov    (%rax),%rdi
mov    $0x74,%esi
call   10a0 <strrchr@plt>
cmp    $0x0,%rax
je     162f <main+0x40f>
jmp    157a <main+0x35a>
mov    -0x20(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xb5a(%rip),%rsi
call   10c0 <fscanf@plt>
mov    %eax,-0x19c(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x198(%rbp),%rax
mov    (%rax),%rsi
call   10f0 <strcmp@plt>
cmp    $0x0,%rax
jne    15c1 <main+0x3a1>
movl   $0x1,-0x1a0(%rbp)
jmp    15c6 <main+0x3a6>
mov    -0x19c(%rbp),%ecx
xor    %eax,%eax
mov    0x2a13(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x1a2(%rbp)
je     15f3 <main+0x3d3>
cmpl   $0x0,-0x1a0(%rbp)
sete   %al
mov    %al,-0x1a2(%rbp)
mov    -0x1a2(%rbp),%al
test   $0x1,%al
jne    157a <main+0x35a>
cmpl   $0x0,-0x1a0(%rbp)
jne    162a <main+0x40a>
mov    -0x20(%rbp),%rdi
mov    -0x198(%rbp),%rax
mov    (%rax),%rdx
lea    0xac3(%rip),%rsi
mov    $0x0,%al
call   1100 <fprintf@plt>
jmp    162f <main+0x40f>
jmp    1634 <main+0x414>
jmp    1639 <main+0x419>
jmp    13fd <main+0x1dd>
mov    -0x20(%rbp),%rdi
call   1090 <rewind@plt>
mov    -0x20(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xa8d(%rip),%rsi
call   10c0 <fscanf@plt>
mov    0x2983(%rip),%rcx
cmp    (%rcx),%eax
je     1762 <main+0x542>
lea    -0x190(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy@plt>
lea    -0x190(%rbp),%rdi
lea    0xa14(%rip),%rsi
call   1140 <strcat@plt>
lea    -0x190(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1140 <strcat@plt>
lea    -0x190(%rbp),%rdi
lea    0x9f0(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     173b <main+0x51b>
mov    -0x38(%rbp),%rdi
lea    -0x190(%rbp),%rdx
lea    0x9cc(%rip),%rsi
mov    $0x0,%al
call   1100 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
lea    -0x190(%rbp),%rcx
call   1030 <openPict@plt>
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x9b2(%rip),%rsi
mov    $0x0,%al
call   1100 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x38(%rbp),%rdi
lea    -0x190(%rbp),%rdx
lea    0x9ac(%rip),%rsi
mov    $0x0,%al
call   1100 <fprintf@plt>
jmp    175d <main+0x53d>
cmpq   $0x0,-0x30(%rbp)
jne    1758 <main+0x538>
mov    -0x38(%rbp),%rdi
lea    0x999(%rip),%rsi
mov    $0x0,%al
call   1100 <fprintf@plt>
jmp    175d <main+0x53d>
jmp    1647 <main+0x427>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   10d0 <closedir@plt>
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movl   $0x0,0x110(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movl   $0x0,0xa0(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movl   $0x0,0x180(%rsp)
cmp    $0x1,%edi
jg     133e <main+0x11e>
mov    0x2cf3(%rip),%rbx
mov    (%rbx),%rcx
lea    0xd11(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1140 <fwrite@plt>
mov    (%rbx),%rcx
lea    0xcfe(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
call   1140 <fwrite@plt>
mov    (%rbx),%rcx
lea    0xd07(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1140 <fwrite@plt>
mov    0x2c99(%rip),%rax
mov    (%rax),%eax
jmp    167e <main+0x45e>
mov    %rsi,0x38(%rsp)
mov    0x8(%rsi),%rdi
call   1060 <opendir@plt>
mov    %rax,%rbx
lea    0xcd8(%rip),%rdi
lea    0xced(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
jne    1390 <main+0x170>
lea    0xcda(%rip),%rdi
call   1070 <system@plt>
lea    0xcaf(%rip),%rdi
lea    0xcc4(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,0x18(%rsp)
lea    0xcc2(%rip),%rdi
lea    0xcc3(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,%r14
lea    0xcb6(%rip),%rdi
lea    0xc96(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,%r13
test   %rax,%rax
jne    13e3 <main+0x1c3>
lea    0xcb4(%rip),%rdi
call   1070 <system@plt>
lea    0xc8f(%rip),%rdi
lea    0xc6f(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,%r13
lea    0xc9d(%rip),%rdi
lea    0xc59(%rip),%rsi
call   1120 <fopen@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
mov    %rax,(%rsp)
xor    %edi,%edi
call   1100 <time@plt>
mov    %eax,%edi
call   10d0 <srand@plt>
mov    %rbx,%rdi
call   1110 <readdir@plt>
test   %rax,%rax
mov    %rbx,0x10(%rsp)
je     1627 <main+0x407>
mov    %rax,%r12
lea    0xcb7(%rip),%r15
mov    0x2bb2(%rip),%rbp
mov    %r13,0x28(%rsp)
mov    %r14,0x30(%rsp)
jmp    1474 <main+0x254>
mov    (%r12),%rdx
xor    %eax,%eax
mov    %rax,(%rsp)
mov    %r15,%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1110 <readdir@plt>
mov    %rax,%r12
test   %rax,%rax
je     1627 <main+0x407>
mov    (%r12),%rdi
lea    0xc22(%rip),%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
je     1460 <main+0x240>
mov    (%r12),%rdi
lea    0xc0c(%rip),%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
je     1460 <main+0x240>
mov    (%r12),%rdi
mov    $0x7e,%esi
call   1080 <strchr@plt>
test   %rax,%rax
jne    1460 <main+0x240>
mov    (%r12),%rdi
mov    $0x2e,%esi
call   1080 <strchr@plt>
test   %rax,%rax
je     1574 <main+0x354>
mov    (%r12),%rdi
mov    $0x74,%esi
call   10a0 <strrchr@plt>
test   %rax,%rax
je     1460 <main+0x240>
mov    %r13,%rdi
mov    %r15,%rsi
lea    0x40(%rsp),%rdx
call   10b0 <fscanf@plt>
mov    %eax,%ebx
mov    (%r12),%rsi
lea    0x40(%rsp),%rdi
call   10e0 <strcmp@plt>
test   %rax,%rax
setne  %al
cmpl   $0x0,(%rsp)
sete   %cl
and    %al,%cl
cmp    0x0(%rbp),%ebx
je     1551 <main+0x331>
test   %cl,%cl
je     1551 <main+0x331>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
mov    %r15,%rsi
lea    0x40(%rsp),%r14
mov    %r14,%rdx
call   10b0 <fscanf@plt>
mov    %eax,%ebx
mov    (%r12),%rsi
mov    %r14,%rdi
call   10e0 <strcmp@plt>
test   %rax,%rax
setne  %cl
cmp    0x0(%rbp),%ebx
je     1551 <main+0x331>
test   %rax,%rax
jne    1520 <main+0x300>
mov    $0x1,%eax
mov    %rax,(%rsp)
mov    %r13,%rdi
test   %cl,%cl
mov    0x10(%rsp),%rbx
mov    0x30(%rsp),%r14
jne    1442 <main+0x222>
jmp    1460 <main+0x240>
mov    0x8(%rsp),%rdi
mov    %r15,%rsi
lea    0xb0(%rsp),%rbx
mov    %rbx,%rdx
call   10b0 <fscanf@plt>
mov    %eax,0x24(%rsp)
mov    (%r12),%rsi
mov    %rbx,%rdi
call   10e0 <strcmp@plt>
test   %rax,%rax
setne  %al
cmpl   $0x0,(%rsp)
sete   %cl
and    %al,%cl
mov    %rbp,%r13
mov    0x24(%rsp),%eax
cmp    0x0(%rbp),%eax
je     1602 <main+0x3e2>
test   %cl,%cl
je     1602 <main+0x3e2>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rdi
mov    %r15,%rbp
mov    %r15,%rsi
lea    0xb0(%rsp),%r15
mov    %r15,%rdx
call   10b0 <fscanf@plt>
mov    %eax,%ebx
mov    (%r12),%rsi
mov    %r15,%rdi
call   10e0 <strcmp@plt>
test   %rax,%rax
setne  %cl
cmp    0x0(%r13),%ebx
je     15ff <main+0x3df>
test   %rax,%rax
mov    %rbp,%r15
jne    15c0 <main+0x3a0>
jmp    1602 <main+0x3e2>
mov    %rbp,%r15
xor    %eax,%eax
mov    %rax,(%rsp)
mov    0x8(%rsp),%rdi
test   %cl,%cl
mov    0x10(%rsp),%rbx
mov    %r13,%rbp
mov    0x28(%rsp),%r13
jne    1442 <main+0x222>
jmp    1460 <main+0x240>
mov    %r13,%rdi
call   1090 <rewind@plt>
lea    0xab0(%rip),%rsi
lea    0x40(%rsp),%rdx
mov    %r13,%rdi
call   10b0 <fscanf@plt>
mov    0x299e(%rip),%rcx
cmp    (%rcx),%eax
jne    1690 <main+0x470>
mov    0x18(%rsp),%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rdi
call   10c0 <closedir@plt>
xor    %eax,%eax
add    $0x188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x120(%rsp),%rbp
lea    0x40(%rsp),%rbx
mov    0x38(%rsp),%r15
jmp    16ea <main+0x4ca>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1c,%esi
mov    $0x1,%edx
lea    0xa29(%rip),%rdi
mov    %r14,%rcx
call   1140 <fwrite@plt>
mov    %r13,%rdi
lea    0xa13(%rip),%rsi
mov    %rbx,%rdx
call   10b0 <fscanf@plt>
mov    0x2906(%rip),%rcx
cmp    (%rcx),%eax
je     164e <main+0x42e>
mov    0x8(%r15),%rsi
mov    %rbp,%rdi
call   1040 <strcpy@plt>
mov    %rbp,%rdi
lea    0x9a3(%rip),%rsi
call   1130 <strcat@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1130 <strcat@plt>
mov    %rbp,%rdi
lea    0x98b(%rip),%rsi
call   1120 <fopen@plt>
test   %rax,%rax
je     16b0 <main+0x490>
mov    %rax,%r12
mov    %r14,%rdi
lea    0x976(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    0x18(%rsp),%rdx
mov    %rbp,%rcx
call   1030 <openPict@plt>
mov    0x8(%r15),%rdx
mov    %r14,%rdi
lea    0x963(%rip),%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
lea    0x966(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
jmp    16c9 <main+0x4a9>

LLVM IR (-O0):
%struct.dirent = type { i8* }
@stderr = global i32* null
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [34 x i8] c"> Bad utilisation: need filename\0A\00"
@.str.2 = [6 x i8] c"\1B[00m\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [28 x i8] c"Bases/liste_base_image.base\00"
@.str.4 = [3 x i8] c"a+\00"
@.str.5 = [12 x i8] c"mkdir Bases\00"
@.str.6 = [8 x i8] c"log.log\00"
@.str.7 = [2 x i8] c"a\00"
@.str.8 = [25 x i8] c"Temp/liste_fichiers.list\00"
@.str.9 = [11 x i8] c"mkdir Temp\00"
@.str.10 = [25 x i8] c"Temp/liste_dossiers.list\00"
@.str.11 = [2 x i8] c".\00"
@.str.12 = [3 x i8] c"..\00"
@.str.13 = [4 x i8] c"%s\0A\00"
@EOF = global i32 0
@.str.14 = [2 x i8] c"/\00"
@.str.15 = [2 x i8] c"r\00"
@.str.16 = [24 x i8] c"> Openning success: %s\0A\00"
@.str.17 = [28 x i8] c"> Indexation of '%s' done!\0A\00"
@.str.18 = [15 x i8] c"> Closing: %s\0A\00"
@.str.19 = [29 x i8] c"> ERROR: can't open picture\0A\00"
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 i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca [100 x i8]
%13 = alloca [100 x i8]
%14 = alloca [100 x i8]
%15 = alloca %struct.dirent*
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
store i32* null, i32** %8
store i32* null, i32** %9
store i32* null, i32** %10
store i32* null, i32** %11
%18 = bitcast [100 x i8]* %12 to i8*
%19 = bitcast [100 x i8]* %13 to i8*
%20 = bitcast [100 x i8]* %14 to i8*
store %struct.dirent* null, %struct.dirent** %15
store i32 0, i32* %16
store i32 0, i32* %17
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 2
br i1 %22, label %23, label %31
23: ; preds = %2
%24 = load i32*, i32** @stderr
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%26 = load i32*, i32** @stderr
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32*, i32** @stderr
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* @EXIT_FAILURE
store i32 %30, i32* %3
br label %217
31: ; preds = %2
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32* @opendir(i8* %34)
store i32* %35, i32** %6
%36 = call i32* @fopen(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %36, i32** %11
%37 = load i32*, i32** %11
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %42
39: ; preds = %31
%40 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%41 = call i32* @fopen(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %41, i32** %11
br label %42
42: ; preds = %39, %31
%43 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %43, i32** %10
%44 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %44, i32** %7
%45 = load i32*, i32** %7
%46 = icmp eq i32* %45, null
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%49 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %49, i32** %7
br label %50
50: ; preds = %47, %42
%51 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %51, i32** %8
%52 = call i32 @time(i32* null)
%53 = call i32 @srand(i32 %52)
br label %54
54: ; preds = %154, %50
%55 = load i32*, i32** %6
%56 = call %struct.dirent* @readdir(i32* %55)
store %struct.dirent* %56, %struct.dirent** %15
%57 = icmp ne %struct.dirent* %56, null
br i1 %57, label %58, label %155
58: ; preds = %54
%59 = load %struct.dirent*, %struct.dirent** %15
%60 = getelementptr inbounds %struct.dirent, %struct.dirent* %59, i32 0, i32 0
%61 = load i8*, i8** %60
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %154
64: ; preds = %58
%65 = load %struct.dirent*, %struct.dirent** %15
%66 = getelementptr inbounds %struct.dirent, %struct.dirent* %65, i32 0, i32 0
%67 = load i8*, i8** %66
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %154
70: ; preds = %64
%71 = load %struct.dirent*, %struct.dirent** %15
%72 = getelementptr inbounds %struct.dirent, %struct.dirent* %71, i32 0, i32 0
%73 = load i8*, i8** %72
%74 = call i32* @strchr(i8* %73, i8 signext 126)
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %154
76: ; preds = %70
%77 = load %struct.dirent*, %struct.dirent** %15
%78 = getelementptr inbounds %struct.dirent, %struct.dirent* %77, i32 0, i32 0
%79 = load i8*, i8** %78
%80 = call i32* @strchr(i8* %79, i8 signext 46)
%81 = icmp eq i32* %80, null
br i1 %81, label %82, label %114
82: ; preds = %76
br label %83
83: ; preds = %102, %82
%84 = load i32*, i32** %8
%85 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%86 = call i32 @fscanf(i32* %84, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %85)
store i32 %86, i32* %16
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%88 = load %struct.dirent*, %struct.dirent** %15
%89 = getelementptr inbounds %struct.dirent, %struct.dirent* %88, i32 0, i32 0
%90 = load i8*, i8** %89
%91 = call i64 @strcmp(i8* %87, i8* %90)
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %94
93: ; preds = %83
store i32 1, i32* %17
br label %94
94: ; preds = %93, %83
br label %95
95: ; preds = %94
%96 = load i32, i32* %16
%97 = load i32, i32* @EOF
%98 = icmp ne i32 %96, %97
br i1 %98, label %99, label %102
99: ; preds = %95
%100 = load i32, i32* %17
%101 = icmp eq i32 %100, 0
br label %102
102: ; preds = %99, %95
%103 = phi i1 [ false, %95 ], [ %101, %99 ]
br i1 %103, label %83, label %104
104: ; preds = %102
%105 = load i32, i32* %17
%106 = icmp ne i32 %105, 0
br i1 %106, label %113, label %107
107: ; preds = %104
%108 = load i32*, i32** %8
%109 = load %struct.dirent*, %struct.dirent** %15
%110 = getelementptr inbounds %struct.dirent, %struct.dirent* %109, i32 0, i32 0
%111 = load i8*, i8** %110
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %108, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %111)
br label %113
113: ; preds = %107, %104
store i32 0, i32* %17
br label %153
114: ; preds = %76
%115 = load %struct.dirent*, %struct.dirent** %15
%116 = getelementptr inbounds %struct.dirent, %struct.dirent* %115, i32 0, i32 0
%117 = load i8*, i8** %116
%118 = call i64 @strrchr(i8* %117, i8 signext 116)
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %152
120: ; preds = %114
br label %121
121: ; preds = %140, %120
%122 = load i32*, i32** %7
%123 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%124 = call i32 @fscanf(i32* %122, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %123)
store i32 %124, i32* %16
%125 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%126 = load %struct.dirent*, %struct.dirent** %15
%127 = getelementptr inbounds %struct.dirent, %struct.dirent* %126, i32 0, i32 0
%128 = load i8*, i8** %127
%129 = call i64 @strcmp(i8* %125, i8* %128)
%130 = icmp eq i64 %129, 0
br i1 %130, label %131, label %132
131: ; preds = %121
store i32 1, i32* %17
br label %132
132: ; preds = %131, %121
br label %133
133: ; preds = %132
%134 = load i32, i32* %16
%135 = load i32, i32* @EOF
%136 = icmp ne i32 %134, %135
br i1 %136, label %137, label %140
137: ; preds = %133
%138 = load i32, i32* %17
%139 = icmp eq i32 %138, 0
br label %140
140: ; preds = %137, %133
%141 = phi i1 [ false, %133 ], [ %139, %137 ]
br i1 %141, label %121, label %142
142: ; preds = %140
%143 = load i32, i32* %17
%144 = icmp ne i32 %143, 0
br i1 %144, label %151, label %145
145: ; preds = %142
%146 = load i32*, i32** %7
%147 = load %struct.dirent*, %struct.dirent** %15
%148 = getelementptr inbounds %struct.dirent, %struct.dirent* %147, i32 0, i32 0
%149 = load i8*, i8** %148
%150 = call i32 (i32*, i8*, ...) @fprintf(i32* %146, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %149)
br label %151
151: ; preds = %145, %142
br label %152
152: ; preds = %151, %114
br label %153
153: ; preds = %152, %113
br label %154
154: ; preds = %153, %70, %64, %58
br label %54
155: ; preds = %54
%156 = load i32*, i32** %7
%157 = call i32 @rewind(i32* %156)
br label %158
158: ; preds = %205, %155
%159 = load i32*, i32** %7
%160 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%161 = call i32 @fscanf(i32* %159, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %160)
%162 = load i32, i32* @EOF
%163 = icmp ne i32 %161, %162
br i1 %163, label %164, label %206
164: ; preds = %158
%165 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%166 = load i8**, i8*** %5
%167 = getelementptr inbounds i8*, i8** %166, i64 1
%168 = load i8*, i8** %167
%169 = call i32 @strcpy(i8* %165, i8* %168)
%170 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%171 = call i32 @strcat(i8* %170, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%172 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%173 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%174 = call i32 @strcat(i8* %172, i8* %173)
%175 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%176 = call i32* @fopen(i8* %175, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
store i32* %176, i32** %9
%177 = load i32*, i32** %9
%178 = icmp ne i32* %177, null
br i1 %178, label %179, label %198
179: ; preds = %164
%180 = load i32*, i32** %10
%181 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%182 = call i32 (i32*, i8*, ...) @fprintf(i32* %180, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), i8* %181)
%183 = load i32*, i32** %9
%184 = load i32*, i32** %10
%185 = load i32*, i32** %11
%186 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%187 = call i32 @openPict(i32* %183, i32* %184, i32* %185, i8* %186)
%188 = load i32*, i32** %10
%189 = load i8**, i8*** %5
%190 = getelementptr inbounds i8*, i8** %189, i64 1
%191 = load i8*, i8** %190
%192 = call i32 (i32*, i8*, ...) @fprintf(i32* %188, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i8* %191)
%193 = load i32*, i32** %9
%194 = call i32 @fclose(i32* %193)
%195 = load i32*, i32** %10
%196 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%197 = call i32 (i32*, i8*, ...) @fprintf(i32* %195, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %196)
br label %205
198: ; preds = %164
%199 = load i32*, i32** %9
%200 = icmp eq i32* %199, null
br i1 %200, label %201, label %204
201: ; preds = %198
%202 = load i32*, i32** %10
%203 = call i32 (i32*, i8*, ...) @fprintf(i32* %202, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0))
br label %204
204: ; preds = %201, %198
br label %205
205: ; preds = %204, %179
br label %158
206: ; preds = %158
%207 = load i32*, i32** %11
%208 = call i32 @fclose(i32* %207)
%209 = load i32*, i32** %10
%210 = call i32 @fclose(i32* %209)
%211 = load i32*, i32** %7
%212 = call i32 @fclose(i32* %211)
%213 = load i32*, i32** %8
%214 = call i32 @fclose(i32* %213)
%215 = load i32*, i32** %6
%216 = call i32 @closedir(i32* %215)
br label %217
217: ; preds = %206, %23
%218 = load i32, i32* %3
ret i32 %218
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@stderr = global i32* null
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [34 x i8] c"> Bad utilisation: need filename\0A\00"
@.str.2 = [6 x i8] c"\1B[00m\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [28 x i8] c"Bases/liste_base_image.base\00"
@.str.4 = [3 x i8] c"a+\00"
@.str.5 = [12 x i8] c"mkdir Bases\00"
@.str.6 = [8 x i8] c"log.log\00"
@.str.7 = [2 x i8] c"a\00"
@.str.8 = [25 x i8] c"Temp/liste_fichiers.list\00"
@.str.9 = [11 x i8] c"mkdir Temp\00"
@.str.10 = [25 x i8] c"Temp/liste_dossiers.list\00"
@.str.11 = [2 x i8] c".\00"
@.str.12 = [3 x i8] c"..\00"
@.str.13 = [4 x i8] c"%s\0A\00"
@EOF = global i32 0
@.str.14 = [2 x i8] c"/\00"
@.str.15 = [2 x i8] c"r\00"
@.str.16 = [24 x i8] c"> Openning success: %s\0A\00"
@.str.17 = [28 x i8] c"> Indexation of '%s' done!\0A\00"
@.str.18 = [15 x i8] c"> Closing: %s\0A\00"
@.str.19 = [29 x i8] c"> ERROR: can't open picture\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = icmp slt i32 %0, 2
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i32*, i32** @stderr
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5, i64 1, i32* %11)
%13 = load i32*, i32** @stderr
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i64 33, i64 1, i32* %13)
%15 = load i32*, i32** @stderr
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 5, i64 1, i32* %15)
%17 = load i32, i32* @EXIT_FAILURE
br label %144
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i32* @opendir(i8* %20)
%22 = tail call i32* @fopen(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %27
24: ; preds = %18
%25 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%26 = tail call i32* @fopen(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %24, %18
%28 = phi i32* [ %26, %24 ], [ %22, %18 ]
%29 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%30 = tail call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %35
32: ; preds = %27
%33 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%34 = tail call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %35
35: ; preds = %32, %27
%36 = phi i32* [ %34, %32 ], [ %30, %27 ]
%37 = tail call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%38 = tail call i32 @time(i32* null)
%39 = tail call i32 @srand(i32 %38)
%40 = call %struct.dirent* @readdir(i32* %21)
%41 = icmp eq %struct.dirent* %40, null
br i1 %41, label %113, label %42
42: ; preds = %35, %109
%43 = phi %struct.dirent* [ %111, %109 ], [ %40, %35 ]
%44 = phi i32 [ %110, %109 ], [ 0, %35 ]
%45 = getelementptr inbounds %struct.dirent, %struct.dirent* %43, i64 0, i32 0
%46 = load i8*, i8** %45
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %109, label %49
49: ; preds = %42
%50 = load i8*, i8** %45
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %109, label %53
53: ; preds = %49
%54 = load i8*, i8** %45
%55 = call i32* @strchr(i8* %54, i8 signext 126)
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %109
57: ; preds = %53
%58 = load i8*, i8** %45
%59 = call i32* @strchr(i8* %58, i8 signext 46)
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %81
61: ; preds = %57
%62 = call i32 @fscanf(i32* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %6)
%63 = load i8*, i8** %45
%64 = call i64 @strcmp(i8* %6, i8* %63)
%65 = icmp ne i64 %64, 0
%66 = load i32, i32* @EOF
%67 = icmp ne i32 %62, %66
%68 = icmp eq i32 %44, 0
%69 = select i1 %65, i1 %68, i1 false
%70 = select i1 %67, i1 %69, i1 false
br i1 %70, label %71, label %79
71: ; preds = %61, %71
%72 = call i32 @fscanf(i32* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %6)
%73 = load i8*, i8** %45
%74 = call i64 @strcmp(i8* %6, i8* %73)
%75 = icmp ne i64 %74, 0
%76 = load i32, i32* @EOF
%77 = icmp ne i32 %72, %76
%78 = select i1 %77, i1 %75, i1 false
br i1 %78, label %71, label %79
79: ; preds = %71, %61
%80 = phi i1 [ %69, %61 ], [ %75, %71 ]
br i1 %80, label %105, label %109
81: ; preds = %57
%82 = load i8*, i8** %45
%83 = call i64 @strrchr(i8* %82, i8 signext 116)
%84 = icmp eq i64 %83, 0
br i1 %84, label %109, label %85
85: ; preds = %81
%86 = call i32 @fscanf(i32* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %7)
%87 = load i8*, i8** %45
%88 = call i64 @strcmp(i8* %7, i8* %87)
%89 = icmp ne i64 %88, 0
%90 = load i32, i32* @EOF
%91 = icmp ne i32 %86, %90
%92 = icmp eq i32 %44, 0
%93 = select i1 %89, i1 %92, i1 false
%94 = select i1 %91, i1 %93, i1 false
br i1 %94, label %95, label %103
95: ; preds = %85, %95
%96 = call i32 @fscanf(i32* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %7)
%97 = load i8*, i8** %45
%98 = call i64 @strcmp(i8* %7, i8* %97)
%99 = icmp ne i64 %98, 0
%100 = load i32, i32* @EOF
%101 = icmp ne i32 %96, %100
%102 = select i1 %101, i1 %99, i1 false
br i1 %102, label %95, label %103
103: ; preds = %95, %85
%104 = phi i1 [ %93, %85 ], [ %99, %95 ]
br i1 %104, label %105, label %109
105: ; preds = %103, %79
%106 = phi i32* [ %37, %79 ], [ %36, %103 ]
%107 = load i8*, i8** %45
%108 = call i32 (i32*, i8*, ...) @fprintf(i32* %106, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %107)
br label %109
109: ; preds = %105, %79, %103, %81, %53, %49, %42
%110 = phi i32 [ 1, %103 ], [ %44, %81 ], [ %44, %53 ], [ %44, %49 ], [ %44, %42 ], [ 0, %79 ], [ 0, %105 ]
%111 = call %struct.dirent* @readdir(i32* %21)
%112 = icmp eq %struct.dirent* %111, null
br i1 %112, label %113, label %42
113: ; preds = %109, %35
%114 = call i32 @rewind(i32* %36)
%115 = call i32 @fscanf(i32* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %7)
%116 = load i32, i32* @EOF
%117 = icmp eq i32 %115, %116
br i1 %117, label %138, label %118
118: ; preds = %113, %134
%119 = load i8*, i8** %19
%120 = call i32 @strcpy(i8* %8, i8* %119)
%121 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%122 = call i32 @strcat(i8* %8, i8* %7)
%123 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%124 = icmp eq i32* %123, null
br i1 %124, label %132, label %125
125: ; preds = %118
%126 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), i8* %8)
%127 = call i32 @openPict(i32* %123, i32* %29, i32* %28, i8* %8)
%128 = load i8*, i8** %19
%129 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i8* %128)
%130 = call i32 @fclose(i32* %123)
%131 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %8)
br label %134
132: ; preds = %118
%133 = call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0), i64 28, i64 1, i32* %29)
br label %134
134: ; preds = %132, %125
%135 = call i32 @fscanf(i32* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %7)
%136 = load i32, i32* @EOF
%137 = icmp eq i32 %135, %136
br i1 %137, label %138, label %118
138: ; preds = %134, %113
%139 = call i32 @fclose(i32* %28)
%140 = call i32 @fclose(i32* %29)
%141 = call i32 @fclose(i32* %36)
%142 = call i32 @fclose(i32* %37)
%143 = call i32 @closedir(i32* %21)
br label %144
144: ; preds = %138, %10
%145 = phi i32 [ %17, %10 ], [ 0, %138 ]
ret i32 %145
}