LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/config.hpp
// Function: ProcessConfig::ProcessConfig()
ProcessConfig() : environment(), dirRules(), diskQuota(), filePermissions() {
        this->mode = kUnspecified;
        this->boxId = -1;
        this->processId = 0;

        this->verboseLevel = 0;
        this->metaFile = "";

        this->cpuTimeLimitMs = 0;
        this->wallTimeLimitMs = 0;
        this->extraTimeMs = 0;
        this->checkIntervalMs = 100;

        this->memoryLimitKB = 0;
        this->stackLimitKB = 0;

        this->redirectStdin = "";
        this->redirectStdout = "";
        this->redirectStderr = "";
        this->execDirectory = "";
        this->fileSizeLimitKB = 0;

        this->maxProcesses = 1;
        this->shareNetwork = 0;
        this->swapPipeOpenOrder = 0;

        this->runCommand = "";
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r15
leaq 0x20(%rdi), %rax
movq %rax, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
xorl %eax, %eax
movb %al, 0x20(%rdi)
leaq 0x68(%rdi), %rcx
movq %rcx, 0x58(%rdi)
andq $0x0, 0x60(%rdi)
movb %al, 0x68(%rdi)
leaq 0x88(%rdi), %rcx
movq %rcx, 0x78(%rdi)
andq $0x0, 0x80(%rdi)
movb %al, 0x88(%rdi)
leaq 0xa8(%rdi), %rcx
movq %rcx, 0x98(%rdi)
andq $0x0, 0xa0(%rdi)
addq $0x10, %rdi
leaq 0x58(%r15), %r14
movb %al, 0xa8(%r15)
leaq 0xc8(%r15), %rcx
movq %rcx, 0xb8(%r15)
andq $0x0, 0xc0(%r15)
leaq 0x78(%r15), %r12
leaq 0x98(%r15), %r13
movb %al, 0xc8(%r15)
leaq 0xf8(%r15), %rcx
movq %rcx, 0xe8(%r15)
andq $0x0, 0xf0(%r15)
leaq 0xb8(%r15), %rbp
leaq 0xe8(%r15), %rbx
movb %al, 0xf8(%r15)
leaq 0x110(%r15), %rax
movq %rax, 0x18(%rsp)
xorps %xmm0, %xmm0
andq $0x0, 0x120(%r15)
movups %xmm0, 0x110(%r15)
movq $0x1, 0x108(%r15)
leaq 0x128(%r15), %rax
movq %rax, 0x10(%rsp)
movups %xmm0, 0x148(%r15)
movups %xmm0, 0x138(%r15)
andq $0x0, 0x158(%r15)
movups %xmm0, 0x128(%r15)
movl $0x1, 0x160(%r15)
movsd 0x19d8f(%rip), %xmm0    # 0x5b020
movups %xmm0, (%r15)
leaq 0x19eac(%rip), %rsi     # 0x5b148
movq %rdi, 0x20(%rsp)
callq 0x378f0
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r15)
andq $0x0, 0x40(%r15)
movq $0x64, 0x48(%r15)
andq $0x0, 0x50(%r15)
leaq 0x19e81(%rip), %rsi     # 0x5b148
movq %r14, %rdi
callq 0x378f0
leaq 0x19e72(%rip), %rsi     # 0x5b148
movq %r12, %rdi
callq 0x378f0
leaq 0x19e63(%rip), %rsi     # 0x5b148
movq %r13, %rdi
callq 0x378f0
leaq 0x19e54(%rip), %rsi     # 0x5b148
movq %rbp, %rdi
callq 0x378f0
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0xd8(%r15)
andl $0x0, 0xe0(%r15)
movb $0x0, 0xe4(%r15)
leaq 0x19e24(%rip), %rsi     # 0x5b148
movq %rbx, %rdi
callq 0x378f0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, 0x8(%rsp)
addq $0x148, %r15            # imm = 0x148
movq %r15, %rdi
callq 0x41050
movq 0x10(%rsp), %rdi
callq 0x438f8
movq 0x18(%rsp), %rdi
callq 0x41050
movq %rbx, %rdi
callq 0x37958
movq %rbp, %rdi
callq 0x37958
movq %r13, %rdi
callq 0x37958
movq %r12, %rdi
callq 0x37958
movq %r14, %rdi
callq 0x37958
movq 0x20(%rsp), %rdi
callq 0x37958
movq 0x8(%rsp), %rdi
callq 0x377f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: ProcessKeeper::checkLimits()
RunStats::ResultCode checkLimits() {
        if (config.cpuTimeLimitMs && getProcTimeMs() >= config.cpuTimeLimitMs + config.extraTimeMs) {
            return RunStats::TIME_LIMIT_EXCEEDED;
        }

        if (config.wallTimeLimitMs && getWallTimeMs() >= config.wallTimeLimitMs + config.extraTimeMs) {
            return RunStats::WALL_TIME_LIMIT_EXCEEDED;
        }

        if (config.memoryLimitKB && getMemoryKB() >= config.memoryLimitKB) {
            return RunStats::MEMORY_LIMIT_EXCEEDED;
        }

        return RunStats::OK;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x30(%rdi)
je 0x4177c
leaq 0x3335e(%rip), %rdi     # 0x74ac8
callq 0x44258
movq 0x40(%rbx), %rcx
addq 0x30(%rbx), %rcx
cmpq %rcx, %rax
jae 0x417b3
cmpq $0x0, 0x38(%rbx)
je 0x41798
movq %rbx, %rdi
callq 0x4422a
movq 0x40(%rbx), %rcx
addq 0x38(%rbx), %rcx
cmpq %rcx, %rax
jae 0x417b7
cmpl $0x0, 0x50(%rbx)
je 0x417af
leaq 0x33323(%rip), %rdi     # 0x74ac8
callq 0x44ba2
cmpl %eax, 0x50(%rbx)
jle 0x417bb
pushq $0x1
jmp 0x417bd
pushq $0x3
jmp 0x417bd
pushq $0x4
jmp 0x417bd
pushq $0x5
popq %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: ProcessKeeper::killProcess(RunStats::ResultCode, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void killProcess(RunStats::ResultCode killReason, string internalMessage = "") {
        clearTimer();

        kill(-processPid, SIGKILL);
        kill(processPid, SIGKILL);

        struct rusage rus;
        int p, stat;

        do {
            p = wait4(processPid, &stat, 0, &rus);
        } while (p < 0 && errno == EINTR);

        processStats.processWasKilled = true;
        processStats.update(killReason);
        processStats.update(rus);
        processStats.exitCode = 0;
        processStats.internalMessage = internalMessage;

        updateStats();
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
callq 0x44cdc
xorl %edi, %edi
subl 0x168(%rbx), %edi
pushq $0x9
popq %r15
movl %r15d, %esi
callq 0x37690
movl 0x168(%rbx), %edi
movl %r15d, %esi
callq 0x37690
leaq 0xc(%rsp), %r15
leaq 0x10(%rsp), %r12
movl 0x168(%rbx), %edi
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x37270
testl %eax, %eax
jns 0x41829
callq 0x37050
cmpl $0x4, (%rax)
je 0x41808
movb $0x1, 0x1f8(%rbx)
testl %ebp, %ebp
je 0x4183a
movl %ebp, 0x1fc(%rbx)
leaq 0x198(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3adb6
andl $0x0, 0x1f4(%rbx)
leaq 0x200(%rbx), %rdi
movq %r14, %rsi
callq 0x37250
movq %rbx, %rdi
callq 0x44ce4
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: ProcessInitialiser::setupSystem()
void setupSystem() {
        Base::die_fd = errorPipes[1];
        close(errorPipes[0]);

        cg.enter();
        setupRoot();
        setupPipes();
        setupFilePermissions();
        setupRlimits();
        setupCredentials();

        /// changes dir before executin to dir provided from flag / set dir
        if (config.execDirectory.size() && chdir(config.execDirectory.c_str())) {
            Die("chdir: %m");
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x174(%rdi), %eax
movl %eax, 0x32bee(%rip)     # 0x744c4
movl 0x170(%rdi), %edi
callq 0x37920
leaq 0x331e0(%rip), %rdi     # 0x74ac8
callq 0x44eb2
movq %rbx, %rdi
callq 0x451c8
movq %rbx, %rdi
callq 0x4536a
movq %rbx, %rdi
callq 0x45474
movq %rbx, %rdi
callq 0x454c8
movq %rbx, %rdi
callq 0x4553e
cmpq $0x0, 0xc0(%rbx)
je 0x4192f
movq 0xb8(%rbx), %rdi
callq 0x376e0
testl %eax, %eax
jne 0x41931
popq %rbx
retq
leaq 0x1a74a(%rip), %rdi     # 0x5c082
xorl %eax, %eax
callq 0x3b2a4
nop
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/rules.hpp
// Function: Rules::Environment::Environment(ProcessConfig::Environment const&)
Environment(const ProcessConfig::Environment& config)
                : allRules({}) {
            this->passEnvironment = config.passEnvironment;

            for (int itr = 0; environ[itr]; itr += 1) {
                auto rule = getRule(environ[itr]);
                allRules[rule.first] = rule.second;
            }

            addDefaultRules();

            for (const auto& rule : config.rules) {
                addRule(rule);
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
xorl %ebp, %ebp
leaq 0x38(%rsp), %r12
leaq 0x18(%rsp), %r13
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r12, %rcx
movq %r13, %r8
callq 0x479ea
movq %r15, 0x10(%rsp)
movl 0x4(%r15), %eax
movl %eax, (%r14)
movq 0x3261f(%rip), %r15     # 0x73fa8
movq (%r15), %rax
movq (%rax,%rbp), %rsi
testq %rsi, %rsi
je 0x419de
movq %r13, %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x47a32
movq %r13, %rdi
callq 0x37958
movq %rbx, %rdi
movq %r12, %rsi
callq 0x47af4
movq %rax, %rdi
leaq 0x58(%rsp), %rsi
callq 0x37250
movq %r12, %rdi
callq 0x47b5a
addq $0x8, %rbp
jmp 0x41989
movq %r14, %rdi
callq 0x47b70
movq 0x10(%rsp), %rax
movq 0x8(%rax), %r15
movq 0x10(%rax), %r12
cmpq %r12, %r15
je 0x41a09
movq %r14, %rdi
movq %r15, %rsi
callq 0x47bc6
addq $0x20, %r15
jmp 0x419f3
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x41a1c
jmp 0x41a1c
movq %rax, %r14
jmp 0x41a3d
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x37958
jmp 0x41a3d
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x47b5a
movq %rbx, %rdi
callq 0x47c8a
movq %r14, %rdi
callq 0x377f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/rules.hpp
// Function: Rules::Environment::getEnvironment()
char** getEnvironment() {
            int numRules = 0;
            for (auto rule : allRules) {
                // don't count empty rules for the final number of rules
                numRules += !rule.second.empty();
            }

            char** env = (char**) malloc((numRules + 1) * sizeof(char*));
            int currentRule = 0;

            env[numRules] = NULL;
            for (auto rule : allRules) {
                if (rule.second.empty()) {
                    // no empty rules
                    continue;
                }

                env[currentRule++] = strdup(Base::StrCat(rule.first, "=", rule.second).c_str());
            }

            return env;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %r12
movq 0x20(%rdi), %r15
leaq 0x10(%rdi), %r14
xorl %ebp, %ebp
leaq 0x18(%rsp), %rbx
cmpq %r14, %r15
je 0x41aa0
leaq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x47fa2
cmpq $0x1, 0x40(%rsp)
sbbl $-0x1, %ebp
movq %rbx, %rdi
callq 0x4802c
movq %r15, %rdi
callq 0x37310
movq %rax, %r15
jmp 0x41a71
movq %r14, 0x10(%rsp)
movl %ebp, %ebx
leaq 0x8(,%rbx,8), %rdi
callq 0x37620
movq %rax, 0x8(%rsp)
andq $0x0, (%rax,%rbx,8)
movq 0x20(%r12), %r12
xorl %ebx, %ebx
leaq 0x78(%rsp), %r13
leaq 0x58(%rsp), %rbp
cmpq 0x10(%rsp), %r12
je 0x41b76
leaq 0x20(%r12), %rsi
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x47fa2
cmpq $0x0, 0x40(%rsp)
je 0x41b5c
movq %r13, %rdi
movq %r15, %rsi
callq 0x37650
movq %rbp, %rdi
leaq 0x38(%rsp), %rsi
callq 0x37650
leaq 0x98(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
leaq 0x1aab3(%rip), %rdx     # 0x5c5d4
movq %rbp, %rcx
callq 0x48285
movq 0x98(%rsp), %rdi
callq 0x37850
movslq %ebx, %rcx
incl %ebx
movq 0x8(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
movq %r14, %rdi
callq 0x37958
movq %rbp, %rdi
callq 0x37958
movq %r13, %rdi
callq 0x37958
leaq 0x18(%rsp), %rdi
callq 0x4802c
movq %r12, %rdi
callq 0x37310
movq %rax, %r12
jmp 0x41acf
movq 0x8(%rsp), %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x37958
jmp 0x41ba4
movq %rax, %rbx
jmp 0x41bae
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x37958
leaq 0x18(%rsp), %rdi
callq 0x4802c
movq %rbx, %rdi
callq 0x377f0
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: Jailer::Jailer(ProcessConfig const&, void*)
Jailer(const ProcessConfig& config, void* isolatedProcessStack = nullptr)
          : config(config), isolatedProcessStack(isolatedProcessStack) {
        /// sanity check
        if (config.boxId == -1) {
            Die("Specify box-id.");
        }

        if (config.processId < 0 or config.processId >= maxProcessesPerCG) {
            Die("Process if out of range [0, %d). Id=%d", maxProcessesPerCG, config.processId);
        }

        uid = firstProcessUid + maxProcessesPerCG * config.boxId + config.processId;
        gid = firstProcessGid + maxProcessesPerCG * config.boxId + config.processId;
        cgid = firstCgroupId + maxProcessesPerCG * config.boxId + config.processId;

        boxDir = Base::StrCat(baseBoxDir, "/", config.boxId);
        this->meta_fd = -1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x4d2a2
movq %r14, 0x168(%rbx)
leaq 0x180(%rbx), %rax
movq %rax, 0x170(%rbx)
andq $0x0, 0x178(%rbx)
leaq 0x170(%rbx), %r14
movb $0x0, 0x180(%rbx)
movl 0x4(%r15), %eax
cmpl $-0x1, %eax
je 0x42e6e
movl 0x8(%r15), %edx
movl 0x316fb(%rip), %esi     # 0x744d4
testl %edx, %edx
js 0x42e7c
cmpl %esi, %edx
jge 0x42e7c
imull %eax, %esi
addl %edx, %esi
movl 0x316d4(%rip), %eax     # 0x744c8
addl %esi, %eax
movl %eax, 0x190(%rbx)
movl 0x316ca(%rip), %eax     # 0x744cc
addl %esi, %eax
movl %eax, 0x194(%rbx)
addl 0x316c0(%rip), %esi     # 0x744d0
movl %esi, 0x198(%rbx)
leaq 0x32cdb(%rip), %rsi     # 0x75af8
movq %rsp, %rdi
callq 0x37650
movl 0x4(%r15), %ecx
leaq 0x193f0(%rip), %rdx     # 0x5c220
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x4d43c
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x37590
movq %r15, %rdi
callq 0x37958
movq %rsp, %rdi
callq 0x37958
orl $-0x1, 0x19c(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1976d(%rip), %rdi     # 0x5c5e2
xorl %eax, %eax
callq 0x3b2a4
leaq 0x1976f(%rip), %rdi     # 0x5c5f2
xorl %eax, %eax
callq 0x3b2a4
movq %rax, %r15
movq %rsp, %rdi
callq 0x37958
jmp 0x42e9c
jmp 0x42e99
movq %rax, %r15
movq %r14, %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x42d14
movq %r15, %rdi
callq 0x377f0
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: Jailer::Start()
void Start() {
        Base::verbose_level = config.verboseLevel;

        BoxInit();
        typedef ProcessConfig::Modes Modes;
        switch (config.mode) {
            case Modes::kUnspecified:
                Die("Specify a mode for isolate");
                break;
            case Modes::kInit:
                Init();
                break;
            case Modes::kRun:
                Run();
                break;
            case Modes::kCleanup:
                Cleanup();
                break;
            default:
                Die("Unknown mode");
                break;
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %eax
movl %eax, 0x31ac7(%rip)     # 0x74988
callq 0x4d70c
movl (%rbx), %eax
cmpq $0x3, %rax
ja 0x42f02
leaq 0x181a3(%rip), %rcx     # 0x5b078
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
popq %rbx
jmp 0x4d7ce
movq %rbx, %rdi
popq %rbx
jmp 0x4d870
movq %rbx, %rdi
popq %rbx
jmp 0x4db28
leaq 0x19719(%rip), %rdi     # 0x5c619
jmp 0x42f09
leaq 0x1972b(%rip), %rdi     # 0x5c634
xorl %eax, %eax
callq 0x3b2a4
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/cgroups.hpp
// Function: CGroups::readStat(CGroups::CGSubsystem, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
int readStat(CGSubsystem subsystem, const std::string& parameter, bool maybe=false) {
        int success = 0;
        int readSize = 0;

        std::string path = getPath(subsystem, parameter);

        int fd = open(path.c_str(), O_RDONLY);
        if (fd < 0) {
            if (maybe) {
                goto fail;
            }
            Base::Die("Cannot read %s: %m", path.c_str());
        }

        readSize = read(fd, buffer, kCGBufferSize);

        /// check read
        if (readSize < 0) {
            if (maybe) {
                goto fail_close;
            }
            Base::Die("Cannot read %s: %m", path.c_str());
        }

        if (readSize >= kCGBufferSize - 1) {
            Base::Die("Attribute %s too long", path.c_str());
        }

        /// erase \n from answer
        if (readSize > 0 && buffer[readSize - 1] == '\n') {
            readSize -= 1;
        }

        /// set end of read
        buffer[readSize] = 0;

        Base::Msg(2, "CG: Read '%s' = '%s'\n", parameter.c_str(), buffer);

        success = 1;

        fail_close:
        if (success == 0) {
            Base::Msg(2, "Failed to read %s\n", path.c_str());
        }
        close(fd);
        fail:
        return success;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r12d
movq %rdx, %r15
movq %rdi, %r14
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0x414c6
movq %rsp, %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x4442c
leaq 0x20(%rsp), %rdi
callq 0x37958
movq (%rsp), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x37340
movl %eax, %ebp
testl %eax, %eax
js 0x44380
addq $0x28, %r14
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r14, %rsi
callq 0x376a0
testl %eax, %eax
js 0x44391
cmpl $0xfff, %eax            # imm = 0xFFF
jae 0x443f3
testl %eax, %eax
je 0x443b0
leal -0x1(%rax), %ecx
cmpb $0xa, (%r14,%rcx)
cmovel %ecx, %eax
jmp 0x443b2
xorl %r14d, %r14d
testb %r12b, %r12b
jne 0x443d9
leaq 0x17beb(%rip), %rdi     # 0x5bf7a
jmp 0x443fa
movq (%rsp), %rdx
testb %r12b, %r12b
je 0x44400
xorl %r14d, %r14d
leaq 0x17c15(%rip), %rsi     # 0x5bfb9
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x3b38c
jmp 0x443d2
xorl %eax, %eax
movb $0x0, (%r14,%rax)
movq (%r15), %rdx
leaq 0x17be2(%rip), %rsi     # 0x5bfa3
pushq $0x2
popq %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x3b38c
pushq $0x1
popq %r14
movl %ebp, %edi
callq 0x37920
movq %rsp, %rdi
callq 0x37958
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17b93(%rip), %rdi     # 0x5bf8d
movq (%rsp), %rdx
jmp 0x44407
leaq 0x17b73(%rip), %rdi     # 0x5bf7a
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3b2a4
movq %rax, %r14
movq %r13, %rbx
jmp 0x4441c
movq %rax, %r14
movq %rbx, %rdi
callq 0x37958
movq %r14, %rdi
callq 0x377f0
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/cgroups.hpp
// Function: CGroups::memoryKB()
size_t memoryKB() {
        // Memory usage statistics
        size_t mem = 0, memsw = 0;
        if (readStat(cgMemory, "memory.max_usage_in_bytes", true)) {
            mem = atoll(buffer);
        } else {
            Base::Msg("Failed to read memory from cgroup");
        }

        if (readStat(cgMemory, "memory.memsw.max_usage_in_bytes", true)) {
            memsw = atoll(buffer);
            if (memsw > mem) {
                mem = memsw;
            }
        } else {
            Base::Msg("Failed to read swap memory from cgroup");
        }

        return mem >> 10;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq 0x2fe02(%rip), %rsi     # 0x749b8
leaq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0x414c6
leaq 0x17402(%rip), %rsi     # 0x5bfcc
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x40b24
leaq 0x50(%rsp), %rsi
leaq 0x8(%rsp), %rdx
pushq $0x1
popq %rcx
movq %rbx, %rdi
callq 0x442f8
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x37958
leaq 0x50(%rsp), %rdi
callq 0x37958
testl %ebp, %ebp
je 0x44c16
leaq 0x28(%rbx), %rdi
callq 0x37360
movq %rax, %r15
jmp 0x44c27
leaq 0x173c9(%rip), %rdi     # 0x5bfe6
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x3b443
leaq 0x2fd8a(%rip), %rsi     # 0x749b8
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x414c6
leaq 0x173c6(%rip), %rsi     # 0x5c008
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x40b24
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
pushq $0x1
popq %rcx
movq %rbx, %rdi
callq 0x442f8
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x37958
leaq 0x28(%rsp), %rdi
callq 0x37958
testl %ebp, %ebp
je 0x44c95
addq $0x28, %rbx
movq %rbx, %rdi
callq 0x37360
cmpq %r15, %rax
cmovaq %rax, %r15
jmp 0x44ca3
leaq 0x1738c(%rip), %rdi     # 0x5c028
xorl %eax, %eax
callq 0x3b443
shrq $0xa, %r15
movq %r15, %rax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x44cb9
jmp 0x44cc8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x37958
jmp 0x44ccb
movq %rax, %rbx
movq %r14, %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x377f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: ProcessKeeper::startStatusCheck(unsigned long long)
void startStatusCheck(unsigned long long checkIntervalMs) {
        /// setup callback for SIGALRM signal
        struct sigaction sa;
        bzero(&sa, sizeof(sa));
        sa.sa_handler = ProcessKeeper::alarmSignalHandler;
        sigaction(SIGALRM, &sa, NULL);

        /// setup initial time and interval time for signal triggering
        itimerval timer;

        timer.it_interval.tv_sec = checkIntervalMs / 1000;
        timer.it_interval.tv_usec = (checkIntervalMs % 1000) * 1000;
        timer.it_value = timer.it_interval;

        if (setitimer(ITIMER_REAL, &timer, NULL) != 0) {
            Die("ERROR: setitimer failed");
            exit(-1);
        }
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %rbx
leaq 0x20(%rsp), %r14
movl $0x98, %esi
movq %r14, %rdi
callq 0x377d0
leaq -0x8b2c(%rip), %rax     # 0x3c242
movq %rax, (%r14)
pushq $0xe
popq %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x375a0
movl $0x3e8, %ecx            # imm = 0x3E8
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
movq %rsp, %rsi
movq %rax, (%rsi)
imulq $0x3e8, %rdx, %rax      # imm = 0x3E8
movq %rax, 0x8(%rsi)
movq (%rsi), %rax
movq %rax, 0x10(%rsi)
movq 0x8(%rsi), %rax
movq %rax, 0x18(%rsi)
xorl %edi, %edi
xorl %edx, %edx
callq 0x37700
testl %eax, %eax
jne 0x44dc3
addq $0xb8, %rsp
popq %rbx
popq %r14
retq
leaq 0x17285(%rip), %rdi     # 0x5c04f
xorl %eax, %eax
callq 0x3b2a4
nop
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/cgroups.hpp
// Function: CGroups::getFullTime()
RunStats::TimeStat getFullTime() {
        RunStats::TimeStat timeStat;
        timeStat.wallTimeMs = 0;
        timeStat.cpuTimeMs = cpuTimeMs();

        /// http://stackoverflow.com/questions/3875801/convert-jiffies-to-seconds/6786757#6786757
        /// returns in jiffies. jiffies/sec = 100. num_juffies / 100 * 1000 to ms
        readStat(cgCpuacct, "cpuacct.stat");
        timeStat.userTimeMs = 10 * atoll(strstr(buffer, "user ") + strlen("user "));
        timeStat.systemTimeMs = 10 * atoll(strstr(buffer, "system ") + strlen("system "));

        return timeStat;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, (%rdi)
movq %rsi, %rdi
callq 0x44258
movq %rax, 0x8(%rbx)
leaq 0x2fbea(%rip), %rsi     # 0x749e0
leaq 0x30(%rsp), %rdi
callq 0x414c6
leaq 0x17260(%rip), %rsi     # 0x5c067
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x442f8
leaq 0x10(%rsp), %rdi
callq 0x37958
leaq 0x30(%rsp), %rdi
callq 0x37958
addq $0x28, %r14
leaq 0x1722b(%rip), %rsi     # 0x5c074
movq %r14, %rdi
callq 0x370c0
leaq 0x5(%rax), %rdi
callq 0x37360
imulq $0xa, %rax, %rax
movq %rax, 0x10(%rbx)
leaq 0x17211(%rip), %rsi     # 0x5c07a
movq %r14, %rdi
callq 0x370c0
leaq 0x7(%rax), %rdi
callq 0x37360
imulq $0xa, %rax, %rax
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x37958
jmp 0x44e9f
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x377f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x16d13(%rip), %rsi     # 0x5beec
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x40b24
leaq 0x10(%rsp), %rdi
movl $0x1e8, %esi            # imm = 0x1E8
callq 0x3b57a
leaq 0x10(%rsp), %rdi
callq 0x37958
leaq 0x17018(%rip), %rsi     # 0x5c220
movl $0x44000, %ecx          # imm = 0x44000
xorl %edi, %edi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x378b0
testl %eax, %eax
js 0x452fe
leaq 0x16f59(%rip), %rdi     # 0x5c181
leaq 0x16cbd(%rip), %rsi     # 0x5beec
leaq 0x16f50(%rip), %rdx     # 0x5c186
leaq 0x16f4f(%rip), %r8      # 0x5c18c
xorl %ecx, %ecx
callq 0x378b0
testl %eax, %eax
js 0x45307
addq $0x128, %rbx            # imm = 0x128
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x456de
movq %r14, %rdi
callq 0x45820
leaq 0x16c7a(%rip), %rdi     # 0x5beec
callq 0x37430
testl %eax, %eax
js 0x45315
leaq 0x16f3f(%rip), %rdi     # 0x5c1c5
callq 0x376e0
testl %eax, %eax
js 0x4531e
leaq 0x16f58(%rip), %rsi     # 0x5c1f2
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
leaq 0x10(%rsp), %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x3b57a
leaq 0x10(%rsp), %rdi
callq 0x37958
leaq 0x16f2e(%rip), %rsi     # 0x5c1f7
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
leaq 0x10(%rsp), %rdi
callq 0x3b754
leaq 0x10(%rsp), %rdi
callq 0x37958
leaq 0x30(%rsp), %rdi
callq 0x45ea6
addq $0x48, %rsp
popq %rbx
popq %r14
retq
leaq 0x16e60(%rip), %rdi     # 0x5c165
jmp 0x4530e
leaq 0x16e87(%rip), %rdi     # 0x5c195
xorl %eax, %eax
callq 0x3b2a4
leaq 0x16e97(%rip), %rdi     # 0x5c1b3
jmp 0x45325
leaq 0x16ea9(%rip), %rdi     # 0x5c1ce
xorl %eax, %eax
callq 0x3b2a4
jmp 0x45330
jmp 0x45355
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x37958
jmp 0x45358
jmp 0x45355
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x37958
jmp 0x45362
movq %rax, %rbx
jmp 0x45362
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x45ea6
movq %rbx, %rdi
callq 0x377f0
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: ProcessInitialiser::setupPipes()
void setupPipes() {
        if (config.swapPipeOpenOrder == false) {
            if (config.redirectStdin.size()) {
                close(0);
                if (open(config.redirectStdin.c_str(), O_RDONLY) != 0) {
                    Die("open(\"%s\"): %m", config.redirectStdin.c_str());
                }
            }

            if (config.redirectStdout.size()) {
                close(1);
                if (open(config.redirectStdout.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0666) != 1) {
                    Die("open(\"%s\"): %m", config.redirectStdout.c_str());
                }
            }
        } else {
            if (config.redirectStdout.size()) {
                close(1);
                if (open(config.redirectStdout.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0666) != 1) {
                    Die("open(\"%s\"): %m", config.redirectStdout.c_str());
                }
            }

            if (config.redirectStdin.size()) {
                close(0);
                if (open(config.redirectStdin.c_str(), O_RDONLY) != 0) {
                    Die("open(\"%s\"): %m", config.redirectStdin.c_str());
                }
            }
        }

        if (config.redirectStderr.size()) {
            close(2);
            if (open(config.redirectStderr.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0666) != 2) {
                Die("open(\"%s\"): %m", config.redirectStderr.c_str());
            }
        } else {
            dup2(1, 2);
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, 0xe4(%rdi)
je 0x453cb
cmpq $0x0, 0x80(%rbx)
je 0x453a7
pushq $0x1
popq %rdi
callq 0x37920
movq 0x78(%rbx), %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x37340
cmpl $0x1, %eax
jne 0x45453
cmpq $0x0, 0x60(%rbx)
je 0x45416
xorl %edi, %edi
callq 0x37920
movq 0x58(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x37340
testl %eax, %eax
je 0x45416
jmp 0x45459
cmpq $0x0, 0x60(%rbx)
je 0x453ea
xorl %edi, %edi
callq 0x37920
movq 0x58(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x37340
testl %eax, %eax
jne 0x45459
cmpq $0x0, 0x80(%rbx)
je 0x45416
pushq $0x1
popq %rdi
callq 0x37920
movq 0x78(%rbx), %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x37340
cmpl $0x1, %eax
jne 0x45453
cmpq $0x0, 0xa0(%rbx)
je 0x45447
pushq $0x2
popq %rdi
callq 0x37920
movq 0x98(%rbx), %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x37340
cmpl $0x2, %eax
jne 0x4545f
popq %rbx
retq
pushq $0x1
popq %rdi
pushq $0x2
popq %rsi
popq %rbx
jmp 0x37420
movq 0x78(%rbx), %rsi
jmp 0x45466
movq 0x58(%rbx), %rsi
jmp 0x45466
movq 0x98(%rbx), %rsi
leaq 0x16e71(%rip), %rdi     # 0x5c2de
xorl %eax, %eax
callq 0x3b2a4
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: ProcessInitialiser::setupRlimits()
void setupRlimits() {
        /// max file limit
        if (config.fileSizeLimitKB) {
            setRlimit(RLIMIT_FSIZE, (rlim_t)config.fileSizeLimitKB * 1024);
        }

        /// stack limit
        if (config.stackLimitKB) {
            setRlimit(RLIMIT_STACK, (rlim_t)config.stackLimitKB * 1024);
        } else {
            setRlimit(RLIMIT_STACK, RLIM_INFINITY);
        }

        /// max opened files at once
        setRlimit(RLIMIT_NOFILE, (rlim_t)64);

        /// prevents the process from locking memory into RAM - preventing
        /// the os to move the memory to swap space
        setRlimit(RLIMIT_MEMLOCK, (rlim_t)0);

        /// max num of processes/threads that can be created
        if (config.maxProcesses) {
            setRlimit(RLIMIT_NPROC, (rlim_t)config.maxProcesses);
        }
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movslq 0xd8(%rdi), %rdx
testq %rdx, %rdx
je 0x454e7
shlq $0xa, %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x47242
movslq 0x54(%rbx), %rax
movq %rax, %rcx
shlq $0xa, %rcx
xorl %edx, %edx
cmpq $0x1, %rax
sbbq %rdx, %rdx
orq %rcx, %rdx
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x47242
pushq $0x7
popq %rsi
pushq $0x40
popq %rdx
movq %rbx, %rdi
callq 0x47242
pushq $0x8
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x47242
movslq 0xdc(%rbx), %rdx
testq %rdx, %rdx
je 0x4553c
pushq $0x6
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x47242
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: ProcessInitialiser::setupCredentials()
void setupCredentials() {
        if (setresgid(gid, gid, gid) < 0) {
            Die("setresgid: %m");
        }

        if (setgroups(0, NULL) < 0) {
            Die("setgroups: %m");
        }

        if (setresuid(uid, uid, uid) < 0) {
            Die("setresuid: %m");
        }

        setpgrp();
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x16c(%rdi), %edi
movl %edi, %esi
movl %edi, %edx
callq 0x37140
testl %eax, %eax
js 0x4557b
xorl %edi, %edi
xorl %esi, %esi
callq 0x37750
testl %eax, %eax
js 0x45584
movl 0x168(%rbx), %edi
movl %edi, %esi
movl %edi, %edx
callq 0x370a0
testl %eax, %eax
js 0x4558d
popq %rbx
jmp 0x37540
leaq 0x16e71(%rip), %rdi     # 0x5c3f3
jmp 0x45594
leaq 0x16e76(%rip), %rdi     # 0x5c401
jmp 0x45594
leaq 0x16e7b(%rip), %rdi     # 0x5c40f
xorl %eax, %eax
callq 0x3b2a4
nop
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/rules.hpp
// Function: Rules::DirRules::DirRules(ProcessConfig::DirRules const&)
DirRules(const ProcessConfig::DirRules& config) {
            /// add default rules before any other rule can be added.
            /// in this way the default rules can be overwitten
            addDefaultRules();
            for (auto itr : config.rules) {
                if (itr.localPath != "") {
                    add(itr.boxPath, itr.localPath, itr.flags);
                } else {
                    add(itr.boxPath, itr.flags);
                }
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rdi, 0x8(%rsp)
callq 0x45a3c
movq (%rbx), %r14
movq 0x8(%rbx), %r15
leaq 0x10(%rsp), %r12
leaq 0x98(%rsp), %rbp
leaq 0x78(%rsp), %r13
leaq 0x58(%rsp), %rbx
cmpq %r15, %r14
je 0x457bc
movq %r12, %rdi
movq %r14, %rsi
callq 0x4409e
leaq 0x30(%rsp), %rdi
leaq 0x15a03(%rip), %rsi     # 0x5b148
callq 0x45ca3
testb %al, %al
je 0x45787
movq %rbp, %rdi
movq %r12, %rsi
callq 0x37650
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x37650
movl 0x50(%rsp), %ecx
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x45cae
movq %r13, %rdi
callq 0x37958
movq %rbp, %rdi
jmp 0x457a6
movq %rbx, %rdi
movq %r12, %rsi
callq 0x37650
movl 0x50(%rsp), %edx
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x45e24
movq %rbx, %rdi
callq 0x37958
movq %r12, %rdi
callq 0x43966
addq $0x48, %r14
jmp 0x45725
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x457fb
movq %rax, %rbx
jmp 0x457ec
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x457f4
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x37958
leaq 0x98(%rsp), %rdi
callq 0x37958
jmp 0x45803
movq %rax, %rbx
jmp 0x4580d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x43966
movq 0x8(%rsp), %rdi
callq 0x45ea6
movq %rbx, %rdi
callq 0x377f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/rules.hpp
// Function: Rules::DirRules::addDefaultRules()
void addDefaultRules() {
            add("box", "./box", FLAG_RW);
            add("bin");
            add("dev", FLAG_DEV); /// TODO Is this really necesary?
            add("lib");
            add("lib64", FLAG_MAYBE);
            add("proc", "proc", FLAG_FS);
            add("usr");
        }

// Assembly:
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movq %rdi, %rbx
leaq 0x167b6(%rip), %rsi     # 0x5c204
leaq 0x110(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x40b24
leaq 0x1679b(%rip), %rsi     # 0x5c202
leaq 0xf0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
leaq 0x110(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
pushq $0x1
popq %rcx
movq %rbx, %rdi
callq 0x45cae
leaq 0xf0(%rsp), %rdi
callq 0x37958
leaq 0x110(%rsp), %rdi
callq 0x37958
leaq 0x16753(%rip), %rsi     # 0x5c208
leaq 0xd0(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x40b24
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x45e24
leaq 0xd0(%rsp), %rdi
callq 0x37958
leaq 0x16dc8(%rip), %rsi     # 0x5c8b5
leaq 0xb0(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x40b24
leaq 0xb0(%rsp), %rsi
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0x45e24
leaq 0xb0(%rsp), %rdi
callq 0x37958
leaq 0x166e6(%rip), %rsi     # 0x5c20c
leaq 0x90(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x40b24
leaq 0x90(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x45e24
leaq 0x90(%rsp), %rdi
callq 0x37958
leaq 0x166b2(%rip), %rsi     # 0x5c210
leaq 0x70(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x40b24
leaq 0x70(%rsp), %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x45e24
leaq 0x70(%rsp), %rdi
callq 0x37958
leaq 0x16688(%rip), %rsi     # 0x5c216
leaq 0x50(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x40b24
leaq 0x16672(%rip), %rsi     # 0x5c216
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
pushq $0x4
popq %rcx
movq %rbx, %rdi
callq 0x45cae
leaq 0x30(%rsp), %rdi
callq 0x37958
leaq 0x50(%rsp), %rdi
callq 0x37958
leaq 0x16638(%rip), %rsi     # 0x5c21b
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x40b24
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x45e24
leaq 0x10(%rsp), %rdi
callq 0x37958
addq $0x130, %rsp            # imm = 0x130
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x45c91
jmp 0x45c98
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x37958
jmp 0x45c32
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x45c91
jmp 0x45c98
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0x45c91
jmp 0x45c98
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
jmp 0x45c91
jmp 0x45c98
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x45c91
jmp 0x45c98
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
jmp 0x45c91
jmp 0x45c98
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x37958
jmp 0x45c89
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x37958
jmp 0x45c9b
movq %rax, %rbx
movq %rbx, %rdi
callq 0x377f0
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
movl %ecx, 0x4(%rsp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
leaq 0x10(%rsp), %rbp
pushq $0x1
popq %rbx
pushq $-0x1
popq %r14
xorl %r13d, %r13d
cmpq $0x0, 0x8(%r12)
je 0x45deb
movq (%r12), %rax
cmpb $0x2f, (%rax)
jne 0x45d15
movq %rbp, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x374b0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x37590
movq %rbp, %rdi
callq 0x37958
jmp 0x45cd7
cmpq $0x0, 0x8(%r15)
je 0x45deb
movq %r15, %r14
movq (%r15), %rax
movb (%rax), %al
movl 0x4(%rsp), %r15d
testb $0x4, %r15b
jne 0x45d70
cmpb $0x2f, %al
je 0x45d74
xorl %r13d, %r13d
leaq 0x10(%rsp), %rbx
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x374b0
leaq 0x164c9(%rip), %rsi     # 0x5c21f
movq %rbx, %rdi
callq 0x45ca3
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x37958
testb %bl, %bl
je 0x45d74
jmp 0x45deb
cmpb $0x2f, %al
je 0x45deb
movq 0x8(%rsp), %rax
movq (%rax), %r13
movq 0x8(%rax), %rbx
addq $0x20, %r13
leaq -0x20(%r13), %rdi
cmpq %rbx, %rdi
je 0x45d9f
movq %r12, %rsi
callq 0x4141d
testb %al, %al
jne 0x45dd8
addq $0x48, %r13
jmp 0x45d84
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x37650
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x37650
leaq 0x10(%rsp), %rsi
movl %r15d, 0x40(%rsi)
movq 0x8(%rsp), %rdi
callq 0x45ede
leaq 0x10(%rsp), %rdi
callq 0x45ec8
jmp 0x45de7
movq %r13, %rdi
movq %r14, %rsi
callq 0x37250
movl %r15d, 0x20(%r13)
pushq $0x1
popq %r13
movl %r13d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x45e0e
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x45ec8
jmp 0x45e1b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x377f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/rules.hpp
// Function: Rules::FilePermissions::FilePermissions(ProcessConfig::FilePermissions const&)
FilePermissions(const ProcessConfig::FilePermissions& config) {
            this->fullPermissionsOverFolder = config.fullPermissionsOverFolder;

            if (fullPermissionsOverFolder) {
                addRule(".", "rxw");
                addRule("*", "rxw");
            }

            for (auto rule : config.rules) {
                addRule(rule);
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
cmpl $0x0, 0x18(%rsi)
setne 0x18(%rdi)
je 0x4626c
leaq 0x1619a(%rip), %rsi     # 0x5c360
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x40b24
leaq 0x1610e(%rip), %rsi     # 0x5c2ed
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
leaq 0x90(%rsp), %rsi
leaq 0x70(%rsp), %rdx
movq %rbx, %rdi
callq 0x465a4
leaq 0x70(%rsp), %rdi
callq 0x37958
leaq 0x90(%rsp), %rdi
callq 0x37958
leaq 0x16145(%rip), %rsi     # 0x5c366
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x40b24
leaq 0x160b6(%rip), %rsi     # 0x5c2ed
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x465a4
leaq 0x30(%rsp), %rdi
callq 0x37958
leaq 0x50(%rsp), %rdi
callq 0x37958
movq (%r14), %r15
movq 0x8(%r14), %r13
leaq 0x10(%rsp), %r14
leaq 0xb0(%rsp), %r12
cmpq %r13, %r15
je 0x462bc
movq %r14, %rdi
movq %r15, %rsi
callq 0x37650
movq %r12, %rdi
movq %r14, %rsi
callq 0x37650
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4663e
movq %r12, %rdi
callq 0x37958
movq %r14, %rdi
callq 0x37958
addq $0x20, %r15
jmp 0x46280
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x37958
jmp 0x462df
movq %rax, %r14
leaq 0x50(%rsp), %rdi
jmp 0x46325
jmp 0x46306
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x37958
jmp 0x462fa
movq %rax, %r14
leaq 0x90(%rsp), %rdi
jmp 0x46325
jmp 0x46306
movq %rax, %r14
jmp 0x4632a
movq %rax, %r14
jmp 0x46320
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x37958
leaq 0x10(%rsp), %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x46748
movq %r14, %rdi
callq 0x377f0
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/rules.hpp
// Function: Rules::FilePermissions::addRule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void addRule(std::string path, std::string mode) {
            Permission p;
            p.path = path;
            p.mode = modeFromString(mode);
            allPermissions.push_back(p);
        }

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x8(%rsp), %rdi
callq 0x37250
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4676a
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %r14
movq %r14, %rsi
callq 0x37590
movq %r14, %rdi
callq 0x37958
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4683e
leaq 0x8(%rsp), %rdi
callq 0x4686a
addq $0x68, %rsp
popq %rbx
popq %r14
retq
jmp 0x46628
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4686a
movq %rbx, %rdi
callq 0x377f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/rules.hpp
// Function: Rules::FilePermissions::addRule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void addRule(std::string rule) {
            auto colonLocation = rule.find(":");
            if (colonLocation == std::string::npos) {
                addRule(rule, "");
            } else {
                addRule(rule.substr(0, colonLocation), rule.substr(colonLocation + 1, rule.size()));
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x14d63(%rip), %rsi     # 0x5b3bc
movq %r15, %rdi
xorl %edx, %edx
callq 0x37930
cmpq $-0x1, %rax
je 0x466be
movq %rax, %r12
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x374b0
incq %r12
movq 0x8(%r15), %rcx
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x374b0
leaq 0x48(%rsp), %rbx
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x465a4
leaq 0x8(%rsp), %rdi
callq 0x37958
leaq 0x48(%rsp), %r15
jmp 0x46703
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x37650
leaq 0x14a73(%rip), %rsi     # 0x5b148
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x40b24
leaq 0x68(%rsp), %r15
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x465a4
leaq 0x28(%rsp), %rdi
callq 0x37958
movq %r15, %rdi
callq 0x37958
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x28(%rsp), %rdi
jmp 0x4672e
jmp 0x46735
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x37958
jmp 0x46738
movq %rax, %r14
movq %rbx, %rdi
callq 0x37958
movq %r14, %rdi
callq 0x377f0
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/rules.hpp
// Function: Rules::FilePermissions::modeFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string modeFromString(const std::string& mode) {
            int bitmask = 0;

            for (char c : mode) {
                if (c == 'x' or c == 'X') {
                    bitmask |= (1 << 0);
                }
                if (c == 'w' or c == 'W') {
                    bitmask |= (1 << 1);
                }
                if (c == 'r' or c == 'R') {
                    bitmask |= (1 << 2);
                }
            }

            std::string result = "";
            std::string modes = "xwr";
            for (int i = 0; i < 3; i += 1) {
                if (bitmask & (1 << i)) {
                    result += modes[i];
                }
            }

            return result;
        }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
xorl %edx, %edx
xorl %ebp, %ebp
cmpq %rdx, %rcx
je 0x467b6
movb (%rax,%rdx), %sil
andb $-0x21, %sil
xorl %edi, %edi
cmpb $0x58, %sil
sete %dil
orl %edi, %ebp
movl %ebp, %edi
orl $0x2, %edi
cmpb $0x57, %sil
cmovnel %ebp, %edi
movl %edi, %ebp
orl $0x4, %ebp
cmpb $0x52, %sil
cmovnel %edi, %ebp
incq %rdx
jmp 0x46780
leaq 0x1498b(%rip), %rsi     # 0x5b148
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x40b24
leaq 0x15b20(%rip), %rsi     # 0x5c2f1
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
xorl %r14d, %r14d
cmpq $0x3, %r14
je 0x46806
btl %r14d, %ebp
jae 0x46801
movq 0x10(%rsp), %rax
movsbl (%rax,%r14), %esi
movq %rbx, %rdi
callq 0x373a0
incq %r14
jmp 0x467e3
leaq 0x10(%rsp), %rdi
callq 0x37958
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
jmp 0x4682e
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x37958
movq %r14, %rdi
callq 0x377f0
// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/lib.hpp
// Function: ProcessInitialiser::setRlimit(int, unsigned long)
void setRlimit(int resource, rlim_t limit) {
        struct rlimit rl;
        bzero(&rl, sizeof(rl));
        rl.rlim_cur = limit;
        rl.rlim_max = limit;

        if (setrlimit(resource, &rl) < 0) {
            Die("setrlimit(%s, %jd)", getRlimitName(resource).c_str(), (intmax_t)limit);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x28(%rsp), %r15
pushq $0x10
popq %rsi
movq %r15, %rdi
callq 0x377d0
movq %rbx, (%r15)
movq %rbx, 0x8(%r15)
movl %ebp, %edi
movq %r15, %rsi
callq 0x37400
testl %eax, %eax
js 0x47284
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x472c2
movq (%r15), %rsi
xorl %edx, %edx
testq %rbx, %rbx
setne %dl
leaq 0x150e5(%rip), %rdi     # 0x5c38d
callq 0x3af9f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x377f0