// File: establishment[P]sandman/src/cgroups.hpp
// Function: CGroups::cleanup()
void cleanup() {
        /// search for each subsystem (memory, cpuset, acuacct) and delete them
        for (auto subsystem : cgAllSubSystems) {
            if (subsystem.optional) {
                if (!readStat(subsystem, "tasks", true)) {
                    continue;
                }
            } else {
                readStat(subsystem, "tasks");
            }

            if (buffer[0]) {
                Base::Die("Some tasks left in subsystem %s of cgroup %s, failed to remove it",
                    subsystem.name.c_str(), cgName.c_str());
            }

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

            if (rmdir(path.c_str()) < 0) {
                Base::Die("Cannot remove control group %s: %m", path.c_str());
            }
        }
    }

// Assembly:
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x190(%rsp)
movq 0x190(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x555fd(%rip), %rax     # 0x11eb70
movq %rax, 0x188(%rsp)
leaq 0x555ee(%rip), %rax     # 0x11eb70
movq %rax, 0x180(%rsp)
leaq 0x555df(%rip), %rax     # 0x11eb70
addq $0x78, %rax
movq %rax, 0x178(%rsp)
movq 0x180(%rsp), %rax
cmpq 0x178(%rsp), %rax
je 0xc99a6
movq 0x180(%rsp), %rsi
leaq 0x150(%rsp), %rdi
callq 0xa2a40
testb $0x1, 0x170(%rsp)
je 0xc9704
leaq 0x128(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0xa2a40
jmp 0xc95ed
leaq 0xf7(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x8ca50
movq 0x20(%rsp), %rdx
leaq 0x2cb00(%rip), %rsi     # 0xf610b
leaq 0xf8(%rsp), %rdi
callq 0xa0a90
jmp 0xc961a
movq 0x28(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
movl $0x1, %ecx
callq 0xaa9c0
movl %eax, 0x1c(%rsp)
jmp 0xc963f
movl 0x1c(%rsp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, 0x1b(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x8cbd8
leaq 0xf7(%rsp), %rdi
callq 0x8c630
leaq 0x128(%rsp), %rdi
callq 0xa2a30
movb 0x1b(%rsp), %al
testb $0x1, %al
jne 0xc9680
jmp 0xc96ff
movl $0x3, 0xf0(%rsp)
jmp 0xc9960
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x120(%rsp)
movl %eax, 0x11c(%rsp)
jmp 0xc9997
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x120(%rsp)
movl %eax, 0x11c(%rsp)
jmp 0xc96e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x120(%rsp)
movl %eax, 0x11c(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x8cbd8
leaq 0xf7(%rsp), %rdi
callq 0x8c630
leaq 0x128(%rsp), %rdi
callq 0xa2a30
jmp 0xc9997
jmp 0xc97e5
leaq 0xc8(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0xa2a40
jmp 0xc971b
leaq 0xa7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x8ca50
movq 0x10(%rsp), %rdx
leaq 0x2c9d2(%rip), %rsi     # 0xf610b
leaq 0xa8(%rsp), %rdi
callq 0xa0a90
jmp 0xc9748
movq 0x28(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
xorl %ecx, %ecx
callq 0xaa9c0
jmp 0xc9766
leaq 0xa8(%rsp), %rdi
callq 0x8cbd8
leaq 0xa7(%rsp), %rdi
callq 0x8c630
leaq 0xc8(%rsp), %rdi
callq 0xa2a30
jmp 0xc97e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x120(%rsp)
movl %eax, 0x11c(%rsp)
jmp 0xc97c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x120(%rsp)
movl %eax, 0x11c(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x8cbd8
leaq 0xa7(%rsp), %rdi
callq 0x8c630
leaq 0xc8(%rsp), %rdi
callq 0xa2a30
jmp 0xc9997
movq 0x28(%rsp), %rax
cmpb $0x0, 0x28(%rax)
je 0xc9828
leaq 0x150(%rsp), %rdi
callq 0x8c1f0
movq 0x28(%rsp), %rdi
movq %rax, 0x8(%rsp)
callq 0x8c1f0
movq 0x8(%rsp), %rsi
testq %rax, %rax
setne %al
movzbl %al, %edx
leaq 0x2d2c1(%rip), %rdi     # 0xf6ae2
callq 0x94580
jmp 0xc9828
leaq 0x58(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0xa2a40
jmp 0xc983c
leaq 0x37(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x8ca50
movq (%rsp), %rdx
leaq 0x2b957(%rip), %rsi     # 0xf51ac
leaq 0x38(%rsp), %rdi
callq 0xa0a90
jmp 0xc9861
movq 0x28(%rsp), %rsi
leaq 0x80(%rsp), %rdi
leaq 0x58(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq 0xaac50
jmp 0xc987f
leaq 0x38(%rsp), %rdi
callq 0x8cbd8
leaq 0x37(%rsp), %rdi
callq 0x8c630
leaq 0x58(%rsp), %rdi
callq 0xa2a30
leaq 0x80(%rsp), %rdi
callq 0x8c1f0
movq %rax, %rdi
callq 0x8c200
cmpl $0x0, %eax
jge 0xc9948
leaq 0x80(%rsp), %rdi
callq 0x8c1f0
movq %rax, %rsi
leaq 0x2d252(%rip), %rdi     # 0xf6b24
xorl %eax, %eax
callq 0x94bf0
jmp 0xc98db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x120(%rsp)
movl %eax, 0x11c(%rsp)
jmp 0xc990f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x120(%rsp)
movl %eax, 0x11c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x8cbd8
leaq 0x37(%rsp), %rdi
callq 0x8c630
leaq 0x58(%rsp), %rdi
callq 0xa2a30
jmp 0xc9997
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x120(%rsp)
movl %eax, 0x11c(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x8cbd8
jmp 0xc9997
leaq 0x80(%rsp), %rdi
callq 0x8cbd8
movl $0x0, 0xf0(%rsp)
leaq 0x150(%rsp), %rdi
callq 0xa2a30
movl 0xf0(%rsp), %eax
testl %eax, %eax
je 0xc997c
jmp 0xc997a
jmp 0xc997e
jmp 0xc997e
movq 0x180(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x180(%rsp)
jmp 0xc959d
leaq 0x150(%rsp), %rdi
callq 0xa2a30
jmp 0xc99ae
addq $0x198, %rsp            # imm = 0x198
retq
movq 0x120(%rsp), %rdi
callq 0x8ca40
nopl (%rax,%rax)