LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctrl.c
// Function: process_winsz_ctrl_line
static gboolean process_winsz_ctrl_line(char *line)
{
	int height, width, ret = -1;
	ret = sscanf(line, "%d %d\n", &height, &width);
	ndebugf("Height: %d, Width: %d", height, width);
	if (ret != 2) {
		nwarn("Failed to sscanf message");
		return FALSE;
	}
	resize_winsz(height, width);
	return TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x460a(%rip), %rsi      # 0x100e3
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x41d0
movl %eax, %ebx
leaq 0x99a1(%rip), %r14      # 0x15494
cmpl $0x3, (%r14)
jae 0xbb4b
cmpl $0x2, %ebx
jne 0xbb3b
movzwl 0xc(%rsp), %eax
movzwl 0x8(%rsp), %ecx
leaq 0x10(%rsp), %rdx
movw %ax, (%rdx)
movw %cx, 0x2(%rdx)
leaq 0xa221(%rip), %rax      # 0x15d3c
movl (%rax), %edi
movl $0x5414, %esi           # imm = 0x5414
xorl %eax, %eax
callq 0x4140
cmpl $-0x1, %eax
jne 0xbb34
cmpl $0x0, (%r14)
jne 0xbb5c
movl $0x1, %eax
jmp 0xbb43
xorl %eax, %eax
cmpl $0x0, (%r14)
jne 0xbb63
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0xc(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x7591
jmp 0xbaf9
callq 0x7643
jmp 0xbb34
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x75ed
movl (%rbx), %eax
jmp 0xbb43
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctrl.c
// Function: process_terminal_ctrl_line
static gboolean process_terminal_ctrl_line(char *line)
{
	/* while the height and width won't be used in this function,
	 * we want to remove them from the buffer anyway
	 */
	int ctl_msg_type, height, width, ret = -1;
	ret = sscanf(line, "%d %d %d\n", &ctl_msg_type, &height, &width);
	if (ret != 3) {
		nwarn("Failed to sscanf message");
		return FALSE;
	}

	ndebugf("Message type: %d", ctl_msg_type);
	switch (ctl_msg_type) {
	case WIN_RESIZE_EVENT: {
		_cleanup_free_ char *hw_str = g_strdup_printf("%d %d\n", height, width);
		if (write(winsz_fd_w, hw_str, strlen(hw_str)) < 0) {
			nwarn("Failed to write to window resizing fd. A resize event may have been dropped");
			return FALSE;
		}
		break;
	}
	case REOPEN_LOGS_EVENT:
		reopen_log_files();
		break;
	default:
		nwarnf("Unknown message type: %d", ctl_msg_type);
		break;
	}
	return TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x4549(%rip), %rsi      # 0x100e0
xorl %ebx, %ebx
movq %rsp, %rdx
leaq 0x8(%rsp), %rcx
leaq 0x4(%rsp), %r8
xorl %eax, %eax
callq 0x41d0
leaq 0x98e0(%rip), %r14      # 0x15494
movl (%r14), %ecx
cmpl $0x3, %eax
jne 0xbc18
cmpl $0x3, %ecx
jae 0xbca5
movl (%rsp), %edx
cmpl $0x2, %edx
je 0xbc2d
cmpl $0x1, %edx
jne 0xbc39
movl 0x8(%rsp), %esi
movl 0x4(%rsp), %edx
leaq 0x4502(%rip), %rdi      # 0x100e3
xorl %eax, %eax
callq 0x4380
movq %rax, %rbx
leaq 0xa166(%rip), %rax      # 0x15d58
movl (%rax), %ebp
movq %rbx, %rdi
callq 0x4360
movl %ebp, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4830
testq %rax, %rax
js 0xbc8a
movq %rbx, %rdi
callq 0x48e8
jmp 0xbc32
testl %ecx, %ecx
je 0xbc9a
leaq 0xc(%rsp), %rbx
movq %rbx, %rdi
callq 0x7685
movl (%rbx), %ebx
jmp 0xbc9a
callq 0x9a42
movl $0x1, %ebx
jmp 0xbc9a
movl $0x1, %ebx
cmpl $0x0, (%r14)
je 0xbc9a
movq 0x93a5(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0x4529(%rip), %rsi      # 0x1017e
xorl %eax, %eax
callq 0x4820
leaq 0x1e265(%rip), %rax     # 0x29ec8
cmpl $0x0, (%rax)
je 0xbc9a
leaq 0x1e251(%rip), %rax     # 0x29ec0
movq (%rax), %rdx
movl (%rsp), %ecx
leaq 0x4528(%rip), %rsi      # 0x101a4
movl $0x6, %edi
xorl %eax, %eax
callq 0x4120
jmp 0xbc9a
cmpl $0x0, (%r14)
jne 0xbcb2
movq %rbx, %rdi
callq 0x48e8
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rsp, %rdi
callq 0x76db
jmp 0xbbc5
callq 0x7724
jmp 0xbc90
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctrl.c
// Function: setup_fifo
static void setup_fifo(int *fifo_r, int *fifo_w, char *filename, char *error_var_name)
{
	_cleanup_free_ char *fifo_path = g_build_filename(opt_bundle_path, filename, NULL);

	if (!fifo_r || !fifo_w)
		pexitf("setup fifo was passed a NULL pointer");

	if (mkfifo(fifo_path, 0660) == -1) {
		if (errno == EEXIST) {
			unlink(fifo_path);
			if (mkfifo(fifo_path, 0660) == -1)
				pexitf("Failed to mkfifo at %s", fifo_path);
		}
	}

	if ((*fifo_r = open(fifo_path, O_RDONLY | O_NONBLOCK | O_CLOEXEC)) == -1)
		pexitf("Failed to open %s read half", error_var_name);

	if ((*fifo_w = open(fifo_path, O_WRONLY | O_CLOEXEC)) == -1)
		pexitf("Failed to open %s write half", error_var_name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0x1e208(%rip), %rax     # 0x29f10
movq (%rax), %rdi
movq %rdx, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4680
testq %r12, %r12
je 0xbda0
testq %r14, %r14
je 0xbda0
movq %rax, %r15
movq %rax, %rdi
movl $0x1b0, %esi            # imm = 0x1B0
callq 0x4730
cmpl $-0x1, %eax
jne 0xbd5e
callq 0x45b0
cmpl $0x11, (%rax)
jne 0xbd5e
movq %r15, %rdi
callq 0x4290
movq %r15, %rdi
movl $0x1b0, %esi            # imm = 0x1B0
callq 0x4730
cmpl $-0x1, %eax
je 0xbdb5
movq %r15, %rdi
movl $0x80800, %esi          # imm = 0x80800
xorl %eax, %eax
callq 0x48c0
movl %eax, (%r12)
cmpl $-0x1, %eax
je 0xbda5
movq %r15, %rdi
movl $0x80001, %esi          # imm = 0x80001
xorl %eax, %eax
callq 0x48c0
movl %eax, (%r14)
cmpl $-0x1, %eax
je 0xbdad
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x48e8
callq 0x77de
movq %rbx, %rdi
callq 0x7877
movq %rbx, %rdi
callq 0x7826
movq %r15, %rdi
callq 0x78c8
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctrl.c
// Function: setup_terminal_control_fifo
int setup_terminal_control_fifo()
{
	/*
	 * Open a dummy writer to prevent getting flood of POLLHUPs when
	 * last writer closes.
	 */
	int dummyfd = -1;
	setup_fifo(&terminal_ctrl_fd, &dummyfd, "ctl", "terminal control fifo");
	ndebugf("terminal_ctrl_fd: %d", terminal_ctrl_fd);
	g_unix_fd_add(terminal_ctrl_fd, G_IO_IN, ctrl_cb, NULL);

	return dummyfd;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rsi
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
leaq 0x9f7c(%rip), %rbx      # 0x15d50
leaq 0x41b3(%rip), %rdx      # 0xff8e
leaq 0x41b0(%rip), %rcx      # 0xff92
movq %rbx, %rdi
callq 0xbcf0
leaq 0x96a3(%rip), %rax      # 0x15494
cmpl $0x3, (%rax)
jae 0xbe15
movl (%rbx), %edi
leaq -0x28b(%rip), %rdx      # 0xbb74
movl $0x1, %esi
xorl %ecx, %ecx
callq 0x4430
movl 0xc(%rsp), %eax
addq $0x10, %rsp
popq %rbx
retq
callq 0x7919
jmp 0xbdf6
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_stdio.c
// Function: read_stdio
static bool read_stdio(int fd, stdpipe_t pipe, gboolean *eof)
{
	/* We use two extra bytes. One at the start, which we don't read into, instead
	   we use that for marking the pipe when we write to the attached socket.
	   One at the end to guarantee a null-terminated buffer for journald logging*/

	char real_buf[STDIO_BUF_SIZE + 2];
	char *buf = real_buf + 1;
	ssize_t num_read = 0;

	if (eof)
		*eof = false;

	num_read = read(fd, buf, STDIO_BUF_SIZE);
	if (num_read == 0) {
		if (eof)
			*eof = true;
		return false;
	} else if (num_read < 0) {
		if (errno == EAGAIN || errno == EWOULDBLOCK) {
			// Non-blocking mode - no data available, return gracefully
			return true;
		}
		/* Ignore EIO if fd is a tty, since this can happen when the tty is closed
		   while we are reading from it. */
		if (errno == EIO && isatty(fd)) {
			if (eof)
				*eof = true;
			return false;
		}
		nwarnf("stdio_input read failed: %m");
		return false;
	} else {
		// Always null terminate the buffer, just in case.
		buf[num_read] = '\0';

		bool written = write_to_logs(pipe, buf, num_read);
		if (!written)
			return false;

		real_buf[0] = pipe;
		write_back_to_remote_consoles(real_buf, num_read + 1);
		return true;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2020, %rsp           # imm = 0x2020
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
leaq 0x11(%rsp), %r12
testq %rdx, %rdx
je 0xbf6d
movl $0x0, (%rbx)
movl $0x2000, %edx           # imm = 0x2000
movl %r14d, %edi
movq %r12, %rsi
callq 0x4230
testq %rax, %rax
je 0xbfd1
js 0xbfb4
movq %rax, %r15
movb $0x0, 0x11(%rsp,%rax)
movl %ebp, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x93fb
movl %eax, %ebx
testb %al, %al
je 0xbfec
leaq 0x10(%rsp), %rdi
movb %bpl, (%rdi)
incl %r15d
movl %r15d, %esi
callq 0xb2b0
jmp 0xbfec
callq 0x45b0
movl (%rax), %eax
cmpl $0xb, %eax
je 0xc001
cmpl $0x5, %eax
jne 0xbfde
movl %r14d, %edi
callq 0x41b0
testl %eax, %eax
je 0xbfde
testq %rbx, %rbx
je 0xbfea
movl $0x1, (%rbx)
jmp 0xbfea
leaq 0x94af(%rip), %rax      # 0x15494
cmpl $0x0, (%rax)
jne 0xc005
xorl %ebx, %ebx
andb $0x1, %bl
movl %ebx, %eax
addq $0x2020, %rsp           # imm = 0x2020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bl
jmp 0xbfec
leaq 0xf(%rsp), %rbx
movq %rbx, %rdi
callq 0x7966
movb (%rbx), %bl
jmp 0xbfec
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_stdio.c
// Function: drain_stdio
void drain_stdio()
{
	if (mainfd_stdout != -1) {
		g_unix_set_fd_nonblocking(mainfd_stdout, TRUE, NULL);
		while (read_stdio(mainfd_stdout, STDOUT_PIPE, NULL))
			;
	}
	drain_log_buffers(STDOUT_PIPE);
	if (mainfd_stderr != -1) {
		g_unix_set_fd_nonblocking(mainfd_stderr, TRUE, NULL);
		while (read_stdio(mainfd_stderr, STDERR_PIPE, NULL))
			;
	}
	drain_log_buffers(STDERR_PIPE);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x9cef(%rip), %rbx      # 0x15d3c
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0xc072
movl $0x1, %esi
xorl %edx, %edx
callq 0x4280
movl (%rbx), %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0xbf46
testb %al, %al
jne 0xc060
leaq 0xe(%rsp), %rsi
movl $0x2, %edi
xorl %edx, %edx
callq 0x93fb
leaq 0x9cb6(%rip), %rbx      # 0x15d40
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0xc0af
movl $0x1, %esi
xorl %edx, %edx
callq 0x4280
movl (%rbx), %edi
movl $0x3, %esi
xorl %edx, %edx
callq 0xbf46
testb %al, %al
jne 0xc09d
leaq 0xf(%rsp), %rsi
movl $0x3, %edi
xorl %edx, %edx
callq 0x93fb
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/parent_pipe_fd.c
// Function: get_pipe_fd_from_env
int get_pipe_fd_from_env(const char *envname)
{
	char *endptr = NULL;

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

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

	return pipe_fd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq $0x0, 0x8(%rsp)
callq 0x4590
testq %rax, %rax
je 0xc13e
movq %rax, %r14
callq 0x45b0
movq %rax, %r15
movl $0x0, (%rax)
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movl $0xa, %edx
callq 0x44c0
cmpl $0x0, (%r15)
jne 0xc151
movq %rax, %r14
movq 0x8(%rsp), %rax
cmpb $0x0, (%rax)
jne 0xc151
movl %r14d, %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x48b0
cmpl $-0x1, %eax
jne 0xc144
movq %rbx, %rdi
callq 0x79ff
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x79ae
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_exit.c
// Function: on_sig_exit
void on_sig_exit(int signal)
{
	if (container_pid > 0) {
		if (kill(container_pid, signal) == 0)
			return;
	} else if (create_pid > 0) {
		if (kill(create_pid, signal) == 0)
			return;
		if (errno == ESRCH) {
			/* The create_pid process might have exited, so try container_pid again.  */
			if (container_pid > 0 && kill(container_pid, signal) == 0)
				return;
		}
	}
	/* Just force a check if we get here.  */
	raise(SIGUSR1);
}

// Assembly:
pushq %rbx
movl %edi, %ebx
cmpl $0x0, 0x19ad2(%rip)     # 0x25e54
jle 0xc397
movl 0x19aca(%rip), %edi     # 0x25e54
movl %ebx, %esi
callq 0x4490
testl %eax, %eax
jne 0xc3c4
jmp 0xc3cf
cmpl $0x0, 0x19aba(%rip)     # 0x25e58
jle 0xc3c4
movl 0x19ab2(%rip), %edi     # 0x25e58
movl %ebx, %esi
callq 0x4490
testl %eax, %eax
je 0xc3cf
callq 0x45b0
cmpl $0x3, (%rax)
jne 0xc3c4
cmpl $0x0, 0x19a92(%rip)     # 0x25e54
jg 0xc384
movl $0xa, %edi
popq %rbx
jmp 0x4530
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_exit.c
// Function: timeout_cb
gboolean timeout_cb(G_GNUC_UNUSED gpointer user_data)
{
	timed_out = TRUE;
	ninfo("Timed out, killing main loop");
	g_main_loop_quit(main_loop);
	return G_SOURCE_REMOVE;
}

// Assembly:
pushq %rax
leaq 0x1da7c(%rip), %rax     # 0x29fd8
movl $0x1, (%rax)
leaq 0x8f2b(%rip), %rax      # 0x15494
cmpl $0x2, (%rax)
jae 0xc581
leaq 0x1da6b(%rip), %rax     # 0x29fe0
movq (%rax), %rdi
callq 0x4160
xorl %eax, %eax
popq %rcx
retq
callq 0x7bee
jmp 0xc56e
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_exit.c
// Function: container_exit_cb
void container_exit_cb(G_GNUC_UNUSED GPid pid, int status, G_GNUC_UNUSED gpointer user_data)
{
	if (get_exit_status(status) != 0) {
		ninfof("container %d exited with status %d", pid, get_exit_status(status));
	}
	container_status = status;
	container_pid = -1;
	/* In the case of a quickly exiting exec command, the container exit callback
	   sometimes gets called earlier than the pid exit callback. If we quit the loop at that point
	   we risk falsely telling the caller of conmon the runtime call failed (because runtime status
	   wouldn't be set). Instead, don't quit the loop until runtime exit is also called, which should
	   shortly after. */
	if (opt_api_version >= 1 && create_pid > 0 && opt_exec && opt_terminal) {
		ndebugf("container pid return handled before runtime pid return. Not quitting yet.");
		return;
	}

	g_main_loop_quit(main_loop);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
leaq 0x8eb2(%rip), %r14      # 0x15494
testl $0xff7f, %esi           # imm = 0xFF7F
je 0xc5f0
cmpl $0x2, (%r14)
jae 0xc654
leaq 0x973d(%rip), %rax      # 0x15d34
movl %ebx, (%rax)
movl $0xffffffff, 0x19851(%rip) # imm = 0xFFFFFFFF
leaq 0x1d942(%rip), %rax     # 0x29f4c
cmpl $0x0, (%rax)
jle 0xc63e
cmpl $0x0, 0x19842(%rip)     # 0x25e58
jle 0xc63e
leaq 0x1d929(%rip), %rax     # 0x29f48
cmpl $0x0, (%rax)
je 0xc63e
leaq 0x1d8a9(%rip), %rax     # 0x29ed4
cmpl $0x0, (%rax)
je 0xc63e
cmpl $0x3, (%r14)
jae 0xc66a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1d99b(%rip), %rax     # 0x29fe0
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4160
movl %edi, %ecx
xorl %edi, %edi
movl %ebx, %edx
andl $0x7f, %edx
sete %dil
movl %ebx, %esi
callq 0x7c40
jmp 0xc5f0
callq 0x7cff
jmp 0xc636
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/ctr_exit.c
// Function: cleanup_socket_dir_symlink
void cleanup_socket_dir_symlink()
{
	/* A symbolic link might be created at {opt_socket_path}/{opt_cuuid} if the container
	   is created successfully.
	   This function will take care of removing the link when the conmon process exits. */
	_cleanup_free_ char *base_path = g_build_filename(opt_socket_path, opt_cuuid, NULL);
	if (unlink(base_path) == -1 && errno != ENOENT)
		pexitf("Failed to remove existing symlink for the socket directory %s", base_path);
}

// Assembly:
pushq %rbx
leaq 0x8c79(%rip), %rax      # 0x154b0
movq (%rax), %rdi
leaq 0x1d6b7(%rip), %rax     # 0x29ef8
movq (%rax), %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4680
movq %rax, %rbx
movq %rax, %rdi
callq 0x4290
cmpl $-0x1, %eax
jne 0xc867
callq 0x45b0
cmpl $0x2, (%rax)
jne 0xc870
movq %rbx, %rdi
popq %rbx
jmp 0x48e8
movq %rbx, %rdi
callq 0x7e93
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/runtime_args.c
// Function: add_argv
static void add_argv(GPtrArray *argv_array, ...)
{
	va_list args;
	char *arg;

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

// Assembly:
pushq %rbx
subq $0xd0, %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 0xcb47
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 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0xcb80
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0xcb8e
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
testq %rsi, %rsi
je 0xcba0
movq %rbx, %rdi
callq 0x4350
jmp 0xcb67
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/close_fds.c
// Function: init
static void __attribute__((constructor)) init()
{
	struct dirent *ent;
	ssize_t size = 0;
	DIR *d;

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

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

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

		fd = atoi(ent->d_name);
		if (fd == dirfd(d))
			continue;

		if (fd >= size * FD_SETSIZE) {
			int i;
			ssize_t new_size;

			new_size = (fd / FD_SETSIZE) + 1;
			open_files_set = realloc(open_files_set, new_size * sizeof(fd_set));
			if (open_files_set == NULL)
				_exit(EXIT_FAILURE);

			for (i = size; i < new_size; i++)
				FD_ZERO(&(open_files_set[i]));

			size = new_size;
		}

		if (fd > open_files_max_fd)
			open_files_max_fd = fd;

		FD_SET(fd % FD_SETSIZE, &(open_files_set[fd / FD_SETSIZE]));
	}
	closedir(d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x3efa(%rip), %rdi      # 0x10b02
callq 0x4390
testq %rax, %rax
je 0xcd50
movq %rax, %rbx
movq %rax, %rdi
callq 0x4420
testq %rax, %rax
je 0xcd3f
xorl %r13d, %r13d
cmpb $0x2e, 0x13(%rax)
je 0xcc4f
addq $0x13, %rax
movq %rax, %rdi
callq 0x44e0
movl %eax, %r14d
movq %rbx, %rdi
callq 0x44d0
cmpl %eax, %r14d
jne 0xcc57
movq %r13, %r12
jmp 0xcd2b
movslq %r14d, %rax
movq %r13, %rcx
shlq $0xa, %rcx
cmpq %rax, %rcx
jle 0xcc6b
movq %r13, %r12
jmp 0xccca
leal 0x3ff(%r14), %r15d
testl %r14d, %r14d
cmovnsl %r14d, %r15d
sarl $0xa, %r15d
movslq %r15d, %r12
incq %r12
movq 0x1d4b6(%rip), %rdi     # 0x2a140
movq %r12, %rsi
shlq $0x7, %rsi
callq 0x4800
movq %rax, 0x1d4a3(%rip)     # 0x2a140
testq %rax, %rax
je 0xcd5a
subl %r13d, %r15d
jl 0xccca
movslq %r13d, %rcx
shlq $0x7, %rcx
addq %rcx, %rax
shlq $0x7, %r15
subq $-0x80, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x40b0
cmpl 0x1d477(%rip), %r14d    # 0x2a148
jle 0xccda
movl %r14d, 0x1d46e(%rip)    # 0x2a148
leal 0x3ff(%r14), %eax
testl %r14d, %r14d
cmovnsl %r14d, %eax
movl %eax, %edx
andl $0xfffffc00, %edx       # imm = 0xFFFFFC00
movl %r14d, %ecx
subl %edx, %ecx
negl %edx
addl %r14d, %edx
addl $0x3f, %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
movl %edx, %esi
andl $-0x40, %esi
subl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
sarl $0xa, %eax
cltq
shlq $0x7, %rax
addq 0x1d41f(%rip), %rax     # 0x2a140
sarl $0x6, %edx
movslq %edx, %rcx
orq %rsi, (%rax,%rcx,8)
movq %rbx, %rdi
callq 0x4420
movq %r12, %r13
testq %rax, %rax
jne 0xcc2d
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x4720
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x1, %edi
callq 0x42a0
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/close_fds.c
// Function: close_other_fds
void close_other_fds()
{
	int fd;

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

// Assembly:
cmpq $0x0, 0x1d3d4(%rip)     # 0x2a140
je 0xcdc2
cmpl $0x3, 0x1d3d3(%rip)     # 0x2a148
jl 0xcdc2
pushq %r14
pushq %rbx
pushq %rax
movl $0x2, %ebx
leaq 0x190c9(%rip), %r14     # 0x25e50
incl %ebx
cmpl (%r14), %ebx
je 0xcdb3
movl %ebx, %eax
shrl $0x3, %eax
movl %eax, %ecx
andl $-0x80, %ecx
addq 0x1d3a1(%rip), %rcx     # 0x2a140
andl $0x78, %eax
movq (%rax,%rcx), %rax
btq %rbx, %rax
jae 0xcdb3
movl %ebx, %edi
callq 0x4100
cmpl 0x1d38f(%rip), %ebx     # 0x2a148
jl 0xcd87
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/containers[P]conmon/src/close_fds.c
// Function: close_all_fds_ge_than
void close_all_fds_ge_than(int firstfd)
{
	struct dirent *ent;
	DIR *d;

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

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

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x3d32(%rip), %rdi      # 0x10b02
callq 0x4390
testq %rax, %rax
je 0xce23
movq %rax, %r14
movq %r14, %rdi
callq 0x4420
testq %rax, %rax
je 0xce17
cmpb $0x2e, 0x13(%rax)
je 0xcddd
addq $0x13, %rax
movq %rax, %rdi
callq 0x44e0
movl %eax, %ebp
movq %r14, %rdi
callq 0x44d0
cmpl %ebx, %ebp
jl 0xcddd
cmpl %eax, %ebp
je 0xcddd
movl %ebp, %edi
callq 0x4100
jmp 0xcddd
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4720
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/demo/keyboard.c
// Function: print_tb
void print_tb(const char *str, int x, int y, uint16_t fg, uint16_t bg)
{
    while (*str) {
        uint32_t uni;
        str += tb_utf8_char_to_unicode(&uni, str);
        tb_change_cell(x, y, uni, fg, bg);
        x++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, (%rsp)
cmpb $0x0, (%rdi)
je 0x53f0
movl %esi, %ebp
movq %rdi, %r14
movzwl %cx, %r12d
movzwl %r8w, %r13d
leaq 0x4(%rsp), %rdi
movq %r14, %rsi
callq 0x8488
movslq %eax, %r15
leaq (%r14,%r15), %rbx
movl 0x4(%rsp), %edx
movl %ebp, %edi
movl (%rsp), %esi
movl %r12d, %ecx
movl %r13d, %r8d
callq 0x76bd
incl %ebp
cmpb $0x0, (%r14,%r15)
movq %rbx, %r14
jne 0x53bc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/demo/keyboard.c
// Function: pretty_print_mouse
void  pretty_print_mouse(struct tb_event *ev) {
    printf_tb(3, 19, TB_WHITE, TB_DEFAULT, "Mouse event: %d x %d", ev->x, ev->y);
    char *btn = "";
    switch (ev->key) {
    case TB_KEY_MOUSE_LEFT:
        btn = "MouseLeft: %d";
        break;
    case TB_KEY_MOUSE_MIDDLE:
        btn = "MouseMiddle: %d";
        break;
    case TB_KEY_MOUSE_RIGHT:
        btn = "MouseRight: %d";
        break;
    case TB_KEY_MOUSE_WHEEL_UP:
        btn = "MouseWheelUp: %d";
        break;
    case TB_KEY_MOUSE_WHEEL_DOWN:
        btn = "MouseWheelDown: %d";
        break;
    case TB_KEY_MOUSE_RELEASE:
        btn = "MouseRelease: %d";
    }
    counter++;
    printf_tb(43, 19, TB_WHITE, TB_DEFAULT, "Key: ");
    printf_tb(48, 19, TB_YELLOW, TB_DEFAULT, btn, counter);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rdi), %r9d
movl 0x14(%rdi), %eax
movl %eax, (%rsp)
leaq 0x2f92(%rip), %r8       # 0x92d9
movl $0x3, %edi
movl $0x13, %esi
movl $0x8, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x53ff
movzwl 0x2(%rbx), %eax
addl $0x1c, %eax
cmpw $0x5, %ax
ja 0x637f
movzwl %ax, %eax
leaq 0x301a(%rip), %rcx      # 0x9390
movslq (%rcx,%rax,4), %rbx
addq %rcx, %rbx
jmp 0x6386
leaq 0x2fee(%rip), %rbx      # 0x9374
leaq 0x8eaf(%rip), %r14      # 0xf23c
incl (%r14)
leaq 0x2ecf(%rip), %r8       # 0x9266
movl $0x2b, %edi
movl $0x13, %esi
movl $0x8, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x53ff
movl (%r14), %r9d
movl $0x30, %edi
movl $0x13, %esi
movl $0x4, %edx
xorl %ecx, %ecx
movq %rbx, %r8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x53ff
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/demo/keyboard.c
// Function: dispatch_press
void dispatch_press(struct tb_event *ev)
{
    if (ev->mod & TB_MOD_ALT) {
        draw_key(K_LALT, TB_WHITE, TB_RED);
        draw_key(K_RALT, TB_WHITE, TB_RED);
    }

    struct combo *k = 0;
    if (ev->key >= TB_KEY_ARROW_RIGHT)
        k = &func_combos[0xFFFF-ev->key];
    else if (ev->ch < 128) {
        if (ev->ch == 0 && ev->key < 128)
            k = &combos[ev->key];
        else
            k = &combos[ev->ch];
    }
    if (!k)
        return;

    struct key **keys = k->keys;
    while (*keys) {
        draw_key(*keys, TB_WHITE, TB_RED);
        keys++;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x1, 0x1(%rdi)
je 0x640a
leaq 0x690b(%rip), %rdi      # 0xccf0
movl $0x8, %esi
movl $0x2, %edx
callq 0x54b7
leaq 0x6995(%rip), %rdi      # 0xcd90
movl $0x8, %esi
movl $0x2, %edx
callq 0x54b7
movzwl 0x2(%rbx), %eax
cmpq $0xffea, %rax           # imm = 0xFFEA
jb 0x642b
xorl $0xffff, %eax           # imm = 0xFFFF
leaq (%rax,%rax,2), %rbx
shll $0x4, %ebx
addq 0x5bbf(%rip), %rbx      # 0xbfe8
jmp 0x6463
movl 0x4(%rbx), %ecx
cmpq $0x7f, %rcx
ja 0x6450
testq %rcx, %rcx
setne %dl
cmpw $0x7f, %ax
seta %sil
orb %dl, %sil
jne 0x6454
leaq (%rax,%rax,2), %rbx
shll $0x4, %ebx
jmp 0x645c
xorl %ebx, %ebx
jmp 0x6463
leaq (%rcx,%rcx,2), %rbx
shlq $0x4, %rbx
addq 0x5b6d(%rip), %rbx      # 0xbfd0
testq %rbx, %rbx
je 0x648f
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x648f
addq $0x8, %rbx
movl $0x8, %esi
movl $0x2, %edx
callq 0x54b7
movq (%rbx), %rdi
addq $0x8, %rbx
testq %rdi, %rdi
jne 0x6474
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_06/calloc.c
// Function: main
int main(int argc, char *argv[])
{
  char *test_malloc_str_p;
  if ((test_malloc_str_p = c_malloc(27 * sizeof(char))) == NULL)
  {
    printf("Error: malloc faild to allocate the requrested memory.\n");
    return EXIT_FAILURE;
  }

  strcpy(test_malloc_str_p, "Content from malloc here.");
  printf("%s\n", test_malloc_str_p);
  c_free(test_malloc_str_p);

  char *test_calloc_str_p;
  if ((test_calloc_str_p = c_calloc(27, sizeof(char))) == NULL)
  {
    printf("Error: calloc faild to allocate the requrested memory.\n");
    return EXIT_FAILURE;
  }

  strcpy(test_calloc_str_p, "Content from calloc here.");
  printf("%s\n", test_calloc_str_p);
  c_free(test_calloc_str_p);

  return EXIT_SUCCESS;
}

// Assembly:
pushq %rbx
movl $0x1b, %edi
callq 0x11fe
testq %rax, %rax
je 0x11b2
movq %rax, %rbx
movups 0xe98(%rip), %xmm0      # 0x200e
movups %xmm0, 0xa(%rax)
movups 0xe83(%rip), %xmm0      # 0x2004
movups %xmm0, (%rax)
movq %rax, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x12a0
movl $0x1b, %edi
callq 0x11fe
testq %rax, %rax
je 0x11bb
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0xb(%rax)
movups %xmm0, (%rax)
jmp 0x11bd
leaq 0xeb6(%rip), %rdi       # 0x206f
jmp 0x11f2
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x11eb
movups 0xe5f(%rip), %xmm0      # 0x2028
movups %xmm0, 0xa(%rbx)
movups 0xe4a(%rip), %xmm0      # 0x201e
movups %xmm0, (%rbx)
movq %rbx, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x12a0
xorl %eax, %eax
jmp 0x11fc
leaq 0xe46(%rip), %rdi       # 0x2038
callq 0x1030
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_06/calloc.c
// Function: c_malloc
void *c_malloc(size_t nr_of_bytes)
{
  Header *p;
  Header *prev_p;
  size_t nr_of_units = (nr_of_bytes + sizeof(Header) - 1) / sizeof(Header);

  if ((prev_p = free_p) == NULL)
  {
    base.s.free_block_p = free_p = prev_p = &base;
    base.s.size = 0;
  }

  for (p = prev_p->s.free_block_p;; prev_p = p, p = p->s.free_block_p)
  {
    if (p->s.size >= nr_of_units)
    {
      if (p->s.size == nr_of_units)
      {
        prev_p->s.free_block_p = p->s.free_block_p;
      }
      else
      {
        p->s.size -= nr_of_units;
        p += p->s.size;
        p->s.size = nr_of_units;
      }

      free_p = prev_p;
      return (void *)(p + 1);
    }

    if (p == free_p)
    {
      if ((p = c_morecore(nr_of_units)) == NULL)
      {
        return NULL;
      }
    }
  }

  return NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0xf, %rbx
shrq $0x4, %rbx
movq 0x2e37(%rip), %rdx      # 0x4048
testq %rdx, %rdx
jne 0x1236
leaq 0x2e33(%rip), %rdx      # 0x4050
movq %rdx, 0x2e24(%rip)      # 0x4048
movq %rdx, 0x2e25(%rip)      # 0x4050
movq $0x0, 0x2e22(%rip) # 0x4058
movq (%rdx), %rcx
movq 0x8(%rcx), %rsi
cmpq %rbx, %rsi
jae 0x126f
cmpq 0x2dff(%rip), %rcx      # 0x4048
jne 0x125b
movq %rbx, %rdi
callq 0x134a
movq %rax, %rcx
testq %rax, %rax
je 0x129c
movq (%rcx), %rax
movq 0x8(%rax), %rsi
movq %rcx, %rdx
movq %rax, %rcx
cmpq %rbx, %rsi
jb 0x1242
jmp 0x1272
movq %rcx, %rax
subq %rbx, %rsi
jne 0x127f
movq (%rax), %rcx
movq %rcx, (%rdx)
jmp 0x128f
movq %rsi, 0x8(%rax)
shlq $0x4, %rsi
movq %rbx, 0x8(%rax,%rsi)
addq %rsi, %rax
movq %rdx, 0x2db2(%rip)      # 0x4048
addq $0x10, %rax
popq %rbx
retq
xorl %eax, %eax
jmp 0x129a
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_8/exercise_8_06/calloc.c
// Function: c_free
void c_free(void *a_p)
{
  Header *p;
  Header *b_p = (Header *)a_p - 1;

  for (p = free_p; !(b_p > p && b_p < p->s.free_block_p); p = p->s.free_block_p)
  {
    if (p >= p->s.free_block_p && (b_p > p || b_p < p->s.free_block_p))
    {
      break;
    }
  }

  if (b_p + b_p->s.size == p->s.free_block_p)
  {
    b_p->s.size += p->s.free_block_p->s.size;
    b_p->s.free_block_p = p->s.free_block_p->s.free_block_p;
  }
  else
  {
    b_p->s.free_block_p = p->s.free_block_p;
  }

  if (p + p->s.size == b_p)
  {
    p->s.size += b_p->s.size;
    p->s.free_block_p = b_p->s.free_block_p;
  }
  else
  {
    p->s.free_block_p = b_p;
  }

  free_p = p;
}

// Assembly:
leaq -0x10(%rdi), %rcx
leaq 0x2d9d(%rip), %rax      # 0x4048
movq (%rax), %rax
cmpq %rax, %rcx
jbe 0x12b8
cmpq (%rax), %rcx
jb 0x12d2
cmpq %rax, %rcx
seta %dl
movq (%rax), %r8
cmpq %r8, %rcx
setb %sil
cmpq %r8, %rax
jb 0x12ab
orb %sil, %dl
je 0x12ab
movq -0x8(%rdi), %rsi
movq %rsi, %r8
shlq $0x4, %r8
addq %rcx, %r8
movq (%rax), %rdx
cmpq %rdx, %r8
jne 0x12f6
addq 0x8(%rdx), %rsi
movq %rsi, -0x8(%rdi)
movq (%rax), %rdx
movq (%rdx), %rdx
movq %rdx, (%rcx)
movq 0x8(%rax), %rdx
movq %rdx, %rsi
shlq $0x4, %rsi
addq %rax, %rsi
cmpq %rcx, %rsi
jne 0x1318
addq -0x8(%rdi), %rdx
movq %rdx, 0x8(%rax)
movq -0x10(%rdi), %rcx
movq %rcx, (%rax)
movq %rax, 0x2d26(%rip)      # 0x4048
retq
// File: /workspace/github_c_makefile_star2_O1/agraf[P]kvmbench/cpuid.c
// Function: main
int main(int argc, char **argv)
{
    char test_data[2048 * 1024];

    setup_tsc();
    memset(test_data, 'd', sizeof(test_data));

    benchmark(naiveChecksum, sizeof(test_data), test_data, "Generic");
    benchmark(avxChecksum, sizeof(test_data), test_data, "AVX2");
    benchmark(avxChecksumV2, sizeof(test_data), test_data, "AVX2 (optimized)");

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200008, %rsp         # imm = 0x200008
callq 0x13a0
movq %rsp, %rdi
movl $0x200000, %edx         # imm = 0x200000
movl $0x64, %esi
callq 0x1060
rdtsc
movl %eax, %r12d
shlq $0x20, %rdx
leaq 0x2ea7(%rip), %r15      # 0x4058
addq (%r15), %r12
addq %rdx, %r12
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
orq %rax, %rdx
xorl %r14d, %r14d
cmpq %r12, %rdx
jae 0x11ed
movq %rsp, %rbx
movl $0x200000, %esi         # imm = 0x200000
movq %rbx, %rdi
callq 0x12d4
incq %r14
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
orq %rax, %rdx
cmpq %r12, %rdx
jb 0x11cd
leaq 0xe2e(%rip), %rdi       # 0x2022
leaq 0xe09(%rip), %rsi       # 0x2004
xorl %ebx, %ebx
movq %r14, %rdx
xorl %eax, %eax
callq 0x1030
rdtsc
movl %eax, %r12d
shlq $0x20, %rdx
addq (%r15), %r12
addq %rdx, %r12
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
orq %rax, %rdx
cmpq %r12, %rdx
jae 0x124b
xorl %ebx, %ebx
movq %rsp, %r14
movl $0x200000, %esi         # imm = 0x200000
movq %r14, %rdi
callq 0x12f4
incq %rbx
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
orq %rax, %rdx
cmpq %r12, %rdx
jb 0x122b
leaq 0xdd0(%rip), %rdi       # 0x2022
leaq 0xdb3(%rip), %rsi       # 0x200c
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1030
rdtsc
movl %eax, %r12d
shlq $0x20, %rdx
addq (%r15), %r12
addq %rdx, %r12
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
orq %rax, %rdx
cmpq %r12, %rdx
jae 0x12ab
xorl %r14d, %r14d
movq %rsp, %rbx
movl $0x200000, %esi         # imm = 0x200000
movq %rbx, %rdi
callq 0x1312
incq %r14
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
orq %rax, %rdx
cmpq %r12, %rdx
jb 0x128b
leaq 0xd70(%rip), %rdi       # 0x2022
leaq 0xd58(%rip), %rsi       # 0x2011
movq %r14, %rdx
xorl %eax, %eax
callq 0x1030
xorl %eax, %eax
addq $0x200008, %rsp         # imm = 0x200008
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/agraf[P]kvmbench/cpuid_csum.c
// Function: naiveChecksum
int CSUM(const char * const target, size_t targetLength) {
	unsigned int checksum = 0;
	size_t i;

	for (i = 0; i < targetLength; ++i) {
		checksum += (unsigned int) target[i];
	}
	return checksum % 256;
}

// Assembly:
testq %rsi, %rsi
je 0x12ef
xorl %eax, %eax
xorl %ecx, %ecx
movzbl (%rdi,%rax), %edx
addl %edx, %ecx
incq %rax
cmpq %rax, %rsi
jne 0x12dd
movzbl %cl, %eax
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/agraf[P]kvmbench/cpuid_csum.c
// Function: avxChecksumV2
int avxChecksumV2(const char * const target, size_t targetLength) {
	const __m256i zeroVec = _mm256_setzero_si256();
	const __m256i oneVec = _mm256_set1_epi16(1);
	__m256i accum = _mm256_setzero_si256();
	unsigned int checksum = 0;
	size_t offset = 0;

	if(targetLength >= 32) {
		for(; offset <= targetLength - 32; offset += 32) {
			__m256i vec = _mm256_loadu_si256(
			(const __m256i*)(target + offset));
			__m256i vl = _mm256_unpacklo_epi8(vec, zeroVec);
			__m256i vh = _mm256_unpackhi_epi8(vec, zeroVec);
			// There's no "add and unpack" instruction but multiplying by 
			// one has the same effect and gets us unpacking from 16-bits to 
			// 32 bits for free.
			accum = _mm256_add_epi32(accum, _mm256_madd_epi16(vl, oneVec));
			accum = _mm256_add_epi32(accum, _mm256_madd_epi16(vh, oneVec));
		}
	}

	for(; offset < targetLength; ++offset) {
		checksum += (unsigned int) target[offset];
	}

	// We could accomplish the same thing with horizontal add instructions as 
	// we did above but shifts and vertical adds have much lower instruction 
	// latency.
	accum = _mm256_add_epi32(accum, _mm256_srli_si256(accum, 4));
	accum = _mm256_add_epi32(accum, _mm256_srli_si256(accum, 8));
	return (_mm256_extract_epi32(accum, 0) + _mm256_extract_epi32(accum, 4) + 
		checksum) % 256;
}

// Assembly:
xorl %eax, %eax
cmpq $0x20, %rsi
jb 0x1359
leaq -0x20(%rsi), %rdx
vpxor %xmm1, %xmm1, %xmm1
xorl %ecx, %ecx
vpbroadcastw 0xd05(%rip), %ymm2 # 0x2032
vpxor %xmm0, %xmm0, %xmm0
vmovdqu (%rdi,%rcx), %ymm3
vpunpcklbw %ymm1, %ymm3, %ymm4 # ymm4 = ymm3[0],ymm1[0],ymm3[1],ymm1[1],ymm3[2],ymm1[2],ymm3[3],ymm1[3],ymm3[4],ymm1[4],ymm3[5],ymm1[5],ymm3[6],ymm1[6],ymm3[7],ymm1[7],ymm3[16],ymm1[16],ymm3[17],ymm1[17],ymm3[18],ymm1[18],ymm3[19],ymm1[19],ymm3[20],ymm1[20],ymm3[21],ymm1[21],ymm3[22],ymm1[22],ymm3[23],ymm1[23]
vpunpckhbw %ymm1, %ymm3, %ymm3 # ymm3 = ymm3[8],ymm1[8],ymm3[9],ymm1[9],ymm3[10],ymm1[10],ymm3[11],ymm1[11],ymm3[12],ymm1[12],ymm3[13],ymm1[13],ymm3[14],ymm1[14],ymm3[15],ymm1[15],ymm3[24],ymm1[24],ymm3[25],ymm1[25],ymm3[26],ymm1[26],ymm3[27],ymm1[27],ymm3[28],ymm1[28],ymm3[29],ymm1[29],ymm3[30],ymm1[30],ymm3[31],ymm1[31]
vpmaddwd %ymm2, %ymm4, %ymm4
vpaddd %ymm0, %ymm4, %ymm0
vpmaddwd %ymm2, %ymm3, %ymm3
vpaddd %ymm3, %ymm0, %ymm0
addq $0x20, %rcx
cmpq %rdx, %rcx
jbe 0x1331
jmp 0x135f
vpxor %xmm0, %xmm0, %xmm0
xorl %ecx, %ecx
cmpq %rsi, %rcx
jae 0x1374
xorl %eax, %eax
movzbl (%rdi,%rcx), %edx
addl %edx, %eax
incq %rcx
cmpq %rcx, %rsi
jne 0x1366
vpsrldq $0x4, %ymm0, %ymm1      # ymm1 = ymm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero,ymm0[20,21,22,23,24,25,26,27,28,29,30,31],zero,zero,zero,zero
vpaddd %ymm0, %ymm1, %ymm0
vpshufd $0xee, %ymm0, %ymm1     # ymm1 = ymm0[2,3,2,3,6,7,6,7]
vpaddd %ymm1, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm1
vpaddd %xmm1, %xmm0, %xmm0
vmovd %xmm0, %ecx
addl %eax, %ecx
movzbl %cl, %eax
vzeroupper
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/nmmmnu[P]HM2/test_hm_glob.c
// Function: main
int main(int argc, char **argv){
	if (argc < 2){
		print_usage(argv[0]);
		return 1;
	}

	const char *path = argv[1];

	glob_t globresults;

	const char **files = hm_glob_open(&globresults, path);

	if (files == NULL){
		printf("Error glob() %s\n", path);
		return 1;
	}

	size_t i = 0;
	const char **f = files;
	while(*f)
		printf("%5zu : %s\n", i++, *f++ );

	size_t size = hm_glob_size(files);

	if (i == size)
		printf("Total %zu files...\n", size);
	else
		printf("File count does not match! (%zu != %zu)\n", size, i);

	hm_glob_close(&globresults, files);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
cmpl $0x1, %edi
jg 0x11da
movq (%rsi), %rbx
leaq 0xed6(%rip), %rdi       # 0x208c
callq 0x1040
leaq 0xe9b(%rip), %rdi       # 0x205d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1070
leaq 0xec0(%rip), %rdi       # 0x2093
callq 0x1040
jmp 0x1235
movq 0x8(%rsi), %r14
movq %rsp, %rdi
movq %r14, %rsi
callq 0x1294
testq %rax, %rax
je 0x1224
movq %rax, %rbx
movq (%rax), %rdx
testq %rdx, %rdx
je 0x123c
leaq 0xe15(%rip), %r15       # 0x2015
xorl %r12d, %r12d
leaq 0x1(%r12), %r14
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1070
movq 0x8(%rbx,%r12,8), %rdx
movq %r14, %r12
testq %rdx, %rdx
jne 0x1203
jmp 0x123f
leaq 0xdd9(%rip), %rdi       # 0x2004
movq %r14, %rsi
xorl %eax, %eax
callq 0x1070
movl $0x1, %eax
jmp 0x1285
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x1353
cmpq %rax, %r14
jne 0x125f
leaq 0xdcd(%rip), %rdi       # 0x2020
movq %rax, %rsi
xorl %eax, %eax
callq 0x1070
jmp 0x1273
leaq 0xdce(%rip), %rdi       # 0x2034
movq %rax, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x1030
movq %rsp, %rdi
callq 0x1050
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/pasc600.c
// Function: main
int main(int argc, char* argv[]) {

    if (argc == 2) {
        filename = argv[1];

        if (!(yyin = fopen(filename, "r"))) {
            perror(filename);
            exit(EXIT_FAILURE);
        }

        if (DEBUG) printf("-> Line No. 1 <-");

        yyparse();
        fclose(yyin);

        // sem_analysis(ast);

        yylex_destroy();
        ast_free(ast);

        printf("\n");
        exit(EXIT_SUCCESS);
    }

    printf("\nUsage: %s {filename}\n", argv[0]);
    exit(EXIT_FAILURE);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jne 0xab5b
movq 0x8(%rsi), %rdi
movq %rdi, 0x1801e(%rip)     # 0x22b50
leaq 0xc53d(%rip), %rsi      # 0x17076
callq 0x7230
leaq 0x17d9b(%rip), %rbx     # 0x228e0
movq %rax, (%rbx)
testq %rax, %rax
jne 0xab76
movq 0x17ffc(%rip), %rdi     # 0x22b50
callq 0x7250
jmp 0xab6c
movq (%rsi), %rsi
leaq 0xe1b7(%rip), %rdi      # 0x18d1c
xorl %eax, %eax
callq 0x7100
movl $0x1, %edi
callq 0x7270
leaq 0xe18e(%rip), %rdi      # 0x18d0b
xorl %eax, %eax
callq 0x7100
xorl %eax, %eax
callq 0x73cc
movq (%rbx), %rdi
callq 0x70d0
xorl %eax, %eax
callq 0xaa7d
movq 0x17fb7(%rip), %rdi     # 0x22b58
callq 0xcfe4
movl $0xa, %edi
callq 0x7030
xorl %edi, %edi
callq 0x7270
nop
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/error.c
// Function: scanner_error
void scanner_error(int lineno, const char* error, ...) {

    va_list args;
    va_start(args, error);

    printf("\n" ANSI_BWHT "%s:%d: " ANSI_MAG "warning: " ANSI_RESET, filename, lineno);
    vprintf(error, args);
    printf("\n");

    va_end(args);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
movl %edi, %r10d
leaq -0xe0(%rbp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xac23
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq -0x30(%rbp), %r14
movq %rsi, 0x10(%r14)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r14)
leaq 0x17f09(%rip), %rax     # 0x22b50
movq (%rax), %rsi
leaq 0xe0e2(%rip), %rdi      # 0x18d33
movl %r10d, %edx
xorl %eax, %eax
callq 0x7100
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7210
movl $0xa, %edi
callq 0x7030
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/error.c
// Function: parser_error
void parser_error(int lineno, const char* error) {

    static unsigned parser_error_count = 0; // yyerrs

    printf("\n" ANSI_BWHT "%s:%d: " ANSI_RED "error: " ANSI_RESET "%s", filename, lineno, error);

    if (++parser_error_count == PARSER_MAX_ERRORS) {
        printf("\n\nParsing error limit (%u) is exceeded. Exiting...\n", PARSER_MAX_ERRORS);
        exit(EXIT_FAILURE);
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, %rcx
movl %edi, %edx
leaq 0x17ec4(%rip), %rax     # 0x22b50
movq (%rax), %rsi
leaq 0xe0c1(%rip), %rdi      # 0x18d57
xorl %eax, %eax
callq 0x7100
movl 0x17ebd(%rip), %eax     # 0x22b60
incl %eax
movl %eax, 0x17eb5(%rip)     # 0x22b60
cmpl $0x5, %eax
je 0xacb2
popq %rbp
retq
leaq 0xe0c2(%rip), %rdi      # 0x18d7b
movl $0x5, %esi
xorl %eax, %eax
callq 0x7100
movl $0x1, %edi
callq 0x7270
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/error.c
// Function: sem_error
void sem_error(int lineno, const char* error, ...) {

    va_list args;
    va_start(args, error);

    if (lineno == NO_LINE) {
        printf("\n" ANSI_BWHT "%s: " ANSI_MAG "error: " ANSI_RESET, filename);
    } else {
        printf("\n" ANSI_BWHT "%s:%d: " ANSI_MAG "error: " ANSI_RESET, filename, lineno);
    }

    vprintf(error, args);
    printf("\n");

    va_end(args);

    exit(EXIT_FAILURE);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
leaq -0xd0(%rbp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xad1f
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x20(%rbp)
leaq 0x17e10(%rip), %rax     # 0x22b50
movq (%rax), %rsi
cmpl $-0x1, %edi
jne 0xad58
leaq 0xe060(%rip), %rdi      # 0x18daf
xorl %eax, %eax
callq 0x7100
jmp 0xad6c
movl %edi, %r10d
leaq 0xe06c(%rip), %rdi      # 0x18dce
movl %r10d, %edx
xorl %eax, %eax
callq 0x7100
leaq -0x20(%rbp), %rsi
movq %rbx, %rdi
callq 0x7210
movl $0xa, %edi
callq 0x7030
movl $0x1, %edi
callq 0x7270
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/ast.c
// Function: ast_id
Id* ast_id(const char* identifier) {

    Id* id = MALLOC(id, Id);

    id->identifier = strdup(identifier);
    id->next = NULL;

    return id;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x10, %edi
callq 0x72c8
movq %rax, %rbx
testq %rax, %rax
jne 0xadb4
leaq 0xe041(%rip), %rdi      # 0x18df0
callq 0xabb8
movq %r14, %rdi
callq 0x7290
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/ast.c
// Function: ast_program
AST* ast_program(Definition* header, Declaration* declarations, Definition* subprograms, Statement* comp_statement) {

    AST* ast = MALLOC(ast, AST);

    ast->header = header;
    ast->declarations = declarations;
    ast->subprograms = subprograms;
    ast->comp_statement = comp_statement;

    return ast;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x20, %edi
callq 0x72c8
movq %rax, %r13
testq %rax, %rax
jne 0xae07
leaq 0xdfee(%rip), %rdi      # 0x18df0
callq 0xabb8
movq %r12, (%r13)
movq %r15, 0x8(%r13)
movq %r14, 0x10(%r13)
movq %rbx, 0x18(%r13)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/ast.c
// Function: ast_program_declarations
Declaration* ast_program_declarations(Definition* constdefs, Definition* typedefs, Definition* vardefs) {

    Declaration* declaration = MALLOC(declaration, Declaration);

    declaration->constdefs = constdefs;
    declaration->typedefs = typedefs;
    declaration->vardefs = vardefs;

    return declaration;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x18, %edi
callq 0x72c8
movq %rax, %r12
testq %rax, %rax
jne 0xae5b
leaq 0xdf9a(%rip), %rdi      # 0x18df0
callq 0xabb8
movq %r15, (%r12)
movq %r14, 0x8(%r12)
movq %rbx, 0x10(%r12)
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/ast.c
// Function: ast_definition_program
Definition* ast_definition_program(Line line, Id* id) {

    Definition* definition = MALLOC(definition, Definition);

    definition->line = line;
    definition->tag = DEFINITION_PROGRAM;
    definition->next = NULL;
    definition->program.id = id;

    return definition;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movl $0x30, %edi
callq 0x72c8
movq %rax, %r15
testq %rax, %rax
jne 0xaea3
leaq 0xdf52(%rip), %rdi      # 0x18df0
callq 0xabb8
movl %r14d, (%r15)
movl $0x0, 0x4(%r15)
movq $0x0, 0x8(%r15)
movq %rbx, 0x10(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/ast.c
// Function: ast_definition_constant
Definition* ast_definition_constant(Line line, Id* id, Expression* expression) {

    Definition* definition = MALLOC(definition, Definition);

    definition->line = line;
    definition->tag = DEFINITION_CONSTANT;
    definition->next = NULL;
    definition->constant.id = id;
    definition->constant.expression = expression;

    return definition;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r12d
movl $0x30, %edi
callq 0x72c8
movq %rax, %r15
testq %rax, %rax
jne 0xaefa
leaq 0xdefb(%rip), %rdi      # 0x18df0
callq 0xabb8
movl %r12d, (%r15)
movl $0x1, 0x4(%r15)
movq $0x0, 0x8(%r15)
movq %r14, 0x10(%r15)
movq %rbx, 0x18(%r15)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/ast.c
// Function: ast_definition_type
Definition* ast_definition_type(Line line, Id* id, Type* type) {

    Definition* definition = MALLOC(definition, Definition);

    definition->line = line;
    definition->tag = DEFINITION_TYPE;
    definition->next = NULL;
    definition->type.id = id;
    definition->type.type = type;

    return definition;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r12d
movl $0x30, %edi
callq 0x72c8
movq %rax, %r15
testq %rax, %rax
jne 0xaf53
leaq 0xdea2(%rip), %rdi      # 0x18df0
callq 0xabb8
movl %r12d, (%r15)
movl $0x2, 0x4(%r15)
movq $0x0, 0x8(%r15)
movq %r14, 0x10(%r15)
movq %rbx, 0x18(%r15)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/neosploit[P]compiler/ast.c
// Function: ast_definition_field
Definition* ast_definition_field(Line line, Id* identifiers, Type* type) {

    Definition* definition = MALLOC(definition, Definition);

    definition->line = line;
    definition->tag = DEFINITION_FIELD;
    definition->next = NULL;
    definition->field.identifiers = identifiers;
    definition->field.type = type;

    return definition;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r12d
movl $0x30, %edi
callq 0x72c8
movq %rax, %r15
testq %rax, %rax
jne 0xafac
leaq 0xde49(%rip), %rdi      # 0x18df0
callq 0xabb8
movl %r12d, (%r15)
movl $0x3, 0x4(%r15)
movq $0x0, 0x8(%r15)
movq %r14, 0x10(%r15)
movq %rbx, 0x18(%r15)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq