#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 /*<<< orphan*/);
int /*<<< orphan*/ mount_encfs(char *, char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ unmount_encfs(char *);
int main(int argc, char *argv[]) {
  char *cmd = argv[1];
  char *target_path = argv[2];
  if (strcmp(cmd, "mount") == 0) {
    char *mountpoint = argv[3];
    char *password = argv[4];
    printf("mounting\n");
    exit(mount_encfs(target_path, mountpoint, password, 0));
  } else if (strcmp(cmd, "umount") == 0) {
    printf("unmounting\n");
    exit(unmount_encfs(target_path));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11d6 <main+0x86>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x30(%rbp)
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
xor    %ecx,%ecx
call   1050 <mount_encfs@plt>
mov    %eax,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
lea    0xe1f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    120c <main+0xbc>
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <unmount_encfs@plt>
mov    %eax,%edi
call   1070 <exit@plt>
jmp    1211 <main+0xc1>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%r15
mov    0x10(%rsi),%r14
lea    0xe9a(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1190 <main+0x40>
lea    0xe85(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11bb <main+0x6b>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x18(%rbx),%r15
mov    0x20(%rbx),%rbx
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1050 <mount_encfs@plt>
mov    %eax,%edi
call   1070 <exit@plt>
lea    0xe45(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1060 <unmount_encfs@plt>
mov    %eax,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"mount\00"
@.str.1 = [10 x i8] c"mounting\0A\00"
@.str.2 = [7 x i8] c"umount\00"
@.str.3 = [12 x i8] c"unmounting\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
store i8* %15, i8** %7
%16 = load i8*, i8** %6
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %32
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 3
%22 = load i8*, i8** %21
store i8* %22, i8** %8
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 4
%25 = load i8*, i8** %24
store i8* %25, i8** %9
%26 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%27 = load i8*, i8** %7
%28 = load i8*, i8** %8
%29 = load i8*, i8** %9
%30 = call i32 @mount_encfs(i8* %27, i8* %28, i8* %29, i32 0)
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %2
%33 = load i8*, i8** %6
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%38 = load i8*, i8** %7
%39 = call i32 @unmount_encfs(i8* %38)
%40 = call i32 @exit(i32 %39)
unreachable
41: ; preds = %32
br label %42
42: ; preds = %41
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"mount\00"
@.str.2 = [7 x i8] c"umount\00"
@str = [11 x i8] c"unmounting\00"
@str.4 = [9 x i8] c"mounting\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 3
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 4
%13 = load i8*, i8** %12
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
%15 = tail call i32 @mount_encfs(i8* %6, i8* %11, i8* %13, i32 0)
%16 = tail call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
%18 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%22 = tail call i32 @unmount_encfs(i8* %6)
%23 = tail call i32 @exit(i32 %22)
unreachable
24: ; preds = %17
ret i32 0
}