// File: establishment[P]sandman/src/lib.hpp
// Function: ProcessInitialiser::getRlimitName[abi:cxx11](int)
string getRlimitName(int resource) {
        static std::map<int, string> resource_name = {
            {RLIMIT_AS, "RMLIMIT_AS"},        {RLIMIT_FSIZE, "RMLIMIT_FSIZE"},     {RLIMIT_STACK, "RMLIMIT_STACK"},
            {RLIMIT_NOFILE, "RLIMIT_NOFILE"}, {RLIMIT_MEMLOCK, "RMLIMIT_MEMLOCK"}, {RLIMIT_NPROC, "RMLIMIT_NPROC"},
        };

        return resource_name[resource];
    }

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0x1a0(%rsp)
movq %rsi, 0x198(%rsp)
movl %edx, 0x194(%rsp)
cmpb $0x0, 0x6e24e(%rip)     # 0x11fce0
jne 0xb1c77
leaq 0x6e241(%rip), %rdi     # 0x11fce0
callq 0x8caa0
cmpl $0x0, %eax
je 0xb1c77
leaq 0x90(%rsp), %rdi
movq %rdi, 0x88(%rsp)
movl $0x9, 0x84(%rsp)
leaq 0x44935(%rip), %rdx     # 0xf6404
leaq 0x84(%rsp), %rsi
callq 0xb1d70
jmp 0xb1ade
leaq 0xb8(%rsp), %rdi
movq %rdi, 0x88(%rsp)
movl $0x1, 0x70(%rsp)
leaq 0x44912(%rip), %rdx     # 0xf640f
leaq 0x70(%rsp), %rsi
callq 0xb1e00
jmp 0xb1b09
leaq 0xe0(%rsp), %rdi
movq %rdi, 0x88(%rsp)
movl $0x3, 0x6c(%rsp)
leaq 0x448f5(%rip), %rdx     # 0xf641d
leaq 0x6c(%rsp), %rsi
callq 0xb1e00
jmp 0xb1b34
leaq 0x108(%rsp), %rdi
movq %rdi, 0x88(%rsp)
movl $0x7, 0x68(%rsp)
leaq 0x448d8(%rip), %rdx     # 0xf642b
leaq 0x68(%rsp), %rsi
callq 0xb1e00
jmp 0xb1b5f
leaq 0x130(%rsp), %rdi
movq %rdi, 0x88(%rsp)
movl $0x8, 0x64(%rsp)
leaq 0x448bb(%rip), %rdx     # 0xf6439
leaq 0x64(%rsp), %rsi
callq 0xb1e90
jmp 0xb1b8a
leaq 0x158(%rsp), %rdi
movq %rdi, 0x88(%rsp)
movl $0x6, 0x60(%rsp)
leaq 0x448a0(%rip), %rdx     # 0xf6449
leaq 0x60(%rsp), %rsi
callq 0xb1e00
jmp 0xb1bb5
leaq 0x90(%rsp), %rax
movq %rax, 0x180(%rsp)
movq $0x6, 0x188(%rsp)
leaq 0x5e(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xb1f40
movq 0x40(%rsp), %r8
movq 0x180(%rsp), %rsi
movq 0x188(%rsp), %rdx
leaq 0x6e0b4(%rip), %rdi     # 0x11fcb0
leaq 0x5f(%rsp), %rcx
callq 0xb1f50
jmp 0xb1c08
leaq 0x5e(%rsp), %rdi
callq 0xb2030
leaq 0x90(%rsp), %rax
movq %rax, 0x30(%rsp)
addq $0xf0, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x28(%rsp)
callq 0xb1f20
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x38(%rsp)
jne 0xb1c2a
leaq 0x3e8(%rip), %rdi       # 0xb2040
leaq 0x6e051(%rip), %rsi     # 0x11fcb0
leaq 0x6c992(%rip), %rdx     # 0x11e5f8
callq 0x8c4e0
leaq 0x6e06e(%rip), %rdi     # 0x11fce0
callq 0x8c3c0
leaq 0x6e032(%rip), %rdi     # 0x11fcb0
leaq 0x194(%rsp), %rsi
callq 0xb2050
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x8c220
movq 0x50(%rsp), %rax
addq $0x1a8, %rsp            # imm = 0x1A8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
movq 0x88(%rsp), %rax
leaq 0x90(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x20(%rsp)
je 0xb1cf7
movq 0x20(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x18(%rsp)
callq 0xb1f20
movq 0x18(%rsp), %rax
leaq 0x90(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x20(%rsp)
jne 0xb1ccd
jmp 0xb1d50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x5e(%rsp), %rdi
callq 0xb2030
leaq 0x90(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0xf0, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, (%rsp)
callq 0xb1f20
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x10(%rsp)
jne 0xb1d29
jmp 0xb1d50
leaq 0x6df89(%rip), %rdi     # 0x11fce0
callq 0x8c3b0
movq 0x78(%rsp), %rdi
callq 0x8ca40
nopw %cs:(%rax,%rax)