#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 */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ mkdir(char *, int);
int /*<<< orphan*/ perror(char *);
scalar_t__ rmdir(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ umask(int /*<<< orphan*/);
int main(void) {
  fprintf(stderr, "Création repertoire mode rwxrwxrwx : ");
  if (mkdir("repertoire", 0777) != 0) {
    perror("");
    exit(1);
  } else {
    fprintf(stderr, "Ok\n");
  }
  system("ls -ld repertoire");
  fprintf(stderr, "Suppression repertoire : ");
  if (rmdir("repertoire") != 0) {
    perror("");
    exit(1);
  } else {
    fprintf(stderr, "Ok\n");
  }
  fprintf(stderr, "Modification umask\n");
  umask(0);
  fprintf(stderr, "Création repertoire mode rwxrwxrwx : ");
  if (mkdir("repertoire", 0777) != 0) {
    perror("");
    exit(1);
  } else {
    fprintf(stderr, "Ok\n");
  }
  system("ls -ld repertoire");
  fprintf(stderr, "Suppression repertoire : ");
  if (rmdir("repertoire") != 0) {
    perror("");
    exit(1);
  } else {
    fprintf(stderr, "Ok\n");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xe71(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xe97(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     11c5 <main+0x55>
lea    0xe74(%rip),%rdi
call   1080 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
lea    0xe52(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xe4a(%rip),%rdi
call   1050 <system@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
lea    0xe47(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xe30(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%rax
je     1227 <main+0xb7>
lea    0xe12(%rip),%rdi
call   1080 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
lea    0xdf0(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0xe0b(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <umask@plt>
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
lea    0xd98(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xdbe(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     129e <main+0x12e>
lea    0xd9b(%rip),%rdi
call   1080 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
lea    0xd79(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xd71(%rip),%rdi
call   1050 <system@plt>
mov    0x2d1a(%rip),%rax
mov    (%rax),%edi
lea    0xd6e(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xd57(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%rax
je     1300 <main+0x190>
lea    0xd39(%rip),%rdi
call   1080 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
lea    0xd17(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e68(%rip),%rbx
mov    (%rbx),%edi
lea    0xe7f(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xea5(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
test   %rax,%rax
jne    126f <main+0xff>
mov    (%rbx),%edi
lea    0xe7e(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xe76(%rip),%rdi
call   1050 <system@plt>
mov    (%rbx),%edi
lea    0xe7a(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xe63(%rip),%rdi
call   1040 <rmdir@plt>
test   %rax,%rax
jne    126f <main+0xff>
mov    (%rbx),%edi
lea    0xe41(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe63(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <umask@plt>
mov    (%rbx),%edi
lea    0xdf7(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xe1d(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
test   %rax,%rax
jne    126f <main+0xff>
mov    (%rbx),%edi
lea    0xdfa(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xdf2(%rip),%rdi
call   1050 <system@plt>
mov    (%rbx),%edi
lea    0xdf6(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xddf(%rip),%rdi
call   1040 <rmdir@plt>
test   %rax,%rax
jne    126f <main+0xff>
mov    (%rbx),%edi
lea    0xdc1(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xdb4(%rip),%rdi
call   1080 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Cr\C3\A9ation repertoire mode rwxrwxrwx : \00"
@.str.1 = [11 x i8] c"repertoire\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"Ok\0A\00"
@.str.4 = [18 x i8] c"ls -ld repertoire\00"
@.str.5 = [26 x i8] c"Suppression repertoire : \00"
@.str.6 = [20 x i8] c"Modification umask\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 511)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %9
%13 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%16 = call i64 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %12
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %24
24: ; preds = %21
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%27 = call i32 @umask(i32 0)
%28 = load i32, i32* @stderr
%29 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%30 = call i64 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 511)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %24
%33 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %24
%36 = load i32, i32* @stderr
%37 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %38
38: ; preds = %35
%39 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%42 = call i64 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %38
%45 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %38
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %50
50: ; preds = %47
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Cr\C3\A9ation repertoire mode rwxrwxrwx : \00"
@.str.1 = [11 x i8] c"repertoire\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"Ok\0A\00"
@.str.4 = [18 x i8] c"ls -ld repertoire\00"
@.str.5 = [26 x i8] c"Suppression repertoire : \00"
@.str.6 = [20 x i8] c"Modification umask\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 511)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%14 = tail call i64 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %8
%17 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %8
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%24 = tail call i32 @umask(i32 0)
%25 = load i32, i32* @stderr
%26 = tail call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%27 = tail call i64 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 511)
%28 = icmp eq i64 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %19
%30 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%31 = tail call i32 @exit(i32 1)
unreachable
32: ; preds = %19
%33 = load i32, i32* @stderr
%34 = tail call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%35 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = tail call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%38 = tail call i64 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %43, label %40
40: ; preds = %32
%41 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%42 = tail call i32 @exit(i32 1)
unreachable
43: ; preds = %32
%44 = load i32, i32* @stderr
%45 = tail call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}