#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*/ execlp(char *, char *, char *, char *, ...);
int /*<<< orphan*/ printf(char *);
int main(int na, char *arg[]) {
  int f;
  if (na != 2) {
    printf("Usage: -m = mount; -u = umount.\n");
    return 0;
  }
  if (arg[1][0] == '-') {
    if (arg[1][1] == 'm') {
      execlp("mount", "mount", "-t", "vfat", "/dev/fd0", "/mnt/floppy", NULL);
    }
    if (arg[1][1] == 'u') {
      execlp("umount", "umount", "/mnt/floppy", NULL);
    }
  } else {
    printf("Usage: -m = mount; -u = umount.\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   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1201 <main+0xe1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11ee <main+0xce>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6d,%eax
jne    11b8 <main+0x98>
lea    0xeb7(%rip),%rsi
lea    0xe92(%rip),%rdx
lea    0xe8e(%rip),%rcx
lea    0xe8c(%rip),%r8
lea    0xe8e(%rip),%r9
xor    %eax,%eax
mov    %rsi,%rdi
movq   $0x0,(%rsp)
mov    $0x0,%al
call   1040 <execlp@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x75,%eax
jne    11e9 <main+0xc9>
lea    0xe6a(%rip),%rsi
lea    0xe57(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
mov    $0x0,%al
call   1040 <execlp@plt>
jmp    1201 <main+0xe1>
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jne    1199 <main+0x79>
mov    %rsi,%rbx
mov    0x8(%rsi),%rax
cmpb   $0x2d,(%rax)
jne    1199 <main+0x79>
mov    0x1(%rax),%al
cmp    $0x6d,%al
jne    1179 <main+0x59>
movq   $0x0,(%rsp)
lea    0xed2(%rip),%rdi
lea    0xead(%rip),%rdx
lea    0xea9(%rip),%rcx
lea    0xea7(%rip),%r8
lea    0xea9(%rip),%r9
mov    %rdi,%rsi
xor    %eax,%eax
call   1040 <execlp@plt>
mov    0x8(%rbx),%rax
mov    0x1(%rax),%al
cmp    $0x75,%al
jne    11a5 <main+0x85>
lea    0xe99(%rip),%rdi
lea    0xe86(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <execlp@plt>
jmp    11a5 <main+0x85>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: -m = mount; -u = umount.\0A\00"
@.str.1 = [6 x i8] c"mount\00"
@.str.2 = [3 x i8] c"-t\00"
@.str.3 = [5 x i8] c"vfat\00"
@.str.4 = [9 x i8] c"/dev/fd0\00"
@.str.5 = [12 x i8] c"/mnt/floppy\00"
@.str.6 = [7 x i8] c"umount\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 ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %42
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br i1 %18, label %19, label %40
19: ; preds = %11
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 109
br i1 %26, label %27, label %29
27: ; preds = %19
%28 = call i32 (i8*, i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* null)
br label %29
29: ; preds = %27, %19
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = getelementptr inbounds i8, i8* %32, i64 1
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 117
br i1 %36, label %37, label %39
37: ; preds = %29
%38 = call i32 (i8*, i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* null)
br label %39
39: ; preds = %37, %29
br label %42
40: ; preds = %11
%41 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %42
42: ; preds = %9, %40, %39
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"mount\00"
@.str.2 = [3 x i8] c"-t\00"
@.str.3 = [5 x i8] c"vfat\00"
@.str.4 = [9 x i8] c"/dev/fd0\00"
@.str.5 = [12 x i8] c"/mnt/floppy\00"
@.str.6 = [7 x i8] c"umount\00"
@str.7 = [32 x i8] c"Usage: -m = mount; -u = umount.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0))
br label %27
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 45
br i1 %10, label %11, label %25
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 109
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = tail call i32 (i8*, i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* null)
%17 = load i8*, i8** %7
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
br label %20
20: ; preds = %15, %11
%21 = phi i8 [ %19, %15 ], [ %13, %11 ]
%22 = icmp eq i8 %21, 117
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = tail call i32 (i8*, i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* null)
br label %27
25: ; preds = %6
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0))
br label %27
27: ; preds = %23, %20, %25, %4
ret i32 0
}