LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: cg_read
static int
cg_read(cg_controller controller, const char *attr, char *buf)
{
  int maybe = 0;
  if (attr[0] == '?')
    {
      attr++;
      maybe = 1;
    }

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

  int fd = open(path, O_RDONLY);
  if (fd < 0)
    {
      if (maybe)
	return 0;
      die("Cannot read %s: %m", path);
    }

  int n = read(fd, buf, CG_BUFSIZE);
  if (n < 0)
    {
      if (maybe)
	return 0;
      die("Cannot read %s: %m", path);
    }
  if (n >= CG_BUFSIZE - 1)
    die("Attribute %s too long", path);
  if (n > 0 && buf[n-1] == '\n')
    n--;
  buf[n] = 0;

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

  close(fd);
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %rbx
movl %edi, %eax
movb (%rsi), %r13b
xorl %r14d, %r14d
cmpb $0x3f, %r13b
sete %r14b
addq %rsi, %r14
movq %rsp, %r12
movq %r12, %rdi
movl %eax, %esi
movq %r14, %rdx
callq 0x3e71
xorl %r15d, %r15d
movq %r12, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2400
testl %eax, %eax
js 0x3e0e
movl %eax, %ebp
movl $0x400, %edx            # imm = 0x400
movl %eax, %edi
movq %rbx, %rsi
callq 0x22c0
testl %eax, %eax
js 0x3e0b
cmpl $0x3ff, %eax            # imm = 0x3FF
jae 0x3e60
testl %eax, %eax
je 0x3e1d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addq %rax, %rcx
movl %ecx, %edx
cmpb $0xa, (%rbx,%rdx)
cmovneq %rax, %rcx
movl %ecx, %eax
jmp 0x3e1f
xorl %r15d, %r15d
cmpb $0x3f, %r13b
je 0x3e4b
leaq 0x16d9(%rip), %rdi      # 0x54f4
jmp 0x3e67
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
cmpl $0x2, 0x54e2(%rip)      # 0x930c
jl 0x3e40
leaq 0x16ea(%rip), %rdi      # 0x551d
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3eaa
movl %ebp, %edi
callq 0x2280
pushq $0x1
popq %r15
movl %r15d, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16a0(%rip), %rdi      # 0x5507
movq %rsp, %rsi
xorl %eax, %eax
callq 0x3696
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: msg
static void __attribute__((format(printf,1,2)))
msg(char *msg, ...)
{
  va_list args;
  va_start(args, msg);
  if (verbose)
    {
      int len = strlen(msg);
      if (len > 0)
        partial_line = (msg[len-1] != '\n');
      vfprintf(stderr, msg, args);
      fflush(stderr);
    }
  va_end(args);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x3f0b
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
cmpl $0x0, 0x53da(%rip)      # 0x930c
jne 0x3f3f
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x2180
testl %eax, %eax
jle 0x3f5c
decl %eax
xorl %ecx, %ecx
cmpb $0xa, (%rbx,%rax)
setne %cl
movl %ecx, 0x53f0(%rip)      # 0x934c
movq 0x5095(%rip), %r14      # 0x8ff8
movq (%r14), %rdi
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x2440
movq (%r14), %rdi
callq 0x2370
jmp 0x3f34
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: make_dir
static void make_dir(char *path)
{
  char *sep = (path[0] == '/' ? path+1 : path);

  for (;;)
    {
      sep = strchr(sep, '/');
      if (sep)
	*sep = 0;

      if (!dir_exists(path) && mkdir(path, 0777) < 0)
	die("Cannot create directory %s: %m\n", path);

      if (!sep)
	return;
      *sep++ = '/';
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
cmpb $0x2f, (%rbx)
sete %dil
addq %rbx, %rdi
pushq $0x2f
popq %rbp
movl %ebp, %esi
callq 0x21f0
movq %rax, %r14
testq %rax, %rax
je 0x3fd2
movb $0x0, (%r14)
movq %rbx, %rdi
callq 0x4016
testl %eax, %eax
jne 0x3fef
movq %rbx, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x20b0
testl %eax, %eax
js 0x4005
testq %r14, %r14
je 0x4000
movq %r14, %rdi
incq %rdi
movb $0x2f, (%r14)
jmp 0x3fbf
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1630(%rip), %rdi      # 0x563c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3696
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: rmtree_helper
static int rmtree_helper(const char *fpath, const struct stat *sb,
    int typeflag, struct FTW *ftwbuf)
{
  if (S_ISDIR(sb->st_mode))
    {
      if (rmdir(fpath) < 0)
	die("Cannot rmdir %s: %m", fpath);
    }
  else
    {
      if (unlink(fpath) < 0)
	die("Cannot unlink %s: %m", fpath);
    }
  return FTW_CONTINUE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rsi), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x4085
callq 0x2170
testl %eax, %eax
jns 0x408e
leaq 0x166b(%rip), %rdi      # 0x56ee
jmp 0x4099
callq 0x2070
testl %eax, %eax
js 0x4092
xorl %eax, %eax
popq %rbx
retq
leaq 0x1669(%rip), %rdi      # 0x5702
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3696
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x5d0, %rsp            # imm = 0x5D0
movl %edi, %ebp
leaq 0x120(%rsp), %rdi
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x410c
movaps %xmm0, 0x150(%rsp)
movaps %xmm1, 0x160(%rsp)
movaps %xmm2, 0x170(%rsp)
movaps %xmm3, 0x180(%rsp)
movaps %xmm4, 0x190(%rsp)
movaps %xmm5, 0x1a0(%rsp)
movaps %xmm6, 0x1b0(%rsp)
movaps %xmm7, 0x1c0(%rsp)
movb (%rsi), %r12b
xorl %r14d, %r14d
cmpb $0x3f, %r12b
sete %r14b
addq %rsi, %r14
movq %rsp, %rcx
movq %rdi, 0x10(%rcx)
leaq 0x600(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
leaq 0x1d0(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x20f0
cmpl $0x400, %eax            # imm = 0x400
jge 0x41f2
movl %eax, %ebx
cmpl $0x2, 0x51a9(%rip)      # 0x930c
jl 0x417e
leaq 0x1673(%rip), %rdi      # 0x57df
leaq 0x1d0(%rsp), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x3eaa
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x3e71
movq %r15, %rdi
movl $0x201, %esi            # imm = 0x201
xorl %eax, %eax
callq 0x2400
testl %eax, %eax
js 0x41c8
movl %eax, %ebp
movslq %ebx, %rdx
leaq 0x1d0(%rsp), %rsi
movl %eax, %edi
callq 0x2120
testl %eax, %eax
js 0x41dc
cmpl %eax, %ebx
jne 0x4203
movl %ebp, %edi
callq 0x2280
jmp 0x41e2
cmpb $0x3f, %r12b
je 0x41e2
leaq 0x161c(%rip), %rdi      # 0x57f1
leaq 0x20(%rsp), %rsi
jmp 0x41fc
cmpb $0x3f, %r12b
jne 0x421a
addq $0x5d0, %rsp            # imm = 0x5D0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15b9(%rip), %rdi      # 0x57b2
movq %r14, %rsi
xorl %eax, %eax
callq 0x3696
leaq 0x1613(%rip), %rdi      # 0x581d
leaq 0x20(%rsp), %rsi
movl %eax, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3696
leaq 0x15e4(%rip), %rdi      # 0x5805
leaq 0x20(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
xorl %eax, %eax
callq 0x3696
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x14c5
leaq (%r14,%r12), %r15
movl %ebp, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x10a0
cmpq $-0x1, %rax
jne 0x14af
callq 0x1050
cmpl $0x4, (%rax)
je 0x1490
jmp 0x14ba
addq %rax, %r12
subq %rax, %rbx
testq %rax, %rax
jg 0x1487
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
jmp 0x14bc
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Joy-Division[P]tools-zoe/dat-extract.c
// Function: processDirectoryListing
void processDirectoryListing( FILE *f, tocDirectoryEntry entry, char *curpath, unsigned int tgsfix ) {
	tocFileEntry file;
	unsigned int i;
	FILE *o;
	char *filepath = NULL;
	
	filepath = malloc(strlen(curpath)+1+strlen(entry.name)+1+16+1); // max filename length is 16
	sprintf(filepath, "%s/%s", curpath, entry.name);
	
	printf("processDirectoryListing - Current directory: %s at %08lx\n", filepath, ftell(f) );
	createDirectory( filepath );
	for( i = 0; i < entry.subFileCount; i++ ) {
		fseek( f, (entry.subFileOffset*BLOCKSIZE)+(32*i), SEEK_SET );
		fread( &file, sizeof(file), 1, f );
		if(!file.name[0]) {
			printf("skipping invalid toc entry %d of %d\n", i+1, entry.subFileCount);
			continue;
		}
		if( tgsfix ) file.fileOffset -= 0x18;
		sprintf(filepath, "%s/%s/%s", curpath, entry.name, file.name);
		printf("Current file: %s at %08x\n", filepath, file.fileOffset*BLOCKSIZE );
		if( !(o = fopen( filepath, "wb" ))) {
			printf("Couldnt open file %s\n", filepath);
			return;
		}
		fseek( f, file.fileOffset*BLOCKSIZE, SEEK_SET );
		writeFile( f, file.fileSize, o );
		fclose(o);
	}
	free(filepath);
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, 0xc(%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq 0x70(%rsp), %r12
movq %rsi, %rdi
callq 0x1080
movq %rax, %rbx
movq %r12, %rdi
callq 0x1080
leaq (%rbx,%rax), %rdi
addq $0x13, %rdi
callq 0x10b0
movq %rax, %r13
leaq 0xdae(%rip), %rsi       # 0x20b4
movq %rax, %rdi
movq %r14, 0x10(%rsp)
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x10f0
movq %r15, %rdi
callq 0x10a0
leaq 0xd28(%rip), %rdi       # 0x2052
movq %r13, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1090
movq %r13, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x1040
leaq 0x18(%rsp), %rbp
xorl %ebx, %ebx
cmpl 0x10(%r12), %ebx
jae 0x142d
movl 0x14(%r12), %eax
shll $0xb, %eax
movl %ebx, %esi
shll $0x5, %esi
addl %eax, %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0x10c0
movq %rbp, %rdi
pushq $0x20
popq %rsi
pushq $0x1
popq %rdx
movq %r15, %rcx
callq 0x1060
cmpb $0x0, 0x18(%rsp)
je 0x1411
cmpl $0x0, 0xc(%rsp)
je 0x1397
addl $-0x18, 0x28(%rsp)
movq %r13, %rdi
leaq 0xd10(%rip), %rsi       # 0x20b1
movq 0x10(%rsp), %rdx
movq %r12, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x10f0
movl 0x28(%rsp), %edx
shll $0xb, %edx
leaq 0xcf9(%rip), %rdi       # 0x20ba
movq %r13, %rsi
xorl %eax, %eax
callq 0x1090
movq %r13, %rdi
leaq 0xcff(%rip), %rsi       # 0x20d4
callq 0x10d0
testq %rax, %rax
je 0x1437
movq %rax, %r14
movl 0x28(%rsp), %esi
shll $0xb, %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0x10c0
movl 0x2c(%rsp), %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x120c
movq %r14, %rdi
callq 0x1070
incl %ebx
jmp 0x134b
incl %ebx
movl 0x10(%r12), %edx
leaq 0xc6d(%rip), %rdi       # 0x208c
movl %ebx, %esi
xorl %eax, %eax
callq 0x1090
jmp 0x134b
movq %r13, %rdi
callq 0x1030
jmp 0x1448
leaq 0xc99(%rip), %rdi       # 0x20d7
movq %r13, %rsi
xorl %eax, %eax
callq 0x1090
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x2c54(%rip)     # 0x40d0
movaps %xmm0, 0x2c3d(%rip)     # 0x40c0
movaps %xmm0, 0x2c26(%rip)     # 0x40b0
testq %rsi, %rsi
je 0x14ce
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 0xbf8(%rip), %rsi       # 0x20b4
movq %rax, %rdi
movq %r13, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x10f0
jmp 0x14df
pushq $0x5
popq %rdi
callq 0x10b0
movq %rax, %r12
movl $0x454f5a, (%rax)       # imm = 0x454F5A
movq %r14, %rdi
callq 0x10a0
leaq 0xbff(%rip), %rdi       # 0x20ed
xorl %ebp, %ebp
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1090
movq %r12, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x1040
xorl %r13d, %r13d
leaq 0x80(%rsp), %rax
cmpl 0x8(%rax), %r13d
jae 0x15b3
testl %ebx, %ebx
setne %r15b
movl 0xc(%rax), %esi
addl %ebp, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10c0
leaq 0x28(%rsp), %rdi
pushq $0x20
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x1060
movl 0x3c(%rsp), %eax
testl %eax, %eax
setne %cl
andb %r15b, %cl
cmpb $0x1, %cl
jne 0x155f
addl $-0x18, %eax
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x1588
movups 0x28(%rsp), %xmm0
movups 0x38(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x1457
jmp 0x15a8
movups 0x28(%rsp), %xmm0
movups 0x38(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x12bf
incl %r13d
addl $0x20, %ebp
jmp 0x150d
movq %r12, %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_O2/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 %rbx
subq $0x48, %rsp
movq %rsi, %r14
andq $0x0, 0x28(%rsp)
cmpl $0x1, %edi
jg 0x15f1
movq (%r14), %rsi
leaq 0xb34(%rip), %rdi       # 0x2120
jmp 0x167a
movl %edi, %r15d
movq 0x8(%r14), %rdi
leaq 0xb44(%rip), %rsi       # 0x2143
callq 0x10d0
testq %rax, %rax
je 0x166f
movq %rax, %rbx
xorl %ebp, %ebp
cmpl $0x3, %r15d
sete %bpl
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10c0
leaq 0x28(%rsp), %r15
pushq $0x20
popq %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1060
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x1457
leaq 0xae6(%rip), %rdi       # 0x2146
callq 0x1050
movq %rbx, %rdi
callq 0x1070
jmp 0x1685
movq 0x8(%r14), %rsi
leaq 0xa5d(%rip), %rdi       # 0x20d7
xorl %eax, %eax
callq 0x1090
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x639e
pushq $0x1
popq %rsi
movl %ebx, %edi
callq 0x4090
testl %eax, %eax
js 0x63ea
pushq $0x2
popq %rsi
movl %ebx, %edi
callq 0x4090
testl %eax, %eax
js 0x642f
popq %rbx
retq
movq 0xdc4b(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x6c64(%rip), %rsi      # 0xd013
leaq 0x6f61(%rip), %rdx      # 0xd317
xorl %eax, %eax
callq 0x4830
leaq 0x22b14(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x647c
leaq 0x22afc(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x6c5f(%rip), %rsi      # 0xd03d
leaq 0x6f32(%rip), %rcx      # 0xd317
jmp 0x6472
movq 0xdbff(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x6c18(%rip), %rsi      # 0xd013
leaq 0x6f44(%rip), %rdx      # 0xd346
xorl %eax, %eax
callq 0x4830
leaq 0x22ac8(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x647c
leaq 0x22ab4(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x6c17(%rip), %rsi      # 0xd03d
leaq 0x6f19(%rip), %rcx      # 0xd346
jmp 0x6472
movq 0xdbba(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x6bd3(%rip), %rsi      # 0xd013
leaq 0x6f30(%rip), %rdx      # 0xd377
xorl %eax, %eax
callq 0x4830
leaq 0x22a83(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x647c
leaq 0x22a6f(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x6bd2(%rip), %rsi      # 0xd03d
leaq 0x6f05(%rip), %rcx      # 0xd377
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x4120
pushq $0x1
popq %rdi
callq 0x41e0
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0x68, %rsp
movl %edx, %ebx
movl %edi, %ebp
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r14
movups %xmm0, 0x28(%r14)
movups %xmm0, 0x18(%r14)
movups %xmm0, 0x8(%r14)
movq %rsp, %r15
movq %rsi, (%r15)
movq %rsi, %rdi
callq 0x4360
incq %rax
movq %rax, 0x8(%r15)
andq $0x0, (%r14)
andl $0x0, 0x8(%r14)
movq %r15, 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 %ebx, 0x10(%rax)
movl %ebp, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4480
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x1db7a(%rip)     # 0x24e84
jne 0x7371
movq 0x1db75(%rip), %rsi     # 0x24e88
leaq 0x6aa6(%rip), %rdi      # 0xddc0
xorl %eax, %eax
callq 0x4380
movq %rax, %rbx
movl 0xd176(%rip), %edi      # 0x144a0
callq 0x4100
andq $0x0, 0x1db59(%rip)     # 0x24e90
movq %rbx, %rdi
movl $0x80241, %esi          # imm = 0x80241
movl $0x1a0, %edx            # imm = 0x1A0
xorl %eax, %eax
callq 0x48d0
movl %eax, 0xd14f(%rip)      # 0x144a0
testl %eax, %eax
js 0x7373
movq 0x1db2c(%rip), %rsi     # 0x24e88
movq %rbx, %rdi
callq 0x48e0
testl %eax, %eax
js 0x73b8
movq %rbx, %rdi
popq %rbx
jmp 0x48f8
popq %rbx
retq
movq 0xcc76(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
movq 0x1db04(%rip), %rdx     # 0x24e88
leaq 0x6a3c(%rip), %rsi      # 0xddc7
xorl %eax, %eax
callq 0x4830
leaq 0x21b3f(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x7405
leaq 0x21b2b(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
movq 0x1dad9(%rip), %rcx     # 0x24e88
leaq 0x6a3c(%rip), %rsi      # 0xddf2
jmp 0x73fb
movq 0xcc31(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x5c4a(%rip), %rsi      # 0xd013
leaq 0x6a58(%rip), %rdx      # 0xde28
xorl %eax, %eax
callq 0x4830
leaq 0x21afa(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x7405
leaq 0x21ae6(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x5c49(%rip), %rsi      # 0xd03d
leaq 0x6a2d(%rip), %rcx      # 0xde28
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x4120
pushq $0x1
popq %rdi
callq 0x41e0
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rax
movl 0xd08c(%rip), %edi      # 0x144a0
testl %edi, %edi
jle 0x742d
callq 0x4460
testl %eax, %eax
jns 0x742d
leaq 0xd07c(%rip), %rax      # 0x144a4
cmpl $0x0, (%rax)
jne 0x742f
popq %rax
retq
movq 0xcbba(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x668a(%rip), %rsi      # 0xdaca
xorl %eax, %eax
callq 0x4830
leaq 0x21a8a(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x742d
leaq 0x21a76(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x669b(%rip), %rsi      # 0xdaff
pushq $0x6
popq %rdi
xorl %eax, %eax
popq %rcx
jmp 0x4120
// File: /workspace/github_c_makefile_star2_O2/containers[P]conmon/src/ctr_logging.c
// Function: get_line_len
static bool get_line_len(ptrdiff_t *line_len, const char *buf, ssize_t buflen)
{
	bool partial = FALSE;
	const char *line_end = memchr(buf, '\n', buflen);
	if (line_end == NULL) {
		line_end = &buf[buflen - 1];
		partial = TRUE;
	}
	*line_len = line_end - buf + 1;
	return partial;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0xa
popq %rsi
movq %r14, %rdi
callq 0x4150
testq %rax, %rax
sete %cl
leaq -0x1(%r14,%rbx), %rdx
cmovneq %rax, %rdx
subq %r14, %rdx
incq %rdx
movq %rdx, (%r15)
movl %ecx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movl %edi, %ebp
leaq 0x8(%rsi), %r13
xorl %r14d, %r14d
xorl %ebx, %ebx
movq %rsi, (%rsp)
movslq (%rsi), %rax
cmpq %rax, %r14
jge 0x7529
movq %r14, %rax
shlq $0x4, %rax
movq (%r13,%rax), %r15
movq 0x8(%r13,%rax), %r12
testq %r12, %r12
je 0x750b
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4840
testq %rax, %rax
jns 0x74fe
callq 0x45c0
cmpl $0x4, (%rax)
je 0x74db
jmp 0x7514
je 0x7514
addq %rax, %r15
subq %rax, %r12
addq %rax, %rbx
jmp 0x74db
incq %r14
movq (%rsp), %rsi
jmp 0x74c2
pushq $-0x1
popq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andl $0x0, (%rsi)
jmp 0x7517
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rbx
testq %rdx, %rdx
je 0x757d
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
cmpl $0x80, (%rsi)
jne 0x755c
movq %r15, %rsi
callq 0x74a8
testq %rax, %rax
js 0x757a
testq %r14, %r14
jle 0x757d
movslq (%r15), %rax
leal 0x1(%rax), %ecx
shlq $0x4, %rax
movq %r12, 0x8(%r15,%rax)
movq %r14, 0x10(%r15,%rax)
movl %ecx, (%r15)
jmp 0x757d
pushq $-0x1
popq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x75ad
leaq 0x68b4(%rip), %rdi      # 0xde54
movq %rcx, %rdx
xorl %eax, %eax
callq 0x4380
movq %rax, %rsi
movq %rsi, 0x2191c(%rip)     # 0x28ed0
movl %ebp, 0x2191e(%rip)     # 0x28ed8
testq %rbx, %rbx
je 0x7679
leaq 0x6891(%rip), %rsi      # 0xde5b
movq %rbx, %rdi
callq 0x4200
xorl %ebp, %ebp
testl %eax, %eax
je 0x7673
leaq 0x687e(%rip), %rsi      # 0xde61
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x7673
leaq 0x686d(%rip), %rsi      # 0xde67
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x7673
leaq 0x6860(%rip), %rsi      # 0xde6d
movq %rbx, %rdi
callq 0x4200
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x7673
leaq 0x684f(%rip), %rsi      # 0xde72
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x7673
leaq 0x691a(%rip), %rsi      # 0xdf50
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x766c
leaq 0x6831(%rip), %rsi      # 0xde7a
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x7670
leaq 0x6824(%rip), %rsi      # 0xde80
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
jne 0x7680
pushq $0x4
jmp 0x7672
pushq $0x2
jmp 0x7672
pushq $0x3
popq %rbp
movl %ebp, 0xce2b(%rip)      # 0x144a4
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpl $0x4, 0xce1d(%rip)      # 0x144a4
jb 0x76c8
movq 0xc960(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x67ec(%rip), %rsi      # 0xde86
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4830
cmpl $0x0, 0x2182d(%rip)     # 0x28ed8
je 0x76c8
movq 0x2181c(%rip), %rdx     # 0x28ed0
leaq 0x67ec(%rip), %rsi      # 0xdea7
pushq $0x6
popq %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4120
movq 0xc921(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x67fb(%rip), %rsi      # 0xded4
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4830
cmpl $0x0, 0x217ee(%rip)     # 0x28ed8
je 0x7707
movq 0x217dd(%rip), %rdx     # 0x28ed0
leaq 0x67fc(%rip), %rsi      # 0xdef6
pushq $0x3
popq %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4120
pushq $0x1
popq %rdi
callq 0x41e0
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
pushq $-0x1
popq %rbx
movq %rdx, %r12
testq %r12, %r12
je 0x7762
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4840
cmpq $-0x1, %rax
jne 0x7755
callq 0x45c0
movl (%rax), %eax
cmpl $0x4, %eax
je 0x772a
cmpl $0xb, %eax
je 0x772a
cmpl $0x69, %eax
je 0x772a
jmp 0x7765
testq %rax, %rax
jle 0x7765
subq %rax, %r12
addq %rax, %r15
jmp 0x7725
movq %r14, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x708d(%rip), %rdi      # 0xe8f5
callq 0x4720
movq %rax, %rbx
leaq 0xcc59(%rip), %rsi      # 0x144d0
leaq 0x7088(%rip), %rdx      # 0xe906
movq %rax, %rdi
callq 0x42e0
leaq 0x8(%rsp), %rcx
andq $0x0, (%rcx)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4470
testl %eax, %eax
je 0x78c9
movq %rbx, %rdi
callq 0x41a0
cmpl $0x0, 0x21630(%rip)     # 0x28ee0
jne 0x78e2
cmpq $0x0, 0x21646(%rip)     # 0x28f00
je 0x78f7
pushq $-0x1
popq %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x7034(%rip), %rdi      # 0xe90d
xorl %eax, %eax
callq 0x4240
jmp 0x7913
leaq 0x7047(%rip), %rdi      # 0xe930
xorl %eax, %eax
callq 0x4190
xorl %edi, %edi
callq 0x41e0
movq 0xc6f2(%rip), %rax      # 0x13ff0
movq (%rax), %rcx
leaq 0x7070(%rip), %rdi      # 0xe978
pushq $0x2d
popq %rsi
pushq $0x1
popq %rdx
callq 0x4800
pushq $0x1
popq %rdi
callq 0x41e0
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0x118, %rsp            # imm = 0x118
movl %esi, %ebx
movl %edi, %ebp
movq %rsp, %rsi
movl $0x110, %edx            # imm = 0x110
callq 0x4230
testq %rax, %rax
js 0x8804
testb $0x1, %bl
je 0x87ef
callq 0x8253
movl %eax, %ebx
testl %eax, %eax
jne 0x8813
movl %ebp, %edi
callq 0x4100
leaq 0xc567(%rip), %rax      # 0x14d64
orl $-0x1, (%rax)
xorl %ebx, %ebx
jmp 0x8813
leaq 0xbc99(%rip), %rax      # 0x144a4
pushq $0x1
popq %rbx
cmpl $0x0, (%rax)
jne 0x881f
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %rbp
retq
movq 0xb7ca(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x4967(%rip), %rsi      # 0xd197
leaq 0x6675(%rip), %rdx      # 0xeeac
xorl %eax, %eax
callq 0x4830
leaq 0x20693(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x8813
leaq 0x2067f(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x4977(%rip), %rsi      # 0xd1d2
leaq 0x664a(%rip), %rcx      # 0xeeac
pushq $0x6
popq %rdi
xorl %eax, %eax
callq 0x4120
jmp 0x8813
// File: /workspace/github_c_makefile_star2_O2/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 0xb988(%rip), %rax      # 0x144a4
cmpl $0x2, (%rax)
jae 0x8b45
leaq 0x20400(%rip), %rax     # 0x28f28
movq (%rax), %rdi
callq 0x8b94
movl %eax, %ebx
leaq 0x203e7(%rip), %rax     # 0x28f20
movq (%rax), %rdi
callq 0x8b94
orl %ebx, %eax
popq %rbx
retq
movq 0xb4a4(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x6670(%rip), %rsi      # 0xf1c6
leaq 0x66a6(%rip), %rdx      # 0xf203
xorl %eax, %eax
callq 0x4830
leaq 0x2036d(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x8b21
leaq 0x20359(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x6668(%rip), %rsi      # 0xf1e9
leaq 0x667b(%rip), %rcx      # 0xf203
pushq $0x6
popq %rdi
xorl %eax, %eax
callq 0x4120
jmp 0x8b21
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x8c01
movq %rdi, %r14
cmpb $0x0, (%rdi)
je 0x8c01
leaq 0x665d(%rip), %rsi      # 0xf210
xorl %ebx, %ebx
movq %r14, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4690
movq %rax, %r15
movq %rax, %rdi
movl $0x80040, %esi          # imm = 0x80040
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x48d0
movl %eax, 0xc(%rsp)
testl %eax, %eax
jns 0x8bef
leaq 0xb8bd(%rip), %rax      # 0x144a4
pushq $-0x1
popq %rbx
cmpl $0x0, (%rax)
jne 0x8c0d
leaq 0xc(%rsp), %rdi
callq 0x87ac
movq %r15, %rdi
callq 0x48f8
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0xb3dc(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x65f6(%rip), %rsi      # 0xf214
movq %r14, %rdx
xorl %eax, %eax
callq 0x4830
leaq 0x202a9(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x8bef
leaq 0x20295(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x6604(%rip), %rsi      # 0xf249
pushq $0x6
popq %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x4120
jmp 0x8bef
// File: /workspace/github_c_makefile_star2_O2/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 0x1ffb3(%rip), %rax     # 0x28fd0
movl (%rax), %r8d
leaq 0x5053(%rip), %rdi      # 0xe07a
leaq 0xbd82(%rip), %rcx      # 0x14db0
movl $0x80805, %esi          # imm = 0x80805
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x90cf
movq %rax, %rbx
movl 0xbd6e(%rip), %edi      # 0x14db4
pushq $0xa
popq %rsi
callq 0x43c0
cmpl $-0x1, %eax
je 0x9074
movl 0xbd5b(%rip), %edi      # 0x14db4
leaq 0xbd50(%rip), %rcx      # 0x14db0
leaq 0x35c(%rip), %rdx       # 0x93c3
pushq $0x1
popq %rsi
callq 0x4430
movq %rbx, %rax
popq %rbx
retq
movq 0xaf75(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x6204(%rip), %rsi      # 0xf289
leaq 0x4fee(%rip), %rcx      # 0xe07a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4830
leaq 0x1fe3b(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x90c7
leaq 0x1fe27(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x620f(%rip), %rsi      # 0xf2c2
leaq 0x4fc0(%rip), %r8       # 0xe07a
pushq $0x3
popq %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4120
pushq $0x1
popq %rdi
callq 0x41e0
// File: /workspace/github_c_makefile_star2_O2/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, 0x1b88a(%rip)     # 0x24e48
jns 0x95ff
movq %rdi, %rbx
pushq $0x1
popq %rdi
movl $0x80802, %esi          # imm = 0x80802
xorl %edx, %edx
callq 0x4580
movl %eax, 0x1b870(%rip)     # 0x24e48
cmpl $-0x1, %eax
je 0x964d
movw $0x1, 0x1fa1a(%rip)     # 0x29000
leaq 0x1fa15(%rip), %rdi     # 0x29002
pushq $0x6b
popq %rdx
movq %rbx, %rsi
callq 0x46f0
movb $0x0, 0x1fa6e(%rip)     # 0x2906d
leaq 0x5d1f(%rip), %rdi      # 0xf325
leaq 0x13803(%rip), %rbx     # 0x1ce10
pushq $0x1
popq %r8
movl $0x80802, %esi          # imm = 0x80802
movl $0x1ff, %edx            # imm = 0x1FF
movq %rbx, %rcx
callq 0x90cf
movq %rax, %r14
movl 0x137e8(%rip), %edi     # 0x1ce14
leaq 0x6f(%rip), %rdx        # 0x96a2
pushq $0x19
popq %rsi
movq %rbx, %rcx
callq 0x4430
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x48f0
movq 0xa99c(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x39b5(%rip), %rsi      # 0xd013
leaq 0x5ca1(%rip), %rdx      # 0xf306
xorl %eax, %eax
callq 0x4830
leaq 0x1f865(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x969a
leaq 0x1f851(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
leaq 0x39b4(%rip), %rsi      # 0xd03d
leaq 0x5c76(%rip), %rcx      # 0xf306
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x4120
pushq $0x1
popq %rdi
callq 0x41e0
// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %rdx, %rbx
testb $0x1, %sil
jne 0x96c3
movq %rbx, %rdi
callq 0x9bab
jmp 0x96d1
cmpq $0x0, 0x20(%rbx)
je 0x96e4
movl $0x1, 0x14(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %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 0x96ff
movl $0x8000, %edx           # imm = 0x8000
movq %r14, %rsi
callq 0x4230
jmp 0x9714
movl $0x8000, %edx           # imm = 0x8000
movq %r14, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x46d0
pushq $0x1
popq %rbp
testq %rax, %rax
js 0x96d3
je 0x96b9
movq %rax, 0x20(%rbx)
andq $0x0, 0x28(%rbx)
cmpl $0x2, (%rbx)
jne 0x9823
movb $0x0, 0x30(%rbx,%rax)
leaq 0x6254(%rip), %rsi      # 0xf990
pushq $-0x1
popq %rdx
movq %r14, 0x10(%rsp)
movq %r14, %rdi
callq 0x4110
andq $0x0, 0x20(%rbx)
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
leaq 0x6358(%rip), %r15      # 0xfab8
leaq 0x633d(%rip), %rbp      # 0xfaa4
movq 0x8(%rsp), %rax
movq (%rax,%r14,8), %r12
testq %r12, %r12
je 0x980b
xorl %r13d, %r13d
cmpq $0x14, %r13
je 0x979c
movslq (%r13,%rbp), %rsi
addq %rbp, %rsi
movq %r12, %rdi
callq 0x4620
addq $0x4, %r13
testl %eax, %eax
jne 0x977c
jmp 0x97bd
xorl %r13d, %r13d
cmpq $0x10, %r13
je 0x9803
movslq (%r13,%r15), %rsi
addq %r15, %rsi
movq %r12, %rdi
callq 0x45b0
addq $0x4, %r13
testl %eax, %eax
je 0x979f
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x97d9
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb $0xa, 0x30(%rbx,%rax)
movq 0x20(%rbx), %r13
jmp 0x97dc
xorl %r13d, %r13d
addq 0x10(%rsp), %r13
movq %r12, %rdi
callq 0x4360
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x48b0
movq %r12, %rdi
callq 0x4360
addq %rax, 0x20(%rbx)
incq %r14
jmp 0x9767
movq 0x8(%rsp), %rdi
callq 0x47a0
cmpq $0x0, 0x20(%rbx)
pushq $0x1
popq %rbp
je 0x96d3
movq %rbx, %rdi
callq 0x9c53
cmpq $0x0, 0x20(%rbx)
je 0x96d3
movq 0x8(%rbx), %rdi
callq 0x984d
jmp 0x96d3
// File: /workspace/github_c_makefile_star2_O2/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 0xb528(%rip), %rax      # 0x14d98
testq %rax, %rax
je 0x993e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rax), %r15d
movslq %esi, %r14
leaq 0xac0f(%rip), %r12      # 0x144a4
pushq $0x1
popq %rbp
testl %r15d, %r15d
jle 0x9930
movq 0xb4f0(%rip), %rax      # 0x14d98
movq (%rax), %rax
movq -0x8(%rax,%r15,8), %r13
cmpl $0x0, 0x1c(%r13)
je 0x98dc
movl 0x4(%r13), %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x770f
testq %rax, %rax
jns 0x98dc
cmpl $0x0, (%r12)
jne 0x98e1
movq %r13, %rdi
movl %ebp, %esi
callq 0x993f
decq %r15
jmp 0x9898
movq 0xa708(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
leaq 0x38a5(%rip), %rsi      # 0xd197
leaq 0x5a3f(%rip), %rdx      # 0xf338
xorl %eax, %eax
callq 0x4830
leaq 0x1f5d1(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x98d2
leaq 0x1f5bd(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
pushq $0x6
popq %rdi
leaq 0x38b2(%rip), %rsi      # 0xd1d2
leaq 0x5a11(%rip), %rcx      # 0xf338
xorl %eax, %eax
callq 0x4120
jmp 0x98d2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x999f
movl %esi, %ebp
callq 0x40e0
testl %ebp, %ebp
je 0x9995
andl $0x0, 0x1c(%rbx)
cmpl $0x0, 0x18(%rbx)
jne 0x999f
leaq 0xab3b(%rip), %rax      # 0x144a4
cmpl $0x3, (%rax)
jae 0x99a6
movl 0x4(%rbx), %edi
callq 0x4100
orl $-0x1, 0x4(%rbx)
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0x999f
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4600
andl $0x0, 0x18(%rbx)
cmpl $0x0, 0x1c(%rbx)
je 0x995c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0xa643(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
movl 0x4(%rbx), %edx
leaq 0x60ad(%rip), %rsi      # 0xfa67
xorl %eax, %eax
callq 0x4830
leaq 0x1f510(%rip), %rax     # 0x28ed8
cmpl $0x0, (%rax)
je 0x996e
leaq 0x1f4fc(%rip), %rax     # 0x28ed0
movq (%rax), %rdx
movl 0x4(%rbx), %ecx
leaq 0x609e(%rip), %rsi      # 0xfa7f
pushq $0x6
popq %rdi
xorl %eax, %eax
callq 0x4120
jmp 0x996e
// File: /workspace/github_c_makefile_star2_O2/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 0xb3a4(%rip), %rdi      # 0x14d98
testq %rdi, %rdi
je 0x9a22
pushq %rax
leaq 0x22(%rip), %rsi        # 0x9a23
xorl %edx, %edx
callq 0x42b0
movl 0xb3a6(%rip), %edi      # 0x14db4
testl %edi, %edi
js 0x9a17
callq 0x4100
orl $-0x1, 0xb396(%rip)     # 0x14db4
addq $0x8, %rsp
retq