#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*/ add2mtab(char *, char *, char *, char *);
int /*<<< orphan*/ lsmtab();
scalar_t__ mount(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
main(int argc, char *argv[]) {
  if (argc == 1) {
    lsmtab();
    return 0;
  }
  if (argc != 3) {
    printf("usage: mount device path\n");
    return 1;
  }
  if (mount(argv[1], argv[2], 0) == 0) {
    add2mtab(argv[1], argv[2], "uzi", "rw");
  } else {
    perror("mount");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1183 <main+0x33>
mov    $0x0,%al
call   1050 <lsmtab@plt>
movl   $0x0,-0x4(%rbp)
jmp    120d <main+0xbd>
cmpl   $0x3,-0x8(%rbp)
je     11a5 <main+0x55>
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    120d <main+0xbd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
xor    %edx,%edx
call   1030 <mount@plt>
cmp    $0x0,%rax
jne    11ee <main+0x9e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe3d(%rip),%rdx
lea    0xe3a(%rip),%rcx
call   1060 <add2mtab@plt>
jmp    1206 <main+0xb6>
lea    0xe2c(%rip),%rdi
call   1070 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    120d <main+0xbd>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x3,%edi
je     1168 <main+0x18>
cmp    $0x1,%edi
jne    119e <main+0x4e>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <lsmtab@plt>
jmp    11af <main+0x5f>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
xor    %ebp,%ebp
xor    %edx,%edx
call   1040 <mount@plt>
test   %rax,%rax
jne    11b8 <main+0x68>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
lea    0xe70(%rip),%rdx
lea    0xe6d(%rip),%rcx
call   1060 <add2mtab@plt>
jmp    11af <main+0x5f>
lea    0xe68(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe48(%rip),%rdi
call   1070 <perror@plt>
jmp    11aa <main+0x5a>

LLVM IR (-O0):
@.str = [26 x i8] c"usage: mount device path\0A\00"
@.str.1 = [4 x i8] c"uzi\00"
@.str.2 = [3 x i8] c"rw\00"
@.str.3 = [6 x i8] c"mount\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @lsmtab()
store i32 0, i32* %3
br label %35
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 3
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %35
15: ; preds = %10
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i64 @mount(i8* %18, i8* %21, i32 0)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %15
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @add2mtab(i8* %27, i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %34
32: ; preds = %15
%33 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %35
34: ; preds = %24
store i32 0, i32* %3
br label %35
35: ; preds = %34, %32, %13, %8
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"uzi\00"
@.str.2 = [3 x i8] c"rw\00"
@.str.3 = [6 x i8] c"mount\00"
@str = [25 x i8] c"usage: mount device path\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %5 [
i32 1, label %3
i32 3, label %7
]
3: ; preds = %2
%4 = tail call i32 (...) @lsmtab()
br label %20
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %20
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i64 @mount(i8* %9, i8* %11, i32 0)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %10
%17 = tail call i32 @add2mtab(i8* %15, i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %20
18: ; preds = %7
%19 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %14, %18, %5, %3
%21 = phi i32 [ 0, %3 ], [ 1, %5 ], [ 0, %14 ], [ 1, %18 ]
ret i32 %21
}