#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*/ demonter();
int /*<<< orphan*/ dialoguer();
int /*<<< orphan*/ exit(int);
int monter(char *);
int /*<<< orphan*/ perreur(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  char *volume = "root";
  if (argc == 1)
    volume = "root";
  else if (argc == 2)
    volume = argv[1];
  else {
    usage();
    exit(1);
  }
  if (monter(volume) == -1) {
    perreur(volume);
    exit(1);
  }
  dialoguer();
  demonter();
  return 1;
}


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)
lea    0xe83(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    119b <main+0x3b>
lea    0xe6e(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    11cc <main+0x6c>
cmpl   $0x2,-0x8(%rbp)
jne    11b6 <main+0x56>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    11c7 <main+0x67>
mov    $0x0,%al
call   1060 <usage@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    11cc <main+0x6c>
mov    -0x18(%rbp),%rdi
call   1040 <monter@plt>
cmp    $0xffffffff,%eax
jne    11f1 <main+0x91>
mov    -0x18(%rbp),%rdi
call   1080 <perreur@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1030 <dialoguer@plt>
mov    $0x0,%al
call   1050 <demonter@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
je     1171 <main+0x11>
cmp    $0x2,%edi
jne    11ac <main+0x4c>
mov    0x8(%rsi),%rbx
jmp    1178 <main+0x18>
lea    0xe88(%rip),%rbx
mov    %rbx,%rdi
call   1040 <monter@plt>
cmp    $0xffffffff,%eax
je     119a <main+0x3a>
xor    %eax,%eax
call   1030 <dialoguer@plt>
xor    %eax,%eax
call   1050 <demonter@plt>
mov    $0x1,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1080 <perreur@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
xor    %eax,%eax
call   1060 <usage@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"root\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
br label %21
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
store i8* %16, i8** %6
br label %20
17: ; preds = %10
%18 = call i32 (...) @usage()
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %13
br label %21
21: ; preds = %20, %9
%22 = load i8*, i8** %6
%23 = call i32 @monter(i8* %22)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i8*, i8** %6
%27 = call i32 @perreur(i8* %26)
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %21
%30 = call i32 (...) @dialoguer()
%31 = call i32 (...) @demonter()
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"root\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %6 [
i32 1, label %9
i32 2, label %3
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
br label %9
6: ; preds = %2
%7 = tail call i32 (...) @usage()
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2, %3
%10 = phi i8* [ %5, %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %2 ]
%11 = tail call i32 @monter(i8* %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = tail call i32 @perreur(i8* %10)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %9
%17 = tail call i32 (...) @dialoguer()
%18 = tail call i32 (...) @demonter()
ret i32 1
}