LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: setup_attach_socket
char *setup_attach_socket(void)
{
	char *symlink_dir_path =
		bind_unix_socket("attach", SOCK_SEQPACKET | SOCK_NONBLOCK | SOCK_CLOEXEC, 0700, &remote_attach_sock, opt_full_attach_path);

	if (listen(remote_attach_sock.fd, 10) == -1)
		pexitf("Failed to listen on attach socket: %s/%s", symlink_dir_path, "attach");

	g_unix_fd_add(remote_attach_sock.fd, G_IO_IN, attach_cb, &remote_attach_sock);

	return symlink_dir_path;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x20401(%rip), %rax     # 0x2b040
movl (%rax), %r8d
leaq 0x5791(%rip), %rdi      # 0x103da
movl $0x80805, %esi          # imm = 0x80805
movl $0x1c0, %edx            # imm = 0x1C0
leaq 0xc156(%rip), %rcx      # 0x16db0
callq 0xad10
movq %rax, -0x8(%rbp)
movl 0xc14b(%rip), %edi      # 0x16db4
movl $0xa, %esi
callq 0x43c0
cmpl $-0x1, %eax
jne 0xacdb
jmp 0xac7a
movq 0xb36f(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x695a(%rip), %rsi      # 0x115e9
leaq 0x5744(%rip), %rcx      # 0x103da
movb $0x0, %al
callq 0x4830
leaq 0x202a4(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xacd1
leaq 0x20290(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movq -0x8(%rbp), %rcx
movl $0x3, %edi
leaq 0x695f(%rip), %rsi      # 0x11622
leaq 0x5710(%rip), %r8       # 0x103da
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
movl 0xc0d3(%rip), %edi      # 0x16db4
movl $0x1, %esi
leaq 0x263(%rip), %rdx       # 0xaf50
leaq 0xc0bc(%rip), %rcx      # 0x16db0
callq 0x4440
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: setup_notify_socket
void setup_notify_socket(char *socket_path)
{
	/* Connect to Host socket */
	if (local_notify_host_fd < 0) {
		local_notify_host_fd = socket(AF_UNIX, SOCK_DGRAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0);
		if (local_notify_host_fd == -1) {
			pexit("Failed to create notify socket");
		}
		local_notify_host_addr.sun_family = AF_UNIX;
		strncpy(local_notify_host_addr.sun_path, socket_path, sizeof(local_notify_host_addr.sun_path) - 1);
		local_notify_host_addr.sun_path[sizeof(local_notify_host_addr.sun_path) - 1] = '\0';
	}

	/* No _cleanup_free_ here so we don't get a warning about unused variables
	 * when compiling with clang */
	char *symlink_dir_path =
		bind_unix_socket("notify/notify.sock", SOCK_DGRAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0777, &remote_notify_sock, TRUE);
	g_unix_fd_add(remote_notify_sock.fd, G_IO_IN | G_IO_HUP | G_IO_ERR, remote_sock_cb, &remote_notify_sock);

	g_free(symlink_dir_path);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x0, 0x1bca5(%rip)     # 0x26e48
jge 0xb24d
movl $0x1, %edi
movl $0x80802, %esi          # imm = 0x80802
xorl %edx, %edx
callq 0x4580
movl %eax, 0x1bc88(%rip)     # 0x26e48
cmpl $-0x1, 0x1bc81(%rip)    # 0x26e48
jne 0xb224
jmp 0xb1cb
movq 0xae1e(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x3e37(%rip), %rsi      # 0xf013
leaq 0x6483(%rip), %rdx      # 0x11666
movb $0x0, %al
callq 0x4830
leaq 0x1fd57(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xb21a
leaq 0x1fd43(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x3, %edi
leaq 0x3e31(%rip), %rsi      # 0xf03d
leaq 0x6453(%rip), %rcx      # 0x11666
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
movw $0x1, 0x1fe43(%rip)     # 0x2b070
movq -0x8(%rbp), %rsi
leaq 0x1fe38(%rip), %rdi     # 0x2b070
addq $0x2, %rdi
movl $0x6b, %edx
callq 0x4700
movb $0x0, 0x1fe90(%rip)     # 0x2b0dd
leaq 0x6431(%rip), %rdi      # 0x11685
movl $0x80802, %esi          # imm = 0x80802
movl $0x1ff, %edx            # imm = 0x1FF
leaq 0x13bab(%rip), %rcx     # 0x1ee10
movl $0x1, %r8d
callq 0xad10
movq %rax, -0x10(%rbp)
movl 0x13b9a(%rip), %edi     # 0x1ee14
movl $0x19, %esi
leaq 0x2a(%rip), %rdx        # 0xb2b0
leaq 0x13b83(%rip), %rcx     # 0x1ee10
callq 0x4440
movq -0x10(%rbp), %rdi
callq 0x48f0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: remote_sock_cb
static gboolean remote_sock_cb(G_GNUC_UNUSED int fd, GIOCondition condition, gpointer user_data)
{
	struct remote_sock_s *sock = (struct remote_sock_s *)user_data;

	if (condition & G_IO_IN)
		return read_remote_sock(sock);

	return terminate_remote_sock(sock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb2e3
movq -0x20(%rbp), %rdi
callq 0xba80
movl %eax, -0x4(%rbp)
jmp 0xb2ef
movq -0x20(%rbp), %rdi
callq 0xbdd0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: write_back_to_remote_consoles
void write_back_to_remote_consoles(char *buf, int len)
{
	if (local_mainfd_stdin.readers == NULL)
		return;

	for (int i = local_mainfd_stdin.readers->len; i > 0; i--) {
		struct remote_sock_s *remote_sock = g_ptr_array_index(local_mainfd_stdin.readers, i - 1);

		if (remote_sock->writable && write_all(remote_sock->fd, buf, len) < 0) {
			nwarn("Failed to write to remote console socket");
			remote_sock_shutdown(remote_sock, SHUT_WR);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, 0xba21(%rip)      # 0x16d98
jne 0xb37e
jmp 0xb457
movq 0xba13(%rip), %rax      # 0x16d98
movl 0x8(%rax), %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jle 0xb457
movq 0xb9fc(%rip), %rax      # 0x16d98
movq (%rax), %rax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0xb447
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x8(%rbp), %rsi
movslq -0xc(%rbp), %rdx
callq 0x8c60
cmpq $0x0, %rax
jge 0xb447
leaq 0xb0c5(%rip), %rax      # 0x164a4
cmpl $0x1, (%rax)
jb 0xb439
jmp 0xb3e6
movq 0xac03(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x3da0(%rip), %rsi      # 0xf197
leaq 0x629a(%rip), %rdx      # 0x11698
movb $0x0, %al
callq 0x4830
leaq 0x1fb3c(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xb435
leaq 0x1fb28(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x3dab(%rip), %rsi      # 0xf1d2
leaq 0x626a(%rip), %rcx      # 0x11698
movb $0x0, %al
callq 0x4120
jmp 0xb437
jmp 0xb439
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xb460
jmp 0xb449
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xb38b
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: remote_sock_shutdown
static void remote_sock_shutdown(struct remote_sock_s *sock, int how)
{
	if (sock->fd == -1)
		return;
	shutdown(sock->fd, how);
	switch (how) {
	case SHUT_RD:
		sock->readable = false;
		break;
	case SHUT_WR:
		sock->writable = false;
		break;
	case SHUT_RDWR:
		sock->readable = false;
		sock->writable = false;
		break;
	}
	if (!sock->writable && !sock->readable) {
		ndebugf("Closing %d", sock->fd);
		close(sock->fd);
		sock->fd = -1;
		if (sock->dest->readers != NULL) {
			g_ptr_array_remove(sock->dest->readers, sock);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
jne 0xb47e
jmp 0xb597
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edi
movl -0xc(%rbp), %esi
callq 0x40e0
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
testl %eax, %eax
je 0xb4ad
jmp 0xb499
movl -0x10(%rbp), %eax
subl $0x1, %eax
je 0xb4ba
jmp 0xb4a3
movl -0x10(%rbp), %eax
subl $0x2, %eax
je 0xb4c7
jmp 0xb4dd
movq -0x8(%rbp), %rax
movl $0x0, 0x18(%rax)
jmp 0xb4dd
movq -0x8(%rbp), %rax
movl $0x0, 0x1c(%rax)
jmp 0xb4dd
movq -0x8(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jne 0xb597
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jne 0xb597
leaq 0xafa4(%rip), %rax      # 0x164a4
cmpl $0x3, (%rax)
jb 0xb55a
jmp 0xb507
movq 0xaae2(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x68a8(%rip), %rsi      # 0x11dc7
movb $0x0, %al
callq 0x4830
leaq 0x1fa1b(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xb556
leaq 0x1fa07(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movl $0x6, %edi
leaq 0x6890(%rip), %rsi      # 0x11ddf
movb $0x0, %al
callq 0x4120
jmp 0xb558
jmp 0xb55a
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x4100
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0xb595
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x4600
jmp 0xb597
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: close_all_readers
void close_all_readers()
{
	if (local_mainfd_stdin.readers == NULL)
		return;
	g_ptr_array_foreach(local_mainfd_stdin.readers, close_sock, NULL);

	if (remote_attach_sock.fd >= 0)
		close(remote_attach_sock.fd);
	remote_attach_sock.fd = -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, 0xb7ec(%rip)      # 0x16d98
jne 0xb5b0
jmp 0xb5e5
movq 0xb7e1(%rip), %rdi      # 0x16d98
leaq 0x32(%rip), %rsi        # 0xb5f0
xorl %eax, %eax
movl %eax, %edx
callq 0x42b0
cmpl $0x0, 0xb7e6(%rip)      # 0x16db4
jl 0xb5db
movl 0xb7de(%rip), %edi      # 0x16db4
callq 0x4100
movl $0xffffffff, 0xb7cf(%rip) # imm = 0xFFFFFFFF
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: close_sock
static void close_sock(gpointer data, G_GNUC_UNUSED gpointer user_data)
{
	if (data == NULL)
		return;
	struct remote_sock_s *sock = (struct remote_sock_s *)data;

	close(sock->fd);
	sock->fd = -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xb609
jmp 0xb628
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x4100
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: init_remote_sock
static void init_remote_sock(struct remote_sock_s *sock, struct remote_sock_s *src)
{
	sock->off = 0;
	sock->remaining = 0;
	sock->data_ready = false;
	sock->listening = false;
	if (src) {
		sock->readable = src->readable;
		sock->writable = src->writable;
		sock->dest = src->dest;
		g_unix_set_fd_nonblocking(*sock->dest->fd, TRUE, NULL);
		sock->sock_type = src->sock_type;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
cmpq $0x0, -0x10(%rbp)
je 0xba78
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movl (%rax), %edi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x4280
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: terminate_remote_sock
static gboolean terminate_remote_sock(struct remote_sock_s *sock)
{
	remote_sock_shutdown(sock, SHUT_RD);
	if (SOCK_IS_CONSOLE(sock->sock_type)) {
		// If we're terminating our STDIN holder, we need to close the FD too, based on the cmdline option
		if (*(sock->dest->fd) >= 0 && opt_stdin) {
			if (!opt_leave_stdin_open) {
				close(*(sock->dest->fd));
				*(sock->dest->fd) = -1;
			} else {
				ninfo("Not closing input");
			}
		}
	}
	return G_SOURCE_REMOVE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xb460
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xbeb0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpl $0x0, (%rax)
jl 0xbeae
leaq 0x1f149(%rip), %rax     # 0x2af58
cmpl $0x0, (%rax)
je 0xbeae
leaq 0x1f13d(%rip), %rax     # 0x2af5c
cmpl $0x0, (%rax)
jne 0xbe49
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movl (%rax), %edi
callq 0x4100
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0xbeac
leaq 0xa654(%rip), %rax      # 0x164a4
cmpl $0x2, (%rax)
jb 0xbeaa
jmp 0xbe57
movq 0xa192(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x56be(%rip), %rsi      # 0x11526
leaq 0x5f46(%rip), %rdx      # 0x11db5
movb $0x0, %al
callq 0x4830
leaq 0x1f0cb(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xbea6
leaq 0x1f0b7(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x56b1(%rip), %rsi      # 0x11549
leaq 0x5f16(%rip), %rcx      # 0x11db5
movb $0x0, %al
callq 0x4120
jmp 0xbea8
jmp 0xbeaa
jmp 0xbeac
jmp 0xbeae
jmp 0xbeb0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: local_sock_write_cb
static gboolean local_sock_write_cb(G_GNUC_UNUSED int fd, G_GNUC_UNUSED GIOCondition condition, gpointer user_data)
{
	struct local_sock_s *local_sock = (struct local_sock_s *)user_data;
	bool has_data = FALSE;

	if (*(local_sock->fd) < 0)
		return G_SOURCE_REMOVE;

	g_ptr_array_foreach(local_sock->readers, write_to_local_sock, &has_data);
	if (has_data)
		return G_SOURCE_CONTINUE;
	return G_SOURCE_REMOVE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, (%rax)
jge 0xc153
movl $0x0, -0x4(%rbp)
jmp 0xc181
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x2e(%rip), %rsi        # 0xc190
leaq -0x21(%rbp), %rdx
callq 0x42b0
testb $0x1, -0x21(%rbp)
je 0xc17a
movl $0x1, -0x4(%rbp)
jmp 0xc181
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/conn_sock.c
// Function: write_to_local_sock
static void write_to_local_sock(gpointer data, gpointer user_data)
{
	struct remote_sock_s *sock = (struct remote_sock_s *)data;
	bool *has_data = user_data;

	sock_try_write_to_local_sock(sock);

	if (sock->remaining)
		*has_data = true;
	else if (sock->data_ready) {
		sock->data_ready = false;
		g_unix_fd_add(sock->fd, G_IO_IN | G_IO_HUP | G_IO_ERR, remote_sock_cb, sock);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0xbec0
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xc1cd
movq -0x20(%rbp), %rax
movb $0x1, (%rax)
jmp 0xc200
movq -0x18(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0xc1fe
movq -0x18(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x18(%rbp), %rcx
movl $0x19, %esi
leaq -0xf49(%rip), %rdx      # 0xb2b0
callq 0x4440
jmp 0xc200
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/oom.c
// Function: write_oom_adjust
static void write_oom_adjust(int oom_score, int *old_value)
{
#ifdef __linux__
	char fmt_oom_score[16];
	int oom_score_fd = open("/proc/self/oom_score_adj", O_RDWR | O_CLOEXEC);
	if (oom_score_fd < 0) {
		ndebugf("failed to open /proc/self/oom_score_adj: %m");
		return;
	}
	if (old_value) {
		if (read(oom_score_fd, fmt_oom_score, sizeof(fmt_oom_score)) < 0) {
			ndebugf("failed to read from /proc/self/oom_score_adj: %m");
		}
		*old_value = atoi(fmt_oom_score);
	}
	snprintf(fmt_oom_score, sizeof(fmt_oom_score), "%d", oom_score);
	if (write(oom_score_fd, fmt_oom_score, strlen(fmt_oom_score)) < 0) {
		ndebugf("failed to write to /proc/self/oom_score_adj: %m");
	}
	close(oom_score_fd);
#else
	(void)oom_score;
	(void)old_value;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x5bbd(%rip), %rdi      # 0x11e03
movl $0x80002, %esi          # imm = 0x80002
movb $0x0, %al
callq 0x48d0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0xc2b3
leaq 0xa242(%rip), %rax      # 0x164a4
cmpl $0x3, (%rax)
jb 0xc2ae
jmp 0xc269
movq 0x9d80(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x5ba2(%rip), %rsi      # 0x11e1c
movb $0x0, %al
callq 0x4830
leaq 0x1ecc0(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xc2aa
leaq 0x1ecac(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x5bb2(%rip), %rsi      # 0x11e55
movb $0x0, %al
callq 0x4120
jmp 0xc2ac
jmp 0xc2ae
jmp 0xc3da
cmpq $0x0, -0x10(%rbp)
je 0xc337
movl -0x24(%rbp), %edi
leaq -0x20(%rbp), %rsi
movl $0x10, %edx
callq 0x4230
cmpq $0x0, %rax
jge 0xc326
leaq 0xa1cc(%rip), %rax      # 0x164a4
cmpl $0x3, (%rax)
jb 0xc324
jmp 0xc2df
movq 0x9d0a(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x5baa(%rip), %rsi      # 0x11e9a
movb $0x0, %al
callq 0x4830
leaq 0x1ec4a(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xc320
leaq 0x1ec36(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x5bbf(%rip), %rsi      # 0x11ed8
movb $0x0, %al
callq 0x4120
jmp 0xc322
jmp 0xc324
jmp 0xc326
leaq -0x20(%rbp), %rdi
callq 0x44f0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %ecx
movl $0x10, %esi
leaq 0x5006(%rip), %rdx      # 0x11350
movb $0x0, %al
callq 0x40c0
movl -0x24(%rbp), %eax
movl %eax, -0x34(%rbp)
leaq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x4360
movl -0x34(%rbp), %edi
movq -0x30(%rbp), %rsi
movq %rax, %rdx
callq 0x4840
cmpq $0x0, %rax
jge 0xc3d2
leaq 0xa120(%rip), %rax      # 0x164a4
cmpl $0x3, (%rax)
jb 0xc3d0
jmp 0xc38b
movq 0x9c5e(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x5b86(%rip), %rsi      # 0x11f22
movb $0x0, %al
callq 0x4830
leaq 0x1eb9e(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xc3cc
leaq 0x1eb8a(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x5b9a(%rip), %rsi      # 0x11f5f
movb $0x0, %al
callq 0x4120
jmp 0xc3ce
jmp 0xc3d0
jmp 0xc3d2
movl -0x24(%rbp), %edi
callq 0x4100
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctrl.c
// Function: process_winsz_ctrl_line
static gboolean process_winsz_ctrl_line(char *line)
{
	int height, width, ret = -1;
	ret = sscanf(line, "%d %d\n", &height, &width);
	ndebugf("Height: %d, Width: %d", height, width);
	if (ret != 2) {
		nwarn("Failed to sscanf message");
		return FALSE;
	}
	resize_winsz(height, width);
	return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
leaq 0x58a0(%rip), %rsi      # 0x123fe
leaq -0x14(%rbp), %rdx
leaq -0x18(%rbp), %rcx
movb $0x0, %al
callq 0x41d0
movl %eax, -0x1c(%rbp)
leaq 0x992d(%rip), %rax      # 0x164a4
cmpl $0x3, (%rax)
jb 0xcbd0
jmp 0xcb7e
movq 0x946b(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
leaq 0x577e(%rip), %rsi      # 0x12313
movb $0x0, %al
callq 0x4830
leaq 0x1e3a5(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xcbcc
leaq 0x1e391(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
movl $0x6, %edi
leaq 0x5771(%rip), %rsi      # 0x12336
movb $0x0, %al
callq 0x4120
jmp 0xcbce
jmp 0xcbd0
cmpl $0x2, -0x1c(%rbp)
je 0xcc40
leaq 0x98c7(%rip), %rax      # 0x164a4
cmpl $0x1, (%rax)
jb 0xcc37
jmp 0xcbe4
movq 0x9405(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x25a2(%rip), %rsi      # 0xf197
leaq 0x5769(%rip), %rdx      # 0x12365
movb $0x0, %al
callq 0x4830
leaq 0x1e33e(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xcc33
leaq 0x1e32a(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x25ad(%rip), %rsi      # 0xf1d2
leaq 0x5739(%rip), %rcx      # 0x12365
movb $0x0, %al
callq 0x4120
jmp 0xcc35
jmp 0xcc37
movl $0x0, -0x4(%rbp)
jmp 0xcc52
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0xd280
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctrl.c
// Function: setup_terminal_control_fifo
int setup_terminal_control_fifo()
{
	/*
	 * Open a dummy writer to prevent getting flood of POLLHUPs when
	 * last writer closes.
	 */
	int dummyfd = -1;
	setup_fifo(&terminal_ctrl_fd, &dummyfd, "ctl", "terminal control fifo");
	ndebugf("terminal_ctrl_fd: %d", terminal_ctrl_fd);
	g_unix_fd_add(terminal_ctrl_fd, G_IO_IN, ctrl_cb, NULL);

	return dummyfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
leaq 0x9b8a(%rip), %rdi      # 0x16d60
leaq -0x4(%rbp), %rsi
leaq 0x50c8(%rip), %rdx      # 0x122a9
leaq 0x50c5(%rip), %rcx      # 0x122ad
callq 0xcfa0
leaq 0x92b0(%rip), %rax      # 0x164a4
cmpl $0x3, (%rax)
jb 0xd252
jmp 0xd1fb
movq 0x8dee(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x9b54(%rip), %rax      # 0x16d60
movl (%rax), %edx
leaq 0x50ae(%rip), %rsi      # 0x122c3
movb $0x0, %al
callq 0x4830
leaq 0x1dd25(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xd24e
leaq 0x1dd11(%rip), %rax     # 0x2af40
movq (%rax), %rdx
leaq 0x9b27(%rip), %rax      # 0x16d60
movl (%rax), %ecx
movl $0x6, %edi
leaq 0x509e(%rip), %rsi      # 0x122e5
movb $0x0, %al
callq 0x4120
jmp 0xd250
jmp 0xd252
leaq 0x9b07(%rip), %rax      # 0x16d60
movl (%rax), %edi
movl $0x1, %esi
leaq -0x607(%rip), %rdx      # 0xcc60
xorl %eax, %eax
movl %eax, %ecx
callq 0x4440
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctrl.c
// Function: resize_winsz
static void resize_winsz(int height, int width)
{
	struct winsize ws;
	ws.ws_row = height;
	ws.ws_col = width;

	int ret = ioctl(mainfd_stdout, TIOCSWINSZ, &ws);
	if (ret == -1)
		nwarnf("Failed to set process pty terminal size: %m");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl -0x4(%rbp), %eax
movw %ax, -0x10(%rbp)
movl -0x8(%rbp), %eax
movw %ax, -0xe(%rbp)
leaq 0x9aa9(%rip), %rax      # 0x16d4c
movl (%rax), %edi
movl $0x5414, %esi           # imm = 0x5414
leaq -0x10(%rbp), %rdx
movb $0x0, %al
callq 0x4140
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0xd313
leaq 0x91df(%rip), %rax      # 0x164a4
cmpl $0x1, (%rax)
jb 0xd311
jmp 0xd2cc
movq 0x8d1d(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x50a1(%rip), %rsi      # 0x1237e
movb $0x0, %al
callq 0x4830
leaq 0x1dc5d(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xd30d
leaq 0x1dc49(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x50b1(%rip), %rsi      # 0x123b7
movb $0x0, %al
callq 0x4120
jmp 0xd30f
jmp 0xd311
jmp 0xd313
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctr_stdio.c
// Function: drain_stdio
void drain_stdio()
{
	if (mainfd_stdout != -1) {
		g_unix_set_fd_nonblocking(mainfd_stdout, TRUE, NULL);
		while (read_stdio(mainfd_stdout, STDOUT_PIPE, NULL))
			;
	}
	drain_log_buffers(STDOUT_PIPE);
	if (mainfd_stderr != -1) {
		g_unix_set_fd_nonblocking(mainfd_stderr, TRUE, NULL);
		while (read_stdio(mainfd_stderr, STDERR_PIPE, NULL))
			;
	}
	drain_log_buffers(STDERR_PIPE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9691(%rip), %rax      # 0x16d4c
cmpl $-0x1, (%rax)
je 0xd6f8
leaq 0x9685(%rip), %rax      # 0x16d4c
movl (%rax), %edi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x4280
leaq 0x966e(%rip), %rax      # 0x16d4c
movl (%rax), %edi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xd4c0
testb $0x1, %al
jne 0xd6f4
jmp 0xd6f6
jmp 0xd6d7
jmp 0xd6f8
movl $0x2, %edi
callq 0xd760
leaq 0x9647(%rip), %rax      # 0x16d50
cmpl $-0x1, (%rax)
je 0xd746
leaq 0x963b(%rip), %rax      # 0x16d50
movl (%rax), %edi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x4280
leaq 0x9624(%rip), %rax      # 0x16d50
movl (%rax), %edi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xd4c0
testb $0x1, %al
jne 0xd742
jmp 0xd744
jmp 0xd725
jmp 0xd746
movl $0x3, %edi
callq 0xd760
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/parent_pipe_fd.c
// Function: get_pipe_fd_from_env
int get_pipe_fd_from_env(const char *envname)
{
	char *endptr = NULL;

	char *pipe_str = getenv(envname);
	if (pipe_str == NULL)
		return -1;

	errno = 0;
	int pipe_fd = strtol(pipe_str, &endptr, 10);
	if (errno != 0 || *endptr != '\0')
		pexitf("unable to parse %s", envname);
	if (fcntl(pipe_fd, F_SETFD, FD_CLOEXEC) == -1)
		pexitf("unable to make %s CLOEXEC", envname);

	return pipe_fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x45a0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xd7c4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8c3
callq 0x45c0
movl $0x0, (%rax)
movq -0x20(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movl $0xa, %edx
callq 0x44d0
movl %eax, -0x24(%rbp)
callq 0x45c0
cmpl $0x0, (%rax)
jne 0xd7fa
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xd84f
jmp 0xd7fc
movq 0x87ed(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x4fb3(%rip), %rsi      # 0x127c4
movb $0x0, %al
callq 0x4830
leaq 0x1d729(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xd845
leaq 0x1d715(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x3, %edi
leaq 0x4fa9(%rip), %rsi      # 0x127e7
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
movl -0x24(%rbp), %edi
movl $0x2, %esi
movl $0x1, %edx
movb $0x0, %al
callq 0x48c0
cmpl $-0x1, %eax
jne 0xd8bd
jmp 0xd86a
movq 0x877f(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x4f96(%rip), %rsi      # 0x12815
movb $0x0, %al
callq 0x4830
leaq 0x1d6bb(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xd8b3
leaq 0x1d6a7(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x3, %edi
leaq 0x4f93(%rip), %rsi      # 0x1283f
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/parent_pipe_fd.c
// Function: write_or_close_sync_fd
void write_or_close_sync_fd(int *fd, int res, const char *message)
{
	const char *res_key;
	if (opt_api_version >= 1)
		res_key = "data";
	else if (opt_exec)
		res_key = "exit_code";
	else
		res_key = "pid";

	ssize_t len;

	if (*fd == -1)
		return;

	_cleanup_free_ char *json = NULL;
	if (message) {
		_cleanup_free_ char *escaped_message = escape_json_string(message);
		json = g_strdup_printf("{\"%s\": %d, \"message\": \"%s\"}\n", res_key, res, escaped_message);
	} else {
		json = g_strdup_printf("{\"%s\": %d}\n", res_key, res);
	}

	len = strlen(json);
	if (write_all(*fd, json, len) != len) {
		if (errno == EPIPE) {
			close(*fd);
			*fd = -1;
			return;
		}
		pexit("Unable to send container stderr message to parent");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x1d6e2(%rip), %rax     # 0x2afcc
cmpl $0x1, (%rax)
jl 0xd8fc
leaq 0x2e95(%rip), %rax      # 0x1078b
movq %rax, -0x20(%rbp)
jmp 0xd922
leaq 0x1d6c5(%rip), %rax     # 0x2afc8
cmpl $0x0, (%rax)
je 0xd915
leaq 0x4f65(%rip), %rax      # 0x12874
movq %rax, -0x20(%rbp)
jmp 0xd920
leaq 0x2ec7(%rip), %rax      # 0x107e3
movq %rax, -0x20(%rbp)
jmp 0xd922
movq -0x8(%rbp), %rax
cmpl $-0x1, (%rax)
jne 0xd930
jmp 0xda4a
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xd974
movq -0x18(%rbp), %rdi
callq 0xda70
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rsi
movl -0xc(%rbp), %edx
movq -0x38(%rbp), %rcx
leaq 0x4f20(%rip), %rdi      # 0x1287e
movb $0x0, %al
callq 0x4380
movq %rax, -0x30(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xda50
jmp 0xd98d
movq -0x20(%rbp), %rsi
movl -0xc(%rbp), %edx
leaq 0x4f19(%rip), %rdi      # 0x1289b
movb $0x0, %al
callq 0x4380
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x4360
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x8c60
cmpq -0x28(%rbp), %rax
je 0xda3a
callq 0x45c0
cmpl $0x20, (%rax)
jne 0xd9df
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x4100
movq -0x8(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x1, -0x3c(%rbp)
jmp 0xda41
jmp 0xd9e1
movq 0x8608(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x1621(%rip), %rsi      # 0xf013
leaq 0x4eae(%rip), %rdx      # 0x128a7
movb $0x0, %al
callq 0x4830
leaq 0x1d541(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xda30
leaq 0x1d52d(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x3, %edi
leaq 0x161b(%rip), %rsi      # 0xf03d
leaq 0x4e7e(%rip), %rcx      # 0x128a7
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
movl $0x0, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xda50
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/parent_pipe_fd.c
// Function: escape_json_string
static char *escape_json_string(const char *str)
{
	const char *p = str;
	GString *escaped = g_string_sized_new(strlen(str));

	while (*p != 0) {
		char c = *p++;
		if (c == '\\' || c == '"') {
			g_string_append_c(escaped, '\\');
			g_string_append_c(escaped, c);
		} else if (c == '\n') {
			g_string_append_printf(escaped, "\\n");
		} else if (c == '\t') {
			g_string_append_printf(escaped, "\\t");
		} else if ((c > 0 && c < 0x1f) || c == 0x7f) {
			g_string_append_printf(escaped, "\\u00%02x", (guint)c);
		} else {
			g_string_append_c(escaped, c);
		}
	}

	return g_string_free(escaped, FALSE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4360
movq %rax, %rdi
callq 0x4330
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xdb74
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
cmpl $0x5c, %eax
je 0xdacf
movsbl -0x19(%rbp), %eax
cmpl $0x22, %eax
jne 0xdaef
movq -0x18(%rbp), %rdi
movl $0x5c, %esi
callq 0xdb90
movq -0x18(%rbp), %rdi
movsbl -0x19(%rbp), %esi
callq 0xdb90
jmp 0xdb6f
movsbl -0x19(%rbp), %eax
cmpl $0xa, %eax
jne 0xdb0c
movq -0x18(%rbp), %rdi
leaq 0x4dd6(%rip), %rsi      # 0x128d9
movb $0x0, %al
callq 0x4890
jmp 0xdb6d
movsbl -0x19(%rbp), %eax
cmpl $0x9, %eax
jne 0xdb29
movq -0x18(%rbp), %rdi
leaq 0x4dbc(%rip), %rsi      # 0x128dc
movb $0x0, %al
callq 0x4890
jmp 0xdb6b
movsbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jle 0xdb3b
movsbl -0x19(%rbp), %eax
cmpl $0x1f, %eax
jl 0xdb44
movsbl -0x19(%rbp), %eax
cmpl $0x7f, %eax
jne 0xdb5c
movq -0x18(%rbp), %rdi
movsbl -0x19(%rbp), %edx
leaq 0x4d8c(%rip), %rsi      # 0x128df
movb $0x0, %al
callq 0x4890
jmp 0xdb69
movq -0x18(%rbp), %rdi
movsbl -0x19(%rbp), %esi
callq 0xdb90
jmp 0xdb6b
jmp 0xdb6d
jmp 0xdb6f
jmp 0xda99
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x43a0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctr_exit.c
// Function: on_sig_exit
void on_sig_exit(int signal)
{
	if (container_pid > 0) {
		if (kill(container_pid, signal) == 0)
			return;
	} else if (create_pid > 0) {
		if (kill(create_pid, signal) == 0)
			return;
		if (errno == ESRCH) {
			/* The create_pid process might have exited, so try container_pid again.  */
			if (container_pid > 0 && kill(container_pid, signal) == 0)
				return;
		}
	}
	/* Just force a check if we get here.  */
	raise(SIGUSR1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl 0x19243(%rip), %eax     # 0x26e64
cmpl $0x0, %eax
jle 0xdc3d
movl 0x19238(%rip), %edi     # 0x26e64
movl -0x4(%rbp), %esi
callq 0x44a0
cmpl $0x0, %eax
jne 0xdc3b
jmp 0xdc97
jmp 0xdc8d
movl 0x19225(%rip), %eax     # 0x26e68
cmpl $0x0, %eax
jle 0xdc8b
movl 0x1921a(%rip), %edi     # 0x26e68
movl -0x4(%rbp), %esi
callq 0x44a0
cmpl $0x0, %eax
jne 0xdc5d
jmp 0xdc97
callq 0x45c0
cmpl $0x3, (%rax)
jne 0xdc89
movl 0x191f7(%rip), %eax     # 0x26e64
cmpl $0x0, %eax
jle 0xdc87
movl 0x191ec(%rip), %edi     # 0x26e64
movl -0x4(%rbp), %esi
callq 0x44a0
cmpl $0x0, %eax
jne 0xdc87
jmp 0xdc97
jmp 0xdc89
jmp 0xdc8b
jmp 0xdc8d
movl $0xa, %edi
callq 0x4540
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctr_exit.c
// Function: check_child_processes
static void check_child_processes(GHashTable *pid_to_handler, GHashTable *cache)
{
	for (;;) {
		int status;
		pid_t pid = waitpid(-1, &status, WNOHANG);
		if (pid < 0 && errno == EINTR)
			continue;

		if (pid < 0 && errno == ECHILD) {
			g_main_loop_quit(main_loop);
			return;
		}
		if (pid < 0)
			pexit("Failed to read child process status");

		if (pid == 0)
			return;

		/* If we got here, pid > 0, so we have a valid pid to check.  */
		void (*cb)(GPid, int, gpointer) = g_hash_table_lookup(pid_to_handler, &pid);
		if (cb) {
			cb(pid, status, 0);
		} else if (cache) {
			pid_t *k = g_malloc(sizeof(pid_t));
			int *v = g_malloc(sizeof(int));
			if (k == NULL || v == NULL)
				pexit("Failed to allocate memory");
			*k = pid;
			*v = status;
			g_hash_table_insert(cache, k, v);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
leaq -0x14(%rbp), %rsi
movl $0x1, %edx
callq 0x4570
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0xdd08
callq 0x45c0
cmpl $0x4, (%rax)
jne 0xdd08
jmp 0xdce0
cmpl $0x0, -0x18(%rbp)
jge 0xdd2c
callq 0x45c0
cmpl $0xa, (%rax)
jne 0xdd2c
leaq 0x1d341(%rip), %rax     # 0x2b060
movq (%rax), %rdi
callq 0x4160
jmp 0xde7f
cmpl $0x0, -0x18(%rbp)
jge 0xdd8d
jmp 0xdd34
movq 0x82b5(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x12ce(%rip), %rsi      # 0xf013
leaq 0x4ea3(%rip), %rdx      # 0x12bef
movb $0x0, %al
callq 0x4830
leaq 0x1d1ee(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xdd83
leaq 0x1d1da(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x3, %edi
leaq 0x12c8(%rip), %rsi      # 0xf03d
leaq 0x4e73(%rip), %rcx      # 0x12bef
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
cmpl $0x0, -0x18(%rbp)
jne 0xdd98
jmp 0xde7f
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x4670
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xddc5
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %edi
movl -0x14(%rbp), %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
jmp 0xde7a
cmpq $0x0, -0x10(%rbp)
je 0xde78
movl $0x4, %edi
callq 0x42c0
movq %rax, -0x28(%rbp)
movl $0x4, %edi
callq 0x42c0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xddfa
cmpq $0x0, -0x30(%rbp)
jne 0xde55
jmp 0xddfc
movq 0x81ed(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x1206(%rip), %rsi      # 0xf013
leaq 0x38d0(%rip), %rdx      # 0x116e4
movb $0x0, %al
callq 0x4830
leaq 0x1d126(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xde4b
leaq 0x1d112(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x3, %edi
leaq 0x1200(%rip), %rsi      # 0xf03d
leaq 0x38a0(%rip), %rcx      # 0x116e4
movb $0x0, %al
callq 0x4120
movl $0x1, %edi
callq 0x41e0
movl -0x18(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x14(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x4220
jmp 0xde7a
jmp 0xdce0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctr_exit.c
// Function: on_signalfd_cb
gboolean on_signalfd_cb(gint fd, G_GNUC_UNUSED GIOCondition condition, gpointer user_data)
{
	struct pid_check_data *data = (struct pid_check_data *)user_data;

	/* drop the signal from the signalfd */
	drop_signal_event(fd);

	check_child_processes(data->pid_to_handler, data->exit_status_cache);
	return G_SOURCE_CONTINUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x4(%rbp), %edi
callq 0x8e10
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0xdcd0
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctr_exit.c
// Function: timeout_cb
gboolean timeout_cb(G_GNUC_UNUSED gpointer user_data)
{
	timed_out = TRUE;
	ninfo("Timed out, killing main loop");
	g_main_loop_quit(main_loop);
	return G_SOURCE_REMOVE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x1d165(%rip), %rax     # 0x2b058
movl $0x1, (%rax)
leaq 0x85a4(%rip), %rax      # 0x164a4
cmpl $0x2, (%rax)
jb 0xdf5a
jmp 0xdf07
movq 0x80e2(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x360e(%rip), %rsi      # 0x11526
leaq 0x49c9(%rip), %rdx      # 0x128e8
movb $0x0, %al
callq 0x4830
leaq 0x1d01b(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xdf56
leaq 0x1d007(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x3601(%rip), %rsi      # 0x11549
leaq 0x4999(%rip), %rcx      # 0x128e8
movb $0x0, %al
callq 0x4120
jmp 0xdf58
jmp 0xdf5a
leaq 0x1d0ff(%rip), %rax     # 0x2b060
movq (%rax), %rdi
callq 0x4160
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctr_exit.c
// Function: get_exit_status
int get_exit_status(int status)
{
	if (WIFEXITED(status))
		return WEXITSTATUS(status);
	if (WIFSIGNALED(status))
		return 128 + WTERMSIG(status);
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
andl $0x7f, %eax
cmpl $0x0, %eax
jne 0xdfa2
movl -0x8(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movl %eax, -0x4(%rbp)
jmp 0xdfcc
movl -0x8(%rbp), %eax
andl $0x7f, %eax
addl $0x1, %eax
movsbl %al, %eax
sarl %eax
cmpl $0x0, %eax
jle 0xdfc5
movl -0x8(%rbp), %eax
andl $0x7f, %eax
addl $0x80, %eax
movl %eax, -0x4(%rbp)
jmp 0xdfcc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/ctr_exit.c
// Function: container_exit_cb
void container_exit_cb(G_GNUC_UNUSED GPid pid, int status, G_GNUC_UNUSED gpointer user_data)
{
	if (get_exit_status(status) != 0) {
		ninfof("container %d exited with status %d", pid, get_exit_status(status));
	}
	container_status = status;
	container_pid = -1;
	/* In the case of a quickly exiting exec command, the container exit callback
	   sometimes gets called earlier than the pid exit callback. If we quit the loop at that point
	   we risk falsely telling the caller of conmon the runtime call failed (because runtime status
	   wouldn't be set). Instead, don't quit the loop until runtime exit is also called, which should
	   shortly after. */
	if (opt_api_version >= 1 && create_pid > 0 && opt_exec && opt_terminal) {
		ndebugf("container pid return handled before runtime pid return. Not quitting yet.");
		return;
	}

	g_main_loop_quit(main_loop);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movl -0x8(%rbp), %edi
callq 0xdf80
cmpl $0x0, %eax
je 0xe0cf
leaq 0x845a(%rip), %rax      # 0x164a4
cmpl $0x2, (%rax)
jb 0xe0cd
jmp 0xe051
movq 0x7f98(%rip), %rax      # 0x15ff0
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %edi
callq 0xdf80
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %edx
movl %eax, %ecx
leaq 0x4888(%rip), %rsi      # 0x12905
movb $0x0, %al
callq 0x4830
leaq 0x1cebd(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xe0c9
leaq 0x1cea9(%rip), %rax     # 0x2af40
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x8(%rbp), %edi
callq 0xdf80
movq -0x30(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl %eax, %r8d
movl $0x6, %edi
leaq 0x4873(%rip), %rsi      # 0x12935
movb $0x0, %al
callq 0x4120
jmp 0xe0cb
jmp 0xe0cd
jmp 0xe0cf
movl -0x8(%rbp), %ecx
leaq 0x8c6b(%rip), %rax      # 0x16d44
movl %ecx, (%rax)
movl $0xffffffff, 0x18d7f(%rip) # imm = 0xFFFFFFFF
leaq 0x1cee0(%rip), %rax     # 0x2afcc
cmpl $0x1, (%rax)
jl 0xe169
movl 0x18d71(%rip), %eax     # 0x26e68
cmpl $0x0, %eax
jle 0xe169
leaq 0x1cec5(%rip), %rax     # 0x2afc8
cmpl $0x0, (%rax)
je 0xe169
leaq 0x1ce45(%rip), %rax     # 0x2af54
cmpl $0x0, (%rax)
je 0xe169
leaq 0x8389(%rip), %rax      # 0x164a4
cmpl $0x3, (%rax)
jb 0xe167
jmp 0xe122
movq 0x7ec7(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x483d(%rip), %rsi      # 0x12970
movb $0x0, %al
callq 0x4830
leaq 0x1ce07(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xe163
leaq 0x1cdf3(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movl $0x6, %edi
leaq 0x486b(%rip), %rsi      # 0x129c7
movb $0x0, %al
callq 0x4120
jmp 0xe165
jmp 0xe167
jmp 0xe178
leaq 0x1cef0(%rip), %rax     # 0x2b060
movq (%rax), %rdi
callq 0x4160
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/runtime_args.c
// Function: add_argv
static void add_argv(GPtrArray *argv_array, ...)
{
	va_list args;
	char *arg;

	va_start(args, argv_array);
	while ((arg = va_arg(args, char *)))
		g_ptr_array_add(argv_array, arg);
	va_end(args);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
testb %al, %al
je 0xe8f8
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movq %rsi, -0xd8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rax
leaq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
leaq -0x20(%rbp), %rax
movq %rax, -0xf0(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0xe4(%rbp)
cmpl $0x28, %eax
ja 0xe97e
movq -0xf0(%rbp), %rcx
movl -0xe4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xf8(%rbp)
jmp 0xe99b
movq -0xf0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0xe9be
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4350
jmp 0xe943
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/runtime_args.c
// Function: print_argv
static void print_argv(GPtrArray *runtime_argv)
{
	if (log_level != TRACE_LEVEL)
		return;
	GString *runtime_args_string = g_string_sized_new(BUF_SIZE);

	g_ptr_array_foreach(runtime_argv, append_argv, runtime_args_string);

	ntracef("calling runtime args: %s", runtime_args_string->str);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x7aa1(%rip), %rax      # 0x164a4
cmpl $0x4, (%rax)
je 0xea0d
jmp 0xea90
movl $0x2000, %edi           # imm = 0x2000
callq 0x4330
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x76(%rip), %rsi        # 0xeaa0
callq 0x42b0
leaq 0x7a6e(%rip), %rax      # 0x164a4
cmpl $0x4, (%rax)
jb 0xea90
jmp 0xea3d
movq 0x75ac(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x423c(%rip), %rsi      # 0x12c91
movb $0x0, %al
callq 0x4830
leaq 0x1c4e5(%rip), %rax     # 0x2af48
cmpl $0x0, (%rax)
je 0xea8c
leaq 0x1c4d1(%rip), %rax     # 0x2af40
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl $0x6, %edi
leaq 0x4232(%rip), %rsi      # 0x12cb7
movb $0x0, %al
callq 0x4120
jmp 0xea8e
jmp 0xea90
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/runtime_args.c
// Function: append_argv
static void append_argv(gpointer data, gpointer user_data)
{
	if (!data)
		return;
	char *arg = (char *)data;
	GString *args = (GString *)user_data;

	g_string_append(args, arg);
	g_string_append_c(args, ' ');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xeab9
jmp 0xeae4
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4880
movq -0x20(%rbp), %rdi
movl $0x20, %esi
callq 0xeaf0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/close_fds.c
// Function: close_other_fds
void close_other_fds()
{
	int fd;

	if (open_files_set == NULL)
		return;
	for (fd = 3; fd <= open_files_max_fd; fd++) {
		if (fd != sync_pipe_fd && FD_ISSET(fd % FD_SETSIZE, &(open_files_set[fd / FD_SETSIZE])))
			close(fd);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
cmpq $0x0, 0x1c440(%rip)     # 0x2b1c0
jne 0xed87
jmp 0xee46
movl $0x3, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x1c431(%rip), %eax     # 0x2b1c8
jg 0xee46
movl -0x4(%rbp), %eax
leaq 0x180b9(%rip), %rcx     # 0x26e60
cmpl (%rcx), %eax
je 0xee36
movq 0x1c40a(%rip), %rax     # 0x2b1c0
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %eax
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
movl %eax, %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x4(%rbp), %eax
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
movl %edx, %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %eax
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
movl %edx, %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x10(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0xee36
movl -0x4(%rbp), %edi
callq 0x4100
jmp 0xee38
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xed8e
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/containers[P]conmon/src/close_fds.c
// Function: close_all_fds_ge_than
void close_all_fds_ge_than(int firstfd)
{
	struct dirent *ent;
	DIR *d;

	d = opendir(OPEN_FILES_DIR);
	if (!d)
		return;

	for (ent = readdir(d); ent; ent = readdir(d)) {
		int fd;

		if (ent->d_name[0] == '.')
			continue;

		fd = atoi(ent->d_name);
		if (fd == dirfd(d))
			continue;
		if (fd >= firstfd)
			close(fd);
	}
	closedir(d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
leaq 0x3e87(%rip), %rdi      # 0x12ce9
callq 0x4390
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xee74
jmp 0xeeeb
movq -0x18(%rbp), %rdi
callq 0x4430
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xeee2
movq -0x10(%rbp), %rax
movsbl 0x13(%rax), %eax
cmpl $0x2e, %eax
jne 0xee97
jmp 0xeed3
movq -0x10(%rbp), %rdi
addq $0x13, %rdi
callq 0x44f0
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x44e0
movl %eax, %ecx
movl -0x20(%rbp), %eax
cmpl %ecx, %eax
jne 0xeec1
jmp 0xeed3
movl -0x1c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jl 0xeed1
movl -0x1c(%rbp), %edi
callq 0x4100
jmp 0xeed3
movq -0x18(%rbp), %rdi
callq 0x4430
movq %rax, -0x10(%rbp)
jmp 0xee81
movq -0x18(%rbp), %rdi
callq 0x4740
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)