// File: /workspace/github_cpp_makefile_star2_O3/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 $0x108, %rsp            # imm = 0x108
movq %rdi, %r14
movq (%rdi), %rsi
leaq 0x1b54f(%rip), %rdi     # 0x560bf
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x2ceee
leaq 0x2feaf(%rip), %r13     # 0x6aa30
leaq 0x48(%rsp), %r15
movq %rsp, %rbp
leaq 0x70(%rsp), %rbx
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq (%r12,%r13), %rsi
movq 0x8(%r12,%r13), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x47420
movb 0x20(%r12,%r13), %al
movb %al, 0x40(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x47420
movb 0x40(%rsp), %al
movb %al, 0x68(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
leaq 0x1b4e9(%rip), %rsi     # 0x560da
leaq 0x1b4e7(%rip), %rdx     # 0x560df
callq 0x42cf8
callq 0x276f0
movq %rbx, %rdi
movl %eax, %esi
callq 0x3b6ec
movzbl 0x40(%rsp), %r8d
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x3b556
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x3ac45
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x27480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3ac60
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3ac7c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3ac98
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
addq $0x28, %r12
cmpq $0x78, %r12
jne 0x3ab8e
movq %r14, %r15
cmpl $0x0, 0x20(%r14)
je 0x3ae5f
leaq 0xf0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x2fcf1(%rip), %rsi     # 0x6a9b8
movq 0x2fcf2(%rip), %rdx     # 0x6a9c0
addq %rsi, %rdx
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
callq 0x47420
movb 0x2fcf1(%rip), %al      # 0x6a9d8
movb %al, 0x20(%rbx)
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1b3e2(%rip), %rsi     # 0x560e0
leaq 0x1b3f0(%rip), %rdx     # 0x560f5
callq 0x42cf8
movl 0x20(%r15), %esi
shll $0xa, %esi
movq %rsp, %rdi
callq 0x3b6ec
leaq 0xe0(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
movq %r15, %rdi
xorl %r8d, %r8d
callq 0x3b556
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3ad4f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3ad6b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0xe0(%rsp), %rdi
cmpq %r14, %rdi
je 0x3ad88
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x27480
leaq 0xc8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x2fc1d(%rip), %rsi     # 0x6a9b8
movq 0x2fc1e(%rip), %rdx     # 0x6a9c0
addq %rsi, %rdx
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
callq 0x47420
movb 0x2fc1d(%rip), %al      # 0x6a9d8
movb %al, 0x20(%rbx)
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1b324(%rip), %rsi     # 0x560f6
leaq 0x1b338(%rip), %rdx     # 0x56111
callq 0x42cf8
movl 0x20(%r15), %esi
shll $0xa, %esi
movq %rsp, %rdi
callq 0x3b6ec
leaq 0xb8(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
movq %r15, %rdi
movl $0x1, %r8d
callq 0x3b556
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3ae26
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3ae42
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0xb8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3ae5f
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x27480
cmpl $0x0, 0x24(%r15)
je 0x3af4d
leaq 0xa0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x2fb63(%rip), %rsi     # 0x6a9e0
movq 0x2fb64(%rip), %rdx     # 0x6a9e8
addq %rsi, %rdx
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
callq 0x47420
movb 0x2fb63(%rip), %al      # 0x6aa00
movb %al, 0x20(%rbx)
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1b0eb(%rip), %rsi     # 0x55f9f
leaq 0x1b0f1(%rip), %rdx     # 0x55fac
callq 0x42cf8
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1bacf(%rip), %rsi     # 0x569a1
leaq 0x1bac9(%rip), %rdx     # 0x569a2
callq 0x42cf8
leaq 0x90(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
movq %r15, %rdi
xorl %r8d, %r8d
callq 0x3b556
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3af14
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3af30
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x3af4d
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x27480
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3afa2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3afa2
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3afc3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3afc3
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3afe4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3afe4
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3b005
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3b005
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x3b109
movq 0xa0(%rsp), %rsi
jmp 0x3b101
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3b109
movq 0xc8(%rsp), %rsi
jmp 0x3b101
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3b046
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3b046
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3b067
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
jmp 0x3b067
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %r14, %rdi
je 0x3b109
movq 0xf0(%rsp), %rsi
jmp 0x3b101
movq %rax, %rbx
jmp 0x3b0ed
movq %rax, %rbx
jmp 0x3b0d1
movq %rax, %rbx
jmp 0x3b0b6
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x3b0b6
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x27480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3b0d1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3b0ed
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x27480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3b109
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x27480
movq %rbx, %rdi
callq 0x27830
nop