#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 stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int EXIT_SUCCESS;
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int chmod(char *, int);
int errno;
int fprintf(int /*<<< orphan*/, char *, ...);
int lstat(char *, struct stat *);
int /*<<< orphan*/ perror(char *);
int rename(char *, char *);
int /*<<< orphan*/ stdout;
int strlen(char *);
int toupper(char);
int unlink(char *);
int main(int argc, char **argv) {
  int error = 0;
  int command = 0;
  int options = 0;
  int fprintf_return = 0;
  int lstat_return = 0;
  int unlink_return = 0;
  int rename_return = 0;
  int chmod_return = 0;
  struct stat lstat_file;
  if (argc < 3 || argc > 4) {
    fprintf_return =
        fprintf(stdout,
                "Usage: %s <type operation: eE, rR, cC> <fichier a traiter> "
                "[<options: nom du fichier a renommer, rR, wW>] \n",
                argv[0]);
    if (fprintf_return < 0) {
      perror("Error fprintf");
      return fprintf_return;
    }
    return -1;
  }
  if (strlen(argv[1]) != 1) {
    fprintf_return =
        fprintf(stdout,
                "Usage: %s <type operation: eE, rR, cC> <fichier a traiter> "
                "[<options: nom du fichier a renommer, rR, wW>] \n",
                argv[0]);
    if (fprintf_return < 0) {
      perror("Error fprintf");
      return fprintf_return;
    }
    return -1;
  }
  lstat_return = lstat(argv[2], &lstat_file);
  if (lstat_return == -1) {
    error = errno;
    perror("Error lstat");
    return error;
  }
  if (S_ISDIR(lstat_file.st_mode)) {
    fprintf_return = fprintf(stdout, "C'est un repertoire ! \n");
    if (fprintf_return < 0) {
      perror("Error fprintf");
      return fprintf_return;
    }
    return EXIT_SUCCESS;
  } else {
    command = toupper((char)argv[1][0]);
    switch (command) {
    case 'E':
      if (argc != 3) {
        fprintf_return = fprintf(
            stdout,
            "Usage: %s <type operation: eE, rR, cC> <fichier a traiter> "
            "[<options: nom du fichier a renommer, rR, wW>] \n",
            argv[0]);
        if (fprintf_return < 0) {
          perror("Error fprintf");
          return fprintf_return;
        }
        return -1;
      }
      unlink_return = unlink(argv[2]);
      if (unlink_return == -1) {
        error = errno;
        perror("Error unlink");
        return error;
      }
      fprintf_return = fprintf(stdout, "Fichier efface ! \n");
      if (fprintf_return < 0) {
        perror("Error fprintf");
        return fprintf_return;
      }
      return EXIT_SUCCESS;
    case 'R':
      if (argc != 4) {
        fprintf_return = fprintf(
            stdout,
            "Usage: %s <type operation: eE, rR, cC> <fichier a traiter> "
            "[<options: nom du fichier a renommer, rR, wW>] \n",
            argv[0]);
        if (fprintf_return < 0) {
          perror("Error fprintf");
          return fprintf_return;
        }
        return -1;
      }
      rename_return = rename(argv[2], argv[3]);
      if (rename_return == -1) {
        error = errno;
        perror("Error rename");
        return error;
      }
      fprintf_return = fprintf(stdout, "Fichier renomme ! \n");
      if (fprintf_return < 0) {
        perror("Error fprintf");
        return fprintf_return;
      }
      return EXIT_SUCCESS;
    case 'C':
      if (argc != 4) {
        fprintf_return = fprintf(
            stdout,
            "Usage: %s <type operation: eE, rR, cC> <fichier a traiter> "
            "[<options: nom du fichier a renommer, rR, wW>] \n",
            argv[0]);
        if (fprintf_return < 0) {
          perror("Error fprintf");
          return fprintf_return;
        }
        return -1;
      }
      if (strlen(argv[3]) != 1) {
        fprintf_return = fprintf(
            stdout,
            "Usage: %s <type operation: eE, rR, cC> <fichier a traiter> "
            "[<options: nom du fichier a renommer, rR, wW>] \n",
            argv[0]);
        if (fprintf_return < 0) {
          perror("Error fprintf");
          return fprintf_return;
        }
        return -1;
      }
      options = toupper(argv[3][0]);
      switch (options) {
      case 'R':
        chmod_return = chmod(argv[2], 00600);
        if (chmod_return == -1) {
          error = errno;
          perror("Error chmod");
          return error;
        }
        fprintf_return = fprintf(stdout, "Droits modifie ! \n");
        if (fprintf_return < 0) {
          perror("Error fprintf");
          return fprintf_return;
        }
        return EXIT_SUCCESS;
      case 'W':
        chmod_return = chmod(argv[2], 00666);
        if (chmod_return == -1) {
          error = errno;
          perror("Error chmod");
          return error;
        }
        fprintf_return = fprintf(stdout, "Droits modifie ! \n");
        if (fprintf_return < 0) {
          perror("Error fprintf");
          return fprintf_return;
        }
        return EXIT_SUCCESS;
      default:
        fprintf_return = fprintf(
            stdout,
            "Usage: %s <type operation: eE, rR, cC> <fichier a traiter> "
            "[<options: nom du fichier a renommer, rR, wW>] \n",
            argv[0]);
        if (fprintf_return < 0) {
          perror("Error fprintf");
          return fprintf_return;
        }
        return EXIT_SUCCESS;
      }
    default:
      fprintf_return =
          fprintf(stdout,
                  "Usage: %s <type operation: eE, rR, cC> <fichier a traiter> "
                  "[<options: nom du fichier a renommer, rR, wW>] \n",
                  argv[0]);
      if (fprintf_return < 0) {
        perror("Error fprintf");
        return fprintf_return;
      }
      return EXIT_SUCCESS;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11f2 <main+0x62>
cmpl   $0x4,-0x8(%rbp)
jle    1240 <main+0xb0>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdf7(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1234 <main+0xa4>
lea    0xe48(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
movl   $0xffffffff,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <strlen@plt>
cmp    $0x1,%eax
je     12a4 <main+0x114>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd93(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1298 <main+0x108>
lea    0xde4(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
movl   $0xffffffff,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x38(%rbp),%rsi
call   1070 <lstat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    12e5 <main+0x155>
mov    0x2d17(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    0xda5(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    -0x38(%rbp),%edi
call   1060 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1343 <main+0x1b3>
mov    0x2cda(%rip),%rax
mov    (%rax),%edi
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1332 <main+0x1a2>
lea    0xd4a(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2c97(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x3c(%rbp)
sub    $0x43,%eax
je     1556 <main+0x3c6>
jmp    136a <main+0x1da>
mov    -0x3c(%rbp),%eax
sub    $0x45,%eax
je     138c <main+0x1fc>
jmp    137b <main+0x1eb>
mov    -0x3c(%rbp),%eax
sub    $0x52,%eax
je     146d <main+0x2dd>
jmp    17b9 <main+0x629>
cmpl   $0x3,-0x8(%rbp)
je     13e4 <main+0x254>
mov    0x2c3b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc53(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    13d8 <main+0x248>
lea    0xca4(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
movl   $0xffffffff,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    1421 <main+0x291>
mov    0x2bdb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    0xc8d(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2bb0(%rip),%rax
mov    (%rax),%edi
lea    0xc7a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    145c <main+0x2cc>
lea    0xc20(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2b6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
cmpl   $0x4,-0x8(%rbp)
je     14c5 <main+0x335>
mov    0x2b5a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb72(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    14b9 <main+0x329>
lea    0xbc3(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
movl   $0xffffffff,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   10b0 <rename@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
jne    150a <main+0x37a>
mov    0x2af2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    0xbc4(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2ac7(%rip),%rax
mov    (%rax),%edi
lea    0xbb1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1545 <main+0x3b5>
lea    0xb37(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2a84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
cmpl   $0x4,-0x8(%rbp)
je     15ae <main+0x41e>
mov    0x2a71(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xa89(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    15a2 <main+0x412>
lea    0xada(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
movl   $0xffffffff,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <strlen@plt>
cmp    $0x1,%eax
je     1612 <main+0x482>
mov    0x2a0d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xa25(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1606 <main+0x476>
lea    0xa76(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
movl   $0xffffffff,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x40(%rbp)
sub    $0x52,%eax
je     164a <main+0x4ba>
jmp    1639 <main+0x4a9>
mov    -0x40(%rbp),%eax
sub    $0x57,%eax
je     16d8 <main+0x548>
jmp    1766 <main+0x5d6>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x180,%esi
call   1090 <chmod@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0xffffffff,-0x30(%rbp)
jne    168c <main+0x4fc>
mov    0x2970(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    0xa63(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2945(%rip),%rax
mov    (%rax),%edi
lea    0xa4f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    16c7 <main+0x537>
lea    0x9b5(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2902(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x1b6,%esi
call   1090 <chmod@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0xffffffff,-0x30(%rbp)
jne    171a <main+0x58a>
mov    0x28e2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    0x9d5(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x28b7(%rip),%rax
mov    (%rax),%edi
lea    0x9c1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1755 <main+0x5c5>
lea    0x927(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2874(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x286b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0x883(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    17a8 <main+0x618>
lea    0x8d4(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2821(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x2818(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0x830(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    17fb <main+0x66b>
lea    0x881(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1807 <main+0x677>
mov    0x27ce(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
lea    -0x5(%rbx),%eax
cmp    $0xfffffffd,%eax
jbe    12fe <main+0x16e>
mov    0x8(%r14),%rdi
call   1050 <strlen@plt>
cmp    $0x1,%eax
jne    12fe <main+0x16e>
mov    0x10(%r14),%rdi
lea    0x8(%rsp),%rsi
call   1070 <lstat@plt>
cmp    $0xffffffff,%eax
je     133e <main+0x1ae>
mov    0x8(%rsp),%edi
call   1060 <S_ISDIR@plt>
test   %rax,%rax
je     120d <main+0x7d>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   %eax,%eax
js     12be <main+0x12e>
mov    0x2dca(%rip),%rax
mov    (%rax),%ebx
jmp    1321 <main+0x191>
mov    0x8(%r14),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
cmp    $0x43,%eax
je     1259 <main+0xc9>
cmp    $0x52,%eax
je     12ce <main+0x13e>
cmp    $0x45,%eax
jne    129c <main+0x10c>
cmp    $0x3,%ebx
jne    12fe <main+0x16e>
mov    0x10(%r14),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
je     137d <main+0x1ed>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
lea    0xe54(%rip),%rsi
jmp    11f0 <main+0x60>
cmp    $0x4,%ebx
jne    12fe <main+0x16e>
mov    0x18(%r14),%rdi
call   1050 <strlen@plt>
cmp    $0x1,%eax
jne    12fe <main+0x16e>
mov    0x18(%r14),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
cmp    $0x57,%eax
je     1355 <main+0x1c5>
cmp    $0x52,%eax
jne    129c <main+0x10c>
mov    0x10(%r14),%rdi
mov    $0x180,%esi
jmp    135e <main+0x1ce>
mov    0x2d35(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xd51(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   %eax,%eax
jns    11ff <main+0x6f>
mov    %eax,%ebx
lea    0xda5(%rip),%rdi
call   10a0 <perror@plt>
jmp    1321 <main+0x191>
cmp    $0x4,%ebx
jne    12fe <main+0x16e>
mov    0x10(%r14),%rdi
mov    0x18(%r14),%rsi
call   10b0 <rename@plt>
cmp    $0xffffffff,%eax
je     1394 <main+0x204>
mov    0x2ce8(%rip),%rax
mov    (%rax),%edi
lea    0xdd2(%rip),%rsi
jmp    11f0 <main+0x60>
mov    0x2cd3(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xcef(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%ebx
test   %eax,%eax
js     132c <main+0x19c>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ebp
lea    0xd37(%rip),%rdi
call   10a0 <perror@plt>
mov    %ebp,%ebx
jmp    1321 <main+0x191>
mov    0x2c9b(%rip),%rax
mov    (%rax),%ebx
lea    0xd2c(%rip),%rdi
call   10a0 <perror@plt>
jmp    1321 <main+0x191>
mov    0x10(%r14),%rdi
mov    $0x1b6,%esi
call   1090 <chmod@plt>
cmp    $0xffffffff,%eax
je     13ae <main+0x21e>
mov    0x2c69(%rip),%rax
mov    (%rax),%edi
lea    0xd73(%rip),%rsi
jmp    11f0 <main+0x60>
mov    0x2c5c(%rip),%rax
mov    (%rax),%ebx
lea    0xd11(%rip),%rdi
call   10a0 <perror@plt>
jmp    1321 <main+0x191>
mov    0x2c45(%rip),%rax
mov    (%rax),%ebx
lea    0xd1a(%rip),%rdi
call   10a0 <perror@plt>
jmp    1321 <main+0x191>
mov    0x2c2b(%rip),%rax
mov    (%rax),%ebx
lea    0xd21(%rip),%rdi
call   10a0 <perror@plt>
jmp    1321 <main+0x191>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stdout = global i32 0
@.str = [108 x i8] c"Usage: %s <type operation: eE, rR, cC> <fichier a traiter> [<options: nom du fichier a renommer, rR, wW>] \0A\00"
@.str.1 = [14 x i8] c"Error fprintf\00"
@errno = global i32 0
@.str.2 = [12 x i8] c"Error lstat\00"
@.str.3 = [24 x i8] c"C'est un repertoire ! \0A\00"
@EXIT_SUCCESS = global i32 0
@.str.4 = [13 x i8] c"Error unlink\00"
@.str.5 = [19 x i8] c"Fichier efface ! \0A\00"
@.str.6 = [13 x i8] c"Error rename\00"
@.str.7 = [20 x i8] c"Fichier renomme ! \0A\00"
@.str.8 = [12 x i8] c"Error chmod\00"
@.str.9 = [19 x i8] c"Droits modifie ! \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 i32
%13 = alloca i32
%14 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 3
br i1 %16, label %20, label %17
17: ; preds = %2
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 4
br i1 %19, label %20, label %32
20: ; preds = %17, %2
%21 = load i32, i32* @stdout
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %24)
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %20
%29 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%30 = load i32, i32* %9
store i32 %30, i32* %3
br label %268
31: ; preds = %20
store i32 -1, i32* %3
br label %268
32: ; preds = %17
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strlen(i8* %35)
%37 = icmp ne i32 %36, 1
br i1 %37, label %38, label %50
38: ; preds = %32
%39 = load i32, i32* @stdout
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 0
%42 = load i8*, i8** %41
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %42)
store i32 %43, i32* %9
%44 = load i32, i32* %9
%45 = icmp slt i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %38
%47 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%48 = load i32, i32* %9
store i32 %48, i32* %3
br label %268
49: ; preds = %38
store i32 -1, i32* %3
br label %268
50: ; preds = %32
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 2
%53 = load i8*, i8** %52
%54 = call i32 @lstat(i8* %53, %struct.stat* %14)
store i32 %54, i32* %10
%55 = load i32, i32* %10
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %61
57: ; preds = %50
%58 = load i32, i32* @errno
store i32 %58, i32* %6
%59 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%60 = load i32, i32* %6
store i32 %60, i32* %3
br label %268
61: ; preds = %50
%62 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%63 = load i32, i32* %62
%64 = call i64 @S_ISDIR(i32 %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %76
66: ; preds = %61
%67 = load i32, i32* @stdout
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
store i32 %68, i32* %9
%69 = load i32, i32* %9
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %66
%72 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%73 = load i32, i32* %9
store i32 %73, i32* %3
br label %268
74: ; preds = %66
%75 = load i32, i32* @EXIT_SUCCESS
store i32 %75, i32* %3
br label %268
76: ; preds = %61
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 1
%79 = load i8*, i8** %78
%80 = getelementptr inbounds i8, i8* %79, i64 0
%81 = load i8, i8* %80
%82 = call i32 @toupper(i8 signext %81)
store i32 %82, i32* %7
%83 = load i32, i32* %7
switch i32 %83, label %255 [
i32 69, label %84
i32 82, label %120
i32 67, label %159
]
84: ; preds = %76
%85 = load i32, i32* %4
%86 = icmp ne i32 %85, 3
br i1 %86, label %87, label %99
87: ; preds = %84
%88 = load i32, i32* @stdout
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 0
%91 = load i8*, i8** %90
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %91)
store i32 %92, i32* %9
%93 = load i32, i32* %9
%94 = icmp slt i32 %93, 0
br i1 %94, label %95, label %98
95: ; preds = %87
%96 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%97 = load i32, i32* %9
store i32 %97, i32* %3
br label %268
98: ; preds = %87
store i32 -1, i32* %3
br label %268
99: ; preds = %84
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 2
%102 = load i8*, i8** %101
%103 = call i32 @unlink(i8* %102)
store i32 %103, i32* %11
%104 = load i32, i32* %11
%105 = icmp eq i32 %104, -1
br i1 %105, label %106, label %110
106: ; preds = %99
%107 = load i32, i32* @errno
store i32 %107, i32* %6
%108 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%109 = load i32, i32* %6
store i32 %109, i32* %3
br label %268
110: ; preds = %99
%111 = load i32, i32* @stdout
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
store i32 %112, i32* %9
%113 = load i32, i32* %9
%114 = icmp slt i32 %113, 0
br i1 %114, label %115, label %118
115: ; preds = %110
%116 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%117 = load i32, i32* %9
store i32 %117, i32* %3
br label %268
118: ; preds = %110
%119 = load i32, i32* @EXIT_SUCCESS
store i32 %119, i32* %3
br label %268
120: ; preds = %76
%121 = load i32, i32* %4
%122 = icmp ne i32 %121, 4
br i1 %122, label %123, label %135
123: ; preds = %120
%124 = load i32, i32* @stdout
%125 = load i8**, i8*** %5
%126 = getelementptr inbounds i8*, i8** %125, i64 0
%127 = load i8*, i8** %126
%128 = call i32 (i32, i8*, ...) @fprintf(i32 %124, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %127)
store i32 %128, i32* %9
%129 = load i32, i32* %9
%130 = icmp slt i32 %129, 0
br i1 %130, label %131, label %134
131: ; preds = %123
%132 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%133 = load i32, i32* %9
store i32 %133, i32* %3
br label %268
134: ; preds = %123
store i32 -1, i32* %3
br label %268
135: ; preds = %120
%136 = load i8**, i8*** %5
%137 = getelementptr inbounds i8*, i8** %136, i64 2
%138 = load i8*, i8** %137
%139 = load i8**, i8*** %5
%140 = getelementptr inbounds i8*, i8** %139, i64 3
%141 = load i8*, i8** %140
%142 = call i32 @rename(i8* %138, i8* %141)
store i32 %142, i32* %12
%143 = load i32, i32* %12
%144 = icmp eq i32 %143, -1
br i1 %144, label %145, label %149
145: ; preds = %135
%146 = load i32, i32* @errno
store i32 %146, i32* %6
%147 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%148 = load i32, i32* %6
store i32 %148, i32* %3
br label %268
149: ; preds = %135
%150 = load i32, i32* @stdout
%151 = call i32 (i32, i8*, ...) @fprintf(i32 %150, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
store i32 %151, i32* %9
%152 = load i32, i32* %9
%153 = icmp slt i32 %152, 0
br i1 %153, label %154, label %157
154: ; preds = %149
%155 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%156 = load i32, i32* %9
store i32 %156, i32* %3
br label %268
157: ; preds = %149
%158 = load i32, i32* @EXIT_SUCCESS
store i32 %158, i32* %3
br label %268
159: ; preds = %76
%160 = load i32, i32* %4
%161 = icmp ne i32 %160, 4
br i1 %161, label %162, label %174
162: ; preds = %159
%163 = load i32, i32* @stdout
%164 = load i8**, i8*** %5
%165 = getelementptr inbounds i8*, i8** %164, i64 0
%166 = load i8*, i8** %165
%167 = call i32 (i32, i8*, ...) @fprintf(i32 %163, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %166)
store i32 %167, i32* %9
%168 = load i32, i32* %9
%169 = icmp slt i32 %168, 0
br i1 %169, label %170, label %173
170: ; preds = %162
%171 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%172 = load i32, i32* %9
store i32 %172, i32* %3
br label %268
173: ; preds = %162
store i32 -1, i32* %3
br label %268
174: ; preds = %159
%175 = load i8**, i8*** %5
%176 = getelementptr inbounds i8*, i8** %175, i64 3
%177 = load i8*, i8** %176
%178 = call i32 @strlen(i8* %177)
%179 = icmp ne i32 %178, 1
br i1 %179, label %180, label %192
180: ; preds = %174
%181 = load i32, i32* @stdout
%182 = load i8**, i8*** %5
%183 = getelementptr inbounds i8*, i8** %182, i64 0
%184 = load i8*, i8** %183
%185 = call i32 (i32, i8*, ...) @fprintf(i32 %181, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %184)
store i32 %185, i32* %9
%186 = load i32, i32* %9
%187 = icmp slt i32 %186, 0
br i1 %187, label %188, label %191
188: ; preds = %180
%189 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%190 = load i32, i32* %9
store i32 %190, i32* %3
br label %268
191: ; preds = %180
store i32 -1, i32* %3
br label %268
192: ; preds = %174
%193 = load i8**, i8*** %5
%194 = getelementptr inbounds i8*, i8** %193, i64 3
%195 = load i8*, i8** %194
%196 = getelementptr inbounds i8, i8* %195, i64 0
%197 = load i8, i8* %196
%198 = call i32 @toupper(i8 signext %197)
store i32 %198, i32* %8
%199 = load i32, i32* %8
switch i32 %199, label %242 [
i32 82, label %200
i32 87, label %221
]
200: ; preds = %192
%201 = load i8**, i8*** %5
%202 = getelementptr inbounds i8*, i8** %201, i64 2
%203 = load i8*, i8** %202
%204 = call i32 @chmod(i8* %203, i32 384)
store i32 %204, i32* %13
%205 = load i32, i32* %13
%206 = icmp eq i32 %205, -1
br i1 %206, label %207, label %211
207: ; preds = %200
%208 = load i32, i32* @errno
store i32 %208, i32* %6
%209 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%210 = load i32, i32* %6
store i32 %210, i32* %3
br label %268
211: ; preds = %200
%212 = load i32, i32* @stdout
%213 = call i32 (i32, i8*, ...) @fprintf(i32 %212, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
store i32 %213, i32* %9
%214 = load i32, i32* %9
%215 = icmp slt i32 %214, 0
br i1 %215, label %216, label %219
216: ; preds = %211
%217 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%218 = load i32, i32* %9
store i32 %218, i32* %3
br label %268
219: ; preds = %211
%220 = load i32, i32* @EXIT_SUCCESS
store i32 %220, i32* %3
br label %268
221: ; preds = %192
%222 = load i8**, i8*** %5
%223 = getelementptr inbounds i8*, i8** %222, i64 2
%224 = load i8*, i8** %223
%225 = call i32 @chmod(i8* %224, i32 438)
store i32 %225, i32* %13
%226 = load i32, i32* %13
%227 = icmp eq i32 %226, -1
br i1 %227, label %228, label %232
228: ; preds = %221
%229 = load i32, i32* @errno
store i32 %229, i32* %6
%230 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%231 = load i32, i32* %6
store i32 %231, i32* %3
br label %268
232: ; preds = %221
%233 = load i32, i32* @stdout
%234 = call i32 (i32, i8*, ...) @fprintf(i32 %233, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
store i32 %234, i32* %9
%235 = load i32, i32* %9
%236 = icmp slt i32 %235, 0
br i1 %236, label %237, label %240
237: ; preds = %232
%238 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%239 = load i32, i32* %9
store i32 %239, i32* %3
br label %268
240: ; preds = %232
%241 = load i32, i32* @EXIT_SUCCESS
store i32 %241, i32* %3
br label %268
242: ; preds = %192
%243 = load i32, i32* @stdout
%244 = load i8**, i8*** %5
%245 = getelementptr inbounds i8*, i8** %244, i64 0
%246 = load i8*, i8** %245
%247 = call i32 (i32, i8*, ...) @fprintf(i32 %243, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %246)
store i32 %247, i32* %9
%248 = load i32, i32* %9
%249 = icmp slt i32 %248, 0
br i1 %249, label %250, label %253
250: ; preds = %242
%251 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%252 = load i32, i32* %9
store i32 %252, i32* %3
br label %268
253: ; preds = %242
%254 = load i32, i32* @EXIT_SUCCESS
store i32 %254, i32* %3
br label %268
255: ; preds = %76
%256 = load i32, i32* @stdout
%257 = load i8**, i8*** %5
%258 = getelementptr inbounds i8*, i8** %257, i64 0
%259 = load i8*, i8** %258
%260 = call i32 (i32, i8*, ...) @fprintf(i32 %256, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %259)
store i32 %260, i32* %9
%261 = load i32, i32* %9
%262 = icmp slt i32 %261, 0
br i1 %262, label %263, label %266
263: ; preds = %255
%264 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%265 = load i32, i32* %9
store i32 %265, i32* %3
br label %268
266: ; preds = %255
%267 = load i32, i32* @EXIT_SUCCESS
store i32 %267, i32* %3
br label %268
268: ; preds = %266, %263, %253, %250, %240, %237, %228, %219, %216, %207, %191, %188, %173, %170, %157, %154, %145, %134, %131, %118, %115, %106, %98, %95, %74, %71, %57, %49, %46, %31, %28
%269 = load i32, i32* %3
ret i32 %269
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stdout = global i32 0
@.str = [108 x i8] c"Usage: %s <type operation: eE, rR, cC> <fichier a traiter> [<options: nom du fichier a renommer, rR, wW>] \0A\00"
@.str.1 = [14 x i8] c"Error fprintf\00"
@errno = global i32 0
@.str.2 = [12 x i8] c"Error lstat\00"
@.str.3 = [24 x i8] c"C'est un repertoire ! \0A\00"
@EXIT_SUCCESS = global i32 0
@.str.4 = [13 x i8] c"Error unlink\00"
@.str.5 = [19 x i8] c"Fichier efface ! \0A\00"
@.str.6 = [13 x i8] c"Error rename\00"
@.str.7 = [20 x i8] c"Fichier renomme ! \0A\00"
@.str.8 = [12 x i8] c"Error chmod\00"
@.str.9 = [19 x i8] c"Droits modifie ! \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = add i32 %0, -5
%6 = icmp ult i32 %5, -2
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* @stdout
%9 = load i8*, i8** %1
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %174
12: ; preds = %7
%13 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @strlen(i8* %16)
%18 = icmp eq i32 %17, 1
br i1 %18, label %26, label %19
19: ; preds = %14
%20 = load i32, i32* @stdout
%21 = load i8*, i8** %1
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %174
24: ; preds = %19
%25 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
26: ; preds = %14
%27 = getelementptr inbounds i8*, i8** %1, i64 2
%28 = load i8*, i8** %27
%29 = call i32 @lstat(i8* %28, %struct.stat* %3)
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %34
31: ; preds = %26
%32 = load i32, i32* @errno
%33 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %174
34: ; preds = %26
%35 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%36 = load i32, i32* %35
%37 = tail call i64 @S_ISDIR(i32 %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %47, label %39
39: ; preds = %34
%40 = load i32, i32* @stdout
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
45: ; preds = %39
%46 = load i32, i32* @EXIT_SUCCESS
br label %174
47: ; preds = %34
%48 = load i8*, i8** %15
%49 = load i8, i8* %48
%50 = tail call i32 @toupper(i8 signext %49)
switch i32 %50, label %165 [
i32 69, label %51
i32 82, label %75
i32 67, label %101
]
51: ; preds = %47
%52 = icmp eq i32 %0, 3
br i1 %52, label %60, label %53
53: ; preds = %51
%54 = load i32, i32* @stdout
%55 = load i8*, i8** %1
%56 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %55)
%57 = icmp slt i32 %56, 0
br i1 %57, label %58, label %174
58: ; preds = %53
%59 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
60: ; preds = %51
%61 = load i8*, i8** %27
%62 = tail call i32 @unlink(i8* %61)
%63 = icmp eq i32 %62, -1
br i1 %63, label %64, label %67
64: ; preds = %60
%65 = load i32, i32* @errno
%66 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %174
67: ; preds = %60
%68 = load i32, i32* @stdout
%69 = tail call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
73: ; preds = %67
%74 = load i32, i32* @EXIT_SUCCESS
br label %174
75: ; preds = %47
%76 = icmp eq i32 %0, 4
br i1 %76, label %84, label %77
77: ; preds = %75
%78 = load i32, i32* @stdout
%79 = load i8*, i8** %1
%80 = tail call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %79)
%81 = icmp slt i32 %80, 0
br i1 %81, label %82, label %174
82: ; preds = %77
%83 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
84: ; preds = %75
%85 = load i8*, i8** %27
%86 = getelementptr inbounds i8*, i8** %1, i64 3
%87 = load i8*, i8** %86
%88 = tail call i32 @rename(i8* %85, i8* %87)
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %93
90: ; preds = %84
%91 = load i32, i32* @errno
%92 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %174
93: ; preds = %84
%94 = load i32, i32* @stdout
%95 = tail call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%96 = icmp slt i32 %95, 0
br i1 %96, label %97, label %99
97: ; preds = %93
%98 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
99: ; preds = %93
%100 = load i32, i32* @EXIT_SUCCESS
br label %174
101: ; preds = %47
%102 = icmp eq i32 %0, 4
br i1 %102, label %110, label %103
103: ; preds = %101
%104 = load i32, i32* @stdout
%105 = load i8*, i8** %1
%106 = tail call i32 (i32, i8*, ...) @fprintf(i32 %104, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %105)
%107 = icmp slt i32 %106, 0
br i1 %107, label %108, label %174
108: ; preds = %103
%109 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
110: ; preds = %101
%111 = getelementptr inbounds i8*, i8** %1, i64 3
%112 = load i8*, i8** %111
%113 = tail call i32 @strlen(i8* %112)
%114 = icmp eq i32 %113, 1
br i1 %114, label %122, label %115
115: ; preds = %110
%116 = load i32, i32* @stdout
%117 = load i8*, i8** %1
%118 = tail call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %117)
%119 = icmp slt i32 %118, 0
br i1 %119, label %120, label %174
120: ; preds = %115
%121 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
122: ; preds = %110
%123 = load i8*, i8** %111
%124 = load i8, i8* %123
%125 = tail call i32 @toupper(i8 signext %124)
switch i32 %125, label %156 [
i32 82, label %126
i32 87, label %141
]
126: ; preds = %122
%127 = load i8*, i8** %27
%128 = tail call i32 @chmod(i8* %127, i32 384)
%129 = icmp eq i32 %128, -1
br i1 %129, label %130, label %133
130: ; preds = %126
%131 = load i32, i32* @errno
%132 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
br label %174
133: ; preds = %126
%134 = load i32, i32* @stdout
%135 = tail call i32 (i32, i8*, ...) @fprintf(i32 %134, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%136 = icmp slt i32 %135, 0
br i1 %136, label %137, label %139
137: ; preds = %133
%138 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
139: ; preds = %133
%140 = load i32, i32* @EXIT_SUCCESS
br label %174
141: ; preds = %122
%142 = load i8*, i8** %27
%143 = tail call i32 @chmod(i8* %142, i32 438)
%144 = icmp eq i32 %143, -1
br i1 %144, label %145, label %148
145: ; preds = %141
%146 = load i32, i32* @errno
%147 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
br label %174
148: ; preds = %141
%149 = load i32, i32* @stdout
%150 = tail call i32 (i32, i8*, ...) @fprintf(i32 %149, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%151 = icmp slt i32 %150, 0
br i1 %151, label %152, label %154
152: ; preds = %148
%153 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
154: ; preds = %148
%155 = load i32, i32* @EXIT_SUCCESS
br label %174
156: ; preds = %122
%157 = load i32, i32* @stdout
%158 = load i8*, i8** %1
%159 = tail call i32 (i32, i8*, ...) @fprintf(i32 %157, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %158)
%160 = icmp slt i32 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %156
%162 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
163: ; preds = %156
%164 = load i32, i32* @EXIT_SUCCESS
br label %174
165: ; preds = %47
%166 = load i32, i32* @stdout
%167 = load i8*, i8** %1
%168 = tail call i32 (i32, i8*, ...) @fprintf(i32 %166, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0), i8* %167)
%169 = icmp slt i32 %168, 0
br i1 %169, label %170, label %172
170: ; preds = %165
%171 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %174
172: ; preds = %165
%173 = load i32, i32* @EXIT_SUCCESS
br label %174
174: ; preds = %115, %103, %77, %53, %19, %7, %172, %170, %163, %161, %154, %152, %145, %139, %137, %130, %120, %108, %99, %97, %90, %82, %73, %71, %64, %58, %45, %43, %31, %24, %12
%175 = phi i32 [ %10, %12 ], [ %22, %24 ], [ %32, %31 ], [ %41, %43 ], [ %46, %45 ], [ %168, %170 ], [ %173, %172 ], [ %106, %108 ], [ %118, %120 ], [ %159, %161 ], [ %164, %163 ], [ %146, %145 ], [ %150, %152 ], [ %155, %154 ], [ %131, %130 ], [ %135, %137 ], [ %140, %139 ], [ %80, %82 ], [ %91, %90 ], [ %95, %97 ], [ %100, %99 ], [ %56, %58 ], [ %65, %64 ], [ %69, %71 ], [ %74, %73 ], [ -1, %7 ], [ -1, %19 ], [ -1, %53 ], [ -1, %77 ], [ -1, %103 ], [ -1, %115 ]
ret i32 %175
}