LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/silverneko[P]miku/isolate/isolate.c
// Function: cg_write
static void __attribute__((format(printf,3,4)))
cg_write(cg_controller controller, const char *attr, const char *fmt, ...)
{
  int maybe = 0;
  if (attr[0] == '?')
    {
      attr++;
      maybe = 1;
    }

  va_list args;
  va_start(args, fmt);

  char buf[CG_BUFSIZE];
  int n = vsnprintf(buf, sizeof(buf), fmt, args);
  if (n >= CG_BUFSIZE)
    die("cg_write: Value for attribute %s is too long", attr);

  if (verbose > 1)
    msg("CG: Write %s = %s", attr, buf);

  char path[256];
  cg_makepath(path, sizeof(path), controller, attr);

  int fd = open(path, O_WRONLY | O_TRUNC);
  if (fd < 0)
    {
      if (maybe)
	return;
      else
	die("Cannot write %s: %m", path);
    }

  int written = write(fd, buf, n);
  if (written < 0)
    {
      if (maybe)
	return;
      else
	die("Cannot set %s to %s: %m", path, buf);
    }
  if (written != n)
    die("Short write to %s (%d out of %d bytes)", path, written, n);

  close(fd);
  va_end(args);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x5e8, %rsp            # imm = 0x5E8
movl %edi, %ebp
leaq 0x130(%rsp), %rdi
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x4392
movaps %xmm0, 0x160(%rsp)
movaps %xmm1, 0x170(%rsp)
movaps %xmm2, 0x180(%rsp)
movaps %xmm3, 0x190(%rsp)
movaps %xmm4, 0x1a0(%rsp)
movaps %xmm5, 0x1b0(%rsp)
movaps %xmm6, 0x1c0(%rsp)
movaps %xmm7, 0x1d0(%rsp)
movb (%rsi), %r15b
xorl %r14d, %r14d
cmpb $0x3f, %r15b
sete %r14b
addq %rsi, %r14
leaq 0x10(%rsp), %rcx
movq %rdi, 0x10(%rcx)
leaq 0x610(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
leaq 0x1e0(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x20f0
cmpl $0x400, %eax            # imm = 0x400
jge 0x44a4
movl %eax, %ebx
cmpl $0x2, 0x4f21(%rip)      # 0x930c
jl 0x4406
leaq 0x13f0(%rip), %rdi      # 0x57e4
leaq 0x1e0(%rsp), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x418b
movl %ebp, %eax
shlq $0x4, %rax
leaq 0x497d(%rip), %rcx      # 0x8d90
movq (%rax,%rcx), %r8
movq %r14, (%rsp)
leaq 0x1121(%rip), %rdx      # 0x5543
leaq 0x110b(%rip), %rcx      # 0x5534
leaq 0x4f40(%rip), %r9       # 0x9370
leaq 0x30(%rsp), %r14
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
xorl %eax, %eax
callq 0x2210
movq %r14, %rdi
movl $0x201, %esi            # imm = 0x201
xorl %eax, %eax
callq 0x2400
testl %eax, %eax
js 0x447c
movl %eax, %ebp
movslq %ebx, %rdx
leaq 0x1e0(%rsp), %rsi
movl %eax, %edi
callq 0x2120
testl %eax, %eax
js 0x4490
cmpl %eax, %ebx
jne 0x44b5
movl %ebp, %edi
callq 0x2280
jmp 0x4496
cmpb $0x3f, %r15b
je 0x4496
leaq 0x136d(%rip), %rdi      # 0x57f6
leaq 0x30(%rsp), %rsi
jmp 0x44ae
cmpb $0x3f, %r15b
jne 0x44cc
addq $0x5e8, %rsp            # imm = 0x5E8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x130c(%rip), %rdi      # 0x57b7
movq %r14, %rsi
xorl %eax, %eax
callq 0x2de4
leaq 0x1366(%rip), %rdi      # 0x5822
leaq 0x30(%rsp), %rsi
movl %eax, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2de4
leaq 0x1337(%rip), %rdi      # 0x580a
leaq 0x30(%rsp), %rsi
leaq 0x1e0(%rsp), %rdx
xorl %eax, %eax
callq 0x2de4
// File: /workspace/github_c_makefile_star2_O1/agl[P]obstcp/obstcp-keygen.c
// Function: reada
static char
reada(int fd, void *buffer, size_t count) {
  size_t done = 0;

  while (count) {
    ssize_t n;
    do {
      n = read(fd, ((uint8_t *) buffer) + done, count);
    } while (n == -1 && errno == EINTR);

    if (n < 1)
      return 0;
    done += n;
    count -= n;
  }

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r13d, %r13d
testq %rbx, %rbx
je 0x1566
leaq (%r14,%r13), %r12
movl %ebp, %edi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x10a0
movq %rax, %r15
cmpq $-0x1, %rax
jne 0x154b
callq 0x1050
cmpl $0x4, (%rax)
je 0x152b
xorl %eax, %eax
testq %r15, %r15
movl $0x0, %ecx
cmovgq %r15, %rcx
subq %rcx, %rbx
addq %rcx, %r13
testq %r15, %r15
jg 0x1522
jmp 0x1568
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-zoe/dat-extract.c
// Function: processDirectory
void processDirectory( FILE *f, tocDirectoryEntry entry, char *curpath, unsigned int tgsfix ) {
	memset( completeName, 0, 48 );
	tocDirectoryEntry workentry;
	unsigned int i;
	char *newpath = NULL;
	
	if(!curpath) {
		newpath = malloc(sizeof("ZOE")+1);
		sprintf(newpath, "ZOE");
	}
	else {
		newpath = malloc(strlen(curpath)+1+strlen(entry.name)+1);
		sprintf(newpath, "%s/%s", curpath, entry.name);
	}
	
	printf("processDirectory - Current directory: %s at %08lx\n", newpath, ftell(f) );
	createDirectory( newpath );
	
	for( i = 0; i < entry.subDirCount; i++ ) {
		fseek( f, entry.subDirOffset+(i*32), SEEK_SET );
		fread( &workentry, sizeof(workentry), 1, f );
		if( tgsfix && workentry.subFileOffset ) workentry.subFileOffset -= 0x18;
		if( workentry.subDirCount ) processDirectory( f, workentry, newpath, tgsfix );
		else processDirectoryListing( f, workentry, newpath, tgsfix );
	}
	
	free(newpath);
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebx
movq %rdi, %r14
leaq 0x80(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x2c05(%rip)     # 0x40d0
movaps %xmm0, 0x2bee(%rip)     # 0x40c0
movaps %xmm0, 0x2bd7(%rip)     # 0x40b0
testq %rsi, %rsi
je 0x151d
movq %rsi, %r13
movq %rsi, %rdi
callq 0x1080
movq %rax, %r12
movq %r15, %rdi
callq 0x1080
leaq (%r12,%rax), %rdi
addq $0x2, %rdi
callq 0x10b0
movq %rax, %r12
leaq 0xba9(%rip), %rsi       # 0x20b4
movq %rax, %rdi
movq %r13, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x10f0
jmp 0x1530
movl $0x5, %edi
callq 0x10b0
movq %rax, %r12
movl $0x454f5a, (%rax)       # imm = 0x454F5A
movq %r14, %rdi
callq 0x10a0
leaq 0xbae(%rip), %rdi       # 0x20ed
xorl %ebp, %ebp
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1090
movq %r12, 0x20(%rsp)
movq %r12, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x1040
cmpl $0x0, 0x8(%r15)
je 0x1619
movq %r15, %rax
xorl %r13d, %r13d
testl %ebx, %ebx
setne %r15b
movq %rax, %r12
movl 0xc(%rax), %esi
addl %ebp, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10c0
movl $0x20, %esi
movl $0x1, %edx
leaq 0x28(%rsp), %rdi
movq %r14, %rcx
callq 0x1060
movl 0x3c(%rsp), %eax
testl %eax, %eax
setne %cl
andb %r15b, %cl
cmpb $0x1, %cl
jne 0x15b8
addl $-0x18, %eax
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x15e3
movups 0x28(%rsp), %xmm0
movups 0x38(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movl %ebx, %edx
callq 0x14a6
jmp 0x1605
movups 0x28(%rsp), %xmm0
movups 0x38(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movl %ebx, %edx
callq 0x12db
incl %r13d
addl $0x20, %ebp
movq %r12, %rax
cmpl 0x8(%r12), %r13d
jb 0x1571
movq 0x20(%rsp), %rdi
callq 0x1030
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-zoe/dat-extract.c
// Function: main
int main( int argc, char **argv ) {
	
	tocDirectoryEntry workdir;
	unsigned int tgsfix = 0;
	FILE *f;
	
	memset( workdir.name, 0, DIRNAMELENGTH );
	
	if ( argc < 2 ) {
		printf("Not enough args!\nUse: %s DAT-file\n", argv[0]);
		return 1;
	}
	if( argc == 3 ) tgsfix = 1;
	
	
	if( !(f = fopen( argv[1], "rb" ))) {
		printf("Couldnt open file %s\n", argv[1]);
		return 1;
	}
	fseek( f, 0, SEEK_SET );
	
	fread( &workdir, sizeof(workdir), 1, f );
	
	processDirectory( f, workdir, NULL, tgsfix );
	
	printf("Done.\n");
	
	fclose(f);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq $0x0, 0x20(%rsp)
cmpl $0x1, %edi
jg 0x165e
movq (%r14), %rsi
leaq 0xac7(%rip), %rdi       # 0x2120
jmp 0x16ed
movl %edi, %ebp
movq 0x8(%r14), %rdi
leaq 0xad8(%rip), %rsi       # 0x2143
callq 0x10d0
testq %rax, %rax
je 0x16e2
movq %rax, %rbx
xorl %r15d, %r15d
cmpl $0x3, %ebp
sete %r15b
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10c0
leaq 0x20(%rsp), %r12
movl $0x20, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1060
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x14a6
leaq 0xa73(%rip), %rdi       # 0x2146
callq 0x1050
movq %rbx, %rdi
callq 0x1070
jmp 0x16fa
movq 0x8(%r14), %rsi
leaq 0x9ea(%rip), %rdi       # 0x20d7
xorl %eax, %eax
callq 0x1090
movl $0x1, %r14d
movl %r14d, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/conmon.c
// Function: disconnect_std_streams
static void disconnect_std_streams(int dev_null_r, int dev_null_w)
{
	if (dup2(dev_null_r, STDIN_FILENO) < 0)
		pexit("Failed to dup over stdin");
	if (dup2(dev_null_w, STDOUT_FILENO) < 0)
		pexit("Failed to dup over stdout");
	if (dup2(dev_null_w, STDERR_FILENO) < 0)
		pexit("Failed to dup over stderr");
}

// Assembly:
pushq %rbx
movl %esi, %ebx
xorl %esi, %esi
callq 0x4090
testl %eax, %eax
js 0x8f8f
movl %ebx, %edi
movl $0x1, %esi
callq 0x4090
testl %eax, %eax
js 0x8f94
movl %ebx, %edi
movl $0x2, %esi
callq 0x4090
testl %eax, %eax
js 0x8f99
popq %rbx
retq
callq 0x5745
callq 0x56ef
callq 0x5699
nop
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/cmsg.c
// Function: sendfd
ssize_t sendfd(int sockfd, struct file_t file)
{
	struct msghdr msg = {0};
	struct iovec iov[1] = {{0}};
	struct cmsghdr *cmsg;
	int *fdptr;

	union {
		char buf[CMSG_SPACE(sizeof(file.fd))];
		struct cmsghdr align;
	} u;

	/*
	 * We need to send some other data along with the ancillary data,
	 * otherwise the other side won't receive any data. This is very
	 * well-hidden in the documentation (and only applies to
	 * SOCK_STREAM). See the bottom part of unix(7).
	 */
	iov[0].iov_base = file.name;
	iov[0].iov_len = strlen(file.name) + 1;

	msg.msg_name = NULL;
	msg.msg_namelen = 0;
	msg.msg_iov = iov;
	msg.msg_iovlen = 1;
	msg.msg_control = u.buf;
	msg.msg_controllen = sizeof(u.buf);

	cmsg = CMSG_FIRSTHDR(&msg);
	cmsg->cmsg_level = SOL_SOCKET;
	cmsg->cmsg_type = SCM_RIGHTS;
	cmsg->cmsg_len = CMSG_LEN(sizeof(int));

	fdptr = (int *)CMSG_DATA(cmsg);
	memcpy(fdptr, &file.fd, sizeof(int));

	return sendmsg(sockfd, &msg, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movl %edx, %ebp
movl %edi, %ebx
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r14
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
xorl %r15d, %r15d
movq %r15, 0x30(%r14)
movq %rsp, %r12
movaps %xmm0, (%r12)
movq %rsi, (%r12)
movq %rsi, %rdi
callq 0x4360
incq %rax
movq %rax, 0x8(%r12)
movq %r15, (%r14)
movl $0x0, 0x8(%r14)
movq %r12, 0x10(%r14)
movq $0x1, 0x18(%r14)
leaq 0x18(%rsp), %rax
movq %rax, 0x20(%r14)
movq $0x18, 0x28(%r14)
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
movq $0x14, (%rax)
movl %ebp, 0x10(%rax)
movl %ebx, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4480
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_logging.c
// Function: reopen_k8s_file
static void reopen_k8s_file(void)
{
	if (!use_k8s_logging)
		return;

	_cleanup_free_ char *k8s_log_path_tmp = g_strdup_printf("%s.tmp", k8s_log_path);

	/* Close the current k8s_log_fd */
	close(k8s_log_fd);

	/* Open with O_TRUNC: reset bytes written */
	k8s_bytes_written = 0;

	/* Open the log path file again */
	k8s_log_fd = open(k8s_log_path_tmp, O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, 0640);
	if (k8s_log_fd < 0)
		pexitf("Failed to open log file %s", k8s_log_path);

	/* Replace the previous file */
	if (rename(k8s_log_path_tmp, k8s_log_path) < 0) {
		pexit("Failed to rename log file");
	}
}

// Assembly:
pushq %rbx
cmpb $0x1, 0x1c428(%rip)     # 0x25e74
jne 0x9ab6
movq 0x1c423(%rip), %rsi     # 0x25e78
leaq 0x4383(%rip), %rdi      # 0xdddf
xorl %eax, %eax
callq 0x4380
movq %rax, %rbx
movl 0xba24(%rip), %edi      # 0x15490
callq 0x4100
movq $0x0, 0x1c404(%rip) # 0x25e80
movq %rbx, %rdi
movl $0x80241, %esi          # imm = 0x80241
movl $0x1a0, %edx            # imm = 0x1A0
xorl %eax, %eax
callq 0x48c0
movl %eax, 0xb9fa(%rip)      # 0x15490
testl %eax, %eax
js 0x9ab8
movq 0x1c3d7(%rip), %rsi     # 0x25e78
movq %rbx, %rdi
callq 0x48d0
testl %eax, %eax
js 0x9abd
movq %rbx, %rdi
popq %rbx
jmp 0x48e8
popq %rbx
retq
callq 0x5e26
callq 0x5dd0
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_logging.c
// Function: sync_logs
void sync_logs(void)
{
	/* Sync the logs to disk */
	if (k8s_log_fd > 0)
		if (fsync(k8s_log_fd) < 0)
			nwarnf("Failed to sync log file before exit: %m");
}

// Assembly:
movl 0xb9c8(%rip), %edi      # 0x15490
testl %edi, %edi
jle 0x9ae6
pushq %rax
callq 0x4460
testl %eax, %eax
jns 0x9ae2
leaq 0xb9b7(%rip), %rax      # 0x15494
cmpl $0x0, (%rax)
jne 0x9ae7
addq $0x8, %rsp
retq
callq 0x5e7c
jmp 0x9ae2
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_logging.c
// Function: writev_buffer_flush
static ssize_t writev_buffer_flush(int fd, writev_buffer_t *buf)
{
	size_t count = 0;

	for (int i = 0; i < buf->iovcnt; i++) {
		const char *ptr = buf->iov[i].iov_base;
		size_t remaining = buf->iov[i].iov_len;

		while (remaining > 0) {
			ssize_t written = write(fd, ptr, remaining);
			if (written < 0) {
				if (errno == EINTR)
					continue;
				return -1;
			}
			if (written == 0)
				return -1;

			ptr += written;
			remaining -= written;
			count += written;
		}
	}

	buf->iovcnt = 0;
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x0, (%rsi)
setg %r13b
jle 0x9bad
movl %edi, %ebp
leaq 0x8(%rsi), %rcx
xorl %ebx, %ebx
xorl %r12d, %r12d
movq %rsi, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rbx, %rax
shlq $0x4, %rax
movq 0x8(%rcx,%rax), %r14
testq %r14, %r14
je 0x9b92
addq %rcx, %rax
movq (%rax), %r15
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4830
testq %rax, %rax
js 0x9b56
je 0x9b6c
addq %rax, %r15
subq %rax, %r14
addq %rax, %r12
xorl %eax, %eax
jmp 0x9b71
callq 0x45b0
xorl %ecx, %ecx
cmpl $0x4, (%rax)
sete %cl
leal 0x1(,%rcx,4), %eax
jmp 0x9b71
movl $0x1, %eax
cmpl $0x5, %eax
je 0x9b7a
testl %eax, %eax
jne 0x9b81
testq %r14, %r14
jne 0x9b35
xorl %eax, %eax
testl %eax, %eax
sete %al
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rcx
jmp 0x9b94
movb $0x1, %al
testb %al, %al
je 0x9bb0
incq %rbx
movslq (%rsi), %rax
cmpq %rax, %rbx
setl %r13b
jl 0x9b1e
jmp 0x9bb0
xorl %r12d, %r12d
movq $-0x1, %rax
testb $0x1, %r13b
jne 0x9bc6
movl $0x0, (%rsi)
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_logging.c
// Function: writev_buffer_append_segment
ssize_t writev_buffer_append_segment(int fd, writev_buffer_t *buf, const void *data, ssize_t len)
{
	if (data == NULL)
		return 1;

	if (buf->iovcnt == WRITEV_BUFFER_N_IOV && writev_buffer_flush(fd, buf) < 0)
		return -1;

	if (len > 0) {
		buf->iov[buf->iovcnt].iov_base = (void *)data;
		buf->iov[buf->iovcnt].iov_len = (size_t)len;
		buf->iovcnt++;
	}

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0x1, %ebx
testq %rdx, %rdx
je 0x9c2a
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
cmpl $0x80, (%rsi)
jne 0x9c05
movq %r15, %rsi
callq 0x9aee
testq %rax, %rax
js 0x9c23
testq %r14, %r14
jle 0x9c2a
movslq (%r15), %rax
leal 0x1(%rax), %ecx
shlq $0x4, %rax
movq %r12, 0x8(%r15,%rax)
movq %r14, 0x10(%r15,%rax)
movl %ecx, (%r15)
jmp 0x9c2a
movq $-0x1, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/utils.c
// Function: set_conmon_logs
void set_conmon_logs(char *level_name, char *cid_, gboolean syslog_, char *tag)
{
	if (tag == NULL)
		log_cid = cid_;
	else
		log_cid = g_strdup_printf("%s: %s", cid_, tag);
	use_syslog = syslog_;
	// log_level is initialized as Warning, no need to set anything
	if (level_name == NULL)
		return;
	if (!strcasecmp(level_name, "error") || !strcasecmp(level_name, "fatal") || !strcasecmp(level_name, "panic")) {
		log_level = EXIT_LEVEL;
		return;
	} else if (!strcasecmp(level_name, "warn") || !strcasecmp(level_name, "warning")) {
		log_level = WARN_LEVEL;
		return;
	} else if (!strcasecmp(level_name, "info")) {
		log_level = INFO_LEVEL;
		return;
	} else if (!strcasecmp(level_name, "debug")) {
		log_level = DEBUG_LEVEL;
		return;
	} else if (!strcasecmp(level_name, "trace")) {
		log_level = TRACE_LEVEL;
		return;
	}
	ntracef("set log level to %s", level_name);
	nexitf("No such log level %s", level_name);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
testq %rcx, %rcx
je 0x9c5d
leaq 0x4224(%rip), %rdi      # 0xde74
movq %rcx, %rdx
xorl %eax, %eax
callq 0x4380
movq %rax, %rsi
movq %rsi, 0x2025c(%rip)     # 0x29ec0
movl %ebp, 0x2025e(%rip)     # 0x29ec8
testq %rbx, %rbx
je 0x9d9d
leaq 0x4201(%rip), %rsi      # 0xde7b
movq %rbx, %rdi
callq 0x4200
xorl %ebp, %ebp
testl %eax, %eax
je 0x9d97
leaq 0x41ee(%rip), %rsi      # 0xde81
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x9d97
leaq 0x41dd(%rip), %rsi      # 0xde87
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x9d97
leaq 0x41cc(%rip), %rsi      # 0xde8d
movq %rbx, %rdi
callq 0x4200
movl $0x1, %ebp
testl %eax, %eax
je 0x9d97
leaq 0x41b5(%rip), %rsi      # 0xde92
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x9d97
leaq 0x427c(%rip), %rsi      # 0xdf70
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x9d8b
leaq 0x418f(%rip), %rsi      # 0xde9a
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x9d92
leaq 0x4182(%rip), %rsi      # 0xdea0
movq %rbx, %rdi
callq 0x4200
movl $0x4, %ebp
testl %eax, %eax
je 0x9d97
cmpl $0x4, 0xb75e(%rip)      # 0x15494
jb 0x9d40
movq %rbx, %rdi
callq 0x5ebf
movq 0xb2a9(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0x41a3(%rip), %rsi      # 0xdef4
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4820
cmpl $0x0, 0x20166(%rip)     # 0x29ec8
je 0x9d81
movq 0x20155(%rip), %rdx     # 0x29ec0
leaq 0x41a4(%rip), %rsi      # 0xdf16
movl $0x3, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4120
movl $0x1, %edi
callq 0x41e0
movl $0x2, %ebp
jmp 0x9d97
movl $0x3, %ebp
movl %ebp, 0xb6f7(%rip)      # 0x15494
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/utils.c
// Function: write_all
ssize_t write_all(int fd, const void *buf, size_t count)
{
	size_t remaining = count;
	const char *p = buf;
	ssize_t res;

	while (remaining > 0) {
		do {
			res = write(fd, p, remaining);
		} while (res == -1 && retryable_error(errno));

		if (res <= 0)
			return -1;

		remaining -= res;
		p += res;
	}

	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rdx, %rdx
je 0x9e1c
movq %rsi, %r14
movl %edi, %ebp
movq %rbx, %r15
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4830
movq %rax, %r12
cmpq $-0x1, %rax
jne 0x9e06
callq 0x45b0
movq %rax, %r13
movl (%r13), %eax
cmpl $0x4, %eax
je 0x9df0
cmpl $0xb, %eax
je 0x9df0
cmpl $0x69, %eax
jne 0x9e06
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4830
movq %rax, %r12
cmpq $-0x1, %rax
je 0x9ddd
testq %r12, %r12
jle 0x9e15
addq %r12, %r14
subq %r12, %r15
jne 0x9dbf
jmp 0x9e1c
movq $-0x1, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/cli.c
// Function: initialize_cli
int initialize_cli(int argc, char *argv[])
{
	GOptionContext *context = g_option_context_new("- conmon utility");
	g_option_context_add_main_entries(context, opt_entries, "conmon");

	GError *error = NULL;
	if (!g_option_context_parse(context, &argc, &argv, &error)) {
		g_printerr("conmon: option parsing failed: %s\n", error->message);
		exit(EXIT_FAILURE);
	}

	g_option_context_free(context);
	context = NULL;

	if (opt_version) {
		g_print("conmon version " VERSION "\ncommit: " GIT_COMMIT "\n");
		exit(EXIT_SUCCESS);
	}

	if (opt_cid == NULL) {
		fprintf(stderr, "conmon: Container ID not provided. Use --cid\n");
		exit(EXIT_FAILURE);
	}
	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0x14(%rsp), %r14
movl %edi, (%r14)
leaq 0x18(%rsp), %r15
movq %rsi, (%r15)
leaq 0x49e1(%rip), %rdi      # 0xe915
callq 0x4710
movq %rax, %rbx
leaq 0xb57d(%rip), %rsi      # 0x154c0
leaq 0x49dc(%rip), %rdx      # 0xe926
movq %rax, %rdi
callq 0x42e0
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4470
testl %eax, %eax
je 0x9f9a
movq %rbx, %rdi
callq 0x41a0
cmpl $0x0, 0x1ff51(%rip)     # 0x29ed0
jne 0x9fbb
cmpq $0x0, 0x1ff67(%rip)     # 0x29ef0
je 0x9fd0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x4983(%rip), %rdi      # 0xe92d
xorl %eax, %eax
callq 0x4240
movl $0x1, %edi
callq 0x41e0
leaq 0x498e(%rip), %rdi      # 0xe950
xorl %eax, %eax
callq 0x4190
xorl %edi, %edi
callq 0x41e0
callq 0x5f05
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/cgroup.c
// Function: oom_cb_cgroup_v2
static gboolean oom_cb_cgroup_v2(int fd, GIOCondition condition, G_GNUC_UNUSED gpointer user_data)
{
	const size_t events_size = sizeof(struct inotify_event) + NAME_MAX + 1;
	char events[events_size];

	/* Drop the inotify events.  */
	ssize_t num_read = read(fd, &events, events_size);
	if (num_read < 0) {
		nwarn("Failed to read oom event from eventfd in v2");
		return G_SOURCE_CONTINUE;
	}

	gboolean ret = G_SOURCE_REMOVE;
	if ((condition & G_IO_IN) != 0) {
		ret = check_cgroup2_oom();
	}

	if (ret == G_SOURCE_REMOVE) {
		/* End of input */
		close(fd);
		inotify_fd = -1;
	}

	return ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movl %esi, %r14d
movl %edi, %ebx
leaq 0x10(%rsp), %rsi
movl $0x110, %edx            # imm = 0x110
callq 0x4230
testq %rax, %rax
js 0xa948
xorl %ebp, %ebp
testb $0x1, %r14b
je 0xa92e
callq 0xa473
movl %eax, %ebp
testl %ebp, %ebp
jne 0xa959
movl %ebx, %edi
callq 0x4100
leaq 0xb414(%rip), %rax      # 0x15d54
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0xa959
leaq 0xab45(%rip), %rax      # 0x15494
movl $0x1, %ebp
cmpl $0x0, (%rax)
jne 0xa967
movl %ebp, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xc(%rsp), %rbx
movq %rbx, %rdi
callq 0x65c9
movl (%rbx), %ebp
jmp 0xa959
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/cgroup.c
// Function: create_oom_files
static int create_oom_files()
{
	ninfo("OOM received");
	int r = 0;
	r |= create_oom_file(opt_persist_path);
	r |= create_oom_file(opt_bundle_path);
	return r;
}

// Assembly:
pushq %rbx
leaq 0xa9f2(%rip), %rax      # 0x15494
cmpl $0x2, (%rax)
jae 0xaacb
leaq 0x1f46a(%rip), %rax     # 0x29f18
movq (%rax), %rdi
callq 0xaad2
movl %eax, %ebx
leaq 0x1f451(%rip), %rax     # 0x29f10
movq (%rax), %rdi
callq 0xaad2
orl %ebx, %eax
popq %rbx
retq
callq 0x6815
jmp 0xaaa7
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/cgroup.c
// Function: create_oom_file
static int create_oom_file(const char *base_path)
{
	if (base_path == NULL || base_path[0] == '\0')
		return 0;

	_cleanup_free_ char *ctr_oom_file_path = g_build_filename(base_path, "oom", NULL);
	_cleanup_close_ int ctr_oom_fd = open(ctr_oom_file_path, O_CREAT | O_CLOEXEC, 0666);
	if (ctr_oom_fd < 0) {
		nwarnf("Failed to write oom file to the %s path", base_path);
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0xab3e
movq %rdi, %r14
cmpb $0x0, (%rdi)
je 0xab3e
leaq 0x4741(%rip), %rsi      # 0xf230
xorl %ebx, %ebx
movq %r14, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4680
movq %rax, %r15
movq %rax, %rdi
movl $0x80040, %esi          # imm = 0x80040
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x48c0
movl %eax, %ebp
testl %eax, %eax
jns 0xab2b
leaq 0xa973(%rip), %rax      # 0x15494
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x0, (%rax)
jne 0xab4b
testl %ebp, %ebp
js 0xab36
movl %ebp, %edi
callq 0x4100
movq %r15, %rdi
callq 0x48e8
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6867
movl (%rbx), %ebx
jmp 0xab2b
nop
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
leaq 0x1f2d1(%rip), %rax     # 0x29fc0
movl (%rax), %r8d
leaq 0x33a1(%rip), %rdi      # 0xe09a
leaq 0xb0a0(%rip), %rcx      # 0x15da0
movl $0x80805, %esi          # imm = 0x80805
movl $0x1c0, %edx            # imm = 0x1C0
callq 0xad52
movq %rax, %rbx
movl 0xb08c(%rip), %edi      # 0x15da4
movl $0xa, %esi
callq 0x43c0
cmpl $-0x1, %eax
je 0xad4a
movl 0xb077(%rip), %edi      # 0x15da4
leaq 0xb06c(%rip), %rcx      # 0x15da0
leaq 0x189(%rip), %rdx       # 0xaec4
movl $0x1, %esi
callq 0x4430
movq %rbx, %rax
popq %rbx
retq
movq %rbx, %rdi
callq 0x6b67
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/conn_sock.c
// Function: attach_cb
static gboolean attach_cb(int fd, G_GNUC_UNUSED GIOCondition condition, gpointer user_data)
{
	struct remote_sock_s *srcsock = (struct remote_sock_s *)user_data;
	int new_fd = accept(fd, NULL, NULL);
	if (new_fd == -1) {
		if (errno != EWOULDBLOCK)
			nwarn("Failed to accept client connection on attach socket");
	} else {
		struct remote_sock_s *remote_sock;
		set_socket_buffers(new_fd);
		if (srcsock->dest->readers == NULL) {
			srcsock->dest->readers = g_ptr_array_new_with_free_func(free);
		}
		remote_sock = malloc(sizeof(*remote_sock));
		if (remote_sock == NULL) {
			pexit("Failed to allocate memory");
		}
		init_remote_sock(remote_sock, srcsock);
		remote_sock->fd = new_fd;
		g_unix_fd_add(remote_sock->fd, G_IO_IN | G_IO_HUP | G_IO_ERR, remote_sock_cb, remote_sock);
		g_ptr_array_add(remote_sock->dest->readers, remote_sock);
		ndebugf("Accepted%s connection %d", SOCK_IS_CONSOLE(srcsock->sock_type) ? " console" : "", remote_sock->fd);
	}

	return G_SOURCE_CONTINUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
xorl %esi, %esi
xorl %edx, %edx
callq 0x4860
cmpl $-0x1, %eax
je 0xaf9b
movl %eax, %ebp
movq 0x8(%rbx), %rax
cmpq $0x0, 0x10(%rax)
jne 0xaefe
movq 0xa0d7(%rip), %rdi      # 0x14fc8
callq 0x4170
movq 0x8(%rbx), %rcx
movq %rax, 0x10(%rcx)
movl $0x8038, %edi           # imm = 0x8038
callq 0x4250
testq %rax, %rax
je 0xafc2
movq %rax, %r14
movq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
testq %rbx, %rbx
je 0xaf54
movl 0x18(%rbx), %eax
movl %eax, 0x18(%r14)
movl 0x1c(%rbx), %eax
movl %eax, 0x1c(%r14)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r14)
movq (%rax), %rax
movl (%rax), %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x4280
movl (%rbx), %eax
movl %eax, (%r14)
movl %ebp, 0x4(%r14)
leaq 0x10f(%rip), %rdx       # 0xb06e
movl %ebp, %edi
movl $0x19, %esi
movq %r14, %rcx
callq 0x4430
movq 0x8(%r14), %rax
movq 0x10(%rax), %rdi
movq %r14, %rsi
callq 0x4350
leaq 0xa50f(%rip), %rax      # 0x15494
cmpl $0x3, (%rax)
jb 0xafb1
addq $0x4, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6db1
jmp 0xafb1
callq 0x45b0
cmpl $0xb, (%rax)
je 0xafb1
leaq 0xa4e8(%rip), %rax      # 0x15494
cmpl $0x0, (%rax)
jne 0xafbb
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x6e94
jmp 0xafb1
callq 0x6e3e
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x1ae66(%rip)     # 0x25e38
jns 0xb017
movq %rdi, %rbx
movl $0x1, %edi
movl $0x80802, %esi          # imm = 0x80802
xorl %edx, %edx
callq 0x4570
movl %eax, 0x1ae4a(%rip)     # 0x25e38
cmpl $-0x1, %eax
je 0xb069
movw $0x1, 0x1eff4(%rip)     # 0x29ff0
leaq 0x1efef(%rip), %rdi     # 0x29ff2
movl $0x6b, %edx
movq %rbx, %rsi
callq 0x46e0
movb $0x0, 0x1f046(%rip)     # 0x2a05d
leaq 0x4327(%rip), %rdi      # 0xf345
leaq 0x12ddb(%rip), %rbx     # 0x1de00
movl $0x80802, %esi          # imm = 0x80802
movl $0x1ff, %edx            # imm = 0x1FF
movq %rbx, %rcx
movl $0x1, %r8d
callq 0xad52
movq %rax, %r14
movl 0x12dbe(%rip), %edi     # 0x1de04
leaq 0x21(%rip), %rdx        # 0xb06e
movl $0x19, %esi
movq %rbx, %rcx
callq 0x4430
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x48e0
callq 0x6ee6
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
testb $0x1, %sil
jne 0xb08f
movq %rbx, %rdi
callq 0xb493
jmp 0xb09d
cmpq $0x0, 0x20(%rbx)
je 0xb0b0
movl $0x1, 0x14(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rbx), %edi
leaq 0x30(%rbx), %r14
cmpl $0x1, (%rbx)
jne 0xb0cb
movl $0x8000, %edx           # imm = 0x8000
movq %r14, %rsi
callq 0x4230
jmp 0xb0e0
movl $0x8000, %edx           # imm = 0x8000
movq %r14, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x46c0
movl $0x1, %ebp
testq %rax, %rax
js 0xb09f
je 0xb085
movq %rax, 0x20(%rbx)
movq $0x0, 0x28(%rbx)
cmpl $0x2, (%rbx)
jne 0xb249
movb $0x0, 0x30(%rbx,%rax)
leaq 0x48a3(%rip), %rsi      # 0xf9b0
movq %r14, 0x20(%rsp)
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
movq $0x0, 0x20(%rbx)
movq %rax, 0x10(%rsp)
movq (%rax), %r12
testq %r12, %r12
je 0xb23a
xorl %r14d, %r14d
leaq 0x4982(%rip), %rbp      # 0xfac4
movq %rbx, 0x18(%rsp)
movq %r12, %rdi
leaq 0x47fb(%rip), %rsi      # 0xf94c
callq 0x4610
testl %eax, %eax
je 0xb186
xorl %ecx, %ecx
movq %rcx, %rbx
cmpq $0x4, %rcx
je 0xb17d
movslq 0x4(%rbp,%rbx,4), %rsi
addq %rbp, %rsi
movq %r12, %rdi
callq 0x4610
leaq 0x1(%rbx), %rcx
testl %eax, %eax
jne 0xb15c
cmpq $0x4, %rbx
setae %al
jmp 0xb188
xorl %eax, %eax
movl %eax, 0xc(%rsp)
testb %al, %al
je 0xb1d9
movl 0xc(%rsp), %eax
movl %eax, %r15d
xorb $0x1, %r15b
leaq 0x4936(%rip), %rbx      # 0xfad8
xorl %r13d, %r13d
movslq (%rbx), %rsi
leaq 0x4929(%rip), %rax      # 0xfad8
addq %rax, %rsi
movq %r12, %rdi
callq 0x45a0
testl %eax, %eax
jne 0xb1d9
cmpq $0x3, %r13
leaq 0x1(%r13), %r13
setae %al
addq $0x4, %rbx
orb %r15b, %al
je 0xb1a5
cmpb $0x0, 0xc(%rsp)
jne 0xb21f
movq 0x18(%rsp), %rbx
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0xb1f4
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb $0xa, 0x30(%rbx,%rax)
movq 0x20(%rbx), %r13
addq 0x20(%rsp), %r13
movq %r12, %rdi
callq 0x4360
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x48a0
movq %r12, %rdi
callq 0x4360
addq %rax, 0x20(%rbx)
movq 0x10(%rsp), %rax
movq 0x8(%rax,%r14,8), %r12
incq %r14
testq %r12, %r12
movq 0x18(%rsp), %rbx
jne 0xb147
movq 0x10(%rsp), %rdi
callq 0x4790
movl $0x1, %ebp
cmpq $0x0, 0x20(%rbx)
je 0xb258
movq %rbx, %rdi
callq 0xb4ef
cmpq $0x0, 0x20(%rbx)
je 0xb09f
movq 0x8(%rbx), %rcx
movq (%rcx), %rax
movl (%rax), %edi
testl %edi, %edi
js 0xb09f
leaq 0x3df(%rip), %rdx       # 0xb65a
movl $0x4, %esi
callq 0x4430
jmp 0xb09f
// File: /workspace/github_c_makefile_star2_O1/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:
movq 0xaad1(%rip), %rax      # 0x15d88
testq %rax, %rax
je 0xb337
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x8(%rax), %r12
testq %r12, %r12
jle 0xb32e
movq %rdi, %rbx
movslq %esi, %r14
incq %r12
leaq 0xa1b6(%rip), %r13      # 0x15494
movq 0xaaa3(%rip), %rax      # 0x15d88
movq (%rax), %rax
movq -0x10(%rax,%r12,8), %r15
cmpl $0x0, 0x1c(%r15)
je 0xb31c
movl 0x4(%r15), %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x9da4
testq %rax, %rax
jns 0xb31c
cmpl $0x0, (%r13)
jne 0xb327
movq %r15, %rdi
movl $0x1, %esi
callq 0xb338
decq %r12
cmpq $0x1, %r12
jg 0xb2de
jmp 0xb32e
callq 0x6f3c
jmp 0xb30f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %edi
cmpl $-0x1, %edi
je 0xb36d
movl %esi, %ebp
callq 0x40e0
testl %ebp, %ebp
je 0xb35a
movl $0x0, 0x1c(%rbx)
jmp 0xb361
movl $0x0, 0x18(%rbx)
cmpl $0x0, 0x1c(%rbx)
jne 0xb36d
cmpl $0x0, 0x18(%rbx)
je 0xb374
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xa119(%rip), %rax      # 0x15494
cmpl $0x3, (%rax)
jae 0xb3aa
movl 0x4(%rbx), %edi
callq 0x4100
movl $0xffffffff, 0x4(%rbx)  # imm = 0xFFFFFFFF
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0xb36d
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x45f0
leaq 0x4(%rbx), %rdi
callq 0x6f8e
jmp 0xb380
// File: /workspace/github_c_makefile_star2_O1/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:
movq 0xa9cc(%rip), %rdi      # 0x15d88
testq %rdi, %rdi
je 0xb3ed
pushq %rax
leaq 0x25(%rip), %rsi        # 0xb3ee
xorl %edx, %edx
callq 0x42b0
movl 0xa9ce(%rip), %edi      # 0x15da4
testl %edi, %edi
js 0xb3df
callq 0x4100
movl $0xffffffff, 0xa9bb(%rip) # imm = 0xFFFFFFFF
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/conn_sock.c
// Function: bind_relative_to_dir
static void bind_relative_to_dir(int dir_fd, int sock_fd, const char *path)
{
	struct sockaddr_un addr;

	/*
	 * To be able to access the location of the attach socket, without first creating the attach socket
	 * but also be able to handle arbitrary length paths, we open the parent dir (base_path), and then use
	 * the corresponding entry in `/proc/self/fd` to act as the path to base_path, then we use the socket_relative_name
	 * to actually refer to the file where the socket will be created below.
	 */
	addr.sun_family = AF_UNIX;
	if (dir_fd == -1) {
		strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1);
	} else {
		snprintf(addr.sun_path, sizeof(addr.sun_path), "/proc/self/fd/%d/%s", dir_fd, path);
	}
	ndebugf("addr{sun_family=AF_UNIX, sun_path=%s}", addr.sun_path);

	if (fchmod(sock_fd, 0700))
		pexit("Failed to change console-socket permissions");
	if (bind(sock_fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
		pexit("Failed to bind to console-socket");
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movq %rdx, %r8
movl %esi, %ebx
movl %edi, %ecx
leaq 0x4(%rsp), %rdi
movw $0x1, -0x2(%rdi)
cmpl $-0x1, %ecx
je 0xb439
leaq 0x4123(%rip), %rdx      # 0xf54e
movl $0x6c, %esi
xorl %eax, %eax
callq 0x40c0
jmp 0xb446
movl $0x6b, %edx
movq %r8, %rsi
callq 0x46e0
leaq 0xa047(%rip), %rax      # 0x15494
cmpl $0x3, (%rax)
jae 0xb47d
movl %ebx, %edi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x4500
testl %eax, %eax
jne 0xb489
leaq 0x2(%rsp), %rsi
movl %ebx, %edi
movl $0x6e, %edx
callq 0x47d0
testl %eax, %eax
js 0xb48e
addq $0x70, %rsp
popq %rbx
retq
leaq 0x2(%rsp), %rdi
callq 0x6fd8
jmp 0xb452
callq 0x7027
callq 0x707d
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0xb338
cmpl $0x1, (%rbx)
jne 0xb4ed
movq 0x8(%rbx), %rax
movq (%rax), %rax
movl (%rax), %edi
testl %edi, %edi
js 0xb4ed
leaq 0x1ea21(%rip), %rax     # 0x29ed8
cmpl $0x0, (%rax)
je 0xb4ed
leaq 0x1ea19(%rip), %rax     # 0x29edc
cmpl $0x0, (%rax)
je 0xb4db
leaq 0x9fc5(%rip), %rax      # 0x15494
cmpl $0x2, (%rax)
jb 0xb4ed
callq 0x70d3
jmp 0xb4ed
callq 0x4100
movq 0x8(%rbx), %rax
movq (%rax), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/conn_sock.c
// Function: sock_try_write_to_local_sock
static void sock_try_write_to_local_sock(struct remote_sock_s *sock)
{
	struct local_sock_s *local_sock = sock->dest;
	ssize_t w = 0;

	if (!sock->remaining || *(local_sock->fd) < 0)
		return;

	if (local_sock->is_stream) {
		w = write(*(local_sock->fd), sock->buf + sock->off, sock->remaining);
		if (w < 0) {
			pwarnf("Failed to write to fd %s", local_sock->label);
		}
	} else {
		w = sendto(*(local_sock->fd), sock->buf + sock->off, sock->remaining, MSG_DONTWAIT | MSG_NOSIGNAL,
			   (struct sockaddr *)local_sock->addr, sizeof(*(local_sock->addr)));
		if (w < 0) {
			pwarnf("Failed to write to socket %s", local_sock->label);
		}
	}
	if (w > 0) {
		sock->off += w;
		sock->remaining -= w;
	}
}

// Assembly:
movq 0x20(%rdi), %rdx
testq %rdx, %rdx
je 0xb5db
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rbp
movq (%rbp), %rax
movl (%rax), %edi
testl %edi, %edi
js 0xb5cd
cmpl $0x0, 0x8(%rbp)
movq 0x28(%rbx), %rax
leaq 0x30(%rbx,%rax), %rsi
je 0xb598
callq 0x4830
movq %rax, %r14
testq %rax, %rax
jns 0xb5c0
leaq 0x9f51(%rip), %rax      # 0x15494
cmpl $0x0, (%rax)
je 0xb5c0
movq 0x9aa1(%rip), %rax      # 0x14ff0
movq (%rax), %r12
movq 0x18(%rbp), %r13
callq 0x45b0
movq %rax, %r15
movl (%rax), %edi
callq 0x44a0
leaq 0x4447(%rip), %rsi      # 0xf9b3
movq %r12, %rdi
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4820
leaq 0x1e945(%rip), %rax     # 0x29ec8
cmpl $0x0, (%rax)
je 0xb5c0
addq $0x18, %rbp
leaq 0x4449(%rip), %r12      # 0xf9dc
jmp 0xb627
movq 0x20(%rbp), %r8
movl $0x4040, %ecx           # imm = 0x4040
movl $0x6e, %r9d
callq 0x47c0
movq %rax, %r14
testq %rax, %rax
jns 0xb5c0
leaq 0x9ed9(%rip), %rax      # 0x15494
cmpl $0x0, (%rax)
jne 0xb5dc
testq %r14, %r14
jle 0xb5cd
addq %r14, 0x28(%rbx)
subq %r14, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9a0d(%rip), %rax      # 0x14ff0
movq (%rax), %r12
movq 0x18(%rbp), %r13
callq 0x45b0
movq %rax, %r15
movl (%rax), %edi
callq 0x44a0
leaq 0x4410(%rip), %rsi      # 0xfa10
movq %r12, %rdi
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4820
leaq 0x1e8b1(%rip), %rax     # 0x29ec8
cmpl $0x0, (%rax)
je 0xb5c0
addq $0x18, %rbp
leaq 0x4416(%rip), %r12      # 0xfa3d
leaq 0x1e892(%rip), %rax     # 0x29ec0
movq (%rax), %r13
movq (%rbp), %rbp
movl (%r15), %edi
callq 0x44a0
movl $0x6, %edi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x4120
jmp 0xb5c0
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x10, %rsp
movb $0x0, 0xf(%rsp)
movq (%rdx), %rax
cmpl $0x0, (%rax)
js 0xb689
movq 0x10(%rdx), %rdi
leaq 0x1a(%rip), %rsi        # 0xb691
leaq 0xf(%rsp), %rbx
movq %rbx, %rdx
callq 0x42b0
movzbl (%rbx), %eax
jmp 0xb68b
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0xb4ef
cmpq $0x0, 0x20(%rbx)
je 0xb6b3
movb $0x1, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x0, 0x14(%rbx)
je 0xb6ab
movl $0x0, 0x14(%rbx)
movl 0x4(%rbx), %edi
leaq -0x65c(%rip), %rdx      # 0xb06e
movl $0x19, %esi
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4430
nop
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movl %edi, %ebp
leaq 0x43eb(%rip), %rdi      # 0xfae8
movl $0x80002, %esi          # imm = 0x80002
xorl %eax, %eax
callq 0x48c0
testl %eax, %eax
js 0xb793
movl %eax, %ebx
testq %r14, %r14
je 0xb743
movq %rsp, %rsi
movl $0x10, %edx
movl %ebx, %edi
callq 0x4230
testq %rax, %rax
jns 0xb738
leaq 0x9d61(%rip), %rax      # 0x15494
cmpl $0x3, (%rax)
jae 0xb7af
movq %rsp, %rdi
callq 0x44e0
movl %eax, (%r14)
leaq 0x38c6(%rip), %rdx      # 0xf010
movq %rsp, %r14
movl $0x10, %esi
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x40c0
movq %r14, %rdi
callq 0x4360
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x4830
testq %rax, %rax
jns 0xb784
leaq 0x9d15(%rip), %rax      # 0x15494
cmpl $0x3, (%rax)
jae 0xb7a8
movl %ebx, %edi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4100
leaq 0x9cfa(%rip), %rax      # 0x15494
cmpl $0x3, (%rax)
jae 0xb7b6
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x7168
jmp 0xb784
callq 0x7125
jmp 0xb738
callq 0x71ab
jmp 0xb79f
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctrl.c
// Function: read_from_ctrl_buffer
static gboolean read_from_ctrl_buffer(int fd, gboolean (*line_process_func)(char *))
{
#define CTLBUFSZ 200
	static char ctlbuf[CTLBUFSZ];
	static int readsz = CTLBUFSZ - 1;
	static char *readptr = ctlbuf;
	ssize_t num_read = read(fd, readptr, readsz);
	if (num_read <= 0) {
		nwarnf("Failed to read from fd %d", fd);
		return G_SOURCE_CONTINUE;
	}

	readptr[num_read] = '\0';
	ndebugf("Got ctl message: %s on fd %d", ctlbuf, fd);

	char *beg = ctlbuf;
	char *newline = strchrnul(beg, '\n');
	/* Process each message which ends with a line */
	while (*newline != '\0') {
		if (!line_process_func(beg))
			return G_SOURCE_CONTINUE;

		beg = newline + 1;
		newline = strchrnul(beg, '\n');
	}
	if (num_read == (CTLBUFSZ - 1) && beg == ctlbuf) {
		/*
		 * We did not find a newline in the entire buffer.
		 * This shouldn't happen as our buffer is larger than
		 * the message that we expect to receive.
		 */
		nwarn("Could not find newline in entire buffer");
	} else if (*beg == '\0') {
		/* We exhausted all messages that were complete */
		readptr = ctlbuf;
		readsz = CTLBUFSZ - 1;
	} else {
		/*
		 * We copy remaining data to beginning of buffer
		 * and advance readptr after that.
		 */
		int cp_rem = 0;
		do {
			ctlbuf[cp_rem++] = *beg++;
		} while (*beg != '\0');
		readptr = ctlbuf + cp_rem;
		readsz = CTLBUFSZ - 1 - cp_rem;
	}

	return G_SOURCE_CONTINUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movq 0x1a4a6(%rip), %rsi     # 0x25e48
movslq 0x1a497(%rip), %rdx     # 0x25e40
callq 0x4230
testq %rax, %rax
jle 0xba46
movq %rax, %r14
movq 0x1a487(%rip), %rax     # 0x25e48
movb $0x0, (%rax,%r14)
leaq 0x9ac7(%rip), %rax      # 0x15494
cmpl $0x3, (%rax)
jae 0xbabf
leaq 0x1e693(%rip), %r12     # 0x2a070
movq %r12, %rdi
movl $0xa, %esi
callq 0x4300
cmpb $0x0, (%rax)
movq %r12, %r15
je 0xba24
movq %rax, %r13
leaq 0x1e674(%rip), %r15     # 0x2a070
movq %r15, %rdi
callq *%rbx
testl %eax, %eax
je 0xbab0
movq %r13, %r15
incq %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x4300
movq %rax, %r13
cmpb $0x0, (%rax)
jne 0xb9fc
xorq $0xc7, %r14
xorq %r15, %r12
orq %r14, %r12
jne 0xba5b
leaq 0x9a5a(%rip), %rax      # 0x15494
cmpl $0x0, (%rax)
je 0xbab0
callq 0x74f6
jmp 0xbab0
leaq 0x9a47(%rip), %rax      # 0x15494
cmpl $0x0, (%rax)
je 0xbab0
movl %ebp, %edi
callq 0x7548
jmp 0xbab0
cmpb $0x0, (%r15)
je 0xba98
xorl %ecx, %ecx
leaq 0x1e606(%rip), %rax     # 0x2a070
movb (%r15,%rcx), %dl
movb %dl, (%rcx,%rax)
cmpb $0x0, 0x1(%r15,%rcx)
leaq 0x1(%rcx), %rcx
jne 0xba6a
movl %ecx, %edx
addq %rdx, %rax
movq %rax, 0x1a3bf(%rip)     # 0x25e48
movl $0xc7, %eax
subl %ecx, %eax
movl %eax, 0x1a3aa(%rip)     # 0x25e40
jmp 0xbab0
leaq 0x1e5d1(%rip), %rax     # 0x2a070
movq %rax, 0x1a3a2(%rip)     # 0x25e48
movl $0xc7, 0x1a390(%rip)    # 0x25e40
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
callq 0x749e
jmp 0xb9d6