#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 */
scalar_t__ basename(char *);
int /*<<< orphan*/ display_help();
int /*<<< orphan*/ errno;
int /*<<< orphan*/ execl(char *, char *, char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int getopt(int, char **, char *);
scalar_t__ getuid();
char *optarg;
int optind;
int sea_mount_filesystem(char *, char *, char *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int opt;
  char *type = 0;
  if (argc == 1)
    execl("/bin/df", "df", "-h", "-a");
  while ((opt = getopt(argc, argv, "ht:")) != -1) {
    switch (opt) {
    case 'h':
      display_help();
      return 0;
      break;
    case 't':
      type = optarg;
      break;
    }
  }
  if ((optind + 2) > argc) {
    fprintf(stderr, "%s: usage: [-t type] device directory\n", argv[0]);
    return 1;
  }
  if (getuid()) {
    fprintf(stderr, "%s: you must be root to use this program\n", argv[0]);
    return 2;
  }
  int ret = sea_mount_filesystem(argv[optind], argv[optind + 1], type, 0, 0);
  if (ret < 0)
    fprintf(stderr, "%s: %s -> %s: %s\n", (char *)basename(argv[0]),
            argv[optind], argv[optind + 1], strerror(errno));
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11c9 <main+0x49>
lea    0xe51(%rip),%rdi
lea    0xe4f(%rip),%rsi
lea    0xe4b(%rip),%rdx
lea    0xe47(%rip),%rcx
call   10a0 <execl@plt>
jmp    11ce <main+0x4e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe32(%rip),%rdx
call   1080 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1238 <main+0xb8>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x68,%eax
je     1212 <main+0x92>
jmp    1201 <main+0x81>
mov    -0x28(%rbp),%eax
sub    $0x74,%eax
je     1225 <main+0xa5>
jmp    1233 <main+0xb3>
mov    $0x0,%al
call   1040 <display_help@plt>
movl   $0x0,-0x4(%rbp)
jmp    1378 <main+0x1f8>
mov    0x2dcc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    11ce <main+0x4e>
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
jle    1277 <main+0xf7>
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1378 <main+0x1f8>
mov    $0x0,%al
call   1030 <getuid@plt>
cmp    $0x0,%rax
je     12b2 <main+0x132>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd9a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1378 <main+0x1f8>
mov    -0x10(%rbp),%rax
mov    0x2d23(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rax
mov    0x2d11(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x20(%rbp),%rdx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1070 <sea_mount_filesystem@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1372 <main+0x1f2>
mov    0x2cd2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <basename@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2cc2(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2cac(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
mov    0x2c7d(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    %rax,%r9
lea    0xcf8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%ebp
cmp    $0x1,%edi
jne    11b3 <main+0x33>
lea    0xe67(%rip),%rdi
lea    0xe65(%rip),%rsi
lea    0xe61(%rip),%rdx
lea    0xe5d(%rip),%rcx
call   10a0 <execl@plt>
xor    %r14d,%r14d
lea    0xe51(%rip),%rbx
mov    0x2e34(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1080 <getopt@plt>
cmp    $0xffffffff,%eax
je     11f4 <main+0x74>
cmp    $0x74,%eax
je     11ee <main+0x6e>
cmp    $0x68,%eax
jne    11d0 <main+0x50>
jmp    1228 <main+0xa8>
mov    (%r12),%r14
jmp    11d0 <main+0x50>
mov    0x2de5(%rip),%rbx
mov    (%rbx),%eax
add    $0x2,%eax
cmp    %ebp,%eax
jle    1236 <main+0xb6>
mov    0x2dc5(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xdfb(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%ebp
jmp    12ce <main+0x14e>
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <display_help@plt>
jmp    12ce <main+0x14e>
xor    %eax,%eax
call   1030 <getuid@plt>
test   %rax,%rax
je     1263 <main+0xe3>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xde4(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x2,%ebp
jmp    12ce <main+0x14e>
movslq (%rbx),%rax
mov    (%r15,%rax,8),%rdi
mov    0x8(%r15,%rax,8),%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1070 <sea_mount_filesystem@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    12ce <main+0x14e>
mov    0x2d47(%rip),%rax
mov    (%rax),%r14d
mov    (%r15),%rdi
call   1060 <basename@plt>
mov    %rax,%r12
movslq (%rbx),%rax
mov    (%r15,%rax,8),%rbx
mov    0x8(%r15,%rax,8),%r15
mov    0x2d1e(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
lea    0xdab(%rip),%rsi
mov    %r14d,%edi
mov    %r12,%rdx
mov    %rbx,%rcx
mov    %r15,%r8
mov    %rax,%r9
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/df\00"
@.str.1 = [3 x i8] c"df\00"
@.str.2 = [3 x i8] c"-h\00"
@.str.3 = [3 x i8] c"-a\00"
@.str.4 = [4 x i8] c"ht:\00"
@optarg = global i8* null
@optind = global i32 0
@stderr = global i32 0
@.str.5 = [39 x i8] c"%s: usage: [-t type] device directory\0A\00"
@.str.6 = [42 x i8] c"%s: you must be root to use this program\0A\00"
@.str.7 = [18 x i8] c"%s: %s -> %s: %s\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 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 ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
br label %14
14: ; preds = %25, %13
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @getopt(i32 %15, i8** %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
store i32 %17, i32* %6
%18 = icmp ne i32 %17, -1
br i1 %18, label %19, label %26
19: ; preds = %14
%20 = load i32, i32* %6
switch i32 %20, label %25 [
i32 104, label %21
i32 116, label %23
]
21: ; preds = %19
%22 = call i32 (...) @display_help()
store i32 0, i32* %3
br label %85
23: ; preds = %19
%24 = load i8*, i8** @optarg
store i8* %24, i8** %7
br label %25
25: ; preds = %19, %23
br label %14
26: ; preds = %14
%27 = load i32, i32* @optind
%28 = add nsw i32 %27, 2
%29 = load i32, i32* %4
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %37
31: ; preds = %26
%32 = load i32, i32* @stderr
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 0
%35 = load i8*, i8** %34
%36 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %35)
store i32 1, i32* %3
br label %85
37: ; preds = %26
%38 = call i64 (...) @getuid()
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %46
40: ; preds = %37
%41 = load i32, i32* @stderr
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 0
%44 = load i8*, i8** %43
%45 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), i8* %44)
store i32 2, i32* %3
br label %85
46: ; preds = %37
%47 = load i8**, i8*** %5
%48 = load i32, i32* @optind
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = load i8**, i8*** %5
%53 = load i32, i32* @optind
%54 = add nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %52, i64 %55
%57 = load i8*, i8** %56
%58 = load i8*, i8** %7
%59 = call i32 @sea_mount_filesystem(i8* %51, i8* %57, i8* %58, i32 0, i32 0)
store i32 %59, i32* %8
%60 = load i32, i32* %8
%61 = icmp slt i32 %60, 0
br i1 %61, label %62, label %83
62: ; preds = %46
%63 = load i32, i32* @stderr
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 0
%66 = load i8*, i8** %65
%67 = call i64 @basename(i8* %66)
%68 = inttoptr i64 %67 to i8*
%69 = load i8**, i8*** %5
%70 = load i32, i32* @optind
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8*, i8** %69, i64 %71
%73 = load i8*, i8** %72
%74 = load i8**, i8*** %5
%75 = load i32, i32* @optind
%76 = add nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %74, i64 %77
%79 = load i8*, i8** %78
%80 = load i32, i32* @errno
%81 = call i8* @strerror(i32 %80)
%82 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8* %68, i8* %73, i8* %79, i8* %81)
br label %83
83: ; preds = %62, %46
%84 = load i32, i32* %8
store i32 %84, i32* %3
br label %85
85: ; preds = %83, %40, %31, %21
%86 = load i32, i32* %3
ret i32 %86
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/df\00"
@.str.1 = [3 x i8] c"df\00"
@.str.2 = [3 x i8] c"-h\00"
@.str.3 = [3 x i8] c"-a\00"
@.str.4 = [4 x i8] c"ht:\00"
@optarg = global i8* null
@optind = global i32 0
@stderr = global i32 0
@.str.5 = [39 x i8] c"%s: usage: [-t type] device directory\0A\00"
@.str.6 = [42 x i8] c"%s: you must be root to use this program\0A\00"
@.str.7 = [18 x i8] c"%s: %s -> %s: %s\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 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 ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
br label %7
7: ; preds = %6, %13
%8 = phi i8* [ null, %6 ], [ %14, %13 ]
br label %9
9: ; preds = %7, %9
%10 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
switch i32 %10, label %9 [
i32 -1, label %15
i32 104, label %11
i32 116, label %13
]
11: ; preds = %9
%12 = tail call i32 (...) @display_help()
br label %57
13: ; preds = %9
%14 = load i8*, i8** @optarg
br label %7
15: ; preds = %9
%16 = load i32, i32* @optind
%17 = add nsw i32 %16, 2
%18 = icmp sgt i32 %17, %0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %1
%22 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %21)
br label %57
23: ; preds = %15
%24 = tail call i64 (...) @getuid()
%25 = icmp eq i64 %24, 0
br i1 %25, label %30, label %26
26: ; preds = %23
%27 = load i32, i32* @stderr
%28 = load i8*, i8** %1
%29 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0), i8* %28)
br label %57
30: ; preds = %23
%31 = load i32, i32* @optind
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
%35 = add nsw i32 %31, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %1, i64 %36
%38 = load i8*, i8** %37
%39 = tail call i32 @sea_mount_filesystem(i8* %34, i8* %38, i8* %8, i32 0, i32 0)
%40 = icmp slt i32 %39, 0
br i1 %40, label %41, label %57
41: ; preds = %30
%42 = load i32, i32* @stderr
%43 = load i8*, i8** %1
%44 = tail call i64 @basename(i8* %43)
%45 = inttoptr i64 %44 to i8*
%46 = load i32, i32* @optind
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %1, i64 %47
%49 = load i8*, i8** %48
%50 = add nsw i32 %46, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %1, i64 %51
%53 = load i8*, i8** %52
%54 = load i32, i32* @errno
%55 = tail call i8* @strerror(i32 %54)
%56 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8* %45, i8* %49, i8* %53, i8* %55)
br label %57
57: ; preds = %30, %41, %26, %19, %11
%58 = phi i32 [ 0, %11 ], [ 1, %19 ], [ 2, %26 ], [ %39, %41 ], [ %39, %30 ]
ret i32 %58
}