// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/cgroup.c
// Function: setup_oom_handling_cgroup_v2
static void setup_oom_handling_cgroup_v2(int pid)
{
	cgroup2_path = process_cgroup_subsystem_path(pid, true, "");
	if (!cgroup2_path) {
		nwarn("Failed to get cgroup path. Container may have exited");
		return;
	}

	_cleanup_free_ char *memory_events_file_path = g_build_filename(cgroup2_path, "memory.events", NULL);

	_cleanup_close_ int ifd = -1;
	if ((ifd = inotify_init()) < 0) {
		nwarnf("Failed to create inotify fd");
		return;
	}

	if (inotify_add_watch(ifd, memory_events_file_path, IN_MODIFY) < 0) {
		nwarnf("Failed to add inotify watch for %s", memory_events_file_path);
		return;
	}

	/* Move ownership to inotify_fd.  */
	inotify_fd = ifd;
	ifd = -1;

	g_unix_fd_add(inotify_fd, G_IO_IN, oom_cb_cgroup_v2, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
movl $0x1, %esi
leaq 0x67eb(%rip), %rdx      # 0xfcf5
callq 0x9d00
movq %rax, %rcx
leaq 0x21a4f(%rip), %rax     # 0x2af68
movq %rcx, (%rax)
leaq 0x21a45(%rip), %rax     # 0x2af68
cmpq $0x0, (%rax)
jne 0x958f
leaq 0xcf74(%rip), %rax      # 0x164a4
cmpl $0x1, (%rax)
jb 0x958a
jmp 0x9537
movq 0xcab2(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x5c4f(%rip), %rsi      # 0xf197
leaq 0x7aae(%rip), %rdx      # 0x10ffd
movb $0x0, %al
callq 0x4830
leaq 0x219eb(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0x9586
leaq 0x219d7(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x5c5a(%rip), %rsi      # 0xf1d2
leaq 0x7a7e(%rip), %rcx      # 0x10ffd
movb $0x0, %al
callq 0x4120
jmp 0x9588
jmp 0x958a
jmp 0x96ea
leaq 0x219d2(%rip), %rax     # 0x2af68
movq (%rax), %rdi
leaq 0x798e(%rip), %rsi      # 0x10f2e
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x46a0
movq %rax, -0x10(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
callq 0x4860
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jge 0x9624
leaq 0xceda(%rip), %rax      # 0x164a4
cmpl $0x1, (%rax)
jb 0x9618
jmp 0x95d1
movq 0xca18(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x7a50(%rip), %rsi      # 0x11032
movb $0x0, %al
callq 0x4830
leaq 0x21958(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0x9612
leaq 0x21944(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x7a50(%rip), %rsi      # 0x1105b
movb $0x0, %al
callq 0x4120
jmp 0x9614
jmp 0x9616
jmp 0x9618
movl $0x1, -0x18(%rbp)
jmp 0x96d8
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0x4710
cmpl $0x0, %eax
jge 0x96a0
leaq 0xce63(%rip), %rax      # 0x164a4
cmpl $0x1, (%rax)
jb 0x9697
jmp 0x9648
movq 0xc9a1(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x7a32(%rip), %rsi      # 0x1108f
movb $0x0, %al
callq 0x4830
leaq 0x218dd(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0x9691
leaq 0x218c9(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x6, %edi
leaq 0x7a35(%rip), %rsi      # 0x110bf
movb $0x0, %al
callq 0x4120
jmp 0x9693
jmp 0x9695
jmp 0x9697
movl $0x1, -0x18(%rbp)
jmp 0x96d8
movl -0x14(%rbp), %ecx
leaq 0xd6ba(%rip), %rax      # 0x16d64
movl %ecx, (%rax)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
leaq 0xd6aa(%rip), %rax      # 0x16d64
movl (%rax), %edi
movl $0x1, %esi
leaq 0xa38(%rip), %rdx       # 0xa100
xorl %eax, %eax
movl %eax, %ecx
callq 0x4440
movl $0x0, -0x18(%rbp)
leaq -0x14(%rbp), %rdi
callq 0xa0d0
leaq -0x10(%rbp), %rdi
callq 0x9ca0
addq $0x20, %rsp
popq %rbp
retq