// File: 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:
subq $0x258, %rsp            # imm = 0x258
movq %rdi, 0x250(%rsp)
movq 0x250(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x8c1f0
movq %rax, %rsi
leaq 0x4a165(%rip), %rdi     # 0xf60f0
movb $0x0, %al
callq 0x94e30
leaq 0x72bd7(%rip), %rax     # 0x11eb70
movq %rax, 0x248(%rsp)
leaq 0x72bc8(%rip), %rax     # 0x11eb70
movq %rax, 0x240(%rsp)
leaq 0x72bb9(%rip), %rax     # 0x11eb70
addq $0x78, %rax
movq %rax, 0x238(%rsp)
movq 0x240(%rsp), %rax
cmpq 0x238(%rsp), %rax
je 0xac171
movq 0x240(%rsp), %rsi
leaq 0x210(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xa2a40
movq 0x28(%rsp), %rsi
leaq 0x1e8(%rsp), %rdi
callq 0xa2a40
jmp 0xac007
leaq 0x1b7(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x8ca50
movq 0x20(%rsp), %rdx
leaq 0x4a0e6(%rip), %rsi     # 0xf610b
leaq 0x1b8(%rsp), %rdi
callq 0xa0a90
jmp 0xac034
callq 0x8c8c0
movl %eax, %esi
leaq 0x190(%rsp), %rdi
callq 0xacf60
jmp 0xac04a
movq 0x30(%rsp), %rdi
movzbl 0x230(%rsp), %r8d
andl $0x1, %r8d
leaq 0x1e8(%rsp), %rsi
leaq 0x1b8(%rsp), %rdx
leaq 0x190(%rsp), %rcx
callq 0xacc40
jmp 0xac07b
leaq 0x190(%rsp), %rdi
callq 0x8cbd8
leaq 0x1b8(%rsp), %rdi
callq 0x8cbd8
leaq 0x1b7(%rsp), %rdi
callq 0x8c630
leaq 0x1e8(%rsp), %rdi
callq 0xa2a30
leaq 0x210(%rsp), %rdi
callq 0xa2a30
movq 0x240(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x240(%rsp)
jmp 0xabfc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0xac15f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0xac145
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0xac138
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x8cbd8
leaq 0x1b8(%rsp), %rdi
callq 0x8cbd8
leaq 0x1b7(%rsp), %rdi
callq 0x8c630
leaq 0x1e8(%rsp), %rdi
callq 0xa2a30
leaq 0x210(%rsp), %rdi
callq 0xa2a30
jmp 0xac52c
movq 0x30(%rsp), %rax
cmpl $0x0, 0x20(%rax)
je 0xac3e6
leaq 0x72971(%rip), %rsi     # 0x11eaf8
leaq 0x168(%rsp), %rdi
callq 0xa2a40
leaq 0x147(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x8ca50
movq 0x18(%rsp), %rdx
leaq 0x49f5f(%rip), %rsi     # 0xf6111
leaq 0x148(%rsp), %rdi
callq 0xa0a90
jmp 0xac1c1
movq 0x30(%rsp), %rax
movl 0x20(%rax), %esi
shll $0xa, %esi
leaq 0x120(%rsp), %rdi
callq 0xacf60
jmp 0xac1db
movq 0x30(%rsp), %rdi
leaq 0x168(%rsp), %rsi
leaq 0x148(%rsp), %rdx
leaq 0x120(%rsp), %rcx
xorl %r8d, %r8d
callq 0xacc40
jmp 0xac202
leaq 0x120(%rsp), %rdi
callq 0x8cbd8
leaq 0x148(%rsp), %rdi
callq 0x8cbd8
leaq 0x147(%rsp), %rdi
callq 0x8c630
leaq 0x168(%rsp), %rdi
callq 0xa2a30
leaq 0x728bb(%rip), %rsi     # 0x11eaf8
leaq 0xf8(%rsp), %rdi
callq 0xa2a40
leaq 0xd7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x8ca50
movq 0x10(%rsp), %rdx
leaq 0x49ebf(%rip), %rsi     # 0xf6127
leaq 0xd8(%rsp), %rdi
callq 0xa0a90
jmp 0xac277
movq 0x30(%rsp), %rax
movl 0x20(%rax), %esi
shll $0xa, %esi
leaq 0xb0(%rsp), %rdi
callq 0xacf60
jmp 0xac291
movq 0x30(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movl $0x1, %r8d
callq 0xacc40
jmp 0xac2bb
leaq 0xb0(%rsp), %rdi
callq 0x8cbd8
leaq 0xd8(%rsp), %rdi
callq 0x8cbd8
leaq 0xd7(%rsp), %rdi
callq 0x8c630
leaq 0xf8(%rsp), %rdi
callq 0xa2a30
jmp 0xac3e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0xac34e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0xac341
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x8cbd8
leaq 0x148(%rsp), %rdi
callq 0x8cbd8
leaq 0x147(%rsp), %rdi
callq 0x8c630
leaq 0x168(%rsp), %rdi
callq 0xa2a30
jmp 0xac52c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0xac3c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0xac3ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x8cbd8
leaq 0xd8(%rsp), %rdi
callq 0x8cbd8
leaq 0xd7(%rsp), %rdi
callq 0x8c630
leaq 0xf8(%rsp), %rdi
callq 0xa2a30
jmp 0xac52c
movq 0x30(%rsp), %rax
cmpl $0x0, 0x24(%rax)
je 0xac524
leaq 0x72724(%rip), %rsi     # 0x11eb20
leaq 0x88(%rsp), %rdi
callq 0xa2a40
leaq 0x67(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x8ca50
movq 0x8(%rsp), %rdx
leaq 0x49bac(%rip), %rsi     # 0xf5fd0
leaq 0x68(%rsp), %rdi
callq 0xa0a90
jmp 0xac430
leaq 0x3f(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x8ca50
movq (%rsp), %rdx
leaq 0x4a589(%rip), %rsi     # 0xf69d2
leaq 0x40(%rsp), %rdi
callq 0xa0a90
jmp 0xac455
movq 0x30(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x40(%rsp), %rcx
xorl %r8d, %r8d
callq 0xacc40
jmp 0xac476
leaq 0x40(%rsp), %rdi
callq 0x8cbd8
leaq 0x3f(%rsp), %rdi
callq 0x8c630
leaq 0x68(%rsp), %rdi
callq 0x8cbd8
leaq 0x67(%rsp), %rdi
callq 0x8c630
leaq 0x88(%rsp), %rdi
callq 0xa2a30
jmp 0xac524
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0xac50b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0xac4f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x8cbd8
leaq 0x3f(%rsp), %rdi
callq 0x8c630
leaq 0x68(%rsp), %rdi
callq 0x8cbd8
leaq 0x67(%rsp), %rdi
callq 0x8c630
leaq 0x88(%rsp), %rdi
callq 0xa2a30
jmp 0xac52c
addq $0x258, %rsp            # imm = 0x258
retq
movq 0x1e0(%rsp), %rdi
callq 0x8ca40
nopl (%rax)