// File: /workspace/github_cpp_makefile_star2_O3/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, %ebx
movq %rdi, %r14
callq 0x278c0
movq %rax, %r15
leaq 0x1983b(%rip), %rsi     # 0x56236
movq %rax, %rdi
callq 0x27670
testl %eax, %eax
jne 0x3cca9
callq 0x272a0
testl %eax, %eax
jne 0x3ccba
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19967(%rip), %rsi     # 0x5638f
leaq 0x19965(%rip), %rdx     # 0x56394
leaq 0x8(%rsp), %rdi
callq 0x42cf8
leaq 0x8(%rsp), %rdi
callq 0x2d3bd
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3ca5a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1992c(%rip), %rsi     # 0x56395
leaq 0x1992a(%rip), %rdx     # 0x5639a
callq 0x42cf8
leaq 0x8(%rsp), %rdi
callq 0x2d3bd
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3ca96
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x186e3(%rip), %rdx     # 0x55188
movq %rdx, %rsi
callq 0x42cf8
movq (%r14), %r12
movq 0x8(%r14), %rbp
cmpq %rbp, %r12
je 0x3cc5e
leaq 0x19afe(%rip), %r13     # 0x565c2
leaq 0x68(%rsp), %r14
leaq 0x20(%r12), %rdi
leaq 0x186b3(%rip), %rsi     # 0x55188
callq 0x27100
testl %eax, %eax
je 0x3cbb4
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x47420
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x47420
leaq 0x28(%rsp), %rdi
leaq 0x19874(%rip), %rsi     # 0x563a1
movl %ebx, %edx
leaq 0x188c2(%rip), %rcx     # 0x553f8
leaq 0x48(%rsp), %r8
movq %r13, %r9
pushq %r13
pushq %r14
callq 0x3d5d8
addq $0x10, %rsp
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x27120
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3cb7b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3cb97
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3cc51
movq 0x58(%rsp), %rsi
jmp 0x3cc49
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %r15
movq %r15, %rdi
callq 0x47420
leaq 0x28(%rsp), %rdi
leaq 0x197af(%rip), %rsi     # 0x5639b
movl %ebx, %edx
movq %r13, %rcx
movq %r15, %r8
movq %r13, %r9
callq 0x3d4f7
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x27120
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3cc2c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x3cc51
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x27480
addq $0x40, %r12
cmpq %rbp, %r12
jne 0x3cac9
movq 0x8(%rsp), %rsi
leaq 0x1973d(%rip), %rdi     # 0x563a7
xorl %eax, %eax
callq 0x2ceee
leaq 0x8(%rsp), %rdi
callq 0x2d49f
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3cc97
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19678(%rip), %rdi     # 0x56328
movq %r15, %rsi
xorl %eax, %eax
callq 0x2cd4f
leaq 0x1969d(%rip), %rdi     # 0x5635e
xorl %eax, %eax
callq 0x2cd4f
jmp 0x3cce4
jmp 0x3ccce
jmp 0x3cce4
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x3cdae
jmp 0x3cdbb
movq %rax, %rbx
jmp 0x3cdbb
jmp 0x3cd9c
jmp 0x3cd9c
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3cd1a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3cd1a
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x3cd9f
movq 0x98(%rsp), %rsi
jmp 0x3cd92
movq %rax, %rbx
jmp 0x3cd7e
movq %rax, %rbx
jmp 0x3cd62
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3cd62
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3cd7e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3cd9f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3cd9f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3cdbb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
movq %rbx, %rdi
callq 0x27830
nop