// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/rules.hpp
// Function: Rules::FilePermissions::applyRules(unsigned int)
void applyRules(uid_t uid) {
            char* pwd = get_current_dir_name();
            if (strcmp(pwd, "/box") != 0) {
                Die("FilePermissions::applyRules must be run in /box | %s\n", pwd);
            }

            if (geteuid()) {
                Die("FilePermissions::applyRules must be run as root\n");
            }

            /// delete all privileges for other
            Base::Chmod("750 .");
            Base::Chmod("750 *");

            std::string command = "";
            for (const Permission& rule : allPermissions) {
                if (rule.mode == "") {
                    command += Base::StrCat("-x u:", uid, " ", rule.path, " ");
                } else {
                    command += Base::StrCat("-m u:", uid, ":", rule.mode, " ", rule.path, " ");
                }
            }

            Msg("permissions command:\t%s\n", command.c_str());
            Base::Setfacl(command);
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %esi, 0x4(%rsp)
movq %rdi, %rbx
callq 0x37890
movq %rax, %r14
leaq 0x15ea2(%rip), %rsi     # 0x5c203
movq %rax, %rdi
callq 0x37670
testl %eax, %eax
jne 0x46512
callq 0x37290
testl %eax, %eax
jne 0x46523
leaq 0x15fd7(%rip), %rsi     # 0x5c35c
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x40b24
leaq 0x8(%rsp), %rdi
callq 0x3b7df
leaq 0x8(%rsp), %rdi
callq 0x37958
leaq 0x15fb3(%rip), %rsi     # 0x5c362
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x40b24
leaq 0x8(%rsp), %rdi
callq 0x3b7df
leaq 0x8(%rsp), %rdi
callq 0x37958
leaq 0x14d6f(%rip), %rsi     # 0x5b148
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x40b24
movq (%rbx), %r14
movq 0x8(%rbx), %r15
leaq 0x16199(%rip), %rbp     # 0x5c58f
leaq 0x28(%rsp), %r13
leaq 0x88(%rsp), %rbx
cmpq %r15, %r14
je 0x464d9
leaq 0x20(%r14), %r12
movq %r12, %rdi
leaq 0x14d2e(%rip), %rsi     # 0x5b148
callq 0x40cd9
testb %al, %al
je 0x4646b
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x37650
movq %r13, %rdi
leaq 0x15f2b(%rip), %rsi     # 0x5c368
movl 0x4(%rsp), %edx
movq %rbp, %rcx
movq %r12, %r8
movq %rbp, %r9
callq 0x46b18
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x37910
movq %r13, %rdi
callq 0x37958
leaq 0x68(%rsp), %rdi
jmp 0x464cb
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x37650
movq %rbx, %rdi
movq %r14, %rsi
callq 0x37650
movq %r13, %rdi
leaq 0x15ee1(%rip), %rsi     # 0x5c36e
movl 0x4(%rsp), %edx
leaq 0x14f24(%rip), %rcx     # 0x5b3bc
leaq 0x48(%rsp), %r8
movq %rbp, %r9
pushq %rbp
pushq %rbx
callq 0x46bab
popq %rax
popq %rcx
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x37910
movq %r13, %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x37958
leaq 0x48(%rsp), %rdi
callq 0x37958
addq $0x40, %r14
jmp 0x46403
movq 0x8(%rsp), %rsi
leaq 0x15e8f(%rip), %rdi     # 0x5c374
xorl %eax, %eax
callq 0x3b443
leaq 0x8(%rsp), %rdi
callq 0x3b86a
leaq 0x8(%rsp), %rdi
callq 0x37958
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15ddc(%rip), %rdi     # 0x5c2f5
movq %r14, %rsi
xorl %eax, %eax
callq 0x3b2a4
leaq 0x15e01(%rip), %rdi     # 0x5c32b
xorl %eax, %eax
callq 0x3b2a4
jmp 0x4653c
jmp 0x46537
jmp 0x4653c
movq %rax, %rbx
jmp 0x46591
movq %rax, %rbx
jmp 0x4659b
jmp 0x46575
movq %rax, %rbx
jmp 0x4656e
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x37958
jmp 0x46561
movq %rax, %rbx
jmp 0x46587
jmp 0x46575
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x37958
leaq 0x48(%rsp), %rdi
jmp 0x4658c
movq %rax, %rbx
jmp 0x46591
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x37958
leaq 0x68(%rsp), %rdi
callq 0x37958
leaq 0x8(%rsp), %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x377f0
nop