#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 /*<<< orphan*/ check(int /*<<< orphan*/, char *);
int /*<<< orphan*/ mkdir(char const *, int);
int /*<<< orphan*/ mount(char const *, char const *, char *, int /*<<< orphan*/,
                         char *);
void bind_mount(const char *src, const char *dst) {
  check(mkdir(dst, 0700), "mkdir");
  check(mount(src, dst, "", MS_BIND, ""), "mount(MS_BIND)");
}


x86 assembly (clang, -O0):
<bind_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
mov    %eax,%edi
lea    0xea9(%rip),%rsi
call   1050 <check@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e7d(%rip),%rax
mov    (%rax),%ecx
lea    0xea0(%rip),%r8
mov    %r8,%rdx
call   1040 <mount@plt>
mov    %eax,%edi
lea    0xe81(%rip),%rsi
call   1050 <check@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_mount>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
lea    0xeb2(%rip),%rsi
mov    %eax,%edi
call   1050 <check@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%ecx
lea    0xeaf(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rdx,%r8
call   1040 <mount@plt>
lea    0xe8c(%rip),%rsi
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <check@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"mkdir\00"
@.str.1 = [1 x i8] zeroinitializer
@MS_BIND = global i32 0
@.str.2 = [15 x i8] c"mount(MS_BIND)\00"
define void @bind_mount(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @mkdir(i8* %5, i32 448)
%7 = call i32 @check(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* @MS_BIND
%11 = call i32 @mount(i8* %8, i8* %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @check(i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"mkdir\00"
@.str.1 = [1 x i8] zeroinitializer
@MS_BIND = global i32 0
@.str.2 = [15 x i8] c"mount(MS_BIND)\00"
define void @bind_mount(i8* %0, i8* %1) {
%3 = tail call i32 @mkdir(i8* %1, i32 448)
%4 = tail call i32 @check(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @MS_BIND
%6 = tail call i32 @mount(i8* %0, i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @check(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}