#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 */

/* Variables and functions */
#define EEXIST 129
#define ENOENT 128
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ mkdir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int i;
  if (argc == 1) {
    fprintf(stderr, "%s: opérande manquant\n", argv[0]);
  } else {
    for (i = 1; i < argc; i++) {
      if (mkdir(argv[i], 0)) {
        fprintf(stderr, "%s: impossible de créer le répertoire \"%s\"", argv[0],
                argv[i]);
        switch (errno) {
        case ENOENT:
          fprintf(stderr, ": Aucun fichier ou dossier de ce type\n");
          break;
        case EEXIST:
          fprintf(stderr, ": Le fichier existe\n");
          break;
        default:
          fprintf(stderr, "\n");
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1163 <main+0x43>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1254 <main+0x134>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    124f <main+0x12f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     123c <main+0x11c>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xe66(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e18(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
sub    $0x80,%eax
je     11e8 <main+0xc8>
jmp    11d5 <main+0xb5>
mov    -0x18(%rbp),%eax
sub    $0x81,%eax
je     1204 <main+0xe4>
jmp    1220 <main+0x100>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
lea    0xe4d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1237 <main+0x117>
mov    0x2dd5(%rip),%rax
mov    (%rax),%edi
lea    0xe58(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1237 <main+0x117>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    123c <main+0x11c>
jmp    1241 <main+0x121>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116a <main+0x4a>
jmp    1254 <main+0x134>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
cmp    $0x1,%edi
jne    1153 <main+0x33>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%rdx
lea    0xeb9(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    11e5 <main+0xc5>
jle    11e5 <main+0xc5>
mov    %edi,%r15d
mov    $0x1,%ebx
mov    0x2e78(%rip),%r13
lea    0xefb(%rip),%rbp
lea    0xecf(%rip),%r14
jmp    1189 <main+0x69>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r15
je     11e5 <main+0xc5>
mov    (%r12,%rbx,8),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
test   %rax,%rax
je     1180 <main+0x60>
mov    0x0(%r13),%edi
mov    (%r12),%rdx
mov    (%r12,%rbx,8),%rcx
lea    0xe6c(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
cmp    $0x81,%eax
mov    %rbp,%rsi
lea    0xea1(%rip),%rcx
cmove  %rcx,%rsi
cmp    $0x80,%eax
cmove  %r14,%rsi
mov    0x0(%r13),%edi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1180 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"%s: op\C3\A9rande manquant\0A\00"
@.str.1 = [45 x i8] c"%s: impossible de cr\C3\A9er le r\C3\A9pertoire \22%s\22\00"
@errno = global i32 0
@.str.2 = [39 x i8] c": Aucun fichier ou dossier de ce type\0A\00"
@.str.3 = [21 x i8] c": Le fichier existe\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %55
15: ; preds = %2
store i32 1, i32* %6
br label %16
16: ; preds = %51, %15
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %54
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i64 @mkdir(i8* %25, i32 0)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %50
28: ; preds = %20
%29 = load i32, i32* @stderr
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = load i8**, i8*** %5
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %32, i8* %37)
%39 = load i32, i32* @errno
switch i32 %39, label %46 [
i32 128, label %40
i32 129, label %43
]
40: ; preds = %28
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
br label %49
43: ; preds = %28
%44 = load i32, i32* @stderr
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %49
46: ; preds = %28
%47 = load i32, i32* @stderr
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %49
49: ; preds = %46, %43, %40
br label %50
50: ; preds = %49, %20
br label %51
51: ; preds = %50
%52 = load i32, i32* %6
%53 = add nsw i32 %52, 1
store i32 %53, i32* %6
br label %16
54: ; preds = %16
br label %55
55: ; preds = %54, %9
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"%s: op\C3\A9rande manquant\0A\00"
@.str.1 = [45 x i8] c"%s: impossible de cr\C3\A9er le r\C3\A9pertoire \22%s\22\00"
@errno = global i32 0
@.str.2 = [39 x i8] c": Aucun fichier ou dossier de ce type\0A\00"
@.str.3 = [21 x i8] c": Le fichier existe\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %33
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %33
12: ; preds = %6, %30
%13 = phi i64 [ 1, %6 ], [ %31, %30 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i64 @mkdir(i8* %15, i32 0)
%17 = icmp eq i64 %16, 0
br i1 %17, label %30, label %18
18: ; preds = %12
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %1
%21 = load i8*, i8** %14
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %20, i8* %21)
%23 = load i32, i32* @errno
%24 = icmp eq i32 %23, 129
%25 = select i1 %24, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%26 = icmp eq i32 %23, 128
%27 = select i1 %26, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %25
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* %27)
br label %30
30: ; preds = %18, %12
%31 = add nuw nsw i64 %13, 1
%32 = icmp eq i64 %31, %7
br i1 %32, label %33, label %12
33: ; preds = %30, %4, %8
ret i32 0
}