#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__ ENOENT;
int MS_BIND;
int MS_MGC_VAL;
int MS_REC;
scalar_t__ errno;
scalar_t__ mount(char const *, char const *, char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pl_fatal(char *, char const *, char const *);
void pl_bind_mount(const char *src, const char *dst) {
  if (0 < mount(src, dst, "none", MS_MGC_VAL | MS_BIND | MS_REC, NULL)) {
    if (errno != ENOENT) {
      pl_fatal("rbind %s to %s", src, dst);
    }
  }
}


x86 assembly (clang, -O0):
<pl_bind_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e89(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea0(%rip),%rax
or     (%rax),%ecx
mov    0x2e8f(%rip),%rax
or     (%rax),%ecx
lea    0xea6(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <mount@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jge    11a5 <pl_bind_mount+0x85>
mov    0x2e57(%rip),%rax
mov    (%rax),%rax
mov    0x2e35(%rip),%rcx
cmp    (%rcx),%rax
je     11a0 <pl_bind_mount+0x80>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe6a(%rip),%rdi
call   1040 <pl_fatal@plt>
jmp    11a5 <pl_bind_mount+0x85>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_bind_mount>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%rax
mov    0x2eb6(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
or     (%rax),%ecx
lea    0xeb4(%rip),%rdx
xor    %r8d,%r8d
call   1030 <mount@plt>
test   %rax,%rax
jle    116f <pl_bind_mount+0x4f>
mov    0x2e70(%rip),%rax
mov    (%rax),%rax
mov    0x2e4e(%rip),%rcx
cmp    (%rcx),%rax
jne    1177 <pl_bind_mount+0x57>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe87(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pl_fatal@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
@MS_MGC_VAL = global i32 0
@MS_BIND = global i32 0
@MS_REC = global i32 0
@errno = global i64 0
@ENOENT = global i64 0
@.str.1 = [15 x i8] c"rbind %s to %s\00"
define void @pl_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** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @MS_MGC_VAL
%8 = load i32, i32* @MS_BIND
%9 = or i32 %7, %8
%10 = load i32, i32* @MS_REC
%11 = or i32 %9, %10
%12 = call i64 @mount(i8* %5, i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11, i32* null)
%13 = icmp slt i64 0, %12
br i1 %13, label %14, label %23
14: ; preds = %2
%15 = load i64, i64* @errno
%16 = load i64, i64* @ENOENT
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8*, i8** %3
%20 = load i8*, i8** %4
%21 = call i32 @pl_fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* %20)
br label %22
22: ; preds = %18, %14
br label %23
23: ; preds = %22, %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
@MS_MGC_VAL = global i32 0
@MS_BIND = global i32 0
@MS_REC = global i32 0
@errno = global i64 0
@ENOENT = global i64 0
@.str.1 = [15 x i8] c"rbind %s to %s\00"
define void @pl_bind_mount(i8* %0, i8* %1) {
%3 = load i32, i32* @MS_MGC_VAL
%4 = load i32, i32* @MS_BIND
%5 = or i32 %4, %3
%6 = load i32, i32* @MS_REC
%7 = or i32 %5, %6
%8 = tail call i64 @mount(i8* %0, i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7, i32* null)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i64, i64* @errno
%12 = load i64, i64* @ENOENT
%13 = icmp eq i64 %11, %12
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = tail call i32 @pl_fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %16
16: ; preds = %10, %14, %2
ret void
}