// File: /workspace/github_cpp_makefile_star2_O3/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 0x1adf1(%rip), %rsi     # 0x55f1f
leaq 0x1adee(%rip), %rdx     # 0x55f23
leaq 0x8(%rsp), %rdi
callq 0x42cf8
leaq 0x8(%rsp), %rdi
movl $0x1e8, %esi            # imm = 0x1E8
callq 0x2d05f
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b165
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x1b0e7(%rip), %rsi     # 0x56253
movl $0x44000, %ecx          # imm = 0x44000
xorl %edi, %edi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x278e0
testl %eax, %eax
js 0x3b288
leaq 0x1b028(%rip), %rdi     # 0x561b4
leaq 0x1ad8c(%rip), %rsi     # 0x55f1f
leaq 0x1b01f(%rip), %rdx     # 0x561b9
leaq 0x1b01e(%rip), %r8      # 0x561bf
xorl %ecx, %ecx
callq 0x278e0
testl %eax, %eax
js 0x3b291
addq $0x128, %rbx            # imm = 0x128
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3b78e
movq %r14, %rdi
callq 0x3ba20
leaq 0x1ad49(%rip), %rdi     # 0x55f1f
callq 0x27440
testl %eax, %eax
js 0x3b29f
leaq 0x1b00e(%rip), %rdi     # 0x561f8
callq 0x27700
testl %eax, %eax
js 0x3b2a8
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1b01f(%rip), %rsi     # 0x56225
leaq 0x1b01c(%rip), %rdx     # 0x56229
callq 0x42cf8
leaq 0x8(%rsp), %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x2d05f
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b238
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1afe3(%rip), %rsi     # 0x5622a
leaq 0x1afe6(%rip), %rdx     # 0x56234
callq 0x42cf8
leaq 0x8(%rsp), %rdi
callq 0x2d2db
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b274
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x28(%rsp), %rdi
callq 0x3c3a6
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1af09(%rip), %rdi     # 0x56198
jmp 0x3b298
leaq 0x1af30(%rip), %rdi     # 0x561c8
xorl %eax, %eax
callq 0x2cd4f
leaq 0x1af40(%rip), %rdi     # 0x561e6
jmp 0x3b2af
leaq 0x1af52(%rip), %rdi     # 0x56201
xorl %eax, %eax
callq 0x2cd4f
jmp 0x3b2ba
jmp 0x3b2f9
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b2fc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3b2fc
jmp 0x3b2f9
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b306
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3b306
movq %rax, %rbx
jmp 0x3b306
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3c3a6
movq %rbx, %rdi
callq 0x27830