// File: /workspace/github_cpp_makefile_star2_O2/establishment[P]sandman/src/cgroups.hpp
// Function: CGroups::enter()
void enter() {
        Base::Msg("Entering control group %s\n", cgName.c_str());

        for (auto subsystem : cgAllSubSystems) {
            /// add current pid to be contored by the cgroup for all target subsystems
            writeStat(subsystem, "tasks", Base::StrCat(getpid()), subsystem.optional);
        }

        if (cgMemoryLimitKB) {
            /// limit RAM used by cgroup
            writeStat(cgMemory, "memory.limit_in_bytes", Base::StrCat(cgMemoryLimitKB << 10));

            /// limit swap space used by cgroup if it can
            writeStat(cgMemory, "memory.memsw.limit_in_bytes", Base::StrCat(cgMemoryLimitKB << 10), true);
        }

        /// time is queried from cgroup for the process. Reset the stats for that cgroup
        if (useCGTiming) {
            /// reset the value of cgroup consumed time
            writeStat(cgCpuacct, "cpuacct.usage", "0");
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbp
movq (%rdi), %rsi
leaq 0x171bc(%rip), %rdi     # 0x5c08c
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x3b443
leaq 0x30(%rsp), %r14
leaq 0xf0(%rsp), %r15
leaq 0x10(%rsp), %r13
leaq 0x58(%rsp), %rbx
cmpq $0x78, %r12
je 0x44f7c
leaq 0x2fb2e(%rip), %rax     # 0x74a30
leaq (%rax,%r12), %rsi
movq %r14, %rdi
callq 0x414c6
movq %r15, %rdi
movq %r14, %rsi
callq 0x414c6
movq %r13, %rdi
leaq 0x17184(%rip), %rsi     # 0x5c0a7
leaq 0xf(%rsp), %rdx
callq 0x40b24
callq 0x376d0
movq %rbx, %rdi
movl %eax, %esi
callq 0x40c80
movzbl 0x50(%rsp), %r8d
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x4559c
movq %rbx, %rdi
callq 0x37958
movq %r13, %rdi
callq 0x37958
movq %r15, %rdi
callq 0x37958
movq %r14, %rdi
callq 0x37958
addq $0x28, %r12
jmp 0x44ef1
cmpl $0x0, 0x20(%rbp)
je 0x45077
leaq 0x2fa2b(%rip), %rsi     # 0x749b8
leaq 0xc8(%rsp), %rdi
callq 0x414c6
leaq 0x1710c(%rip), %rsi     # 0x5c0ad
leaq 0x30(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x40b24
movl 0x20(%rbp), %esi
shll $0xa, %esi
leaq 0x10(%rsp), %rdi
callq 0x40c80
leaq 0xc8(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %rbp, %rdi
xorl %r8d, %r8d
callq 0x4559c
leaq 0x10(%rsp), %rdi
callq 0x37958
leaq 0x30(%rsp), %rdi
callq 0x37958
leaq 0xc8(%rsp), %rdi
callq 0x37958
leaq 0x2f9b3(%rip), %rsi     # 0x749b8
leaq 0xa0(%rsp), %rdi
callq 0x414c6
leaq 0x170aa(%rip), %rsi     # 0x5c0c3
leaq 0x30(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x40b24
movl 0x20(%rbp), %esi
shll $0xa, %esi
leaq 0x10(%rsp), %rdi
callq 0x40c80
leaq 0xa0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x10(%rsp), %rcx
pushq $0x1
popq %r8
movq %rbp, %rdi
callq 0x4559c
leaq 0x10(%rsp), %rdi
callq 0x37958
leaq 0x30(%rsp), %rdi
callq 0x37958
leaq 0xa0(%rsp), %rdi
callq 0x37958
cmpl $0x0, 0x24(%rbp)
je 0x450f2
leaq 0x2f95c(%rip), %rsi     # 0x749e0
leaq 0x78(%rsp), %rdi
callq 0x414c6
leaq 0x16ed7(%rip), %rsi     # 0x5bf6c
leaq 0x30(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x40b24
leaq 0x178c3(%rip), %rsi     # 0x5c96e
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x40b24
leaq 0x78(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %rbp, %rdi
xorl %r8d, %r8d
callq 0x4559c
leaq 0x10(%rsp), %rdi
callq 0x37958
leaq 0x30(%rsp), %rdi
callq 0x37958
leaq 0x78(%rsp), %rdi
callq 0x37958
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x37958
jmp 0x45125
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x37958
jmp 0x45134
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x37958
jmp 0x45143
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x37958
jmp 0x4514d
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x451ba
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
jmp 0x451ba
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x37958
jmp 0x45169
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x37958
jmp 0x45178
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
jmp 0x451ba
movq %rax, %rbx
jmp 0x451b5
movq %rax, %rbx
jmp 0x451a8
movq %rax, %rbx
jmp 0x4519e
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x37958
leaq 0x10(%rsp), %rdi
callq 0x37958
leaq 0xf0(%rsp), %rdi
callq 0x37958
leaq 0x30(%rsp), %rdi
callq 0x37958
movq %rbx, %rdi
callq 0x377f0
nop