#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 MS_BIND;
int MS_NOATIME;
int MS_NODIRATIME;
int MS_NOSUID;
int /*<<< orphan*/ mount(char *, char *, char *, int, char *);
int /*<<< orphan*/ umount(char *);
int /*<<< orphan*/ umount2(char *, int);
int main() {
  mount("mount_source", "mount_target", "ext2",
        MS_BIND | MS_NOATIME | MS_NODIRATIME | MS_NOSUID, "some arguments");
  umount("umount_target");
  umount2("umount2_target", 0x00000001);
  umount2("umount2_target", 0x00000002);
  umount2("umount2_target", 0x00000004);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea1(%rip),%rax
or     (%rax),%ecx
mov    0x2e70(%rip),%rax
or     (%rax),%ecx
mov    0x2e7f(%rip),%rax
or     (%rax),%ecx
lea    0xe96(%rip),%rdi
lea    0xeb1(%rip),%rsi
lea    0xe95(%rip),%rdx
lea    0xe93(%rip),%r8
call   1050 <mount@plt>
lea    0xe96(%rip),%rdi
call   1030 <umount@plt>
lea    0xe98(%rip),%rdi
mov    $0x1,%esi
call   1040 <umount2@plt>
lea    0xe87(%rip),%rdi
mov    $0x2,%esi
call   1040 <umount2@plt>
lea    0xe76(%rip),%rdi
mov    $0x4,%esi
call   1040 <umount2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2e7e(%rip),%rax
or     (%rax),%ecx
mov    0x2e8d(%rip),%rax
or     (%rax),%ecx
lea    0xea4(%rip),%rdi
lea    0xebf(%rip),%rsi
lea    0xea3(%rip),%rdx
lea    0xea1(%rip),%r8
call   1050 <mount@plt>
lea    0xea4(%rip),%rdi
call   1030 <umount@plt>
lea    0xea6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <umount2@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <umount2@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <umount2@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"mount_source\00"
@.str.1 = [13 x i8] c"mount_target\00"
@.str.2 = [5 x i8] c"ext2\00"
@MS_BIND = global i32 0
@MS_NOATIME = global i32 0
@MS_NODIRATIME = global i32 0
@MS_NOSUID = global i32 0
@.str.3 = [15 x i8] c"some arguments\00"
@.str.4 = [14 x i8] c"umount_target\00"
@.str.5 = [15 x i8] c"umount2_target\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @MS_BIND
%3 = load i32, i32* @MS_NOATIME
%4 = or i32 %2, %3
%5 = load i32, i32* @MS_NODIRATIME
%6 = or i32 %4, %5
%7 = load i32, i32* @MS_NOSUID
%8 = or i32 %6, %7
%9 = call i32 @mount(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @umount(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @umount2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 1)
%12 = call i32 @umount2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 2)
%13 = call i32 @umount2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"mount_source\00"
@.str.1 = [13 x i8] c"mount_target\00"
@.str.2 = [5 x i8] c"ext2\00"
@MS_BIND = global i32 0
@MS_NOATIME = global i32 0
@MS_NODIRATIME = global i32 0
@MS_NOSUID = global i32 0
@.str.3 = [15 x i8] c"some arguments\00"
@.str.4 = [14 x i8] c"umount_target\00"
@.str.5 = [15 x i8] c"umount2_target\00"
define i32 @main() {
%1 = load i32, i32* @MS_BIND
%2 = load i32, i32* @MS_NOATIME
%3 = or i32 %2, %1
%4 = load i32, i32* @MS_NODIRATIME
%5 = or i32 %3, %4
%6 = load i32, i32* @MS_NOSUID
%7 = or i32 %5, %6
%8 = tail call i32 @mount(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @umount(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @umount2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 1)
%11 = tail call i32 @umount2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 2)
%12 = tail call i32 @umount2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 4)
ret i32 0
}