// File: /workspace/github_cpp_makefile_star2_O1/establishment[P]sandman/src/lib.hpp
// Function: ProcessInitialiser::setupRoot()
void setupRoot() {
        Base::MakeDir("root", 0750);

        /*
         * Ensure all mounts are private, not shared. We don't want our mounts
         * appearing outside of our namespace.
         * (systemd since version 188 mounts filesystems shared by default).
         */
        if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL) < 0) Die("Cannot privatize mounts: %m");

        /// mount root folder as ramdisk so all writes/reads from files will be fast a.f.
        /// mounts nothing("none") as a folder root which will be seen
        if (mount("none", "root", "tmpfs", 0, "mode=755") < 0) Die("Cannot mount root ramdisk: %m");

        Rules::DirRules dirRules(config.dirRules);
        dirRules.applyRules();

        if (chroot("root") < 0) Die("Chroot failed: %m");

        if (chdir("root/box") < 0) Die("Cannot change current directory: %m");

        /// TODO(@velea) why doesn't Makedir apply permissions mod?
        Base::MakeDir("/tmp", 0777);
        Base::RChmod(" 777 /tmp ");
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a761(%rip), %rsi     # 0x55f1f
leaq 0x1a75e(%rip), %rdx     # 0x55f23
leaq 0x8(%rsp), %rdi
callq 0x43424
leaq 0x8(%rsp), %rdi
movl $0x1e8, %esi            # imm = 0x1E8
callq 0x2d14d
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b7f5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x1aa57(%rip), %rsi     # 0x56253
movl $0x44000, %ecx          # imm = 0x44000
xorl %edi, %edi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x278e0
testl %eax, %eax
js 0x3b918
leaq 0x1a998(%rip), %rdi     # 0x561b4
leaq 0x1a6fc(%rip), %rsi     # 0x55f1f
leaq 0x1a98f(%rip), %rdx     # 0x561b9
leaq 0x1a98e(%rip), %r8      # 0x561bf
xorl %ecx, %ecx
callq 0x278e0
testl %eax, %eax
js 0x3b921
addq $0x128, %rbx            # imm = 0x128
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3be2c
movq %r14, %rdi
callq 0x3c0be
leaq 0x1a6b9(%rip), %rdi     # 0x55f1f
callq 0x27440
testl %eax, %eax
js 0x3b92f
leaq 0x1a97e(%rip), %rdi     # 0x561f8
callq 0x27700
testl %eax, %eax
js 0x3b938
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1a98f(%rip), %rsi     # 0x56225
leaq 0x1a98c(%rip), %rdx     # 0x56229
callq 0x43424
leaq 0x8(%rsp), %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x2d14d
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b8c8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1a953(%rip), %rsi     # 0x5622a
leaq 0x1a956(%rip), %rdx     # 0x56234
callq 0x43424
leaq 0x8(%rsp), %rdi
callq 0x2d3c9
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b904
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x28(%rsp), %rdi
callq 0x3cab2
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1a879(%rip), %rdi     # 0x56198
jmp 0x3b928
leaq 0x1a8a0(%rip), %rdi     # 0x561c8
xorl %eax, %eax
callq 0x2ce45
leaq 0x1a8b0(%rip), %rdi     # 0x561e6
jmp 0x3b93f
leaq 0x1a8c2(%rip), %rdi     # 0x56201
xorl %eax, %eax
callq 0x2ce45
jmp 0x3b94a
jmp 0x3b989
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b98c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3b98c
jmp 0x3b989
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b996
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3b996
movq %rax, %rbx
jmp 0x3b996
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3cab2
movq %rbx, %rdi
callq 0x27830