#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*/ MS_BIND;
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ mount(char const *, char const *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  const char *src;
  const char *dst;
  if (argc > 2) {
    src = argv[1];
    dst = argv[2];
  } else {
    fprintf(stderr, "Bad usage!\n");
    return 1;
  }
  if (mount(src, dst, NULL, MS_BIND, "")) {
    fprintf(stderr, "Failed to mount: errno=%d\n", errno);
    return 1;
  }
  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)
jle    115d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1180 <main+0x60>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11de <main+0xbe>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2e59(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edx
lea    0xe6f(%rip),%r8
call   1030 <mount@plt>
cmp    $0x0,%rax
je     11d7 <main+0xb7>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
mov    0x2e15(%rip),%rax
mov    (%rax),%edx
lea    0xe48(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11de <main+0xbe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
jl     116e <main+0x4e>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%ecx
lea    0xecd(%rip),%r8
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <mount@plt>
test   %rax,%rax
je     118a <main+0x6a>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
lea    0xea7(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1185 <main+0x65>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe82(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Bad usage!\0A\00"
@MS_BIND = global i32 0
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [27 x i8] c"Failed to mount: errno=%d\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 2
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
store i8* %16, i8** %7
br label %20
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %31
20: ; preds = %10
%21 = load i8*, i8** %6
%22 = load i8*, i8** %7
%23 = load i32, i32* @MS_BIND
%24 = call i64 @mount(i8* %21, i8* %22, i32* null, i32 %23, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %20
%27 = load i32, i32* @stderr
%28 = load i32, i32* @errno
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %28)
store i32 1, i32* %3
br label %31
30: ; preds = %20
store i32 0, i32* %3
br label %31
31: ; preds = %30, %26, %17
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Bad usage!\0A\00"
@MS_BIND = global i32 0
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [27 x i8] c"Failed to mount: errno=%d\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = load i32, i32* @MS_BIND
%10 = tail call i64 @mount(i8* %6, i8* %8, i32* null, i32 %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %19, label %15
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %19
15: ; preds = %4
%16 = load i32, i32* @stderr
%17 = load i32, i32* @errno
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %4, %15, %12
%20 = phi i32 [ 1, %15 ], [ 1, %12 ], [ 0, %4 ]
ret i32 %20
}