#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_RDONLY;
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ mount(char *, char *, char *, int /*<<< orphan*/, char *);
void do_mounts(void) {
  mount("hostfs", "/host", "9p", MS_RDONLY, "trans=virtio,version=9p2000.L");
  mount("", "/sys", "sysfs", 0, NULL);
  mount("proc", "/proc", "proc", 0, NULL);
  mount("devtmpfs", "/dev", "devtmpfs", 0, NULL);
  mkdir("/dev/pts", 0755);
  mount("devpts", "/dev/pts", "devpts", 0, NULL);
}


x86 assembly (clang, -O0):
<do_mounts>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%ecx
lea    0xecc(%rip),%rdi
lea    0xecc(%rip),%rsi
lea    0xecb(%rip),%rdx
lea    0xec7(%rip),%r8
call   1040 <mount@plt>
lea    0xed8(%rip),%rdi
lea    0xed2(%rip),%rsi
lea    0xed0(%rip),%rdx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <mount@plt>
lea    0xec4(%rip),%rdx
lea    0xebc(%rip),%rsi
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rdx,%rdi
call   1040 <mount@plt>
lea    0xeac(%rip),%rdx
lea    0xeae(%rip),%rsi
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rdx,%rdi
call   1040 <mount@plt>
lea    0xe9d(%rip),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
lea    0xe95(%rip),%rdx
lea    0xe85(%rip),%rsi
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rdx,%rdi
call   1040 <mount@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mounts>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ecx
lea    0xecf(%rip),%rdi
lea    0xecf(%rip),%rsi
lea    0xece(%rip),%rdx
lea    0xeca(%rip),%r8
call   1040 <mount@plt>
lea    0xedb(%rip),%rdi
lea    0xed5(%rip),%rsi
lea    0xed3(%rip),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <mount@plt>
lea    0xec8(%rip),%rsi
lea    0xec2(%rip),%rdi
mov    %rdi,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <mount@plt>
lea    0xebc(%rip),%rsi
lea    0xeac(%rip),%rdi
mov    %rdi,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <mount@plt>
lea    0xea6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
mov    %rdi,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <mount@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"hostfs\00"
@.str.1 = [6 x i8] c"/host\00"
@.str.2 = [3 x i8] c"9p\00"
@MS_RDONLY = global i32 0
@.str.3 = [30 x i8] c"trans=virtio,version=9p2000.L\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [5 x i8] c"/sys\00"
@.str.6 = [6 x i8] c"sysfs\00"
@.str.7 = [5 x i8] c"proc\00"
@.str.8 = [6 x i8] c"/proc\00"
@.str.9 = [9 x i8] c"devtmpfs\00"
@.str.10 = [5 x i8] c"/dev\00"
@.str.11 = [9 x i8] c"/dev/pts\00"
@.str.12 = [7 x i8] c"devpts\00"
define void @do_mounts() {
%1 = load i32, i32* @MS_RDONLY
%2 = call i32 @mount(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @mount(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 0, i8* null)
%4 = call i32 @mount(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* null)
%5 = call i32 @mount(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 0, i8* null)
%6 = call i32 @mkdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 493)
%7 = call i32 @mount(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 0, i8* null)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"hostfs\00"
@.str.1 = [6 x i8] c"/host\00"
@.str.2 = [3 x i8] c"9p\00"
@MS_RDONLY = global i32 0
@.str.3 = [30 x i8] c"trans=virtio,version=9p2000.L\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [5 x i8] c"/sys\00"
@.str.6 = [6 x i8] c"sysfs\00"
@.str.7 = [5 x i8] c"proc\00"
@.str.8 = [6 x i8] c"/proc\00"
@.str.9 = [9 x i8] c"devtmpfs\00"
@.str.10 = [5 x i8] c"/dev\00"
@.str.11 = [9 x i8] c"/dev/pts\00"
@.str.12 = [7 x i8] c"devpts\00"
define void @do_mounts() {
%1 = load i32, i32* @MS_RDONLY
%2 = tail call i32 @mount(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @mount(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 0, i8* null)
%4 = tail call i32 @mount(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* null)
%5 = tail call i32 @mount(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 0, i8* null)
%6 = tail call i32 @mkdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 493)
%7 = tail call i32 @mount(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 0, i8* null)
ret void
}