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

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, char *);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ perror(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
scalar_t__ readlink(char *, char *, int);
int /*<<< orphan*/ rewinddir(int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ snprintf(char *, int, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
char *strerror(scalar_t__);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strrchr(char *, char);
scalar_t__ system(char *);
int main(int argc, char *argv[]) {
  char *dirpath;
  char *filename;
  dirpath = "/dev/disk/by-uuid";
  filename = "/etc/mtab";
  DIR *dirp;
  FILE *mtab;
  if ((mtab = fopen(filename, "r")) == NULL) {
    fprintf(stderr, "open %s failed\n", filename);
    exit(1);
  }
  if ((dirp = opendir(dirpath)) == NULL) {
    fprintf(stdout, "opendir %s failed\n", dirpath);
    exit(1);
  } else {
    fprintf(stdout, "opendir %s successfully\n", dirpath);
  }
  struct dirent *direntp;
  errno = 0;
  while ((direntp = readdir(dirp)) != NULL) {
    fprintf(stdout, "%s\n", direntp->d_name);
  }
  if (errno != 0) {
    perror("readdir failed");
    exit(1);
  }
  rewinddir(dirp);
  char mdev[64][255];
  int i;
  int devnum;
  i = 0;
  while (fscanf(mtab, "%s", mdev[i]) != EOF) {
    while (getc(mtab) != '\n')
      ;
    if (strncmp(mdev[i], "/dev/sd", 7) == 0 &&
        strncmp(mdev[i], "/dev/sda", 8) != 0) {
      fprintf(stdout, "mdev: %s\n", mdev[i]);
      i++;
    }
  }
  strncpy(mdev[i], "", 1);
  char buf[255];
  char path[255];
  char cmd[255];
  char *p;
  int flag;
  devnum = i;
  errno = 0;
  while ((direntp = readdir(dirp)) != NULL) {
    flag = 1;
    if (direntp->d_name[0] == '.') {
      continue;
    }
    snprintf(path, sizeof(path) - 1, "%s/%s", dirpath, direntp->d_name);
    if (readlink(path, buf, sizeof(buf) - 1) < 0) {
      perror("readlink failed");
      exit(1);
    }
    p = strrchr(buf, '/');
    if (p != NULL && strncmp(p, "/sda", 4) != 0) {
      snprintf(path, sizeof(path) - 1, "/dev%s", p);
      fprintf(stdout, "step 2. %s, devnum = %d\n", path, devnum);
      for (i = 0; i < devnum; i++) {
        if (strcmp(mdev[i], path) == 0) {
          flag = 0;
          break;
        }
      }
      if (flag == 1) {
        fprintf(stdout, "need mount %s\n", path);
        snprintf(cmd, sizeof(cmd) - 1, "sudo mount %s /mnt", path);
        if (system(cmd) < 0) {
          fprintf(stderr, "system() %s failed: %s\n", path, strerror(errno));
        }
      }
    }
  }
  if (errno != 0) {
    perror("readdir failed");
    exit(1);
  }
  sleep(10);
  snprintf(cmd, sizeof(cmd) - 1, "sudo umount /mnt");
  if (system(cmd) < 0) {
    fprintf(stderr, "system() %s failed: %s\n", path, strerror(errno));
  }
  closedir(dirp);
  fclose(mtab);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4340,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xda0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xda7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xda2(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    12b2 <main+0x72>
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xd7d(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1070 <opendir@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    12ee <main+0xae>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xd51(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    0x2cd3(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xd3f(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    0x2cc0(%rip),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rdi
call   1100 <readdir@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     1351 <main+0x111>
mov    0x2c93(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rax
mov    (%rax),%rdx
lea    0xdab(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
jmp    1317 <main+0xd7>
mov    0x2c78(%rip),%rax
cmpq   $0x0,(%rax)
je     1378 <main+0x138>
lea    0xcf1(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    -0x28(%rbp),%rdi
call   10c0 <rewinddir@plt>
movl   $0x0,-0x4004(%rbp)
mov    -0x30(%rbp),%rdi
movslq -0x4004(%rbp),%rax
lea    -0x4000(%rbp),%rdx
imul   $0xff,%rax,%rax
add    %rax,%rdx
lea    0xcd9(%rip),%rsi
call   10b0 <fscanf@plt>
mov    0x2c2e(%rip),%rcx
cmp    (%rcx),%rax
je     148b <main+0x24b>
jmp    13c8 <main+0x188>
mov    -0x30(%rbp),%rdi
call   1160 <getc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     13e2 <main+0x1a2>
jmp    13c8 <main+0x188>
movslq -0x4004(%rbp),%rax
lea    -0x4000(%rbp),%rdi
imul   $0xff,%rax,%rax
add    %rax,%rdi
lea    0xc68(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1486 <main+0x246>
movslq -0x4004(%rbp),%rax
lea    -0x4000(%rbp),%rdi
imul   $0xff,%rax,%rax
add    %rax,%rdi
lea    0xc3d(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1486 <main+0x246>
mov    0x2b79(%rip),%rax
mov    (%rax),%edi
movslq -0x4004(%rbp),%rax
lea    -0x4000(%rbp),%rdx
imul   $0xff,%rax,%rax
add    %rax,%rdx
lea    0xc0a(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    -0x4004(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4004(%rbp)
jmp    138b <main+0x14b>
movslq -0x4004(%rbp),%rax
lea    -0x4000(%rbp),%rdi
imul   $0xff,%rax,%rax
add    %rax,%rdi
lea    0xc0f(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x4004(%rbp),%eax
mov    %eax,-0x4008(%rbp)
mov    0x2b09(%rip),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rdi
call   1100 <readdir@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     171e <main+0x4de>
movl   $0x1,-0x431c(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1507 <main+0x2c7>
jmp    14ce <main+0x28e>
lea    -0x4210(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    (%rax),%r8
mov    $0xfe,%esi
lea    0xb5f(%rip),%rdx
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x4210(%rbp),%rdi
lea    -0x4110(%rbp),%rsi
mov    $0xfe,%edx
call   1050 <readlink@plt>
cmp    $0x0,%rax
jge    1564 <main+0x324>
lea    0xb35(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
lea    -0x4110(%rbp),%rdi
mov    $0x2f,%esi
call   10a0 <strrchr@plt>
mov    %rax,-0x4318(%rbp)
cmpq   $0x0,-0x4318(%rbp)
je     1719 <main+0x4d9>
mov    -0x4318(%rbp),%rdi
lea    0xadd(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1719 <main+0x4d9>
lea    -0x4210(%rbp),%rdi
mov    -0x4318(%rbp),%rcx
mov    $0xfe,%esi
lea    0xad4(%rip),%rdx
mov    $0x0,%al
call   1090 <snprintf@plt>
mov    0x29f4(%rip),%rax
mov    (%rax),%edi
lea    -0x4210(%rbp),%rdx
mov    -0x4008(%rbp),%ecx
lea    0xab7(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
movl   $0x0,-0x4004(%rbp)
mov    -0x4004(%rbp),%eax
cmp    -0x4008(%rbp),%eax
jge    1663 <main+0x423>
movslq -0x4004(%rbp),%rax
lea    -0x4000(%rbp),%rdi
imul   $0xff,%rax,%rax
add    %rax,%rdi
lea    -0x4210(%rbp),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
jne    164a <main+0x40a>
movl   $0x0,-0x431c(%rbp)
jmp    1663 <main+0x423>
jmp    164f <main+0x40f>
mov    -0x4004(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4004(%rbp)
jmp    15fb <main+0x3bb>
cmpl   $0x1,-0x431c(%rbp)
jne    1714 <main+0x4d4>
mov    0x2951(%rip),%rax
mov    (%rax),%edi
lea    -0x4210(%rbp),%rdx
lea    0xa33(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
lea    -0x4310(%rbp),%rdi
lea    -0x4210(%rbp),%rcx
mov    $0xfe,%esi
lea    0xa21(%rip),%rdx
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x4310(%rbp),%rdi
call   1080 <system@plt>
cmp    $0x0,%rax
jge    170f <main+0x4cf>
mov    0x290c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x432c(%rbp)
lea    -0x4210(%rbp),%rax
mov    %rax,-0x4328(%rbp)
mov    0x28e7(%rip),%rax
mov    (%rax),%rdi
call   1140 <strerror@plt>
mov    -0x432c(%rbp),%edi
mov    -0x4328(%rbp),%rdx
mov    %rax,%rcx
lea    0x9d4(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
jmp    1714 <main+0x4d4>
jmp    1719 <main+0x4d9>
jmp    14ce <main+0x28e>
mov    0x28ab(%rip),%rax
cmpq   $0x0,(%rax)
je     1745 <main+0x505>
lea    0x924(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    $0xa,%edi
call   1150 <sleep@plt>
lea    -0x4310(%rbp),%rdi
mov    $0xfe,%esi
lea    0x992(%rip),%rdx
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x4310(%rbp),%rdi
call   1080 <system@plt>
cmp    $0x0,%rax
jge    17c9 <main+0x589>
mov    0x2852(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x433c(%rbp)
lea    -0x4210(%rbp),%rax
mov    %rax,-0x4338(%rbp)
mov    0x282d(%rip),%rax
mov    (%rax),%rdi
call   1140 <strerror@plt>
mov    -0x433c(%rbp),%edi
mov    -0x4338(%rbp),%rdx
mov    %rax,%rcx
lea    0x91a(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   10d0 <closedir@plt>
mov    -0x30(%rbp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x4340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x42d8,%rsp
lea    0xdba(%rip),%rdi
lea    0xdbd(%rip),%rsi
call   1110 <fopen@plt>
test   %rax,%rax
je     167c <main+0x43c>
mov    %rax,%rbx
lea    0xd89(%rip),%rdi
call   1070 <opendir@plt>
mov    0x2d45(%rip),%r15
mov    (%r15),%edi
test   %rax,%rax
je     1695 <main+0x455>
mov    %rax,%r14
lea    0xda8(%rip),%rsi
lea    0xd60(%rip),%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    0x2d22(%rip),%rax
movq   $0x0,(%rax)
mov    %r14,%rdi
call   1100 <readdir@plt>
test   %rax,%rax
je     12ed <main+0xad>
lea    0xe27(%rip),%rbp
nopl   0x0(%rax)
mov    (%r15),%edi
mov    (%rax),%rdx
mov    %rbp,%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    %r14,%rdi
call   1100 <readdir@plt>
test   %rax,%rax
jne    12d0 <main+0x90>
mov    0x2cdc(%rip),%rax
cmpq   $0x0,(%rax)
jne    1673 <main+0x433>
mov    %r14,%rdi
call   10c0 <rewinddir@plt>
lea    0x310(%rsp),%rbp
lea    0xd72(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   10b0 <fscanf@plt>
mov    0x2cc1(%rip),%rcx
xor    %r13d,%r13d
cmp    (%rcx),%rax
jne    15a3 <main+0x363>
lea    0xd7f(%rip),%rsi
mov    %rbp,%rdi
mov    $0x1,%edx
call   1030 <strncpy@plt>
mov    0x2c82(%rip),%rax
movq   $0x0,(%rax)
mov    %r14,%rdi
call   1100 <readdir@plt>
test   %rax,%rax
je     1509 <main+0x2c9>
mov    %r13d,%ecx
mov    %rcx,0x8(%rsp)
lea    0x110(%rsp),%r15
jmp    13e1 <main+0x1a1>
mov    0x2c49(%rip),%rax
mov    (%rax),%edi
lea    0xd32(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xfe,%esi
lea    0xd23(%rip),%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1090 <snprintf@plt>
mov    %rbp,%rdi
call   1080 <system@plt>
test   %rax,%rax
js     14d6 <main+0x296>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1100 <readdir@plt>
test   %rax,%rax
je     1509 <main+0x2c9>
mov    (%rax),%r8
cmpb   $0x2e,(%r8)
je     13d0 <main+0x190>
mov    %r15,%rdi
mov    $0xfe,%esi
lea    0xc8b(%rip),%rdx
lea    0xc00(%rip),%rcx
xor    %eax,%eax
call   1090 <snprintf@plt>
mov    %r15,%rdi
lea    0x210(%rsp),%rbp
mov    %rbp,%rsi
mov    $0xfe,%edx
call   1050 <readlink@plt>
test   %rax,%rax
js     165d <main+0x41d>
mov    %rbp,%rdi
mov    $0x2f,%esi
call   10a0 <strrchr@plt>
test   %rax,%rax
je     13d0 <main+0x190>
mov    %rax,%rbp
mov    %rax,%rdi
lea    0xc2e(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13d0 <main+0x190>
mov    %r15,%rdi
mov    $0xfe,%esi
lea    0xc31(%rip),%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1090 <snprintf@plt>
mov    0x2b4e(%rip),%rax
mov    (%rax),%edi
lea    0xc1e(%rip),%rsi
mov    %r15,%rdx
mov    %r13d,%ecx
xor    %eax,%eax
call   10f0 <fprintf@plt>
test   %r13d,%r13d
jle    1378 <main+0x138>
mov    0x8(%rsp),%rbp
lea    0x310(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15,%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
je     13d0 <main+0x190>
add    $0xff,%r12
add    $0xffffffffffffffff,%rbp
jne    14b0 <main+0x270>
jmp    1378 <main+0x138>
mov    0x2afb(%rip),%rax
mov    (%rax),%ebp
mov    0x2aea(%rip),%rax
mov    (%rax),%rdi
call   1140 <strerror@plt>
mov    %ebp,%edi
lea    0xbe5(%rip),%rsi
mov    %r15,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10f0 <fprintf@plt>
jmp    13d0 <main+0x190>
mov    0x2ac0(%rip),%rax
cmpq   $0x0,(%rax)
jne    1673 <main+0x433>
mov    $0xa,%edi
call   1150 <sleep@plt>
lea    0xbc9(%rip),%rdx
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xfe,%esi
xor    %eax,%eax
call   1090 <snprintf@plt>
mov    %rbp,%rdi
call   1080 <system@plt>
test   %rax,%rax
jns    157f <main+0x33f>
mov    0x2a85(%rip),%rax
mov    (%rax),%ebp
mov    0x2a74(%rip),%rax
mov    (%rax),%rdi
call   1140 <strerror@plt>
lea    0xb71(%rip),%rsi
lea    0x110(%rsp),%rdx
mov    %ebp,%edi
mov    %rax,%rcx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    %r14,%rdi
call   10d0 <closedir@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x42d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x310(%rsp),%rbp
lea    0xab7(%rip),%r15
lea    0xace(%rip),%r12
xor    %r13d,%r13d
jmp    1600 <main+0x3c0>
movslq %r13d,%rax
mov    %rax,%rcx
shl    $0x8,%rcx
sub    %rax,%rcx
lea    (%rsp,%rcx,1),%rbp
add    $0x310,%rbp
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
call   10b0 <fscanf@plt>
mov    0x29fd(%rip),%rcx
cmp    (%rcx),%rax
je     1333 <main+0xf3>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1160 <getc@plt>
cmp    $0xa,%al
jne    1600 <main+0x3c0>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    15be <main+0x37e>
mov    %rbp,%rdi
lea    0xa46(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     15be <main+0x37e>
mov    0x2987(%rip),%rax
mov    (%rax),%edi
lea    0xa30(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
add    $0x1,%r13d
jmp    15be <main+0x37e>
lea    0xa26(%rip),%rdi
call   1120 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
lea    0x9e0(%rip),%rdi
jmp    1664 <main+0x424>
mov    0x2955(%rip),%rax
mov    (%rax),%edi
lea    0x992(%rip),%rsi
lea    0x97f(%rip),%rdx
jmp    16a3 <main+0x463>
lea    0x992(%rip),%rsi
lea    0x95d(%rip),%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    $0x1,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
%struct.dirent = type { i8* }
@.str = [18 x i8] c"/dev/disk/by-uuid\00"
@.str.1 = [10 x i8] c"/etc/mtab\00"
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [16 x i8] c"open %s failed\0A\00"
@stdout = global i32 0
@.str.4 = [19 x i8] c"opendir %s failed\0A\00"
@.str.5 = [25 x i8] c"opendir %s successfully\0A\00"
@errno = global i64 0
@.str.6 = [4 x i8] c"%s\0A\00"
@.str.7 = [15 x i8] c"readdir failed\00"
@.str.8 = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.9 = [8 x i8] c"/dev/sd\00"
@.str.10 = [9 x i8] c"/dev/sda\00"
@.str.11 = [10 x i8] c"mdev: %s\0A\00"
@.str.12 = [1 x i8] zeroinitializer
@.str.13 = [6 x i8] c"%s/%s\00"
@.str.14 = [16 x i8] c"readlink failed\00"
@.str.15 = [5 x i8] c"/sda\00"
@.str.16 = [7 x i8] c"/dev%s\00"
@.str.17 = [25 x i8] c"step 2. %s, devnum = %d\0A\00"
@.str.18 = [15 x i8] c"need mount %s\0A\00"
@.str.19 = [19 x i8] c"sudo mount %s /mnt\00"
@.str.20 = [24 x i8] c"system() %s failed: %s\0A\00"
@.str.21 = [17 x i8] c"sudo umount /mnt\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.dirent*
%11 = alloca [64 x [255 x i8]]
%12 = alloca i32
%13 = alloca i32
%14 = alloca [255 x i8]
%15 = alloca [255 x i8]
%16 = alloca [255 x i8]
%17 = alloca i8*
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %7
%19 = load i8*, i8** %7
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %20, i32** %9
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %27
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = load i8*, i8** %7
%25 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %2
%28 = load i8*, i8** %6
%29 = call i32* @opendir(i8* %28)
store i32* %29, i32** %8
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %36
31: ; preds = %27
%32 = load i32, i32* @stdout
%33 = load i8*, i8** %6
%34 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %33)
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %27
%37 = load i32, i32* @stdout
%38 = load i8*, i8** %6
%39 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %38)
br label %40
40: ; preds = %36
store i64 0, i64* @errno
br label %41
41: ; preds = %45, %40
%42 = load i32*, i32** %8
%43 = call %struct.dirent* @readdir(i32* %42)
store %struct.dirent* %43, %struct.dirent** %10
%44 = icmp ne %struct.dirent* %43, null
br i1 %44, label %45, label %51
45: ; preds = %41
%46 = load i32, i32* @stdout
%47 = load %struct.dirent*, %struct.dirent** %10
%48 = getelementptr inbounds %struct.dirent, %struct.dirent* %47, i32 0, i32 0
%49 = load i8*, i8** %48
%50 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %49)
br label %41
51: ; preds = %41
%52 = load i64, i64* @errno
%53 = icmp ne i64 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %51
%58 = load i32*, i32** %8
%59 = call i32 @rewinddir(i32* %58)
store i32 0, i32* %12
br label %60
60: ; preds = %99, %57
%61 = load i32*, i32** %9
%62 = load i32, i32* %12
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %11, i64 0, i64 %63
%65 = getelementptr inbounds [255 x i8], [255 x i8]* %64, i64 0, i64 0
%66 = call i64 @fscanf(i32* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %65)
%67 = load i64, i64* @EOF
%68 = icmp ne i64 %66, %67
br i1 %68, label %69, label %100
69: ; preds = %60
br label %70
70: ; preds = %75, %69
%71 = load i32*, i32** %9
%72 = call signext i8 @getc(i32* %71)
%73 = sext i8 %72 to i32
%74 = icmp ne i32 %73, 10
br i1 %74, label %75, label %76
75: ; preds = %70
br label %70
76: ; preds = %70
%77 = load i32, i32* %12
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %11, i64 0, i64 %78
%80 = getelementptr inbounds [255 x i8], [255 x i8]* %79, i64 0, i64 0
%81 = call i64 @strncmp(i8* %80, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 7)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %99
83: ; preds = %76
%84 = load i32, i32* %12
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %11, i64 0, i64 %85
%87 = getelementptr inbounds [255 x i8], [255 x i8]* %86, i64 0, i64 0
%88 = call i64 @strncmp(i8* %87, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 8)
%89 = icmp ne i64 %88, 0
br i1 %89, label %90, label %99
90: ; preds = %83
%91 = load i32, i32* @stdout
%92 = load i32, i32* %12
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %11, i64 0, i64 %93
%95 = getelementptr inbounds [255 x i8], [255 x i8]* %94, i64 0, i64 0
%96 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* %95)
%97 = load i32, i32* %12
%98 = add nsw i32 %97, 1
store i32 %98, i32* %12
br label %99
99: ; preds = %90, %83, %76
br label %60
100: ; preds = %60
%101 = load i32, i32* %12
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %11, i64 0, i64 %102
%104 = getelementptr inbounds [255 x i8], [255 x i8]* %103, i64 0, i64 0
%105 = call i32 @strncpy(i8* %104, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i32 1)
%106 = load i32, i32* %12
store i32 %106, i32* %13
store i64 0, i64* @errno
br label %107
107: ; preds = %189, %119, %100
%108 = load i32*, i32** %8
%109 = call %struct.dirent* @readdir(i32* %108)
store %struct.dirent* %109, %struct.dirent** %10
%110 = icmp ne %struct.dirent* %109, null
br i1 %110, label %111, label %190
111: ; preds = %107
store i32 1, i32* %18
%112 = load %struct.dirent*, %struct.dirent** %10
%113 = getelementptr inbounds %struct.dirent, %struct.dirent* %112, i32 0, i32 0
%114 = load i8*, i8** %113
%115 = getelementptr inbounds i8, i8* %114, i64 0
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = icmp eq i32 %117, 46
br i1 %118, label %119, label %120
119: ; preds = %111
br label %107
120: ; preds = %111
%121 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%122 = load i8*, i8** %6
%123 = load %struct.dirent*, %struct.dirent** %10
%124 = getelementptr inbounds %struct.dirent, %struct.dirent* %123, i32 0, i32 0
%125 = load i8*, i8** %124
%126 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %121, i32 254, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8* %122, i8* %125)
%127 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%128 = getelementptr inbounds [255 x i8], [255 x i8]* %14, i64 0, i64 0
%129 = call i64 @readlink(i8* %127, i8* %128, i32 254)
%130 = icmp slt i64 %129, 0
br i1 %130, label %131, label %134
131: ; preds = %120
%132 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0))
%133 = call i32 @exit(i32 1)
unreachable
134: ; preds = %120
%135 = getelementptr inbounds [255 x i8], [255 x i8]* %14, i64 0, i64 0
%136 = call i8* @strrchr(i8* %135, i8 signext 47)
store i8* %136, i8** %17
%137 = load i8*, i8** %17
%138 = icmp ne i8* %137, null
br i1 %138, label %139, label %189
139: ; preds = %134
%140 = load i8*, i8** %17
%141 = call i64 @strncmp(i8* %140, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 4)
%142 = icmp ne i64 %141, 0
br i1 %142, label %143, label %189
143: ; preds = %139
%144 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%145 = load i8*, i8** %17
%146 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %144, i32 254, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* %145)
%147 = load i32, i32* @stdout
%148 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%149 = load i32, i32* %13
%150 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %147, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i8* %148, i32 %149)
store i32 0, i32* %12
br label %151
151: ; preds = %165, %143
%152 = load i32, i32* %12
%153 = load i32, i32* %13
%154 = icmp slt i32 %152, %153
br i1 %154, label %155, label %168
155: ; preds = %151
%156 = load i32, i32* %12
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %11, i64 0, i64 %157
%159 = getelementptr inbounds [255 x i8], [255 x i8]* %158, i64 0, i64 0
%160 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%161 = call i64 @strcmp(i8* %159, i8* %160)
%162 = icmp eq i64 %161, 0
br i1 %162, label %163, label %164
163: ; preds = %155
store i32 0, i32* %18
br label %168
164: ; preds = %155
br label %165
165: ; preds = %164
%166 = load i32, i32* %12
%167 = add nsw i32 %166, 1
store i32 %167, i32* %12
br label %151
168: ; preds = %163, %151
%169 = load i32, i32* %18
%170 = icmp eq i32 %169, 1
br i1 %170, label %171, label %188
171: ; preds = %168
%172 = load i32, i32* @stdout
%173 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%174 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %172, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %173)
%175 = getelementptr inbounds [255 x i8], [255 x i8]* %16, i64 0, i64 0
%176 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%177 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %175, i32 254, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i8* %176)
%178 = getelementptr inbounds [255 x i8], [255 x i8]* %16, i64 0, i64 0
%179 = call i64 @system(i8* %178)
%180 = icmp slt i64 %179, 0
br i1 %180, label %181, label %187
181: ; preds = %171
%182 = load i32, i32* @stderr
%183 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%184 = load i64, i64* @errno
%185 = call i8* @strerror(i64 %184)
%186 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %182, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0), i8* %183, i8* %185)
br label %187
187: ; preds = %181, %171
br label %188
188: ; preds = %187, %168
br label %189
189: ; preds = %188, %139, %134
br label %107
190: ; preds = %107
%191 = load i64, i64* @errno
%192 = icmp ne i64 %191, 0
br i1 %192, label %193, label %196
193: ; preds = %190
%194 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%195 = call i32 @exit(i32 1)
unreachable
196: ; preds = %190
%197 = call i32 @sleep(i32 10)
%198 = getelementptr inbounds [255 x i8], [255 x i8]* %16, i64 0, i64 0
%199 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %198, i32 254, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0))
%200 = getelementptr inbounds [255 x i8], [255 x i8]* %16, i64 0, i64 0
%201 = call i64 @system(i8* %200)
%202 = icmp slt i64 %201, 0
br i1 %202, label %203, label %209
203: ; preds = %196
%204 = load i32, i32* @stderr
%205 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%206 = load i64, i64* @errno
%207 = call i8* @strerror(i64 %206)
%208 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %204, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0), i8* %205, i8* %207)
br label %209
209: ; preds = %203, %196
%210 = load i32*, i32** %8
%211 = call i32 @closedir(i32* %210)
%212 = load i32*, i32** %9
%213 = call i32 @fclose(i32* %212)
ret i32 0
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [18 x i8] c"/dev/disk/by-uuid\00"
@.str.1 = [10 x i8] c"/etc/mtab\00"
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [16 x i8] c"open %s failed\0A\00"
@stdout = global i32 0
@.str.4 = [19 x i8] c"opendir %s failed\0A\00"
@.str.5 = [25 x i8] c"opendir %s successfully\0A\00"
@errno = global i64 0
@.str.6 = [4 x i8] c"%s\0A\00"
@.str.7 = [15 x i8] c"readdir failed\00"
@.str.8 = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.9 = [8 x i8] c"/dev/sd\00"
@.str.10 = [9 x i8] c"/dev/sda\00"
@.str.11 = [10 x i8] c"mdev: %s\0A\00"
@.str.12 = [1 x i8] zeroinitializer
@.str.13 = [6 x i8] c"%s/%s\00"
@.str.14 = [16 x i8] c"readlink failed\00"
@.str.15 = [5 x i8] c"/sda\00"
@.str.16 = [7 x i8] c"/dev%s\00"
@.str.17 = [25 x i8] c"step 2. %s, devnum = %d\0A\00"
@.str.18 = [15 x i8] c"need mount %s\0A\00"
@.str.19 = [19 x i8] c"sudo mount %s /mnt\00"
@.str.20 = [24 x i8] c"system() %s failed: %s\0A\00"
@.str.21 = [17 x i8] c"sudo umount /mnt\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [64 x [255 x i8]]
%4 = alloca [255 x i8]
%5 = alloca [255 x i8]
%6 = alloca [255 x i8]
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = tail call i32* @opendir(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i32* %14, null
%16 = load i32, i32* @stdout
br i1 %15, label %17, label %20
17: ; preds = %13
%18 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %13
%21 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* @errno
%22 = tail call %struct.dirent* @readdir(i32* %14)
%23 = icmp eq %struct.dirent* %22, null
br i1 %23, label %32, label %24
24: ; preds = %20, %24
%25 = phi %struct.dirent* [ %30, %24 ], [ %22, %20 ]
%26 = load i32, i32* @stdout
%27 = getelementptr inbounds %struct.dirent, %struct.dirent* %25, i64 0, i32 0
%28 = load i8*, i8** %27
%29 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %28)
%30 = tail call %struct.dirent* @readdir(i32* %14)
%31 = icmp eq %struct.dirent* %30, null
br i1 %31, label %32, label %24
32: ; preds = %24, %20
%33 = load i64, i64* @errno
%34 = icmp eq i64 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%37 = tail call i32 @exit(i32 1)
unreachable
38: ; preds = %32
%39 = tail call i32 @rewinddir(i32* %14)
%40 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %3, i64 0, i64 0, i64 0
%41 = call i64 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %40)
%42 = load i64, i64* @EOF
%43 = icmp eq i64 %41, %42
br i1 %43, label %67, label %44
44: ; preds = %38, %60
%45 = phi i8* [ %63, %60 ], [ %40, %38 ]
%46 = phi i32 [ %61, %60 ], [ 0, %38 ]
br label %47
47: ; preds = %44, %47
%48 = call signext i8 @getc(i32* %7)
%49 = icmp eq i8 %48, 10
br i1 %49, label %50, label %47
50: ; preds = %47
%51 = call i64 @strncmp(i8* %45, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 7)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %60
53: ; preds = %50
%54 = call i64 @strncmp(i8* %45, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 8)
%55 = icmp eq i64 %54, 0
br i1 %55, label %60, label %56
56: ; preds = %53
%57 = load i32, i32* @stdout
%58 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* %45)
%59 = add nsw i32 %46, 1
br label %60
60: ; preds = %56, %53, %50
%61 = phi i32 [ %59, %56 ], [ %46, %53 ], [ %46, %50 ]
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %3, i64 0, i64 %62, i64 0
%64 = call i64 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %63)
%65 = load i64, i64* @EOF
%66 = icmp eq i64 %64, %65
br i1 %66, label %67, label %44
67: ; preds = %60, %38
%68 = phi i32 [ 0, %38 ], [ %61, %60 ]
%69 = phi i8* [ %40, %38 ], [ %63, %60 ]
%70 = call i32 @strncpy(i8* %69, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i32 1)
%71 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%72 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%73 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
store i64 0, i64* @errno
%74 = call %struct.dirent* @readdir(i32* %14)
%75 = icmp eq %struct.dirent* %74, null
br i1 %75, label %124, label %76
76: ; preds = %67
%77 = icmp sgt i32 %68, 0
%78 = zext i32 %68 to i64
br label %79
79: ; preds = %76, %121
%80 = phi %struct.dirent* [ %74, %76 ], [ %122, %121 ]
%81 = getelementptr inbounds %struct.dirent, %struct.dirent* %80, i64 0, i32 0
%82 = load i8*, i8** %81
%83 = load i8, i8* %82
%84 = icmp eq i8 %83, 46
br i1 %84, label %121, label %85
85: ; preds = %79
%86 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %72, i32 254, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %82)
%87 = call i64 @readlink(i8* %72, i8* %71, i32 254)
%88 = icmp slt i64 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %85
%90 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0))
%91 = call i32 @exit(i32 1)
unreachable
92: ; preds = %85
%93 = call i8* @strrchr(i8* %71, i8 signext 47)
%94 = icmp eq i8* %93, null
br i1 %94, label %121, label %95
95: ; preds = %92
%96 = call i64 @strncmp(i8* %93, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 4)
%97 = icmp eq i64 %96, 0
br i1 %97, label %121, label %98
98: ; preds = %95
%99 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %72, i32 254, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* %93)
%100 = load i32, i32* @stdout
%101 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i8* %72, i32 %68)
br i1 %77, label %104, label %110
102: ; preds = %104
%103 = icmp eq i64 %109, %78
br i1 %103, label %110, label %104
104: ; preds = %98, %102
%105 = phi i64 [ %109, %102 ], [ 0, %98 ]
%106 = getelementptr inbounds [64 x [255 x i8]], [64 x [255 x i8]]* %3, i64 0, i64 %105, i64 0
%107 = call i64 @strcmp(i8* %106, i8* %72)
%108 = icmp eq i64 %107, 0
%109 = add nuw nsw i64 %105, 1
br i1 %108, label %121, label %102
110: ; preds = %102, %98
%111 = load i32, i32* @stdout
%112 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %72)
%113 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %73, i32 254, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i8* %72)
%114 = call i64 @system(i8* %73)
%115 = icmp slt i64 %114, 0
br i1 %115, label %116, label %121
116: ; preds = %110
%117 = load i32, i32* @stderr
%118 = load i64, i64* @errno
%119 = call i8* @strerror(i64 %118)
%120 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %117, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0), i8* %72, i8* %119)
br label %121
121: ; preds = %104, %92, %95, %110, %116, %79
%122 = call %struct.dirent* @readdir(i32* %14)
%123 = icmp eq %struct.dirent* %122, null
br i1 %123, label %124, label %79
124: ; preds = %121, %67
%125 = load i64, i64* @errno
%126 = icmp eq i64 %125, 0
br i1 %126, label %130, label %127
127: ; preds = %124
%128 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%129 = call i32 @exit(i32 1)
unreachable
130: ; preds = %124
%131 = call i32 @sleep(i32 10)
%132 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %73, i32 254, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0))
%133 = call i64 @system(i8* %73)
%134 = icmp slt i64 %133, 0
br i1 %134, label %135, label %140
135: ; preds = %130
%136 = load i32, i32* @stderr
%137 = load i64, i64* @errno
%138 = call i8* @strerror(i64 %137)
%139 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %136, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0), i8* %72, i8* %138)
br label %140
140: ; preds = %135, %130
%141 = call i32 @closedir(i32* %14)
%142 = call i32 @fclose(i32* %7)
ret i32 0
}