LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_nonblock
int so_nonblock(int fd, _Bool nonblock) {
	int flags, mask = (nonblock)? ~0 : (~O_NONBLOCK);

	if (-1 == (flags = fcntl(fd, F_GETFL))
	||  -1 == fcntl(fd, F_SETFL, mask & (flags | O_NONBLOCK)))
		return so_syerr();

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movl %edi, %ebp
xorl %ebx, %ebx
movl $0x3, %esi
xorl %eax, %eax
callq 0xf7b0
cmpl $-0x1, %eax
je 0x236b6
movzbl %r14b, %ecx
negl %ecx
orl $0xfffff7ff, %ecx       # imm = 0xFFFFF7FF
orl $0x800, %eax            # imm = 0x800
andl %ecx, %eax
movl %ebp, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0xf7b0
cmpl $-0x1, %eax
jne 0x236bd
callq 0xf0a0
movl (%rax), %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_setboolopt
static int so_setboolopt(int fd, int lvl, int opt, _Bool enable) {
	if (0 != setsockopt(fd, lvl, opt, &(int){ enable }, sizeof (int))) {
		switch (errno) {
		case ENOTSOCK:
			/* FALL THROUGH */
		case ENOPROTOOPT:
			return EOPNOTSUPP;
		default:
			return errno;
		}
	}

	return 0;
}

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rax
movl %ecx, (%rax)
movq %rax, %rcx
movl $0x4, %r8d
callq 0x10820
testl %eax, %eax
je 0x23706
callq 0xf0a0
movl (%rax), %ecx
movl $0x5f, %eax
movl %ecx, %edx
orl $0x4, %edx
cmpl $0x5c, %edx
je 0x23708
movl %ecx, %eax
jmp 0x23708
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_reuseport
int so_reuseport(int fd, _Bool reuseport) {
	int error;
#if defined SO_REUSEPORT
	error = so_setboolopt(fd, SOL_SOCKET, SO_REUSEPORT, reuseport);
#else
	(void)fd;
	error = EOPNOTSUPP;
#endif
	if (error == EOPNOTSUPP && !reuseport)
		error = 0; /* already disabled */

	return error;
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movl $0x1, %esi
movl $0xf, %edx
movl %ebx, %ecx
callq 0x236d2
testl %ebx, %ebx
movl $0x5f, %ecx
cmovel %ebx, %ecx
cmpl $0x5f, %eax
cmovel %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_rstfl
int so_rstfl(int fd, int *oflags, int flags, int mask, int require) {
	const struct flops *f;
	int error;

	for (f = fltable; f < endof(fltable); f++) {
		if (!(f->flag & mask))
			continue;

		if ((error = f->set(fd, !!(f->flag & flags)))) {
			if ((f->flag & require) || error != EOPNOTSUPP)
				return error;

			*oflags &= ~f->flag;
		} else {
			*oflags &= ~f->flag;
			*oflags |= (f->flag & flags);
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, 0xc(%rsp)
movl %ecx, %ebp
movl %edx, 0x14(%rsp)
movq %rsi, %r15
movl %edi, 0x10(%rsp)
movq $-0x18, %r13
leaq 0x22c4f(%rip), %rbx     # 0x46620
movl 0x18(%r13,%rbx), %r14d
testl %ebp, %r14d
je 0x23a16
xorl %esi, %esi
movl %r14d, %r12d
andl 0x14(%rsp), %r12d
setne %sil
movl 0x10(%rsp), %edi
callq *0x20(%r13,%rbx)
testl %eax, %eax
je 0x23a0a
testl %r14d, 0xc(%rsp)
jne 0x23a25
cmpl $0x5f, %eax
jne 0x23a25
notl %r14d
andl (%r15), %r14d
jmp 0x23a13
notl %r14d
andl (%r15), %r14d
orl %r12d, %r14d
movl %r14d, (%r15)
addq $0x18, %r13
cmpq $0xd8, %r13
jb 0x239d1
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_open
struct socket *(so_open)(const char *host, const char *port, int qtype, int domain, int type, const struct so_options *opts, int *error_) {
	_Bool isnumeric = sa_isnumeric(host);
	struct dns_resolver *res = NULL;
	struct addrinfo hints;
	struct socket *so;
	int error;

	if (!(so = so_make(opts, &error)))
		goto error;

	/*
	 * Copy host name as TLS server host name.
	 *
	 * NOTE: All the TLS RFCs (from RFC 3546 to RFC 6066)
	 * declare
	 *
	 *      Literal IPv4 and IPv6 addresses are not permitted in
	 *      "HostName".
	 *
	 * If the caller wants to send the IP address as the TLS
	 * server host name, they can set .tls_hostname explicitly.
	 */
	if (so->opts.tls_sendname == SO_OPTS_TLS_HOSTNAME && !isnumeric) {
		if (!(so->opts.tls_sendname = strdup(host)))
			goto syerr;
	}

	memset(&hints, 0, sizeof hints);

	hints.ai_flags    = AI_CANONNAME;
	hints.ai_family   = domain;
	hints.ai_socktype = type;

	if (isnumeric) {
		hints.ai_flags |= AI_NUMERICHOST;
	} else {
		struct dns_options *opts = dns_opts();

		opts->closefd.arg = so->opts.fd_close.arg;
		opts->closefd.cb = so->opts.fd_close.cb;

		if (!(res = dns_res_stub(opts, &error)))
			goto error;
	}

	if (!(so->res = dns_ai_open(host, port, qtype, &hints, res, &error)))
		goto error;

	so->todo = SO_S_GETADDR | SO_S_SOCKET | SO_S_BIND;

	dns_res_close(res);

	return so;
syerr:
	error = so_syerr();
error:
	dns_res_close(res);

	so_close(so);

	*error_ = error;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, %rbx
movl %r8d, %r13d
movl %ecx, %ebp
movl %edx, 0x4(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
xorl %r12d, %r12d
leaq 0x10(%rsp), %rdi
movl $0x80, %esi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x10280
movq %rax, %r14
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x23bc6
movq %rax, %rbx
testq %rax, %rax
je 0x23b91
testq %r14, %r14
jne 0x23ae4
cmpq $0x1, 0x40(%rbx)
jne 0x23ae4
movq %r15, %rdi
callq 0x10890
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x23b84
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movl $0x2, 0x10(%rsp)
movl %ebp, 0x14(%rsp)
movl %r13d, 0x18(%rsp)
testq %r14, %r14
je 0x23b19
movl $0x6, 0x10(%rsp)
xorl %r12d, %r12d
jmp 0x23b4b
leaq 0x90(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x28(%rbx), %rax
movq %rax, (%rdi)
movq 0x30(%rbx), %rax
movq %rax, 0x8(%rdi)
movq %rsp, %rsi
callq 0xf830
movq %rax, %r12
testq %rax, %rax
je 0x23b91
leaq 0x10(%rsp), %rcx
movq %rsp, %r9
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %edx
movq %r12, %r8
callq 0xfd00
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x23b91
movl $0xe, 0xb8(%rbx)
movq %r12, %rdi
callq 0xfde0
jmp 0x23bb1
callq 0xf0a0
movl (%rax), %eax
movl %eax, (%rsp)
xorl %r12d, %r12d
movq 0xe0(%rsp), %r14
movq %r12, %rdi
callq 0xfde0
movq %rbx, %rdi
callq 0xf420
movl (%rsp), %eax
movl %eax, (%r14)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_make
static struct socket *so_make(const struct so_options *opts, int *error) {
	static const struct socket so_initializer = {
		.fd = -1,
		.domain = PF_UNSPEC,
		.cred = { (pid_t)-1, (uid_t)-1, (gid_t)-1, }
	};
	struct socket *so;
	size_t len;

	if (!(so = malloc(sizeof *so)))
		goto syerr;

	*so = so_initializer;
	so->opts = *opts;

	if (opts->sa_bind) {
		if (!(len = sa_len((void *)opts->sa_bind))) {
			*error = EAFNOSUPPORT;
			goto error;
		}

		if (!(so->opts.sa_bind = malloc(len)))
			goto syerr;

		memcpy((void *)so->opts.sa_bind, opts->sa_bind, len);
	}

	if (opts->tls_sendname && opts->tls_sendname != SO_OPTS_TLS_HOSTNAME) {
		if (!(so->opts.tls_sendname = strdup(opts->tls_sendname)))
			goto syerr;
	}

	return so;
syerr:
	*error = so_syerr();
error:
	if (so) {
		if (so->opts.tls_sendname != opts->tls_sendname)
			free((void *)so->opts.tls_sendname);

		if (so->opts.sa_bind != opts->sa_bind)
			free((void *)so->opts.sa_bind);

		free(so);
	}

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x220, %edi            # imm = 0x220
callq 0x10110
movq %rax, %rbx
testq %rax, %rax
je 0x23c89
leaq 0x129fe(%rip), %rsi     # 0x365f0
movl $0x220, %edx            # imm = 0x220
movq %rbx, %rdi
callq 0xfa60
movl $0xa, %ecx
movq %rbx, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq (%r14), %r12
testq %r12, %r12
je 0x23c71
movzwl (%r12), %eax
cmpl $0x1, %eax
je 0x23c3b
cmpl $0x2, %eax
je 0x23c31
cmpl $0xa, %eax
jne 0x23c45
movl $0x1c, %r13d
jmp 0x23c41
xorl %eax, %eax
movl $0x10, %r13d
jmp 0x23c4a
movl $0x6e, %r13d
xorl %eax, %eax
jmp 0x23c4a
movb $0x1, %al
xorl %r13d, %r13d
movl $0x61, %ecx
testb %al, %al
jne 0x23c90
movq %r13, %rdi
callq 0x10110
movq %rax, (%rbx)
testq %rax, %rax
je 0x23c89
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xfa60
movq 0x40(%r14), %rdi
cmpq $0x2, %rdi
jb 0x23cbe
callq 0x10890
movq %rax, 0x40(%rbx)
testq %rax, %rax
jne 0x23cbe
callq 0xf0a0
movl (%rax), %ecx
movl %ecx, (%r15)
testq %rbx, %rbx
je 0x23cbc
movq 0x40(%rbx), %rdi
cmpq 0x40(%r14), %rdi
je 0x23ca7
callq 0xff30
movq (%rbx), %rdi
cmpq (%r14), %rdi
je 0x23cb4
callq 0xff30
movq %rbx, %rdi
callq 0xff30
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_close
int so_close(struct socket *so) {
	if (!so)
		return EINVAL;

	so_destroy(so);

	free(so);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x23d44
movq %rdi, %rbx
callq 0x24d4a
movq 0x50(%rbx), %rdi
callq 0xff50
xorl %r14d, %r14d
movq %r14, 0x50(%rbx)
movq 0xa8(%rbx), %rdi
callq 0xff30
movq %r14, 0xa8(%rbx)
leaq 0x58(%rbx), %rdi
movq %rbx, %rsi
callq 0xf2b0
movw $0x0, 0xb0(%rbx)
movq 0x40(%rbx), %rdi
cmpq $0x2, %rdi
jb 0x23d2b
callq 0xff30
movq $0x0, 0x40(%rbx)
movq (%rbx), %rdi
callq 0xff30
movq $0x0, (%rbx)
movq %rbx, %rdi
callq 0xff30
jmp 0x23d4a
movl $0x16, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_dial
struct socket *so_dial(const struct sockaddr *sa, int type, const struct so_options *opts, int *error_) {
	struct { struct addrinfo ai; struct sockaddr_storage ss; } *host;
	struct socket *so;
	int error;

	if (!(so = so_make(opts, &error)))
		goto error;

	if (!(host = malloc(sizeof *host)))
		goto syerr;

	memset(&host->ai, 0, sizeof host->ai);
	memcpy(&host->ss, sa, SO_MIN(af_len(sa->sa_family), sizeof host->ss));

	so->host = &host->ai;
	so->host->ai_family = sa->sa_family;
	so->host->ai_socktype = type;
	so->host->ai_protocol = 0;
	so->host->ai_addrlen = af_len(sa->sa_family);
	so->host->ai_addr = (struct sockaddr *)&host->ss;

	so->todo = SO_S_SOCKET | SO_S_BIND;

	return so;
syerr:
	error = so_syerr();
error:
	so_close(so);

	*error_ = error;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movl %esi, %ebp
movq %rdi, %r12
leaq 0x4(%rsp), %rsi
movq %rdx, %rdi
callq 0x23bc6
movq %rax, %rbx
testq %rax, %rax
je 0x23dcd
movl $0xb0, %edi
callq 0x10110
testq %rax, %rax
je 0x23dc2
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rax, %r15
addq $0x30, %r15
movzwl (%r12), %r13d
cmpl $0x1, %r13d
je 0x23de7
cmpl $0x2, %r13d
je 0x23de0
cmpl $0xa, %r13d
jne 0x23dee
movl $0x1c, %edx
jmp 0x23df0
callq 0xf0a0
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
callq 0xf420
movl 0x4(%rsp), %eax
movl %eax, (%r15)
xorl %ebx, %ebx
jmp 0x23e4d
movl $0x10, %edx
jmp 0x23df0
movl $0x6e, %edx
jmp 0x23df0
xorl %edx, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xfa60
movq %r14, 0xa8(%rbx)
movl %r13d, 0x4(%r14)
movl %ebp, 0x8(%r14)
movl $0x0, 0xc(%r14)
cmpl $0x1, %r13d
je 0x23e32
cmpl $0x2, %r13d
je 0x23e2b
cmpl $0xa, %r13d
jne 0x23e39
movl $0x1c, %eax
jmp 0x23e3b
movl $0x10, %eax
jmp 0x23e3b
movl $0x6e, %eax
jmp 0x23e3b
xorl %eax, %eax
movl %eax, 0x10(%r14)
movq %r15, 0x18(%r14)
movl $0xc, 0xb8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_fdopen
struct socket *so_fdopen(int fd, const struct so_options *opts, int *error_) {
	struct socket *so;
	int flags, mask, need, error;

	if (!(so = so_make(opts, &error)))
		goto error;

	if ((error = so_ftype(fd, &so->mode, &so->domain, &so->type, &so->protocol)))
		goto error;

	flags = so_opts2flags(opts, &mask);
	mask &= so_type2mask(so->mode, so->domain, so->type, so->protocol);
	need = ~(SO_F_NODELAY|SO_F_NOPUSH|SO_F_NOSIGPIPE|SO_F_OOBINLINE);

	if ((error = so_rstfl(fd, &so->flags, flags, mask, need)))
		goto error;

	so->fd = fd;

	return so;
error:
	so_close(so);

	*error_ = error;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, %rbx
movl %edi, 0x8(%rsp)
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x23bc6
movq %rax, %r14
testq %rax, %rax
je 0x23f6e
leaq 0x5c(%r14), %rbp
leaq 0x60(%r14), %r12
leaq 0x64(%r14), %r13
leaq 0x68(%r14), %r15
movl 0x8(%rsp), %edi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %r15, %r8
callq 0x23f9c
movl %eax, 0x4(%rsp)
testl %eax, %eax
jne 0x23f6e
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x23433
movl $0xf000, %edx           # imm = 0xF000
andl (%rbp), %edx
movl $0x83, %ecx
cmpl $0xc000, %edx           # imm = 0xC000
movl 0x8(%rsp), %edi
jne 0x23f48
movl (%r12), %esi
movl (%r13), %edx
movl (%r15), %ecx
testl %ecx, %ecx
jne 0x23f19
movl %esi, %r8d
andl $-0x9, %r8d
xorl %ecx, %ecx
cmpl $0x2, %r8d
jne 0x23f19
cmpl $0x1, %edx
movl $0x6, %r8d
movl $0x11, %ecx
cmovel %r8d, %ecx
xorl %r8d, %r8d
cmpl $0xa, %esi
sete %r8b
shll $0x8, %r8d
xorl %esi, %esi
cmpl $0x2, %edx
sete %sil
shll $0x4, %esi
orl %r8d, %esi
cmpl $0x6, %ecx
movl $0x2ef, %edx            # imm = 0x2EF
movl $0x28f, %ecx            # imm = 0x28F
cmovel %edx, %ecx
orl %esi, %ecx
andl 0xc(%rsp), %ecx
movl %ecx, 0xc(%rsp)
movq %r14, %rsi
addq $0x6c, %rsi
movl %eax, %edx
movl %edi, %ebx
movl $0xfffffd1f, %r8d       # imm = 0xFFFFFD1F
callq 0x10970
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0x23f96
movq %r14, %rdi
callq 0xf420
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, 0x58(%r14)
jmp 0x23f84
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_ftype
static so_error_t so_ftype(int fd, mode_t *mode, int *domain, int *type, int *protocol) {
	struct stat st;
	int error;

	if (0 != fstat(fd, &st))
		return errno;

	*mode = S_IFMT & st.st_mode;

	if (!S_ISSOCK(*mode))
		return 0;

#if defined SO_DOMAIN
	if (0 != getsockopt(fd, SOL_SOCKET, SO_DOMAIN, domain, &(socklen_t){ sizeof *domain })) {
		if (errno != ENOPROTOOPT)
			return errno;

		if ((error = so_ffamily(fd, domain)))
			return error;
	}
#else
	if ((error = so_ffamily(fd, domain)))
		return error;
#endif

	if (0 != getsockopt(fd, SOL_SOCKET, SO_TYPE, type, &(socklen_t){ sizeof *type }))
		return errno;

#if defined SO_PROTOCOL
	if (0 != getsockopt(fd, SOL_SOCKET, SO_PROTOCOL, protocol, &(socklen_t){ sizeof *protocol })) {
		if (errno != ENOPROTOOPT)
			return errno;
	}
#else
	(void)protocol;
#endif

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %ebp
leaq 0x90(%rsp), %rsi
callq 0x106e0
testl %eax, %eax
je 0x23fd6
callq 0xf0a0
movl (%rax), %eax
jmp 0x240b2
movl $0xf000, %ecx           # imm = 0xF000
andl 0xa8(%rsp), %ecx
movl %ecx, (%r12)
xorl %eax, %eax
cmpl $0xc000, %ecx           # imm = 0xC000
jne 0x240b2
leaq 0x8(%rsp), %r8
movl $0x4, (%r8)
movl %ebp, %edi
movl $0x1, %esi
movl $0x27, %edx
movq %r15, %rcx
callq 0xf9a0
testl %eax, %eax
je 0x2405a
callq 0xf0a0
movq %rax, %r12
movl (%rax), %eax
cmpl $0x5c, %eax
jne 0x240b2
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
leaq 0x10(%rsp), %rsi
movl %ebp, %edi
callq 0xfc30
testl %eax, %eax
je 0x2404c
movl (%r12), %eax
jmp 0x24056
movzwl 0x10(%rsp), %eax
movl %eax, (%r15)
xorl %eax, %eax
testl %eax, %eax
jne 0x240b2
leaq 0x4(%rsp), %r8
movl $0x4, (%r8)
movl %ebp, %edi
movl $0x1, %esi
movl $0x3, %edx
movq %r14, %rcx
callq 0xf9a0
testl %eax, %eax
jne 0x23fca
movq %rsp, %r8
movl $0x4, (%r8)
movl %ebp, %edi
movl $0x1, %esi
movl $0x26, %edx
movq %rbx, %rcx
callq 0xf9a0
testl %eax, %eax
je 0x240b0
callq 0xf0a0
movl (%rax), %eax
cmpl $0x5c, %eax
jne 0x240b2
xorl %eax, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_family
int so_family(struct socket *so, int *error_) {
	struct sockaddr_storage saddr;
	socklen_t slen = sizeof saddr;
	int error;

	if ((error = so_localaddr(so, (void *)&saddr, &slen)))
		{ *error_ = error; return AF_UNSPEC; }

	return *sa_family(&saddr);
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rbx
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
leaq 0x10(%rsp), %rsi
callq 0x100b0
testl %eax, %eax
je 0x240ec
movl %eax, (%rbx)
xorl %eax, %eax
jmp 0x240f1
movzwl 0x10(%rsp), %eax
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_localaddr
int so_localaddr(struct socket *so, void *saddr, socklen_t *slen) {
	int error;

	if ((so_state(so) < SO_S_STARTTLS) && (error = so_exec(so)))
		return error;

	if (0 != getsockname(so->fd, saddr, slen))
		return errno;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0xb4(%rdi), %eax
notl %eax
andl 0xb8(%rdi), %eax
je 0x24132
movl $0x1, %ecx
testl %eax, %ecx
jne 0x2412d
addl %ecx, %ecx
cmpl $0x801, %ecx            # imm = 0x801
jl 0x2411d
xorl %ecx, %ecx
cmpl $0x3f, %ecx
jg 0x2413e
movq %r15, %rdi
callq 0x24162
testl %eax, %eax
jne 0x2415c
movl 0x58(%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xfc30
testl %eax, %eax
je 0x2415a
callq 0xf0a0
movl (%rax), %eax
jmp 0x2415c
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_remoteaddr
int so_remoteaddr(struct socket *so, void *saddr, socklen_t *slen) {
	int error;

	if ((so_state(so) < SO_S_STARTTLS) && (error = so_exec(so)))
		return error;

	if (0 != getpeername(so->fd, saddr, slen))
		return errno;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0xb4(%rdi), %eax
notl %eax
andl 0xb8(%rdi), %eax
je 0x249d8
movl $0x1, %ecx
testl %eax, %ecx
jne 0x249d3
addl %ecx, %ecx
cmpl $0x801, %ecx            # imm = 0x801
jl 0x249c3
xorl %ecx, %ecx
cmpl $0x3f, %ecx
jg 0x249e4
movq %r15, %rdi
callq 0x24162
testl %eax, %eax
jne 0x24a02
movl 0x58(%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xf970
testl %eax, %eax
je 0x24a00
callq 0xf0a0
movl (%rax), %eax
jmp 0x24a02
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_accept
int so_accept(struct socket *so, struct sockaddr *saddr, socklen_t *slen, int *error_) {
	int fd = -1, error;

	if ((error = so_listen(so)))
		goto error;

	if ((error = so_exec(so)))
		goto error;

	so->events = POLLIN;

retry:
#if HAVE_ACCEPT4 && defined SOCK_CLOEXEC
	if (-1 == (fd = accept4(so->fd, saddr, slen, SOCK_CLOEXEC)))
		goto soerr;
#elif HAVE_PACCEPT && defined SOCK_CLOEXEC
	if (-1 == (fd = paccept(so->fd, saddr, slen, NULL, SOCK_CLOEXEC)))
		goto soerr;
#else
	if (-1 == (fd = accept(so->fd, saddr, slen)))
		goto soerr;

	if ((error = so_cloexec(fd, 1)))
		goto error;
#endif

	return fd;
soerr:
	switch ((error = so_soerr())) {
	case SO_EINTR:
		goto retry;
#if SO_EWOULDBLOCK != SO_EAGAIN
	case SO_EWOULDBLOCK:
		error = SO_EAGAIN;

		break;
#endif
	case SO_ECONNABORTED:
		error = SO_EAGAIN;

		break;
	}
error:
	*error_ = error;

	so_closesocket(&fd, NULL);

	return -1;
}

// Assembly:
pushq %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
xorl %eax, %eax
testb $0x10, 0xb4(%rdi)
jne 0x24a6b
orb $0x10, 0xb8(%r12)
movq %r12, %rdi
callq 0x24162
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x24a8c
movq %r12, %rdi
callq 0x24162
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x24aad
movl %eax, (%rbx)
cmpl $-0x1, %r13d
je 0x24a9c
movl %r13d, %edi
callq 0x10a10
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movw $0x1, 0xb0(%r12)
movl 0x58(%r12), %edi
movq %r15, %rsi
movq %r14, %rdx
movl $0x80000, %ecx          # imm = 0x80000
callq 0xf5f0
movl %eax, %r13d
cmpl $-0x1, %eax
jne 0x24aed
callq 0xf0a0
movl (%rax), %eax
cmpl $0x4, %eax
je 0x24ab8
cmpl $0x67, %eax
jne 0x24a8c
movl $0xb, %eax
jmp 0x24a8c
movl %r13d, %ebp
jmp 0x24a9c
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_resetssl
static void so_resetssl(struct socket *so) {
	ssl_discard(&so->ssl.ctx);
	so->ssl.state  = 0;
	so->ssl.error  = 0;
	so->ssl.accept = 0;
	so->ssl.vrfd   = 0;

	if (so->bio.ctx) {
		BIO_free(so->bio.ctx);
		so->bio.ctx = NULL;
	}

	free(so->bio.ahead.data);
	so->bio.ahead.data = NULL;
	so->bio.ahead.p = NULL;
	so->bio.ahead.pe = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc8(%rdi), %r14
movq 0xc8(%rdi), %rdi
testq %rdi, %rdi
je 0x24d69
callq 0xf770
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movw $0x0, 0x10(%r14)
movq 0xe0(%rbx), %rdi
testq %rdi, %rdi
je 0x24d93
callq 0xfd90
movq $0x0, 0xe0(%rbx)
movq 0xf0(%rbx), %rdi
callq 0xff30
xorps %xmm0, %xmm0
movups %xmm0, 0xf0(%rbx)
movq $0x0, 0x100(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_pipeign
static int so_pipeign(struct socket *so, _Bool rdonly) {
	if (!so_needign(so, rdonly))
		return 0;

#if _POSIX_REALTIME_SIGNALS > 0
	if (so->pipeign.ncalls++ > 0)
		return 0;

	sigemptyset(&so->pipeign.pending);
	sigpending(&so->pipeign.pending);

	if (sigismember(&so->pipeign.pending, SIGPIPE))
		return 0;

	sigset_t piped;
	sigemptyset(&piped);
	sigaddset(&piped, SIGPIPE);
	sigemptyset(&so->pipeign.blocked);

	return thr_sigmask(SIG_BLOCK, &piped, &so->pipeign.blocked);
#else
	return EOPNOTSUPP;
#endif
}

// Assembly:
cmpb $0x1, 0x1e(%rdi)
jne 0x250a6
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
testb $-0x80, 0x6c(%rdi)
jne 0x2509c
cmpq $0x0, 0xc8(%rbx)
je 0x2500e
cmpq $0x0, 0xe0(%rbx)
sete %al
orb %al, %sil
je 0x25017
jmp 0x25027
testb %sil, %sil
jne 0x2509c
movl $0xf000, %eax           # imm = 0xF000
andl 0x5c(%rbx), %eax
cmpl $0xc000, %eax           # imm = 0xC000
setne %al
testb %al, %al
je 0x2509c
movl 0x108(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x108(%rbx)
testl %eax, %eax
jg 0x2509c
leaq 0x110(%rbx), %r14
movq %r14, %rdi
callq 0x10010
movq %r14, %rdi
callq 0xf310
movq %r14, %rdi
movl $0xd, %esi
callq 0xf610
testl %eax, %eax
jne 0x2509c
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x10010
movq %r14, %rdi
movl $0xd, %esi
callq 0x104c0
addq $0x190, %rbx            # imm = 0x190
movq %rbx, %rdi
callq 0x10010
xorl %edi, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xf350
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: ssl_error
static int ssl_error(SSL *ctx, int rval, short *events) {
	unsigned long code;

	switch (SSL_get_error(ctx, rval)) {
	case SSL_ERROR_ZERO_RETURN:
		return SO_ECLOSURE;
	case SSL_ERROR_WANT_READ:
		*events |= POLLIN;

		return SO_EAGAIN;
	case SSL_ERROR_WANT_WRITE:
		*events |= POLLOUT;

		return SO_EAGAIN;
	case SSL_ERROR_WANT_CONNECT:
		*events |= POLLOUT;

		return SO_EAGAIN;
	case SSL_ERROR_WANT_ACCEPT:
		*events |= POLLIN;

		return SO_EAGAIN;
	case SSL_ERROR_WANT_X509_LOOKUP:
		return SO_EX509INT;
	case SSL_ERROR_SYSCALL:
		if ((code = ERR_peek_last_error()))
			return SO_EOPENSSL;
		else if (rval == 0)
			return ECONNRESET;
		else if (rval == -1 && so_soerr() && so_soerr() != SO_EAGAIN)
			return so_soerr();
		else
			return SO_EOPENSSL;
	case SSL_ERROR_SSL:
		/* FALL THROUGH */
	default:
		return SO_EOPENSSL;
	} /* switch(SSL_get_error()) */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebx
callq 0xf070
addl $-0x2, %eax
cmpl $0x6, %eax
ja 0x25117
leaq 0x114ec(%rip), %rcx     # 0x365b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
orb $0x1, (%r14)
jmp 0x250d7
orb $0x4, (%r14)
movl $0xb, %eax
jmp 0x2511c
movl $0x8c9c94ca, %eax       # imm = 0x8C9C94CA
jmp 0x2511c
movl $0x8c9c94c8, %eax       # imm = 0x8C9C94C8
jmp 0x2511c
callq 0xf090
movq %rax, %rcx
movl $0x8c9c94c7, %eax       # imm = 0x8C9C94C7
testq %rcx, %rcx
jne 0x2511c
testl %ebx, %ebx
je 0x25124
cmpl $-0x1, %ebx
jne 0x25117
callq 0xf0a0
movl (%rax), %eax
cmpl $0xb, %eax
je 0x25117
testl %eax, %eax
jne 0x2511c
movl $0x8c9c94c7, %eax       # imm = 0x8C9C94C7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x68, %eax
jmp 0x2511c
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_sysread
static size_t so_sysread(struct socket *so, void *dst, size_t lim, int *error) {
	long len;

retry:
#if _WIN32
	len = recv(so->fd, dst, SO_MIN(lim, LONG_MAX), 0);
#else
	len = read(so->fd, dst, SO_MIN(lim, LONG_MAX));
#endif

	if (len == -1)
		goto error;
	if (len == 0)
		goto epipe;

	return len;
epipe:
	*error = EPIPE;
	so->st.rcvd.eof = 1;

	return 0;
error:
	*error = so_soerr();

	switch (*error) {
	case SO_EINTR:
		goto retry;
#if SO_EWOULDBLOCK != SO_EAGAIN
	case SO_EWOULDBLOCK:
		*error = SO_EAGAIN;
		/* FALL THROUGH */
#endif
	case SO_EAGAIN:
		so->events |= POLLIN;
		break;
	} /* switch() */

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movabsq $0x7fffffffffffffff, %r13 # imm = 0x7FFFFFFFFFFFFFFF
cmpq %r13, %rdx
cmovbq %rdx, %r13
xorl %r14d, %r14d
movl 0x58(%rbx), %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x10310
cmpq $-0x1, %rax
jne 0x25182
callq 0xf0a0
movl (%rax), %eax
movl %eax, (%r15)
cmpl $0x4, %eax
je 0x25151
cmpl $0xb, %eax
jne 0x2519b
orb $0x1, 0xb0(%rbx)
jmp 0x25198
movq %rax, %r14
testq %rax, %rax
jne 0x2519b
movl $0x20, (%r15)
movb $0x1, 0x90(%rbx)
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_pipeok
static int so_pipeok(struct socket *so, _Bool rdonly) {
	if (!so_needign(so, rdonly))
		return 0;

#if _POSIX_REALTIME_SIGNALS > 0
	assert(so->pipeign.ncalls > 0);

	if (--so->pipeign.ncalls)
		return 0;

	if (sigismember(&so->pipeign.pending, SIGPIPE))
		return 0;

	sigset_t piped;
	sigemptyset(&piped);
	sigaddset(&piped, SIGPIPE);

	while (-1 == sigtimedwait(&piped, NULL, &(struct timespec){ 0, 0 }) && errno == EINTR)
		;;

	return thr_sigmask(SIG_SETMASK, &so->pipeign.blocked, NULL);
#else
	return EOPNOTSUPP;
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
cmpb $0x1, 0x1e(%rdi)
jne 0x25552
movq %rdi, %rbx
testb $-0x80, 0x6c(%rdi)
jne 0x25552
cmpq $0x0, 0xc8(%rbx)
je 0x254ae
cmpq $0x0, 0xe0(%rbx)
sete %al
orb %al, %sil
je 0x254b7
jmp 0x254c7
testb %sil, %sil
jne 0x25552
movl $0xf000, %eax           # imm = 0xF000
andl 0x5c(%rbx), %eax
cmpl $0xc000, %eax           # imm = 0xC000
setne %al
testb %al, %al
je 0x25552
movl 0x108(%rbx), %eax
testl %eax, %eax
jle 0x2555f
decl %eax
movl %eax, 0x108(%rbx)
jne 0x25552
leaq 0x110(%rbx), %rdi
movl $0xd, %esi
callq 0xf610
testl %eax, %eax
jne 0x25552
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x10010
movq %r14, %rdi
movl $0xd, %esi
callq 0x104c0
movq %rsp, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0xf6f0
cmpl $-0x1, %eax
jne 0x2553c
callq 0xf0a0
cmpl $0x4, (%rax)
je 0x25519
addq $0x190, %rbx            # imm = 0x190
movl $0x2, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xf350
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x114de(%rip), %rdi     # 0x36a44
leaq 0x113b1(%rip), %rsi     # 0x3691e
leaq 0x114e7(%rip), %rcx     # 0x36a5b
movl $0x56e, %edx            # imm = 0x56E
callq 0xf890
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_peek
size_t so_peek(struct socket *so, void *dst, size_t lim, int flags, int *_error) {
	int rstlowat = so->todo & SO_S_RSTLOWAT;
	long count;
	int lowat, error;

	so->todo &= ~SO_S_RSTLOWAT;

	error = so_exec(so);

	so->todo |= rstlowat;

	if (error)
		goto error;

	if (flags & SO_F_PEEKALL)
		so->events &= ~POLLIN;
retry:
	count = recv(so->fd, dst, lim, MSG_PEEK);

	if (count == -1)
		goto soerr;

	if ((size_t)count == lim || !(flags & SO_F_PEEKALL))
		return count;
pollin:
	if (!(so->todo & SO_S_RSTLOWAT)) {
		if (0 != getsockopt(so->fd, SOL_SOCKET, SO_RCVLOWAT, &so->olowat, &(socklen_t){ sizeof so->olowat }))
			goto soerr;

		if (lim > INT_MAX) {
			error = EOVERFLOW;

			goto error;
		}

		lowat = (int)lim;

		if (0 != setsockopt(so->fd, SOL_SOCKET, SO_RCVLOWAT, &lowat, sizeof lowat))
			goto soerr;

		so->todo |= SO_S_RSTLOWAT;
	}

	so->events |= POLLIN;

	*_error = SO_EAGAIN;

	return 0;
soerr:
	error = so_soerr();

	switch (error) {
	case SO_EINTR:
		goto retry;
#if SO_EWOULDBLOCK != SO_EAGAIN
	case SO_EWOULDBLOCK:
		/* FALL THROUGH */
#endif
	case SO_EAGAIN:
		if (flags & SO_F_PEEKALL)
			goto pollin;

		break;
	} /* switch() */
error:
	*_error = error;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movl 0xb8(%rdi), %eax
movl %eax, %ebx
andl $0x200, %ebx            # imm = 0x200
andl $0xfffffdff, %eax       # imm = 0xFFFFFDFF
movl %eax, 0xb8(%rdi)
callq 0x24162
orl %ebx, 0xb8(%r14)
testl %eax, %eax
jne 0x2596f
testb $0x1, %bpl
je 0x258aa
andb $-0x2, 0xb0(%r14)
leaq 0xc0(%r14), %r13
leaq 0x8(%rsp), %rbx
movl 0x58(%r14), %edi
movq %r12, %rsi
movq %r15, %rdx
movl $0x2, %ecx
callq 0xf440
cmpq $-0x1, %rax
je 0x258e4
testb $0x1, %bpl
je 0x25978
cmpq %r15, %rax
jne 0x258fb
jmp 0x25978
callq 0xf0a0
movl (%rax), %eax
cmpl $0x4, %eax
je 0x258b6
cmpl $0xb, %eax
jne 0x2596f
testb $0x1, %bpl
je 0x2596a
testb $0x2, 0xb9(%r14)
jne 0x25962
movl 0x58(%r14), %edi
movl $0x4, 0x8(%rsp)
movl $0x1, %esi
movl $0x12, %edx
movq %r13, %rcx
movq %rbx, %r8
callq 0xf9a0
testl %eax, %eax
jne 0x258e4
cmpq $0x7fffffff, %r15       # imm = 0x7FFFFFFF
ja 0x25987
movl %r15d, 0xc(%rsp)
movl 0x58(%r14), %edi
movl $0x1, %esi
movl $0x12, %edx
leaq 0xc(%rsp), %rcx
movl $0x4, %r8d
callq 0x10820
testl %eax, %eax
jne 0x258e4
orb $0x2, 0xb9(%r14)
orb $0x1, 0xb0(%r14)
movl $0xb, %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4b, %eax
jmp 0x2596f
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_sendmsg
int so_sendmsg(struct socket *so, const struct msghdr *msg, int flags) {
	ssize_t count;
	int error;

	so_pipeign(so, 0);

	so->todo |= SO_S_SETWRITE;

	if ((error = so_exec(so)))
		goto error;

	so->events &= ~POLLOUT;

#if defined MSG_NOSIGNAL
	if (so->opts.fd_nosigpipe)
		flags |= MSG_NOSIGNAL;
#endif

retry:
	if (-1 == (count = sendmsg(so->fd, msg, flags)))
		goto syerr;

	st_update(&so->st.sent, count, &so->opts);

	so_pipeok(so, 0);

	return 0;
syerr:
	error = errno;
error:
	switch (error) {
	case SO_EINTR:
		goto retry;
#if SO_EWOULDBLOCK != SO_EAGAIN
	case SO_EWOULDBLOCK:
		/* FALL THROUGH */
#endif
	case SO_EAGAIN:
		so->events |= POLLOUT;

		break;
	} /* switch() */

	so_pipeok(so, 0);

	return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
callq 0x24fd1
orb $0x1, 0xb9(%rbx)
movq %rbx, %rdi
callq 0x24162
testl %eax, %eax
je 0x259bc
movl %eax, %r15d
jmp 0x259ec
andb $-0x5, 0xb0(%rbx)
movl %ebp, %eax
orl $0x4000, %eax           # imm = 0x4000
cmpb $0x0, 0x1e(%rbx)
cmovnel %eax, %ebp
movl 0x58(%rbx), %edi
movq %r14, %rsi
movl %ebp, %edx
callq 0xfa40
cmpq $-0x1, %rax
jne 0x25a01
callq 0xf0a0
movl (%rax), %r15d
cmpl $0x4, %r15d
je 0x259d1
cmpl $0xb, %r15d
jne 0x25a29
orb $0x4, 0xb0(%rbx)
jmp 0x25a29
addq 0x70(%rbx), %rax
movq $-0x1, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x70(%rbx)
xorl %r15d, %r15d
cmpb $0x1, 0x48(%rbx)
jne 0x25a29
leaq 0x80(%rbx), %rdi
callq 0xfc20
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2546f
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_recvmsg
int so_recvmsg(struct socket *so, struct msghdr *msg, int flags) {
	ssize_t count;
	int error;

	so_pipeign(so, 1);

	so->todo |= SO_S_SETREAD;

	if ((error = so_exec(so)))
		goto error;

	so->events &= ~POLLIN;
retry:
	if (-1 == (count = recvmsg(so->fd, msg, flags))) {
		goto syerr;
	} else if (!count) {
		so->st.rcvd.eof = 1;
		error = EPIPE;
		goto error;
	}

	st_update(&so->st.rcvd, count, &so->opts);

	/* RE .msg_iovlen type
	 *
	 * 	- Linux    : size_t
	 * 	- OS X     : int
	 * 	- OpenBSD  : unsigned int
	 * 	- Solaris  : int
	 * 	- FreeBSD  : int
	 * 	- NetBSD   : int
	 * 	- RFC 2292 : size_t
	 */
	for (size_t i = 0; i < (size_t)msg->msg_iovlen; i++) {
		if ((size_t)count < msg->msg_iov[i].iov_len) {
			msg->msg_iov[i].iov_len = count;

			break;
		} else {
			count -= (ssize_t)msg->msg_iov[i].iov_len;
		}
	}

	so_pipeok(so, 1);

	return 0;
syerr:
	error = errno;
error:
	switch (error) {
	case SO_EINTR:
		goto retry;
#if SO_EWOULDBLOCK != SO_EAGAIN
	case SO_EWOULDBLOCK:
		/* FALL THROUGH */
#endif
	case SO_EAGAIN:
		so->events |= POLLIN;

		break;
	} /* switch() */

	so_pipeok(so, 1);

	return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, %esi
callq 0x24fd1
orb $-0x80, 0xb8(%rbx)
movq %rbx, %rdi
callq 0x24162
movl %eax, %ebp
testl %eax, %eax
jne 0x25aa9
andb $-0x2, 0xb0(%rbx)
movl 0x58(%rbx), %edi
movq %r14, %rsi
movl %r15d, %edx
callq 0xf380
cmpq $-0x1, %rax
je 0x25aa2
movq %rax, %r12
testq %rax, %rax
jne 0x25ad2
movb $0x1, 0x90(%rbx)
movl $0x20, %ebp
jmp 0x25aa9
callq 0xf0a0
movl (%rax), %ebp
cmpl $0x4, %ebp
je 0x25a78
cmpl $0xb, %ebp
jne 0x25aba
orb $0x1, 0xb0(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2546f
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x88(%rbx), %rax
addq %r12, %rax
movq $-0x1, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x88(%rbx)
cmpb $0x1, 0x48(%rbx)
jne 0x25b00
leaq 0x98(%rbx), %rdi
callq 0xfc20
movq 0x18(%r14), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0x25aba
movq 0x10(%r14), %rcx
addq $0x8, %rcx
movq %r12, %rdx
subq (%rcx), %rdx
jb 0x25b29
addq $0x10, %rcx
movq %rdx, %r12
decq %rax
jne 0x25b16
jmp 0x25aba
movq %r12, (%rcx)
jmp 0x25aba
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_pollfd
static inline int so_state(const struct socket *so) {
	if (so->todo & ~so->done) {
		int i = 1;

		while (i < SO_S_END && !(i & (so->todo & ~so->done)))
			i <<= 1;

		return (i < SO_S_END)? i : 0;
	} else
		return 0;
}

// Assembly:
movl 0xb4(%rdi), %eax
notl %eax
andl 0xb8(%rdi), %eax
je 0x25b99
movl $0x1, %ecx
testl %eax, %ecx
jne 0x25b8b
addl %ecx, %ecx
cmpl $0x801, %ecx            # imm = 0x801
jl 0x25b7b
xorl %ecx, %ecx
cmpl $0x2, %ecx
jne 0x25b99
movq 0x50(%rdi), %rdi
jmp 0xf130
movl 0x58(%rdi), %eax
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_peereid
int so_peereid(struct socket *so, uid_t *uid, gid_t *gid) {
	int error;

	if ((error = so_loadcred(so)))
		return error;

	if (so->cred.uid == (uid_t)-1)
		return EOPNOTSUPP;

	if (uid)
		*uid = so->cred.uid;
	if (gid)
		*gid = so->cred.gid;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x25c62
testl %eax, %eax
je 0x25c35
popq %rbx
popq %r14
popq %r15
retq
movl 0x214(%r14), %eax
cmpl $-0x1, %eax
je 0x25c5b
testq %r15, %r15
je 0x25c49
movl %eax, (%r15)
xorl %eax, %eax
testq %rbx, %rbx
je 0x25c2f
movl 0x218(%r14), %ecx
movl %ecx, (%rbx)
jmp 0x25c2f
movl $0x5f, %eax
jmp 0x25c2f
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_peerpid
int so_peerpid(struct socket *so, pid_t *pid) {
	int error;

	if ((error = so_loadcred(so)))
		return error;

	if (so->cred.pid == (pid_t)-1)
		return EOPNOTSUPP;

	if (pid)
		*pid = so->cred.pid;

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x25c62
testl %eax, %eax
je 0x25ce4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl 0x210(%r14), %ecx
cmpl $-0x1, %ecx
je 0x25cfb
xorl %eax, %eax
testq %rbx, %rbx
je 0x25cdc
movl %ecx, (%rbx)
jmp 0x25cdc
movl $0x5f, %eax
jmp 0x25cdc
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: bio_methods_init
static void bio_methods_init(void) {
	int type = BIO_get_new_index();
	if (type == -1)
		return;

	bio_methods = BIO_meth_new(type|BIO_TYPE_SOURCE_SINK, "struct socket*");
	if (bio_methods == NULL)
		return;

	BIO_meth_set_write(bio_methods, bio_write);
	BIO_meth_set_read(bio_methods, bio_read);
	BIO_meth_set_puts(bio_methods, bio_puts);
	BIO_meth_set_ctrl(bio_methods, bio_ctrl);
	BIO_meth_set_create(bio_methods, bio_create);
	BIO_meth_set_destroy(bio_methods, bio_destroy);
}

// Assembly:
pushq %rax
callq 0x10140
cmpl $-0x1, %eax
je 0x25e20
orl $0x400, %eax            # imm = 0x400
leaq 0x10bec(%rip), %rsi     # 0x3698a
movl %eax, %edi
callq 0xf8d0
movq %rax, 0x22894(%rip)     # 0x48640
testq %rax, %rax
je 0x25e20
leaq 0x6a(%rip), %rsi        # 0x25e22
movq %rax, %rdi
callq 0x107c0
movq 0x22879(%rip), %rdi     # 0x48640
leaq 0x135(%rip), %rsi       # 0x25f03
callq 0xfe60
movq 0x22866(%rip), %rdi     # 0x48640
leaq 0x255(%rip), %rsi       # 0x26036
callq 0xffb0
movq 0x22853(%rip), %rdi     # 0x48640
leaq 0x272(%rip), %rsi       # 0x26066
callq 0x10a50
movq 0x22840(%rip), %rdi     # 0x48640
leaq 0x298(%rip), %rsi       # 0x2609f
callq 0xf490
movq 0x2282d(%rip), %rdi     # 0x48640
leaq 0x2ab(%rip), %rsi       # 0x260c5
popq %rax
jmp 0xfed0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: bio_write
static int bio_write(BIO *bio, const char *src, int len) {
	struct socket *so = BIO_get_data(bio);
	size_t count;

	assert(so);
	assert(len >= 0);

	BIO_clear_retry_flags(bio);
	so->bio.error = 0;

	if ((count = so_syswrite(so, src, len, &so->bio.error)))
		return (int)count;

	if (bio_nonfatal(so->bio.error))
		BIO_set_retry_write(bio);

	/*
	 * SSL_get_error will return SSL_ERROR_SYSCALL, expecting errno to
	 * be set.
	 */
	errno = so->bio.error;

	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
callq 0x108f0
testq %rax, %rax
je 0x25ec5
testl %ebp, %ebp
js 0x25ee4
movq %rax, %rbx
movq %rax, %r12
movq %r14, %rdi
movl $0xf, %esi
callq 0x104d0
addq $0xe8, %rbx
movl $0x0, 0xe8(%r12)
movl %ebp, %edx
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x2577c
testq %rax, %rax
jne 0x25ebc
movl (%rbx), %eax
leal -0x6b(%rax), %ecx
cmpl $0x8, %ecx
ja 0x25e97
movl $0x181, %edx            # imm = 0x181
btl %ecx, %edx
jb 0x25ea1
cmpl $0xb, %eax
je 0x25ea1
cmpl $0x4, %eax
jne 0x25eae
movq %r14, %rdi
movl $0xa, %esi
callq 0xf170
movl (%rbx), %ebx
callq 0xf0a0
movl %ebx, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10acd(%rip), %rdi     # 0x36999
leaq 0x10a4b(%rip), %rsi     # 0x3691e
leaq 0x10ac2(%rip), %rcx     # 0x3699c
movl $0x9a2, %edx            # imm = 0x9A2
callq 0xf890
leaq 0x10ad9(%rip), %rdi     # 0x369c4
leaq 0x10a2c(%rip), %rsi     # 0x3691e
leaq 0x10aa3(%rip), %rcx     # 0x3699c
movl $0x9a3, %edx            # imm = 0x9A3
callq 0xf890
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: bio_read
static int bio_read(BIO *bio, char *dst, int lim) {
	struct socket *so = BIO_get_data(bio);
	size_t count;

	assert(so);
	assert(lim >= 0);

	BIO_clear_retry_flags(bio);
	so->bio.error = 0;

	if (so->bio.ahead.p < so->bio.ahead.pe) {
		count = SO_MIN(so->bio.ahead.pe - so->bio.ahead.p, lim);
		memcpy(dst, so->bio.ahead.p, count);
		so->bio.ahead.p += count;

		return count;
	}

	if ((count = so_sysread(so, dst, lim, &so->bio.error)))
		return (int)count;

	if (bio_nonfatal(so->bio.error))
		BIO_set_retry_read(bio);

	/* see note about SSL_ERROR_SYSCALL at bio_write */
	errno = so->bio.error;

	return (so->bio.error == EPIPE)? 0 : -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x108f0
testq %rax, %rax
je 0x25ff8
testl %ebp, %ebp
js 0x26017
movq %rax, %r12
movq %rbx, %rdi
movl $0xf, %esi
callq 0x104d0
movl $0x0, 0xe8(%r12)
movq 0xf8(%r12), %rsi
movq 0x100(%r12), %r13
cmpq %r13, %rsi
jae 0x25f7e
subq %rsi, %r13
movl %ebp, %eax
cmpq %rax, %r13
cmovgeq %rax, %r13
movq %r15, %rdi
movq %r13, %rdx
callq 0xfa60
addq %r13, 0xf8(%r12)
jmp 0x25fe6
movq %r12, %r14
addq $0xe8, %r14
movl %ebp, %edx
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x2512b
testq %rax, %rax
je 0x25fa2
movq %rax, %r13
jmp 0x25fe6
movl (%r14), %eax
leal -0x6b(%rax), %ecx
cmpl $0x8, %ecx
ja 0x25fb7
movl $0x181, %edx            # imm = 0x181
btl %ecx, %edx
jb 0x25fc1
cmpl $0xb, %eax
je 0x25fc1
cmpl $0x4, %eax
jne 0x25fce
movq %rbx, %rdi
movl $0x9, %esi
callq 0xf170
movl (%r14), %ebx
callq 0xf0a0
movl %ebx, (%rax)
xorl %r13d, %r13d
cmpl $0x20, (%r14)
setne %r13b
negl %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1099a(%rip), %rdi     # 0x36999
leaq 0x10918(%rip), %rsi     # 0x3691e
leaq 0x109c0(%rip), %rcx     # 0x369cd
movl $0x984, %edx            # imm = 0x984
callq 0xf890
leaq 0x109d0(%rip), %rdi     # 0x369ee
leaq 0x108f9(%rip), %rsi     # 0x3691e
leaq 0x109a1(%rip), %rcx     # 0x369cd
movl $0x985, %edx            # imm = 0x985
callq 0xf890
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: bio_create
static int bio_create(BIO *bio) {
	BIO_set_init(bio, 0);
	BIO_set_shutdown(bio, 0);
	BIO_set_data(bio, NULL);

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0xf820
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10770
movq %rbx, %rdi
xorl %esi, %esi
callq 0xfe10
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_dump
static void so_dump(const unsigned char *src, size_t len, FILE *fp) {
	static const unsigned char hex[] = "0123456789abcdef";
	static const unsigned char tmp[] = "                                                            |                |\n";
	unsigned char ln[sizeof tmp];
	const unsigned char *p, *pe;
	unsigned char *h, *g;
	unsigned i, n;

	p  = src;
	pe = p + len;

	while (p < pe) {
		memcpy(ln, tmp, sizeof ln);

		h = &ln[2];
		g = &ln[61];

		n = p - src;
		h[0] = hex[0x0f & (n >> 20)];
		h[1] = hex[0x0f & (n >> 16)];
		h[2] = hex[0x0f & (n >> 12)];
		h[3] = hex[0x0f & (n >> 8)];
		h[4] = hex[0x0f & (n >> 4)];
		h[5] = hex[0x0f & (n >> 0)];
		h += 8;

		for (n = 0; n < 2; n++) {
			for (i = 0; i < 8 && pe - p > 0; i++, p++) {
				h[0] = hex[0x0f & (*p >> 4)];
				h[1] = hex[0x0f & (*p >> 0)];
				h += 3;

				*g++ = (isgraph(*p))? *p : '.';
			}

			h++;
		}

		fputs((char *)ln, fp);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, 0x10(%rsp)
movq %rdi, (%rsp)
testq %rsi, %rsi
jle 0x2624e
movq (%rsp), %r14
leaq (%r14,%rsi), %rax
movq %rax, 0x8(%rsp)
leaq (%rsi,%r14), %rax
decq %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %r12
leaq 0x10970(%rip), %r15     # 0x36aa0
movl $0x2e, %ebx
movl $0xa, %ecx
movq %r12, %rdi
leaq 0x1097c(%rip), %rsi     # 0x36ac0
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rax
subq (%rsp), %rax
movl %eax, %ecx
shrl $0x14, %ecx
andl $0xf, %ecx
movb (%rcx,%r15), %cl
movb %cl, 0x22(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
andl $0xf, %ecx
movb (%rcx,%r15), %cl
movb %cl, 0x23(%rsp)
movl %eax, %ecx
shrl $0xc, %ecx
andl $0xf, %ecx
movb (%rcx,%r15), %cl
movb %cl, 0x24(%rsp)
movl %eax, %ecx
shrl $0x8, %ecx
andl $0xf, %ecx
movb (%rcx,%r15), %cl
movb %cl, 0x25(%rsp)
movl %eax, %ecx
shrl $0x4, %ecx
andl $0xf, %ecx
movb (%rcx,%r15), %cl
movb %cl, 0x26(%rsp)
andl $0xf, %eax
movb (%rax,%r15), %al
movb %al, 0x27(%rsp)
xorl %ebp, %ebp
leaq 0x5d(%rsp), %r12
leaq 0x2a(%rsp), %r13
movq 0x8(%rsp), %rax
subq %r14, %rax
testq %rax, %rax
jle 0x26225
callq 0xfe30
movq 0x18(%rsp), %rdx
subq %r14, %rdx
xorl %ecx, %ecx
movzbl (%r14,%rcx), %esi
shrl $0x4, %esi
movb (%rsi,%r15), %sil
movb %sil, (%r13)
movzbl (%r14,%rcx), %esi
andl $0xf, %esi
movb (%rsi,%r15), %sil
movb %sil, 0x1(%r13)
addq $0x3, %r13
movq (%rax), %rsi
movzbl (%r14,%rcx), %edi
cmpw $0x0, (%rsi,%rdi,2)
cmovnsl %ebx, %edi
movb %dil, (%r12,%rcx)
movl %ecx, %esi
incq %rcx
cmpl $0x6, %esi
ja 0x2621f
leaq -0x1(%rdx), %rsi
testq %rdx, %rdx
movq %rsi, %rdx
jg 0x261d1
addq %rcx, %r12
addq %rcx, %r14
incq %r13
leal 0x1(%rbp), %eax
testl %ebp, %ebp
movl %eax, %ebp
je 0x261b5
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %rsi
callq 0xfea0
cmpq 0x8(%rsp), %r14
jb 0x26135
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/dns.c
// Function: dns_random_
static unsigned dns_random_(void) {
#if DNS_RANDOM_OPENSSL
	unsigned r;
	_Bool ok;

	ok = (1 == RAND_bytes((unsigned char *)&r, sizeof r));
	assert(ok && "1 == RAND_bytes()");

	return r;
#else
	return DNS_RANDOM();
#endif
}

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rdi
movl $0x4, %esi
callq 0x103c0
cmpl $0x1, %eax
jne 0x262c6
movl 0x4(%rsp), %eax
popq %rcx
retq
leaq 0x12f0b(%rip), %rdi     # 0x391d8
leaq 0x12be9(%rip), %rsi     # 0x38ebd
leaq 0x12f17(%rip), %rcx     # 0x391f2
movl $0x1ca, %edx            # imm = 0x1CA
callq 0xf890
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/dns.c
// Function: dns_strlcpy
size_t dns_strlcpy(char *dst, const char *src, size_t lim) {
	char *d		= dst;
	char *e		= &dst[lim];
	const char *s	= src;

	if (d < e) {
		do {
			if ('\0' == (*d++ = *s++))
				return s - src - 1;
		} while (d < e);

		d[-1]	= '\0';
	}

	while (*s++ != '\0')
		;;

	return s - src - 1;
}

// Assembly:
movq %rsi, %rax
movq %rsi, %rcx
testq %rdx, %rdx
jle 0x26310
addq %rdi, %rdx
movq %rax, %rcx
movb (%rcx), %sil
movb %sil, (%rdi)
incq %rcx
testb %sil, %sil
je 0x2631e
incq %rdi
cmpq %rdx, %rdi
jb 0x262f6
movb $0x0, -0x1(%rdi)
leaq 0x1(%rcx), %rdx
cmpb $0x0, (%rcx)
movq %rdx, %rcx
jne 0x26310
jmp 0x26321
movq %rcx, %rdx
notq %rax
addq %rdx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/dns.c
// Function: dns_strlcat
size_t dns_strlcat(char *dst, const char *src, size_t lim) {
	char *d = memchr(dst, '\0', lim);
	char *e = &dst[lim];
	const char *s = src;
	const char *p;

	if (d && d < e) {
		do {
			if ('\0' == (*d++ = *s++))
				return d - dst - 1;
		} while (d < e);

		d[-1] = '\0';
	}

	p = s;

	while (*s++ != '\0')
		;;

	return lim + (s - p - 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
xorl %esi, %esi
callq 0xfe90
movq %rax, %rcx
leaq (%r15,%r14), %rdx
testq %rax, %rax
setne %al
cmpq %rdx, %rcx
setb %sil
andb %al, %sil
cmpb $0x1, %sil
jne 0x2637d
movq %rcx, %rax
subq %r15, %rax
movb (%rbx), %sil
movb %sil, (%rcx)
testb %sil, %sil
je 0x2638f
incq %rcx
incq %rbx
incq %rax
cmpq %rdx, %rcx
jb 0x26360
movb $0x0, -0x1(%rcx)
decq %r14
movq %r14, %rax
incq %rax
cmpb $0x0, (%rbx)
leaq 0x1(%rbx), %rbx
jne 0x26383
popq %rbx
popq %r14
popq %r15
retq