// File: /workspace/github_cpp_makefile_star2_O1/establishment[P]sandman/src/rules.hpp
// Function: Rules::DirRules::add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
int add(std::string boxPath, std::string localPath, unsigned int flags) {
            // Make sure that "boxPath" is relative
            while (boxPath.size() && boxPath[0] == '/') {
                boxPath = boxPath.substr(1);
            }

            // Check boxPath
            if (boxPath.size() == 0 || localPath.size() == 0) {
                return 0;
            }

            // Check "localPath"
            if (flags & FLAG_FS) {
                if (localPath[0] == '/') {
                    return 0;
                }
            } else if (localPath[0] != '/' && localPath.substr(0, 2) != "./") {
                return 0;
            }

            // Override an existing rule
            for (DirRule& rule : allDirRules) {
                if (rule.boxPath == boxPath) {
                    rule.localPath = localPath;
                    rule.flags = flags;
                    return 1;
                }
            }

            // Add a new rule
            allDirRules.push_back({boxPath, localPath, flags});

            return 1;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
xorl %r12d, %r12d
cmpq $0x0, 0x8(%rsi)
sete %al
je 0x3c98e
movl %ecx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movq %rdx, 0x10(%rsp)
leaq 0x30(%rsp), %rbx
movq (%rsi), %rcx
cmpb $0x2f, (%rcx)
jne 0x3c802
leaq 0x20(%rsp), %r13
movl $0x1, %edx
movq %r13, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x274c0
movq %r15, %rdi
movq %r13, %rsi
callq 0x275a0
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3c7ec
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
cmpq $0x0, 0x8(%r15)
sete %al
je 0x3c98e
movq (%r15), %rcx
cmpb $0x2f, (%rcx)
je 0x3c7b3
testb %al, %al
jne 0x3c98e
movq 0x10(%rsp), %rsi
cmpq $0x0, 0x8(%rsi)
je 0x3c98e
movq %r14, 0x18(%rsp)
movq (%rsi), %rax
movl %ebp, %ecx
movb (%rax), %bpl
movl %ecx, 0xc(%rsp)
testb $0x4, %cl
jne 0x3c83b
cmpb $0x2f, %bpl
jne 0x3c846
xorl %r14d, %r14d
jmp 0x3c86f
cmpb $0x2f, %bpl
jne 0x3c89c
jmp 0x3c98e
leaq 0x68(%rsp), %r12
movl $0x2, %ecx
movq %r12, %rdi
xorl %edx, %edx
callq 0x274c0
leaq 0x199f1(%rip), %rsi     # 0x56252
movq %r12, %rdi
callq 0x27100
testl %eax, %eax
setne %r14b
cmpb $0x2f, %bpl
je 0x3c890
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c890
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x27480
xorl %r12d, %r12d
testb %r14b, %r14b
jne 0x3c98e
movq 0x18(%rsp), %rax
movq (%rax), %r12
movq 0x8(%rax), %rbp
cmpq %rbp, %r12
sete %r13b
je 0x3c90b
movq 0x8(%r15), %r14
movq 0x8(%r12), %rdx
cmpq %r14, %rdx
jne 0x3c8d4
testq %rdx, %rdx
je 0x3c8e3
movq (%r15), %rsi
movq (%r12), %rdi
callq 0x274b0
testl %eax, %eax
je 0x3c8e3
addq $0x48, %r12
cmpq %rbp, %r12
sete %r13b
jne 0x3c8b5
jmp 0x3c90b
leaq 0x20(%r12), %rdi
movq 0x10(%rsp), %rsi
callq 0x27260
movl 0xc(%rsp), %eax
movl %eax, 0x40(%r12)
movl $0x1, %r12d
testb $0x1, %r13b
je 0x3c98e
leaq 0x20(%rsp), %rdi
movq %rbx, (%rdi)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
callq 0x47a78
leaq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x47a78
leaq 0x20(%rsp), %rsi
movl 0xc(%rsp), %eax
movl %eax, 0x40(%rsi)
movq 0x18(%rsp), %rdi
callq 0x3cb18
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x3c971
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3c988
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
movl $0x1, %r12d
movl %r12d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x3cae2
jmp 0x3c9cc
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3c9cc
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
movq %r14, %rdi
callq 0x27830