#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 timeval {
  int tv_sec;
  int tv_usec;
};
struct stat {
  int /*<<< orphan*/ st_mode;
};
struct dirent {
  int /*<<< orphan*/ d_name;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ S_IRWXU;
scalar_t__ S_ISREG(int /*<<< orphan*/);
int asprintf(char **, char *, unsigned int, unsigned int, unsigned int,
             unsigned int, unsigned int, unsigned int, ...);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int link(char *, char *);
int mkdir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
int rmdir(char *);
int stat(int /*<<< orphan*/, struct stat *);
char *strdup(int /*<<< orphan*/);
int unlink(char *);
int main() {
  char *filename = NULL;
  struct dirent *dirent;
  DIR *dir;
  unsigned i;
  struct timeval tv1, tv2;
  unsigned long usecs;
  int err;
  dir = opendir(".");
  while ((dirent = readdir(dir)) != NULL) {
    struct stat stbuf;
    err = stat(dirent->d_name, &stbuf);
    if (err < 0)
      continue;
    if (S_ISREG(stbuf.st_mode)) {
      filename = strdup(dirent->d_name);
      break;
    }
  }
  closedir(dir);
  if (!filename) {
    printf("couldn't find any file to tag\n");
    exit(EXIT_FAILURE);
  }
  printf("Will use file %s\n", filename);
  gettimeofday(&tv1, NULL);
  for (i = 0; i < (64 * 1024); i++) {
    char *tagname;
    err = asprintf(&tagname,
                   "perfs_tmp_tag_"
                   "%c%c%c%c%c%c",
                   (((i) >> 20) & 15) + 'a', (((i) >> 16) & 15) + 'a',
                   (((i) >> 12) & 15) + 'a', (((i) >> 8) & 15) + 'a',
                   (((i) >> 4) & 15) + 'a', (((i) >> 0) & 15) + 'a');
    assert(err >= 0);
    err = mkdir(tagname, S_IRWXU);
    if (err < 0) {
      perror("mkdir");
      exit(EXIT_FAILURE);
    }
    free(tagname);
    if (!(i & (i + 1))) {
      gettimeofday(&tv2, NULL);
      usecs = (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec);
      printf("%lu usecs for creating %u tags\n", usecs, i + 1);
    }
  }
  gettimeofday(&tv1, NULL);
  for (i = 0; i < (64 * 1024); i++) {
    char *linkname;
    err = asprintf(&linkname,
                   "perfs_tmp_tag_"
                   "%c%c%c%c%c%c"
                   "/%s",
                   ((((i + (64 * 1024) / 2) % (64 * 1024)) >> 20) & 15) + 'a',
                   ((((i + (64 * 1024) / 2) % (64 * 1024)) >> 16) & 15) + 'a',
                   ((((i + (64 * 1024) / 2) % (64 * 1024)) >> 12) & 15) + 'a',
                   ((((i + (64 * 1024) / 2) % (64 * 1024)) >> 8) & 15) + 'a',
                   ((((i + (64 * 1024) / 2) % (64 * 1024)) >> 4) & 15) + 'a',
                   ((((i + (64 * 1024) / 2) % (64 * 1024)) >> 0) & 15) + 'a',
                   filename);
    assert(err >= 0);
    err = link(filename, linkname);
    if (err < 0) {
      perror("link");
      exit(EXIT_FAILURE);
    }
    free(linkname);
    if (!(i & (i + 1))) {
      gettimeofday(&tv2, NULL);
      usecs = (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec);
      printf("%lu usecs for adding %u tags to that file\n", usecs, i + 1);
    }
  }
  printf("listage des tags du fichier pas implémenté\n");
  gettimeofday(&tv1, NULL);
  for (i = 0; i < (64 * 1024); i++) {
    char *linkname;
    err = asprintf(&linkname,
                   "perfs_tmp_tag_"
                   "%c%c%c%c%c%c"
                   "/%s",
                   ((((i + (64 * 1024) / 4) % (64 * 1024)) >> 20) & 15) + 'a',
                   ((((i + (64 * 1024) / 4) % (64 * 1024)) >> 16) & 15) + 'a',
                   ((((i + (64 * 1024) / 4) % (64 * 1024)) >> 12) & 15) + 'a',
                   ((((i + (64 * 1024) / 4) % (64 * 1024)) >> 8) & 15) + 'a',
                   ((((i + (64 * 1024) / 4) % (64 * 1024)) >> 4) & 15) + 'a',
                   ((((i + (64 * 1024) / 4) % (64 * 1024)) >> 0) & 15) + 'a',
                   filename);
    assert(err >= 0);
    err = unlink(linkname);
    if (err < 0) {
      perror("unlink");
      exit(EXIT_FAILURE);
    }
    free(linkname);
    if (!(i & (i + 1))) {
      gettimeofday(&tv2, NULL);
      usecs = (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec);
      printf("%lu usecs for removing %u tags to that file\n", usecs, i + 1);
    }
  }
  gettimeofday(&tv1, NULL);
  for (i = 0; i < (64 * 1024); i++) {
    char *tagname;
    err =
        asprintf(&tagname,
                 "perfs_tmp_tag_"
                 "%c%c%c%c%c%c",
                 ((((i + (64 * 1024) / 4 * 3) % (64 * 1024)) >> 20) & 15) + 'a',
                 ((((i + (64 * 1024) / 4 * 3) % (64 * 1024)) >> 16) & 15) + 'a',
                 ((((i + (64 * 1024) / 4 * 3) % (64 * 1024)) >> 12) & 15) + 'a',
                 ((((i + (64 * 1024) / 4 * 3) % (64 * 1024)) >> 8) & 15) + 'a',
                 ((((i + (64 * 1024) / 4 * 3) % (64 * 1024)) >> 4) & 15) + 'a',
                 ((((i + (64 * 1024) / 4 * 3) % (64 * 1024)) >> 0) & 15) + 'a');
    assert(err >= 0);
    err = rmdir(tagname);
    if (err < 0) {
      perror("rmdir");
      exit(EXIT_FAILURE);
    }
    free(tagname);
    if (!(i & (i + 1))) {
      gettimeofday(&tv2, NULL);
      usecs = (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec);
      printf("%lu usecs for destroying %u tags\n", usecs, i + 1);
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xdcf(%rip),%rdi
call   1060 <opendir@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   10e0 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     129d <main+0x8d>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   10c0 <stat@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    1272 <main+0x62>
jmp    123a <main+0x2a>
mov    -0x48(%rbp),%edi
call   10d0 <S_ISREG@plt>
cmp    $0x0,%rax
je     1298 <main+0x88>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1130 <strdup@plt>
mov    %rax,-0x10(%rbp)
jmp    129d <main+0x8d>
jmp    123a <main+0x2a>
mov    -0x20(%rbp),%rdi
call   10a0 <closedir@plt>
cmpq   $0x0,-0x10(%rbp)
jne    12cd <main+0xbd>
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10000,-0x24(%rbp)
jae    142a <main+0x21a>
mov    -0x24(%rbp),%edx
shr    $0x14,%edx
and    $0xf,%edx
add    $0x61,%edx
mov    -0x24(%rbp),%ecx
shr    $0x10,%ecx
and    $0xf,%ecx
add    $0x61,%ecx
mov    -0x24(%rbp),%r8d
shr    $0xc,%r8d
and    $0xf,%r8d
add    $0x61,%r8d
mov    -0x24(%rbp),%r9d
shr    $0x8,%r9d
and    $0xf,%r9d
add    $0x61,%r9d
mov    -0x24(%rbp),%r10d
shr    $0x4,%r10d
and    $0xf,%r10d
add    $0x61,%r10d
mov    -0x24(%rbp),%eax
shr    $0x0,%eax
and    $0xf,%eax
add    $0x61,%eax
lea    -0x50(%rbp),%rdi
lea    0xcd4(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   10f0 <asprintf@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    -0x50(%rbp),%rdi
mov    0x2c5b(%rip),%rax
mov    (%rax),%esi
call   1050 <mkdir@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    13bb <main+0x1ab>
lea    0xca6(%rip),%rdi
call   1100 <perror@plt>
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1417 <main+0x207>
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
mov    -0x38(%rbp),%eax
sub    -0x30(%rbp),%eax
imul   $0xf4240,%eax,%eax
mov    -0x34(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x24(%rbp),%edx
add    $0x1,%edx
lea    0xc44(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    141c <main+0x20c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12f3 <main+0xe3>
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10000,-0x24(%rbp)
jae    15ce <main+0x3be>
mov    -0x24(%rbp),%edx
add    $0x8000,%edx
and    $0xffff,%edx
shr    $0x14,%edx
and    $0xf,%edx
add    $0x61,%edx
mov    -0x24(%rbp),%ecx
add    $0x8000,%ecx
and    $0xffff,%ecx
shr    $0x10,%ecx
and    $0xf,%ecx
add    $0x61,%ecx
mov    -0x24(%rbp),%r8d
add    $0x8000,%r8d
and    $0xffff,%r8d
shr    $0xc,%r8d
and    $0xf,%r8d
add    $0x61,%r8d
mov    -0x24(%rbp),%r9d
add    $0x8000,%r9d
and    $0xffff,%r9d
shr    $0x8,%r9d
and    $0xf,%r9d
add    $0x61,%r9d
mov    -0x24(%rbp),%r11d
add    $0x8000,%r11d
and    $0xffff,%r11d
shr    $0x4,%r11d
and    $0xf,%r11d
add    $0x61,%r11d
mov    -0x24(%rbp),%r10d
add    $0x8000,%r10d
and    $0xffff,%r10d
shr    $0x0,%r10d
and    $0xf,%r10d
add    $0x61,%r10d
mov    -0x10(%rbp),%rax
lea    -0x58(%rbp),%rdi
lea    0xb72(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   10f0 <asprintf@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x58(%rbp),%rsi
call   1110 <link@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    155f <main+0x34f>
lea    0xba1(%rip),%rdi
call   1100 <perror@plt>
mov    0x2a80(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    15bb <main+0x3ab>
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
mov    -0x38(%rbp),%eax
sub    -0x30(%rbp),%eax
imul   $0xf4240,%eax,%eax
mov    -0x34(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x24(%rbp),%edx
add    $0x1,%edx
lea    0xade(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    15c0 <main+0x3b0>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    143e <main+0x22e>
lea    0xae8(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10000,-0x24(%rbp)
jae    177c <main+0x56c>
mov    -0x24(%rbp),%edx
add    $0x4000,%edx
and    $0xffff,%edx
shr    $0x14,%edx
and    $0xf,%edx
add    $0x61,%edx
mov    -0x24(%rbp),%ecx
add    $0x4000,%ecx
and    $0xffff,%ecx
shr    $0x10,%ecx
and    $0xf,%ecx
add    $0x61,%ecx
mov    -0x24(%rbp),%r8d
add    $0x4000,%r8d
and    $0xffff,%r8d
shr    $0xc,%r8d
and    $0xf,%r8d
add    $0x61,%r8d
mov    -0x24(%rbp),%r9d
add    $0x4000,%r9d
and    $0xffff,%r9d
shr    $0x8,%r9d
and    $0xf,%r9d
add    $0x61,%r9d
mov    -0x24(%rbp),%r11d
add    $0x4000,%r11d
and    $0xffff,%r11d
shr    $0x4,%r11d
and    $0xf,%r11d
add    $0x61,%r11d
mov    -0x24(%rbp),%r10d
add    $0x4000,%r10d
and    $0xffff,%r10d
shr    $0x0,%r10d
and    $0xf,%r10d
add    $0x61,%r10d
mov    -0x10(%rbp),%rax
lea    -0x60(%rbp),%rdi
lea    0x9c0(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   10f0 <asprintf@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    -0x60(%rbp),%rdi
call   1040 <unlink@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    170d <main+0x4fd>
lea    0x9f1(%rip),%rdi
call   1100 <perror@plt>
mov    0x28d2(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1769 <main+0x559>
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
mov    -0x38(%rbp),%eax
sub    -0x30(%rbp),%eax
imul   $0xf4240,%eax,%eax
mov    -0x34(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x24(%rbp),%edx
add    $0x1,%edx
lea    0x990(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    176e <main+0x55e>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15f0 <main+0x3e0>
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10000,-0x24(%rbp)
jae    190a <main+0x6fa>
mov    -0x24(%rbp),%edx
add    $0xc000,%edx
and    $0xffff,%edx
shr    $0x14,%edx
and    $0xf,%edx
add    $0x61,%edx
mov    -0x24(%rbp),%ecx
add    $0xc000,%ecx
and    $0xffff,%ecx
shr    $0x10,%ecx
and    $0xf,%ecx
add    $0x61,%ecx
mov    -0x24(%rbp),%r8d
add    $0xc000,%r8d
and    $0xffff,%r8d
shr    $0xc,%r8d
and    $0xf,%r8d
add    $0x61,%r8d
mov    -0x24(%rbp),%r9d
add    $0xc000,%r9d
and    $0xffff,%r9d
shr    $0x8,%r9d
and    $0xf,%r9d
add    $0x61,%r9d
mov    -0x24(%rbp),%r10d
add    $0xc000,%r10d
and    $0xffff,%r10d
shr    $0x4,%r10d
and    $0xf,%r10d
add    $0x61,%r10d
mov    -0x24(%rbp),%eax
add    $0xc000,%eax
and    $0xffff,%eax
shr    $0x0,%eax
and    $0xf,%eax
add    $0x61,%eax
lea    -0x68(%rbp),%rdi
lea    0x7eb(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   10f0 <asprintf@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    -0x68(%rbp),%rdi
call   1070 <rmdir@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    189b <main+0x68b>
lea    0x897(%rip),%rdi
call   1100 <perror@plt>
mov    0x2744(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    18f7 <main+0x6e7>
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
mov    -0x38(%rbp),%eax
sub    -0x30(%rbp),%eax
imul   $0xf4240,%eax,%eax
mov    -0x34(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x24(%rbp),%edx
add    $0x1,%edx
lea    0x835(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    18fc <main+0x6ec>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1790 <main+0x580>
mov    0x26bf(%rip),%rax
mov    (%rax),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xdcb(%rip),%rdi
call   1070 <opendir@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10f0 <readdir@plt>
test   %rax,%rax
je     171d <main+0x4fd>
mov    %rax,%rbp
lea    0x8(%rsp),%r14
jmp    1274 <main+0x54>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10f0 <readdir@plt>
mov    %rax,%rbp
test   %rax,%rax
je     171d <main+0x4fd>
mov    0x0(%rbp),%edi
mov    %r14,%rsi
call   10d0 <stat@plt>
test   %eax,%eax
js     1260 <main+0x40>
mov    0x8(%rsp),%edi
call   10e0 <S_ISREG@plt>
test   %rax,%rax
je     1260 <main+0x40>
mov    0x0(%rbp),%edi
call   1140 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   10b0 <closedir@plt>
test   %r14,%r14
je     1725 <main+0x505>
lea    0xd4e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
mov    0x8(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,0x24(%rsp)
lea    0x10(%rsp),%r15
mov    0x2d02(%rip),%r12
xor    %r13d,%r13d
jmp    12ff <main+0xdf>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r13d
cmp    $0x10000,%ebx
je     13c4 <main+0x1a4>
mov    %r13d,%r8d
shr    $0xc,%r8d
add    $0x61,%r8d
mov    %r13d,%r9d
shr    $0x8,%r9d
and    $0xf,%r9d
add    $0x61,%r9d
mov    %r13d,%ebx
shr    $0x4,%ebx
and    $0xf,%ebx
add    $0x61,%ebx
mov    %r13d,%ebp
and    $0xf,%ebp
add    $0x61,%ebp
mov    %r15,%rdi
lea    0xcdc(%rip),%rsi
mov    $0x61,%edx
mov    $0x61,%ecx
xor    %eax,%eax
push   %rbp
push   %rbx
call   1100 <asprintf@plt>
add    $0x10,%rsp
not    %eax
shr    $0x1f,%eax
mov    %eax,%edi
call   10c0 <assert@plt>
mov    0x10(%rsp),%rdi
mov    (%r12),%esi
call   1050 <mkdir@plt>
test   %eax,%eax
js     1733 <main+0x513>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
lea    0x1(%r13),%ebx
test   %r13d,%ebx
jne    12f0 <main+0xd0>
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
mov    0x18(%rsp),%eax
sub    0x4(%rsp),%eax
mov    0x1c(%rsp),%ecx
sub    0x24(%rsp),%ecx
imul   $0xf4240,%eax,%eax
add    %ecx,%eax
movslq %eax,%rsi
lea    0xc7f(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <printf@plt>
jmp    12f0 <main+0xd0>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
mov    0x8(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,0x24(%rsp)
lea    0xc6e(%rip),%r13
lea    0x10(%rsp),%r15
xor    %r12d,%r12d
jmp    140f <main+0x1ef>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r12d
cmp    $0x10000,%ebx
je     14df <main+0x2bf>
lea    0x8000(%r12),%ebx
mov    %ebx,%r8d
shr    $0xc,%r8d
and    $0xf,%r8d
add    $0x61,%r8d
mov    %ebx,%r9d
shr    $0x8,%r9d
and    $0xf,%r9d
add    $0x61,%r9d
shr    $0x4,%ebx
and    $0xf,%ebx
add    $0x61,%ebx
mov    %r12d,%ebp
and    $0xf,%ebp
add    $0x61,%ebp
sub    $0x8,%rsp
mov    %r15,%rdi
mov    %r13,%rsi
mov    $0x61,%edx
mov    $0x61,%ecx
xor    %eax,%eax
push   %r14
push   %rbp
push   %rbx
call   1100 <asprintf@plt>
add    $0x20,%rsp
not    %eax
shr    $0x1f,%eax
mov    %eax,%edi
call   10c0 <assert@plt>
mov    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1120 <link@plt>
test   %eax,%eax
js     173c <main+0x51c>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
lea    0x1(%r12),%ebx
test   %r12d,%ebx
jne    1400 <main+0x1e0>
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
mov    0x18(%rsp),%eax
sub    0x4(%rsp),%eax
mov    0x1c(%rsp),%ecx
sub    0x24(%rsp),%ecx
imul   $0xf4240,%eax,%eax
add    %ecx,%eax
movslq %eax,%rsi
lea    0xba2(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1400 <main+0x1e0>
lea    0xc32(%rip),%rdi
call   1060 <puts@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
mov    0x8(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,0x24(%rsp)
lea    0xb47(%rip),%r13
lea    0x10(%rsp),%r15
xor    %r12d,%r12d
jmp    152f <main+0x30f>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r12d
cmp    $0x10000,%ebx
je     15fc <main+0x3dc>
lea    0x4000(%r12),%ebx
mov    %ebx,%r8d
shr    $0xc,%r8d
and    $0xf,%r8d
add    $0x61,%r8d
mov    %ebx,%r9d
shr    $0x8,%r9d
and    $0xf,%r9d
add    $0x61,%r9d
shr    $0x4,%ebx
and    $0xf,%ebx
add    $0x61,%ebx
mov    %r12d,%ebp
and    $0xf,%ebp
add    $0x61,%ebp
sub    $0x8,%rsp
mov    %r15,%rdi
mov    %r13,%rsi
mov    $0x61,%edx
mov    $0x61,%ecx
xor    %eax,%eax
push   %r14
push   %rbp
push   %rbx
call   1100 <asprintf@plt>
add    $0x20,%rsp
not    %eax
shr    $0x1f,%eax
mov    %eax,%edi
call   10c0 <assert@plt>
mov    0x10(%rsp),%rdi
call   1040 <unlink@plt>
test   %eax,%eax
js     1745 <main+0x525>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
lea    0x1(%r12),%ebx
test   %r12d,%ebx
jne    1520 <main+0x300>
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
mov    0x18(%rsp),%eax
sub    0x4(%rsp),%eax
mov    0x1c(%rsp),%ecx
sub    0x24(%rsp),%ecx
imul   $0xf4240,%eax,%eax
add    %ecx,%eax
movslq %eax,%rsi
lea    0xab7(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1520 <main+0x300>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
mov    0x8(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0xc(%rsp),%r15d
lea    0x9f8(%rip),%r14
lea    0x10(%rsp),%r13
xor    %r12d,%r12d
jmp    163f <main+0x41f>
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%r12d
cmp    $0x10000,%ebp
je     1705 <main+0x4e5>
lea    0xc000(%r12),%ebp
mov    %ebp,%r8d
shr    $0xc,%r8d
and    $0xf,%r8d
add    $0x61,%r8d
mov    %ebp,%r9d
shr    $0x8,%r9d
and    $0xf,%r9d
add    $0x61,%r9d
shr    $0x4,%ebp
and    $0xf,%ebp
add    $0x61,%ebp
mov    %r12d,%ebx
and    $0xf,%ebx
add    $0x61,%ebx
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x61,%edx
mov    $0x61,%ecx
xor    %eax,%eax
push   %rbx
push   %rbp
call   1100 <asprintf@plt>
add    $0x10,%rsp
not    %eax
shr    $0x1f,%eax
mov    %eax,%edi
call   10c0 <assert@plt>
mov    0x10(%rsp),%rdi
call   1080 <rmdir@plt>
test   %eax,%eax
js     174e <main+0x52e>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
lea    0x1(%r12),%ebp
test   %r12d,%ebp
jne    1630 <main+0x410>
lea    0x18(%rsp),%rdi
xor    %esi,%esi
call   10a0 <gettimeofday@plt>
mov    0x18(%rsp),%eax
sub    0x4(%rsp),%eax
mov    0x1c(%rsp),%ecx
sub    %r15d,%ecx
imul   $0xf4240,%eax,%eax
add    %ecx,%eax
movslq %eax,%rsi
lea    0x9e1(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1630 <main+0x410>
mov    0x28c4(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
call   10b0 <closedir@plt>
lea    0x9ce(%rip),%rdi
call   1060 <puts@plt>
jmp    175a <main+0x53a>
lea    0x8f5(%rip),%rdi
jmp    1755 <main+0x535>
lea    0x95d(%rip),%rdi
jmp    1755 <main+0x535>
lea    0x952(%rip),%rdi
jmp    1755 <main+0x535>
lea    0x97d(%rip),%rdi
call   1110 <perror@plt>
mov    0x2877(%rip),%rax
mov    (%rax),%edi
call   1130 <exit@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
%struct.timeval = type { i32, i32 }
%struct.stat = type { i32 }
@.str = [2 x i8] c".\00"
@.str.1 = [31 x i8] c"couldn't find any file to tag\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [18 x i8] c"Will use file %s\0A\00"
@.str.3 = [27 x i8] c"perfs_tmp_tag_%c%c%c%c%c%c\00"
@S_IRWXU = global i32 0
@.str.4 = [6 x i8] c"mkdir\00"
@.str.5 = [32 x i8] c"%lu usecs for creating %u tags\0A\00"
@.str.6 = [30 x i8] c"perfs_tmp_tag_%c%c%c%c%c%c/%s\00"
@.str.7 = [5 x i8] c"link\00"
@.str.8 = [43 x i8] c"%lu usecs for adding %u tags to that file\0A\00"
@.str.9 = [46 x i8] c"listage des tags du fichier pas impl\C3\A9ment\C3\A9\0A\00"
@.str.10 = [7 x i8] c"unlink\00"
@.str.11 = [45 x i8] c"%lu usecs for removing %u tags to that file\0A\00"
@.str.12 = [6 x i8] c"rmdir\00"
@.str.13 = [34 x i8] c"%lu usecs for destroying %u tags\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca %struct.dirent*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca %struct.timeval
%7 = alloca %struct.timeval
%8 = alloca i64
%9 = alloca i32
%10 = alloca %struct.stat
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%15 = call i32* @opendir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %15, i32** %4
br label %16
16: ; preds = %38, %27, %0
%17 = load i32*, i32** %4
%18 = call %struct.dirent* @readdir(i32* %17)
store %struct.dirent* %18, %struct.dirent** %3
%19 = icmp ne %struct.dirent* %18, null
br i1 %19, label %20, label %39
20: ; preds = %16
%21 = load %struct.dirent*, %struct.dirent** %3
%22 = getelementptr inbounds %struct.dirent, %struct.dirent* %21, i32 0, i32 0
%23 = load i32, i32* %22
%24 = call i32 @stat(i32 %23, %struct.stat* %10)
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %20
br label %16
28: ; preds = %20
%29 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%30 = load i32, i32* %29
%31 = call i64 @S_ISREG(i32 %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %38
33: ; preds = %28
%34 = load %struct.dirent*, %struct.dirent** %3
%35 = getelementptr inbounds %struct.dirent, %struct.dirent* %34, i32 0, i32 0
%36 = load i32, i32* %35
%37 = call i8* @strdup(i32 %36)
store i8* %37, i8** %2
br label %39
38: ; preds = %28
br label %16
39: ; preds = %33, %16
%40 = load i32*, i32** %4
%41 = call i32 @closedir(i32* %40)
%42 = load i8*, i8** %2
%43 = icmp ne i8* %42, null
br i1 %43, label %48, label %44
44: ; preds = %39
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%46 = load i32, i32* @EXIT_FAILURE
%47 = call i32 @exit(i32 %46)
unreachable
48: ; preds = %39
%49 = load i8*, i8** %2
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %49)
%51 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
store i32 0, i32* %5
br label %52
52: ; preds = %122, %48
%53 = load i32, i32* %5
%54 = icmp ult i32 %53, 65536
br i1 %54, label %55, label %125
55: ; preds = %52
%56 = load i32, i32* %5
%57 = lshr i32 %56, 20
%58 = and i32 %57, 15
%59 = add i32 %58, 97
%60 = load i32, i32* %5
%61 = lshr i32 %60, 16
%62 = and i32 %61, 15
%63 = add i32 %62, 97
%64 = load i32, i32* %5
%65 = lshr i32 %64, 12
%66 = and i32 %65, 15
%67 = add i32 %66, 97
%68 = load i32, i32* %5
%69 = lshr i32 %68, 8
%70 = and i32 %69, 15
%71 = add i32 %70, 97
%72 = load i32, i32* %5
%73 = lshr i32 %72, 4
%74 = and i32 %73, 15
%75 = add i32 %74, 97
%76 = load i32, i32* %5
%77 = lshr i32 %76, 0
%78 = and i32 %77, 15
%79 = add i32 %78, 97
%80 = call i32 (i8**, i8*, i32, i32, i32, i32, i32, i32, ...) @asprintf(i8** %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %59, i32 %63, i32 %67, i32 %71, i32 %75, i32 %79)
store i32 %80, i32* %9
%81 = load i32, i32* %9
%82 = icmp sge i32 %81, 0
%83 = zext i1 %82 to i32
%84 = call i32 @assert(i32 %83)
%85 = load i8*, i8** %11
%86 = load i32, i32* @S_IRWXU
%87 = call i32 @mkdir(i8* %85, i32 %86)
store i32 %87, i32* %9
%88 = load i32, i32* %9
%89 = icmp slt i32 %88, 0
br i1 %89, label %90, label %94
90: ; preds = %55
%91 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%92 = load i32, i32* @EXIT_FAILURE
%93 = call i32 @exit(i32 %92)
unreachable
94: ; preds = %55
%95 = load i8*, i8** %11
%96 = call i32 @free(i8* %95)
%97 = load i32, i32* %5
%98 = load i32, i32* %5
%99 = add i32 %98, 1
%100 = and i32 %97, %99
%101 = icmp ne i32 %100, 0
br i1 %101, label %121, label %102
102: ; preds = %94
%103 = call i32 @gettimeofday(%struct.timeval* %7, i32* null)
%104 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%105 = load i32, i32* %104
%106 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%107 = load i32, i32* %106
%108 = sub nsw i32 %105, %107
%109 = mul nsw i32 %108, 1000000
%110 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%111 = load i32, i32* %110
%112 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%113 = load i32, i32* %112
%114 = sub nsw i32 %111, %113
%115 = add nsw i32 %109, %114
%116 = sext i32 %115 to i64
store i64 %116, i64* %8
%117 = load i64, i64* %8
%118 = load i32, i32* %5
%119 = add i32 %118, 1
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i64 %117, i32 %119)
br label %121
121: ; preds = %102, %94
br label %122
122: ; preds = %121
%123 = load i32, i32* %5
%124 = add i32 %123, 1
store i32 %124, i32* %5
br label %52
125: ; preds = %52
%126 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
store i32 0, i32* %5
br label %127
127: ; preds = %210, %125
%128 = load i32, i32* %5
%129 = icmp ult i32 %128, 65536
br i1 %129, label %130, label %213
130: ; preds = %127
%131 = load i32, i32* %5
%132 = add i32 %131, 32768
%133 = urem i32 %132, 65536
%134 = lshr i32 %133, 20
%135 = and i32 %134, 15
%136 = add i32 %135, 97
%137 = load i32, i32* %5
%138 = add i32 %137, 32768
%139 = urem i32 %138, 65536
%140 = lshr i32 %139, 16
%141 = and i32 %140, 15
%142 = add i32 %141, 97
%143 = load i32, i32* %5
%144 = add i32 %143, 32768
%145 = urem i32 %144, 65536
%146 = lshr i32 %145, 12
%147 = and i32 %146, 15
%148 = add i32 %147, 97
%149 = load i32, i32* %5
%150 = add i32 %149, 32768
%151 = urem i32 %150, 65536
%152 = lshr i32 %151, 8
%153 = and i32 %152, 15
%154 = add i32 %153, 97
%155 = load i32, i32* %5
%156 = add i32 %155, 32768
%157 = urem i32 %156, 65536
%158 = lshr i32 %157, 4
%159 = and i32 %158, 15
%160 = add i32 %159, 97
%161 = load i32, i32* %5
%162 = add i32 %161, 32768
%163 = urem i32 %162, 65536
%164 = lshr i32 %163, 0
%165 = and i32 %164, 15
%166 = add i32 %165, 97
%167 = load i8*, i8** %2
%168 = call i32 (i8**, i8*, i32, i32, i32, i32, i32, i32, ...) @asprintf(i8** %12, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %136, i32 %142, i32 %148, i32 %154, i32 %160, i32 %166, i8* %167)
store i32 %168, i32* %9
%169 = load i32, i32* %9
%170 = icmp sge i32 %169, 0
%171 = zext i1 %170 to i32
%172 = call i32 @assert(i32 %171)
%173 = load i8*, i8** %2
%174 = load i8*, i8** %12
%175 = call i32 @link(i8* %173, i8* %174)
store i32 %175, i32* %9
%176 = load i32, i32* %9
%177 = icmp slt i32 %176, 0
br i1 %177, label %178, label %182
178: ; preds = %130
%179 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%180 = load i32, i32* @EXIT_FAILURE
%181 = call i32 @exit(i32 %180)
unreachable
182: ; preds = %130
%183 = load i8*, i8** %12
%184 = call i32 @free(i8* %183)
%185 = load i32, i32* %5
%186 = load i32, i32* %5
%187 = add i32 %186, 1
%188 = and i32 %185, %187
%189 = icmp ne i32 %188, 0
br i1 %189, label %209, label %190
190: ; preds = %182
%191 = call i32 @gettimeofday(%struct.timeval* %7, i32* null)
%192 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%193 = load i32, i32* %192
%194 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%195 = load i32, i32* %194
%196 = sub nsw i32 %193, %195
%197 = mul nsw i32 %196, 1000000
%198 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%199 = load i32, i32* %198
%200 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%201 = load i32, i32* %200
%202 = sub nsw i32 %199, %201
%203 = add nsw i32 %197, %202
%204 = sext i32 %203 to i64
store i64 %204, i64* %8
%205 = load i64, i64* %8
%206 = load i32, i32* %5
%207 = add i32 %206, 1
%208 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i64 %205, i32 %207)
br label %209
209: ; preds = %190, %182
br label %210
210: ; preds = %209
%211 = load i32, i32* %5
%212 = add i32 %211, 1
store i32 %212, i32* %5
br label %127
213: ; preds = %127
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0))
%215 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
store i32 0, i32* %5
br label %216
216: ; preds = %298, %213
%217 = load i32, i32* %5
%218 = icmp ult i32 %217, 65536
br i1 %218, label %219, label %301
219: ; preds = %216
%220 = load i32, i32* %5
%221 = add i32 %220, 16384
%222 = urem i32 %221, 65536
%223 = lshr i32 %222, 20
%224 = and i32 %223, 15
%225 = add i32 %224, 97
%226 = load i32, i32* %5
%227 = add i32 %226, 16384
%228 = urem i32 %227, 65536
%229 = lshr i32 %228, 16
%230 = and i32 %229, 15
%231 = add i32 %230, 97
%232 = load i32, i32* %5
%233 = add i32 %232, 16384
%234 = urem i32 %233, 65536
%235 = lshr i32 %234, 12
%236 = and i32 %235, 15
%237 = add i32 %236, 97
%238 = load i32, i32* %5
%239 = add i32 %238, 16384
%240 = urem i32 %239, 65536
%241 = lshr i32 %240, 8
%242 = and i32 %241, 15
%243 = add i32 %242, 97
%244 = load i32, i32* %5
%245 = add i32 %244, 16384
%246 = urem i32 %245, 65536
%247 = lshr i32 %246, 4
%248 = and i32 %247, 15
%249 = add i32 %248, 97
%250 = load i32, i32* %5
%251 = add i32 %250, 16384
%252 = urem i32 %251, 65536
%253 = lshr i32 %252, 0
%254 = and i32 %253, 15
%255 = add i32 %254, 97
%256 = load i8*, i8** %2
%257 = call i32 (i8**, i8*, i32, i32, i32, i32, i32, i32, ...) @asprintf(i8** %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %225, i32 %231, i32 %237, i32 %243, i32 %249, i32 %255, i8* %256)
store i32 %257, i32* %9
%258 = load i32, i32* %9
%259 = icmp sge i32 %258, 0
%260 = zext i1 %259 to i32
%261 = call i32 @assert(i32 %260)
%262 = load i8*, i8** %13
%263 = call i32 @unlink(i8* %262)
store i32 %263, i32* %9
%264 = load i32, i32* %9
%265 = icmp slt i32 %264, 0
br i1 %265, label %266, label %270
266: ; preds = %219
%267 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%268 = load i32, i32* @EXIT_FAILURE
%269 = call i32 @exit(i32 %268)
unreachable
270: ; preds = %219
%271 = load i8*, i8** %13
%272 = call i32 @free(i8* %271)
%273 = load i32, i32* %5
%274 = load i32, i32* %5
%275 = add i32 %274, 1
%276 = and i32 %273, %275
%277 = icmp ne i32 %276, 0
br i1 %277, label %297, label %278
278: ; preds = %270
%279 = call i32 @gettimeofday(%struct.timeval* %7, i32* null)
%280 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%281 = load i32, i32* %280
%282 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%283 = load i32, i32* %282
%284 = sub nsw i32 %281, %283
%285 = mul nsw i32 %284, 1000000
%286 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%287 = load i32, i32* %286
%288 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%289 = load i32, i32* %288
%290 = sub nsw i32 %287, %289
%291 = add nsw i32 %285, %290
%292 = sext i32 %291 to i64
store i64 %292, i64* %8
%293 = load i64, i64* %8
%294 = load i32, i32* %5
%295 = add i32 %294, 1
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i64 %293, i32 %295)
br label %297
297: ; preds = %278, %270
br label %298
298: ; preds = %297
%299 = load i32, i32* %5
%300 = add i32 %299, 1
store i32 %300, i32* %5
br label %216
301: ; preds = %216
%302 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
store i32 0, i32* %5
br label %303
303: ; preds = %384, %301
%304 = load i32, i32* %5
%305 = icmp ult i32 %304, 65536
br i1 %305, label %306, label %387
306: ; preds = %303
%307 = load i32, i32* %5
%308 = add i32 %307, 49152
%309 = urem i32 %308, 65536
%310 = lshr i32 %309, 20
%311 = and i32 %310, 15
%312 = add i32 %311, 97
%313 = load i32, i32* %5
%314 = add i32 %313, 49152
%315 = urem i32 %314, 65536
%316 = lshr i32 %315, 16
%317 = and i32 %316, 15
%318 = add i32 %317, 97
%319 = load i32, i32* %5
%320 = add i32 %319, 49152
%321 = urem i32 %320, 65536
%322 = lshr i32 %321, 12
%323 = and i32 %322, 15
%324 = add i32 %323, 97
%325 = load i32, i32* %5
%326 = add i32 %325, 49152
%327 = urem i32 %326, 65536
%328 = lshr i32 %327, 8
%329 = and i32 %328, 15
%330 = add i32 %329, 97
%331 = load i32, i32* %5
%332 = add i32 %331, 49152
%333 = urem i32 %332, 65536
%334 = lshr i32 %333, 4
%335 = and i32 %334, 15
%336 = add i32 %335, 97
%337 = load i32, i32* %5
%338 = add i32 %337, 49152
%339 = urem i32 %338, 65536
%340 = lshr i32 %339, 0
%341 = and i32 %340, 15
%342 = add i32 %341, 97
%343 = call i32 (i8**, i8*, i32, i32, i32, i32, i32, i32, ...) @asprintf(i8** %14, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %312, i32 %318, i32 %324, i32 %330, i32 %336, i32 %342)
store i32 %343, i32* %9
%344 = load i32, i32* %9
%345 = icmp sge i32 %344, 0
%346 = zext i1 %345 to i32
%347 = call i32 @assert(i32 %346)
%348 = load i8*, i8** %14
%349 = call i32 @rmdir(i8* %348)
store i32 %349, i32* %9
%350 = load i32, i32* %9
%351 = icmp slt i32 %350, 0
br i1 %351, label %352, label %356
352: ; preds = %306
%353 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%354 = load i32, i32* @EXIT_FAILURE
%355 = call i32 @exit(i32 %354)
unreachable
356: ; preds = %306
%357 = load i8*, i8** %14
%358 = call i32 @free(i8* %357)
%359 = load i32, i32* %5
%360 = load i32, i32* %5
%361 = add i32 %360, 1
%362 = and i32 %359, %361
%363 = icmp ne i32 %362, 0
br i1 %363, label %383, label %364
364: ; preds = %356
%365 = call i32 @gettimeofday(%struct.timeval* %7, i32* null)
%366 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%367 = load i32, i32* %366
%368 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%369 = load i32, i32* %368
%370 = sub nsw i32 %367, %369
%371 = mul nsw i32 %370, 1000000
%372 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%373 = load i32, i32* %372
%374 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%375 = load i32, i32* %374
%376 = sub nsw i32 %373, %375
%377 = add nsw i32 %371, %376
%378 = sext i32 %377 to i64
store i64 %378, i64* %8
%379 = load i64, i64* %8
%380 = load i32, i32* %5
%381 = add i32 %380, 1
%382 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i64 %379, i32 %381)
br label %383
383: ; preds = %364, %356
br label %384
384: ; preds = %383
%385 = load i32, i32* %5
%386 = add i32 %385, 1
store i32 %386, i32* %5
br label %303
387: ; preds = %303
%388 = load i32, i32* @EXIT_SUCCESS
ret i32 %388
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.stat = type { i32 }
%struct.dirent = type { i32 }
@.str = [2 x i8] c".\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [18 x i8] c"Will use file %s\0A\00"
@.str.3 = [27 x i8] c"perfs_tmp_tag_%c%c%c%c%c%c\00"
@S_IRWXU = global i32 0
@.str.4 = [6 x i8] c"mkdir\00"
@.str.5 = [32 x i8] c"%lu usecs for creating %u tags\0A\00"
@.str.6 = [30 x i8] c"perfs_tmp_tag_%c%c%c%c%c%c/%s\00"
@.str.7 = [5 x i8] c"link\00"
@.str.8 = [43 x i8] c"%lu usecs for adding %u tags to that file\0A\00"
@.str.10 = [7 x i8] c"unlink\00"
@.str.11 = [45 x i8] c"%lu usecs for removing %u tags to that file\0A\00"
@.str.12 = [6 x i8] c"rmdir\00"
@.str.13 = [34 x i8] c"%lu usecs for destroying %u tags\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [30 x i8] c"couldn't find any file to tag\00"
@str.14 = [45 x i8] c"listage des tags du fichier pas impl\C3\A9ment\C3\A9\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timeval
%3 = alloca %struct.stat
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = bitcast %struct.timeval* %1 to i8*
%9 = bitcast %struct.timeval* %2 to i8*
%10 = tail call i32* @opendir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = call %struct.dirent* @readdir(i32* %10)
%12 = icmp eq %struct.dirent* %11, null
br i1 %12, label %29, label %13
13: ; preds = %0
%14 = bitcast %struct.stat* %3 to i8*
%15 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
br label %16
16: ; preds = %13, %26
%17 = phi %struct.dirent* [ %11, %13 ], [ %27, %26 ]
%18 = getelementptr inbounds %struct.dirent, %struct.dirent* %17, i64 0, i32 0
%19 = load i32, i32* %18
%20 = call i32 @stat(i32 %19, %struct.stat* %3)
%21 = icmp slt i32 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %16
%23 = load i32, i32* %15
%24 = call i64 @S_ISREG(i32 %23)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %22, %16
%27 = call %struct.dirent* @readdir(i32* %10)
%28 = icmp eq %struct.dirent* %27, null
br i1 %28, label %29, label %16
29: ; preds = %26, %0
%30 = call i32 @closedir(i32* %10)
br label %37
31: ; preds = %22
%32 = getelementptr inbounds %struct.dirent, %struct.dirent* %17, i64 0, i32 0
%33 = load i32, i32* %32
%34 = call i8* @strdup(i32 %33)
%35 = call i32 @closedir(i32* %10)
%36 = icmp eq i8* %34, null
br i1 %36, label %37, label %41
37: ; preds = %29, %31
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%39 = load i32, i32* @EXIT_FAILURE
%40 = call i32 @exit(i32 %39)
unreachable
41: ; preds = %31
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %34)
%43 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%44 = bitcast i8** %4 to i8*
%45 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%46 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%47 = load i32, i32* %46
%48 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%49 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%50 = load i32, i32* %49
br label %51
51: ; preds = %41, %91
%52 = phi i32 [ 0, %41 ], [ %78, %91 ]
%53 = lshr i32 %52, 12
%54 = add nuw nsw i32 %53, 97
%55 = lshr i32 %52, 8
%56 = and i32 %55, 15
%57 = add nuw nsw i32 %56, 97
%58 = lshr i32 %52, 4
%59 = and i32 %58, 15
%60 = add nuw nsw i32 %59, 97
%61 = and i32 %52, 15
%62 = add nuw nsw i32 %61, 97
%63 = call i32 (i8**, i8*, i32, i32, i32, i32, i32, i32, ...) @asprintf(i8** %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 97, i32 97, i32 %54, i32 %57, i32 %60, i32 %62)
%64 = xor i32 %63, -1
%65 = lshr i32 %64, 31
%66 = call i32 @assert(i32 %65)
%67 = load i8*, i8** %4
%68 = load i32, i32* @S_IRWXU
%69 = call i32 @mkdir(i8* %67, i32 %68)
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %75
71: ; preds = %51
%72 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%73 = load i32, i32* @EXIT_FAILURE
%74 = call i32 @exit(i32 %73)
unreachable
75: ; preds = %51
%76 = load i8*, i8** %4
%77 = call i32 @free(i8* %76)
%78 = add nuw nsw i32 %52, 1
%79 = and i32 %78, %52
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %91
81: ; preds = %75
%82 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%83 = load i32, i32* %45
%84 = sub nsw i32 %83, %47
%85 = mul nsw i32 %84, 1000000
%86 = load i32, i32* %48
%87 = sub i32 %86, %50
%88 = add nsw i32 %87, %85
%89 = sext i32 %88 to i64
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i64 %89, i32 %78)
br label %91
91: ; preds = %81, %75
%92 = icmp eq i32 %78, 65536
br i1 %92, label %93, label %51
93: ; preds = %91
%94 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%95 = bitcast i8** %5 to i8*
%96 = load i32, i32* %46
%97 = load i32, i32* %49
br label %98
98: ; preds = %93, %139
%99 = phi i32 [ 0, %93 ], [ %126, %139 ]
%100 = add nuw nsw i32 %99, 32768
%101 = lshr i32 %100, 12
%102 = and i32 %101, 15
%103 = add nuw nsw i32 %102, 97
%104 = lshr i32 %100, 8
%105 = and i32 %104, 15
%106 = add nuw nsw i32 %105, 97
%107 = lshr i32 %100, 4
%108 = and i32 %107, 15
%109 = add nuw nsw i32 %108, 97
%110 = and i32 %99, 15
%111 = add nuw nsw i32 %110, 97
%112 = call i32 (i8**, i8*, i32, i32, i32, i32, i32, i32, ...) @asprintf(i8** %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 97, i32 97, i32 %103, i32 %106, i32 %109, i32 %111, i8* %34)
%113 = xor i32 %112, -1
%114 = lshr i32 %113, 31
%115 = call i32 @assert(i32 %114)
%116 = load i8*, i8** %5
%117 = call i32 @link(i8* %34, i8* %116)
%118 = icmp slt i32 %117, 0
br i1 %118, label %119, label %123
119: ; preds = %98
%120 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%121 = load i32, i32* @EXIT_FAILURE
%122 = call i32 @exit(i32 %121)
unreachable
123: ; preds = %98
%124 = load i8*, i8** %5
%125 = call i32 @free(i8* %124)
%126 = add nuw nsw i32 %99, 1
%127 = and i32 %126, %99
%128 = icmp eq i32 %127, 0
br i1 %128, label %129, label %139
129: ; preds = %123
%130 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%131 = load i32, i32* %45
%132 = sub nsw i32 %131, %96
%133 = mul nsw i32 %132, 1000000
%134 = load i32, i32* %48
%135 = sub i32 %134, %97
%136 = add nsw i32 %135, %133
%137 = sext i32 %136 to i64
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i64 %137, i32 %126)
br label %139
139: ; preds = %129, %123
%140 = icmp eq i32 %126, 65536
br i1 %140, label %141, label %98
141: ; preds = %139
%142 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.14, i64 0, i64 0))
%143 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%144 = bitcast i8** %6 to i8*
%145 = load i32, i32* %46
%146 = load i32, i32* %49
br label %147
147: ; preds = %141, %188
%148 = phi i32 [ 0, %141 ], [ %175, %188 ]
%149 = add nuw nsw i32 %148, 16384
%150 = lshr i32 %149, 12
%151 = and i32 %150, 15
%152 = add nuw nsw i32 %151, 97
%153 = lshr i32 %149, 8
%154 = and i32 %153, 15
%155 = add nuw nsw i32 %154, 97
%156 = lshr i32 %149, 4
%157 = and i32 %156, 15
%158 = add nuw nsw i32 %157, 97
%159 = and i32 %148, 15
%160 = add nuw nsw i32 %159, 97
%161 = call i32 (i8**, i8*, i32, i32, i32, i32, i32, i32, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 97, i32 97, i32 %152, i32 %155, i32 %158, i32 %160, i8* %34)
%162 = xor i32 %161, -1
%163 = lshr i32 %162, 31
%164 = call i32 @assert(i32 %163)
%165 = load i8*, i8** %6
%166 = call i32 @unlink(i8* %165)
%167 = icmp slt i32 %166, 0
br i1 %167, label %168, label %172
168: ; preds = %147
%169 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%170 = load i32, i32* @EXIT_FAILURE
%171 = call i32 @exit(i32 %170)
unreachable
172: ; preds = %147
%173 = load i8*, i8** %6
%174 = call i32 @free(i8* %173)
%175 = add nuw nsw i32 %148, 1
%176 = and i32 %175, %148
%177 = icmp eq i32 %176, 0
br i1 %177, label %178, label %188
178: ; preds = %172
%179 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%180 = load i32, i32* %45
%181 = sub nsw i32 %180, %145
%182 = mul nsw i32 %181, 1000000
%183 = load i32, i32* %48
%184 = sub i32 %183, %146
%185 = add nsw i32 %184, %182
%186 = sext i32 %185 to i64
%187 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i64 %186, i32 %175)
br label %188
188: ; preds = %178, %172
%189 = icmp eq i32 %175, 65536
br i1 %189, label %190, label %147
190: ; preds = %188
%191 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%192 = bitcast i8** %7 to i8*
%193 = load i32, i32* %46
%194 = load i32, i32* %49
br label %195
195: ; preds = %190, %236
%196 = phi i32 [ 0, %190 ], [ %223, %236 ]
%197 = add nuw nsw i32 %196, 49152
%198 = lshr i32 %197, 12
%199 = and i32 %198, 15
%200 = add nuw nsw i32 %199, 97
%201 = lshr i32 %197, 8
%202 = and i32 %201, 15
%203 = add nuw nsw i32 %202, 97
%204 = lshr i32 %197, 4
%205 = and i32 %204, 15
%206 = add nuw nsw i32 %205, 97
%207 = and i32 %196, 15
%208 = add nuw nsw i32 %207, 97
%209 = call i32 (i8**, i8*, i32, i32, i32, i32, i32, i32, ...) @asprintf(i8** %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 97, i32 97, i32 %200, i32 %203, i32 %206, i32 %208)
%210 = xor i32 %209, -1
%211 = lshr i32 %210, 31
%212 = call i32 @assert(i32 %211)
%213 = load i8*, i8** %7
%214 = call i32 @rmdir(i8* %213)
%215 = icmp slt i32 %214, 0
br i1 %215, label %216, label %220
216: ; preds = %195
%217 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%218 = load i32, i32* @EXIT_FAILURE
%219 = call i32 @exit(i32 %218)
unreachable
220: ; preds = %195
%221 = load i8*, i8** %7
%222 = call i32 @free(i8* %221)
%223 = add nuw nsw i32 %196, 1
%224 = and i32 %223, %196
%225 = icmp eq i32 %224, 0
br i1 %225, label %226, label %236
226: ; preds = %220
%227 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%228 = load i32, i32* %45
%229 = sub nsw i32 %228, %193
%230 = mul nsw i32 %229, 1000000
%231 = load i32, i32* %48
%232 = sub i32 %231, %194
%233 = add nsw i32 %232, %230
%234 = sext i32 %233 to i64
%235 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i64 %234, i32 %223)
br label %236
236: ; preds = %226, %220
%237 = icmp eq i32 %223, 65536
br i1 %237, label %238, label %195
238: ; preds = %236
%239 = load i32, i32* @EXIT_SUCCESS
ret i32 %239
}