// File: /workspace/github_cpp_makefile_star2_O1/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 0x19137(%rip), %rsi     # 0x56236
movq %rax, %rdi
callq 0x27670
testl %eax, %eax
jne 0x3d3ad
callq 0x272a0
testl %eax, %eax
jne 0x3d3be
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19263(%rip), %rsi     # 0x5638f
leaq 0x19261(%rip), %rdx     # 0x56394
leaq 0x8(%rsp), %rdi
callq 0x43424
leaq 0x8(%rsp), %rdi
callq 0x2d4ab
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3d15e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x19228(%rip), %rsi     # 0x56395
leaq 0x19226(%rip), %rdx     # 0x5639a
callq 0x43424
leaq 0x8(%rsp), %rdi
callq 0x2d4ab
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3d19a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x17fdf(%rip), %rdx     # 0x55188
movq %rdx, %rsi
callq 0x43424
movq (%r14), %r12
movq 0x8(%r14), %rbp
cmpq %rbp, %r12
je 0x3d362
leaq 0x193fa(%rip), %r13     # 0x565c2
leaq 0x68(%rsp), %r14
leaq 0x20(%r12), %rdi
leaq 0x17faf(%rip), %rsi     # 0x55188
callq 0x27100
testl %eax, %eax
je 0x3d2b8
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x47a78
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x47a78
leaq 0x28(%rsp), %rdi
leaq 0x19170(%rip), %rsi     # 0x563a1
movl %ebx, %edx
leaq 0x181be(%rip), %rcx     # 0x553f8
leaq 0x48(%rsp), %r8
movq %r13, %r9
pushq %r13
pushq %r14
callq 0x3dcdc
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 0x3d27f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3d29b
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3d355
movq 0x58(%rsp), %rsi
jmp 0x3d34d
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 0x47a78
leaq 0x28(%rsp), %rdi
leaq 0x190ab(%rip), %rsi     # 0x5639b
movl %ebx, %edx
movq %r13, %rcx
movq %r15, %r8
movq %r13, %r9
callq 0x3dbfb
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 0x3d330
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x3d355
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x27480
addq $0x40, %r12
cmpq %rbp, %r12
jne 0x3d1cd
movq 0x8(%rsp), %rsi
leaq 0x19039(%rip), %rdi     # 0x563a7
xorl %eax, %eax
callq 0x2cfe4
leaq 0x8(%rsp), %rdi
callq 0x2d58d
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3d39b
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 0x18f74(%rip), %rdi     # 0x56328
movq %r15, %rsi
xorl %eax, %eax
callq 0x2ce45
leaq 0x18f99(%rip), %rdi     # 0x5635e
xorl %eax, %eax
callq 0x2ce45
jmp 0x3d3e8
jmp 0x3d3d2
jmp 0x3d3e8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x3d4b2
jmp 0x3d4bf
movq %rax, %rbx
jmp 0x3d4bf
jmp 0x3d4a0
jmp 0x3d4a0
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3d41e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3d41e
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x3d4a3
movq 0x98(%rsp), %rsi
jmp 0x3d496
movq %rax, %rbx
jmp 0x3d482
movq %rax, %rbx
jmp 0x3d466
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3d466
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3d482
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3d4a3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3d4a3
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3d4bf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x27480
movq %rbx, %rdi
callq 0x27830
nop