LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/dns.c
// Function: res_prep
static struct resolver *res_prep(lua_State *L) {
	struct resolver *R = lua_newuserdata(L, sizeof *R);

	R->res = 0;

#if defined LUA_RIDX_MAINTHREAD
	lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_MAINTHREAD);
	R->mainthread = lua_tothread(L, -1);
	lua_pop(L, 1);
#else
	R->mainthread = 0;
#endif

	luaL_setmetatable(L, RESOLVER_CLASS);

	return R;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0xfbe0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movl $0x1, %edx
callq 0xf4a0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf4b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x107f0
movq -0x8(%rbp), %rdi
leaq 0x1dc06(%rip), %rsi     # 0x49424
callq 0x10340
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/dns.c
// Function: res_closefd
static int res_closefd(int *fd, void *arg) {
	struct resolver *R = arg;

	if (R->mainthread) {
		cqs_cancelfd(R->mainthread, *fd);
		cqs_closefd(fd);
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2b86f
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %esi
callq 0xfd10
movq -0x8(%rbp), %rdi
callq 0x2b880
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/dns.c
// Function: dnsL_version
static int dnsL_version(lua_State *L) {
	lua_pushinteger(L, dns_v_rel());
	lua_pushinteger(L, dns_v_abi());
	lua_pushinteger(L, dns_v_api());

	return 3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x105d0
movq -0x20(%rbp), %rdi
movslq %eax, %rsi
callq 0xf9a0
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x10940
movq -0x18(%rbp), %rdi
movslq %eax, %rsi
callq 0xf9a0
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
callq 0x10410
movq -0x10(%rbp), %rdi
movslq %eax, %rsi
callq 0xf9a0
movl $0x3, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/dns.c
// Function: dnsL_random
static int dnsL_random(lua_State *L) {
	lua_Number modn = luaL_optnumber(L, 1, UINT_MAX + 1.0);

	if (modn >= (UINT_MAX + 1.0)) {
		lua_pushnumber(L, dns_random());
	} else {
		unsigned n = (unsigned)modn;
		unsigned r, min;

		luaL_argcheck(L, n > 1, 1, lua_pushfstring(L, "[0, %d): interval is empty", (int)n));

		min = -n % n;

		for (;;) {
			r = dns_random();

			if (r >= min)
				break;
		}

		lua_pushinteger(L, r % n);
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
movsd 0x1d99b(%rip), %xmm0    # 0x492d8
callq 0xf800
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x1d984(%rip), %xmm1    # 0x492d8
ucomisd %xmm1, %xmm0
jb 0x2b981
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x10700
movq (%rax), %rax
callq *%rax
movq -0x28(%rbp), %rdi
movl %eax, %eax
cvtsi2sd %rax, %xmm0
callq 0xf300
jmp 0x2ba07
cvttsd2si -0x10(%rbp), %rax
movl %eax, -0x14(%rbp)
movb $0x1, %al
cmpl $0x1, -0x14(%rbp)
movb %al, -0x29(%rbp)
ja 0x2b9cc
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq 0x1dd7a(%rip), %rsi     # 0x49725
movb $0x0, %al
callq 0x10130
movq -0x38(%rbp), %rdi
movq %rax, %rdx
movl $0x1, %esi
callq 0xf440
cmpl $0x0, %eax
setne %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
xorl %eax, %eax
subl -0x14(%rbp), %eax
xorl %edx, %edx
divl -0x14(%rbp)
movl %edx, -0x1c(%rbp)
callq 0x10700
callq *(%rax)
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jb 0x2b9f0
jmp 0x2b9f2
jmp 0x2b9dc
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %eax
xorl %edx, %edx
divl -0x14(%rbp)
movl %edx, %eax
movl %eax, %esi
callq 0xf9a0
movl $0x1, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_strerror
const char *so_strerror(int error) {
	static const char *errlist[] = {
		[SO_EOPENSSL - SO_ERRNO0] = "TLS/SSL error",
		[SO_EX509INT - SO_ERRNO0] = "X.509 certificate lookup interrupt",
		[SO_ENOTVRFD - SO_ERRNO0] = "Absent or unverified peer certificate",
		[SO_ECLOSURE - SO_ERRNO0] = "Peers elected to shutdown secure transport",
		[SO_ENOHOST - SO_ERRNO0]  = "No host address available to complete operation",
	};

	if (error >= 0)
		return strerror(error);

	if (error == SO_EOPENSSL) {
#if SO_THREAD_SAFE && (!defined __NetBSD__ || __NetBSD_Version__ > 600000000)
		static __thread char sslstr[256];
#else
		static char sslstr[256];
#endif
		unsigned long code = ERR_peek_last_error();

		if (!code)
			return "Unknown TLS/SSL error";

		ERR_error_string_n(code, sslstr, sizeof sslstr);

		return sslstr;
	} else {
		int index = error - SO_ERRNO0;

		if (index >= 0 && index < (int)countof(errlist) && errlist[index])
			return errlist[index];
		else
			return "Unknown socket error";
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x2ba82
movl -0xc(%rbp), %edi
callq 0xf4c0
movq %rax, -0x8(%rbp)
jmp 0x2bb36
cmpl $0x8c9c94c7, -0xc(%rbp) # imm = 0x8C9C94C7
jne 0x2baed
callq 0xf080
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x2baab
leaq 0x1e16d(%rip), %rax     # 0x49c0f
movq %rax, -0x8(%rbp)
jmp 0x2bb36
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0x3048e(%rip), %rdi     # 0x5bf48
callq 0x10900
movq -0x28(%rbp), %rdi
leaq (%rax), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x10820
leaq 0x3046d(%rip), %rdi     # 0x5bf48
callq 0x10900
leaq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x2bb36
movl -0xc(%rbp), %eax
subl $0x8c9c94c7, %eax       # imm = 0x8C9C94C7
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x2bb2b
cmpl $0x5, -0x1c(%rbp)
jge 0x2bb2b
movslq -0x1c(%rbp), %rcx
leaq 0x318c1(%rip), %rax     # 0x5d3d0
cmpq $0x0, (%rax,%rcx,8)
je 0x2bb2b
movslq -0x1c(%rbp), %rcx
leaq 0x318af(%rip), %rax     # 0x5d3d0
movq (%rax,%rcx,8), %rax
movq %rax, -0x8(%rbp)
jmp 0x2bb36
leaq 0x1e0f3(%rip), %rax     # 0x49c25
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: sa_pton
void *sa_pton(void *dst, size_t lim, const char *src, const void *def, int *_error) {
	union sockaddr_any family[] = { { { .sa_family = AF_INET } }, { { .sa_family = AF_INET6 } } }, *fp;
	int error;

	memset(dst, 0, lim);

	for (fp = family; fp < endof(family); fp++) {
		switch (inet_pton(*sa_family(fp), src, sa_addr(fp, NULL, NULL))) {
		case -1:
			goto syerr;
		case 1:
			if (lim < sa_len(fp)) {
				error = ENOSPC;

				goto error;
			}

			memcpy(dst, fp, sa_len(fp));

			return dst;
		}
	}

	error = EAFNOSUPPORT;

	goto error;
syerr:
	error = so_syerr();
error:
	if (_error)
		*_error = error;

	return (void *)def;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
leaq -0x130(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0xf7d0
movw $0x2, -0x130(%rbp)
movw $0xa, -0xb0(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0xf7d0
leaq -0x130(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rax
leaq -0x130(%rbp), %rcx
addq $0x100, %rcx            # imm = 0x100
cmpq %rcx, %rax
jae 0x2befa
movq -0x138(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rdi
callq 0x2bd10
movzwl (%rax), %eax
movl %eax, -0x174(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x2bf40
movl -0x174(%rbp), %edi
movq -0x170(%rbp), %rsi
movq %rax, %rdx
callq 0x10b60
movl %eax, %ecx
movl %ecx, -0x164(%rbp)
subl $-0x1, %eax
je 0x2be42
jmp 0x2be32
movl -0x164(%rbp), %eax
subl $0x1, %eax
je 0x2be47
jmp 0x2bedf
jmp 0x2bf06
movq -0x18(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rdi
callq 0x2c000
movl %eax, %ecx
movq -0x180(%rbp), %rax
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x2be8b
movl $0x1c, -0x13c(%rbp)
jmp 0x2bf13
movq -0x10(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rdi
callq 0x2c000
movq -0x190(%rbp), %rdi
movq -0x188(%rbp), %rsi
movl %eax, %eax
movl %eax, %edx
callq 0xfb40
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2bf2e
jmp 0x2bee1
movq -0x138(%rbp), %rax
addq $0x80, %rax
movq %rax, -0x138(%rbp)
jmp 0x2bda1
movl $0x61, -0x13c(%rbp)
jmp 0x2bf13
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x13c(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x2bf26
movl -0x13c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.h
// Function: sa_addr
static inline void *(sa_addr)(sockaddr_arg_t arg, const void *def, int *error) {
	switch (*sa_family(arg)) {
	case AF_INET:
		return &sockaddr_ref(arg).sin->sin_addr;
	case AF_INET6:
		return &sockaddr_ref(arg).sin6->sin6_addr;
#if SA_UNIX
	case AF_UNIX:
		return &sockaddr_ref(arg).sun->sun_path;
#endif
	default:
		if (error)
			*error = EAFNOSUPPORT;

		return (void *)def;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2bd10
movzwl (%rax), %eax
movl %eax, -0x3c(%rbp)
subl $0x1, %eax
je 0x2bfb4
jmp 0x2bf6a
movl -0x3c(%rbp), %eax
subl $0x2, %eax
je 0x2bf7e
jmp 0x2bf74
movl -0x3c(%rbp), %eax
subl $0xa, %eax
je 0x2bf99
jmp 0x2bfcf
movq -0x10(%rbp), %rdi
callq 0x2c450
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
jmp 0x2bfe8
movq -0x10(%rbp), %rdi
callq 0x2c450
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
jmp 0x2bfe8
movq -0x10(%rbp), %rdi
callq 0x2c450
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x8(%rbp)
jmp 0x2bfe8
cmpq $0x0, -0x20(%rbp)
je 0x2bfe0
movq -0x20(%rbp), %rax
movl $0x61, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_cloexec
int so_cloexec(int fd, _Bool cloexec) {
#if _WIN32
	return 0;
#else
	if (-1 == fcntl(fd, F_SETFD, cloexec))
		return so_syerr();

	return 0;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movl %edi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movl -0x8(%rbp), %edi
movb -0x9(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
movl $0x2, %esi
movb $0x0, %al
callq 0xf830
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x2c3d1
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2c3d8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_closesocket
void so_closesocket(int *fd, const struct so_options *opts) {
	if (opts && opts->fd_close.cb)
		opts->fd_close.cb(fd, opts->fd_close.arg);

	if (*fd != -1) {
#if _WIN32
		closesocket(*fd);
#else
		close(*fd);
#endif

		*fd = -1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2c428
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x2c428
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rsi
callq *%rax
movq -0x8(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x2c446
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x10c10
movq -0x8(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_socket
int so_socket(int domain, int type, const struct so_options *opts, int *_error) {
	int error, fd, flags, mask, need;

#if defined SOCK_CLOEXEC
	if (-1 == (fd = socket(domain, type|SOCK_CLOEXEC, 0)))
		goto syerr;
#else
	if (-1 == (fd = socket(domain, type, 0)))
		goto syerr;
#endif

	flags = so_opts2flags(opts, &mask);
	mask &= so_type2mask(S_IFSOCK, domain, type, 0);
	need = ~(SO_F_NODELAY|SO_F_NOPUSH|SO_F_NOSIGPIPE|SO_F_OOBINLINE);

	if ((error = so_setfl(fd, flags, mask, need)))
		goto error;

	return fd;
syerr:
	error = so_syerr();

	goto error;
error:
	*_error = error;

	so_closesocket(&fd, opts);

	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
orl $0x80000, %esi          # imm = 0x80000
xorl %edx, %edx
callq 0xf340
movl %eax, %ecx
movl %ecx, -0x28(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x2c539
jmp 0x2c58b
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2c5c0
movl %eax, -0x2c(%rbp)
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
movl $0xc000, %edi           # imm = 0xC000
xorl %ecx, %ecx
callq 0x2c6b0
andl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl $0xfffffd1f, -0x34(%rbp) # imm = 0xFFFFFD1F
movl -0x28(%rbp), %edi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x34(%rbp), %ecx
callq 0xfac0
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x2c583
jmp 0x2c595
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2c5b2
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0xf2f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_opts2flags
static int so_opts2flags(const struct so_options *opts, int *mask) {
	const struct flops *f;
	int flags = 0;

	*mask = 0;

	for (f = fltable; f < endof(fltable); f++) {
		if (f->offset == NO_OFFSET)
			continue;

		flags |= (*(_Bool *)((char *)opts + f->offset))? f->flag : 0;
		*mask |= f->flag;
	}

	switch (opts->sin_v6only) {
	case SO_V6ONLY_DEFAULT:
		break;
	case SO_V6ONLY_ENABLE:
		flags |= SO_F_V6ONLY;
		*mask |= SO_F_V6ONLY;
		break;
	case SO_V6ONLY_DISABLE:
		*mask |= SO_F_V6ONLY;
		break;
	}

	return flags;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
leaq 0x2f26c(%rip), %rax     # 0x5b850
movq %rax, -0x18(%rbp)
leaq 0x2f261(%rip), %rax     # 0x5b850
addq $0xf0, %rax
cmpq %rax, -0x18(%rbp)
jae 0x2c651
movq -0x18(%rbp), %rax
cmpq $-0x1, 0x10(%rax)
jne 0x2c608
jmp 0x2c643
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
testb $0x1, (%rax,%rcx)
je 0x2c625
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
jmp 0x2c62c
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0x2c62c
movl -0x20(%rbp), %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x18(%rbp)
jmp 0x2c5e8
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x24(%rbp)
testl %eax, %eax
je 0x2c675
jmp 0x2c661
movl -0x24(%rbp), %eax
subl $0x1, %eax
je 0x2c677
jmp 0x2c66b
movl -0x24(%rbp), %eax
subl $0x2, %eax
je 0x2c692
jmp 0x2c6a0
jmp 0x2c6a0
movl -0x1c(%rbp), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, (%rax)
jmp 0x2c6a0
movq -0x10(%rbp), %rax
movl (%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, (%rax)
movl -0x1c(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_type2mask
static int so_type2mask(mode_t mode, int family, int type, int protocol) {
	int mask = SO_F_CLOEXEC|SO_F_NONBLOCK|SO_F_NOSIGPIPE;

	if (S_ISSOCK(mode)) {
		mask |= SO_F_REUSEADDR|SO_F_REUSEPORT|SO_F_OOBINLINE;

		if (!protocol) {
			if (family == AF_INET || family == AF_INET6) {
				protocol = (type == SOCK_STREAM)? IPPROTO_TCP : IPPROTO_UDP;
			}
		}

		if (family == AF_INET6) {
			mask |= SO_F_V6ONLY;
		}

		if (type == SOCK_DGRAM) {
			mask |= SO_F_BROADCAST;
		}

		if (protocol == IPPROTO_TCP) {
			mask |= SO_F_NODELAY|SO_F_NOPUSH;
		}
	}

	return mask;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl $0x83, -0x14(%rbp)
movl -0x4(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xc000, %eax           # imm = 0xC000
jne 0x2c73c
movl -0x14(%rbp), %eax
orl $0x20c, %eax            # imm = 0x20C
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x2c70b
cmpl $0x2, -0x8(%rbp)
je 0x2c6f3
cmpl $0xa, -0x8(%rbp)
jne 0x2c709
movl -0xc(%rbp), %edx
movl $0x11, %eax
movl $0x6, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, -0x10(%rbp)
jmp 0x2c70b
cmpl $0xa, -0x8(%rbp)
jne 0x2c71c
movl -0x14(%rbp), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, -0x14(%rbp)
cmpl $0x2, -0xc(%rbp)
jne 0x2c72b
movl -0x14(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x14(%rbp)
cmpl $0x6, -0x10(%rbp)
jne 0x2c73a
movl -0x14(%rbp), %eax
orl $0x60, %eax
movl %eax, -0x14(%rbp)
jmp 0x2c73c
movl -0x14(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movl %edi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movb -0x9(%rbp), %dl
movl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %edi
movl $0x3, %esi
movb $0x0, %al
callq 0xf830
movl %eax, %ecx
movl %ecx, -0x10(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
je 0x2cadd
movl -0x8(%rbp), %edi
movl -0x14(%rbp), %edx
movl -0x10(%rbp), %eax
orl $0x800, %eax            # imm = 0x800
andl %eax, %edx
movl $0x4, %esi
movb $0x0, %al
callq 0xf830
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x2cae9
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2caf0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %cl, %al
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x18(%rbp)
leaq -0x18(%rbp), %rcx
movl $0x4, %r8d
callq 0x109f0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2cba9
callq 0xf0a0
movl (%rax), %eax
orl $0x4, %eax
subl $0x5c, %eax
je 0x2cb94
jmp 0x2cb9d
movl $0x5f, -0x4(%rbp)
jmp 0x2cbb0
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cbb0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movl %edi, -0x4(%rbp)
andb $0x1, %al
movb %al, -0x5(%rbp)
movl -0x4(%rbp), %edi
movb -0x5(%rbp), %al
movl $0x1, %esi
movl $0xf, %edx
andb $0x1, %al
movzbl %al, %ecx
callq 0x2cb40
movl %eax, -0xc(%rbp)
cmpl $0x5f, -0xc(%rbp)
jne 0x2cc03
testb $0x1, -0x5(%rbp)
jne 0x2cc03
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_getboolopt
static _Bool so_getboolopt(int fd, int lvl, int opt) {
	int val;

	if (0 != getsockopt(fd, lvl, opt, &val, &(socklen_t){ sizeof val }))
		return 0;

	return !!val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl $0x4, -0x18(%rbp)
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0xfa30
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2cf8c
movb $0x0, -0x1(%rbp)
jmp 0x2cf9c
cmpl $0x0, -0x14(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
leaq 0x2e880(%rip), %rax     # 0x5b850
movq %rax, -0x28(%rbp)
leaq 0x2e875(%rip), %rax     # 0x5b850
addq $0xf0, %rax
cmpq %rax, -0x28(%rbp)
jae 0x2d092
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl -0x18(%rbp), %eax
cmpl $0x0, %eax
jne 0x2cffe
jmp 0x2d081
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x8(%rbp), %edi
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
andl -0x14(%rbp), %ecx
cmpl $0x0, %ecx
setne %cl
xorb $-0x1, %cl
xorb $-0x1, %cl
movzbl %cl, %esi
andl $0x1, %esi
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x2d05d
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl -0x1c(%rbp), %eax
cmpl $0x0, %eax
jne 0x2d042
cmpl $0x5f, -0x2c(%rbp)
je 0x2d04a
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2d099
movq -0x28(%rbp), %rax
movl (%rax), %ecx
xorl $-0x1, %ecx
movq -0x10(%rbp), %rax
andl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x2d07f
movq -0x28(%rbp), %rax
movl (%rax), %ecx
xorl $-0x1, %ecx
movq -0x10(%rbp), %rax
andl (%rax), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movl (%rax), %ecx
andl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x2d081
movq -0x28(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x28(%rbp)
jmp 0x2cfd4
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x220, %edi            # imm = 0x220
callq 0x10260
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x2d359
jmp 0x2d428
movq -0x20(%rbp), %rdi
leaq 0x1c55c(%rip), %rsi     # 0x498c0
movl $0x220, %edx            # imm = 0x220
callq 0xfb40
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x50, %edx
callq 0xfb40
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2d3e5
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x2c000
movl %eax, %eax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x2d3b6
movq -0x18(%rbp), %rax
movl $0x61, (%rax)
jmp 0x2d435
movq -0x28(%rbp), %rdi
callq 0x10260
movq -0x20(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x2d3ce
jmp 0x2d428
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x28(%rbp), %rdx
callq 0xfb40
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x2d41e
movq -0x10(%rbp), %rax
movl $0x1, %ecx
cmpq %rcx, 0x40(%rax)
je 0x2d41e
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x10a90
movq -0x20(%rbp), %rcx
movq %rax, 0x40(%rcx)
cmpq $0x0, %rax
jne 0x2d41c
jmp 0x2d428
jmp 0x2d41e
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2d488
callq 0xf0a0
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x2d480
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x40(%rcx), %rax
je 0x2d45b
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x10060
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
je 0x2d477
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x10060
movq -0x20(%rbp), %rdi
callq 0x10060
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2d4bc
movl $0x16, -0x4(%rbp)
jmp 0x2d4d5
movq -0x10(%rbp), %rdi
callq 0x2d940
movq -0x10(%rbp), %rdi
callq 0x10060
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x2d330
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x2d513
jmp 0x2d632
movl $0xb0, %edi
callq 0x10260
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x2d52c
jmp 0x2d628
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0xf7d0
movq -0x30(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movzwl (%rax), %edi
callq 0x2d660
movl %eax, %eax
cmpq $0x80, %rax
jae 0x2d57a
movq -0x10(%rbp), %rax
movzwl (%rax), %edi
callq 0x2d660
movl %eax, %eax
movq %rax, -0x58(%rbp)
jmp 0x2d585
movl $0x80, %eax
movq %rax, -0x58(%rbp)
jmp 0x2d585
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rdx
callq 0xfb40
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0xa8(%rax)
movq -0x10(%rbp), %rax
movzwl (%rax), %ecx
movq -0x38(%rbp), %rax
movq 0xa8(%rax), %rax
movl %ecx, 0x4(%rax)
movl -0x14(%rbp), %ecx
movq -0x38(%rbp), %rax
movq 0xa8(%rax), %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0xa8(%rax), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movzwl (%rax), %edi
callq 0x2d660
movl %eax, %ecx
movq -0x38(%rbp), %rax
movq 0xa8(%rax), %rax
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rcx
addq $0x30, %rcx
movq -0x38(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x38(%rbp), %rax
movl $0xc, 0xb8(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2d64c
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
callq 0xf470
movl -0x3c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.h
// Function: af_len
static inline socklen_t af_len(sa_family_t af) {
	switch (af) {
	case AF_INET:
		return sizeof (struct sockaddr_in);
	case AF_INET6:
		return sizeof (struct sockaddr_in6);
#if SA_UNIX
	case AF_UNIX:
		return sizeof (struct sockaddr_un);
#endif
	default:
		return 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x6(%rbp)
movzwl -0x6(%rbp), %eax
movl %eax, -0xc(%rbp)
subl $0x1, %eax
je 0x2d69f
jmp 0x2d679
movl -0xc(%rbp), %eax
subl $0x2, %eax
je 0x2d68d
jmp 0x2d683
movl -0xc(%rbp), %eax
subl $0xa, %eax
je 0x2d696
jmp 0x2d6a8
movl $0x10, -0x4(%rbp)
jmp 0x2d6af
movl $0x1c, -0x4(%rbp)
jmp 0x2d6af
movl $0x6e, -0x4(%rbp)
jmp 0x2d6af
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2d330
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x2d6ef
jmp 0x2d797
movl -0xc(%rbp), %edi
movq -0x28(%rbp), %rsi
addq $0x5c, %rsi
movq -0x28(%rbp), %rdx
addq $0x60, %rdx
movq -0x28(%rbp), %rcx
addq $0x64, %rcx
movq -0x28(%rbp), %r8
addq $0x68, %r8
callq 0x2d7c0
movl %eax, -0x38(%rbp)
cmpl $0x0, %eax
je 0x2d721
jmp 0x2d797
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2c5c0
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movl 0x5c(%rax), %edi
movq -0x28(%rbp), %rax
movl 0x60(%rax), %esi
movq -0x28(%rbp), %rax
movl 0x64(%rax), %edx
movq -0x28(%rbp), %rax
movl 0x68(%rax), %ecx
callq 0x2c6b0
andl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl $0xfffffd1f, -0x34(%rbp) # imm = 0xFFFFFD1F
movl -0xc(%rbp), %edi
movq -0x28(%rbp), %rsi
addq $0x6c, %rsi
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x34(%rbp), %r8d
callq 0x10b70
movl %eax, -0x38(%rbp)
cmpl $0x0, %eax
je 0x2d783
jmp 0x2d797
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2d7b1
movq -0x28(%rbp), %rdi
callq 0xf470
movl -0x38(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xd0, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl -0x8(%rbp), %edi
leaq -0xb8(%rbp), %rsi
callq 0x10890
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2d804
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2d92c
movl -0xa0(%rbp), %ecx
andl $0xf000, %ecx           # imm = 0xF000
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xc000, %eax           # imm = 0xC000
je 0x2d834
movl $0x0, -0x4(%rbp)
jmp 0x2d92c
movl -0x8(%rbp), %edi
movq -0x18(%rbp), %rcx
movl $0x4, -0xc0(%rbp)
movl $0x1, %esi
movl $0x27, %edx
leaq -0xc0(%rbp), %r8
callq 0xfa30
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2d8a3
callq 0xf0a0
cmpl $0x5c, (%rax)
je 0x2d87c
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2d92c
movl -0x8(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x30360
movl %eax, -0xbc(%rbp)
cmpl $0x0, %eax
je 0x2d8a1
movl -0xbc(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2d92c
jmp 0x2d8a3
movl -0x8(%rbp), %edi
movq -0x20(%rbp), %rcx
movl $0x4, -0xc4(%rbp)
movl $0x1, %esi
movl $0x3, %edx
leaq -0xc4(%rbp), %r8
callq 0xfa30
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2d8de
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2d92c
movl -0x8(%rbp), %edi
movq -0x28(%rbp), %rcx
movl $0x4, -0xc8(%rbp)
movl $0x1, %esi
movl $0x26, %edx
leaq -0xc8(%rbp), %r8
callq 0xfa30
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2d925
callq 0xf0a0
cmpl $0x5c, (%rax)
je 0x2d923
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2d92c
jmp 0x2d925
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_destroy
static int so_destroy(struct socket *so) {
	so_resetssl(so);

	dns_ai_close(so->res);
	so->res = NULL;

	free(so->host);
	so->host = NULL;

	so_closesocket(&so->fd, &so->opts);

	so->events = 0;

	if (so->opts.tls_sendname && so->opts.tls_sendname != SO_OPTS_TLS_HOSTNAME) {
		free((void *)so->opts.tls_sendname);
		so->opts.tls_sendname = NULL;
	}

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

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e460
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x10090
movq -0x8(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rdi
callq 0x10060
movq -0x8(%rbp), %rax
movq $0x0, 0xa8(%rax)
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
movq -0x8(%rbp), %rsi
callq 0xf2f0
movq -0x8(%rbp), %rax
movw $0x0, 0xb0(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x2d9de
movq -0x8(%rbp), %rax
movl $0x1, %ecx
cmpq %rcx, 0x40(%rax)
je 0x2d9de
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x10060
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x10060
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x80, -0x9c(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0x9c(%rbp), %rdx
callq 0x10200
movl %eax, -0xa0(%rbp)
cmpl $0x0, %eax
je 0x2da54
movl -0xa0(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2da74
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x2bd10
movzwl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2db00
cmpl $0x40, %eax
jge 0x2dabb
movq -0x10(%rbp), %rdi
callq 0x2dbb0
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x2dabb
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2daf2
movq -0x10(%rbp), %rax
movl 0x58(%rax), %edi
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rsi
callq 0xfd30
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2daeb
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2daf2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_state
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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0xb8(%rax), %eax
movq -0x10(%rbp), %rcx
movl 0xb4(%rcx), %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x2db97
movl $0x1, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x801, -0x14(%rbp)     # imm = 0x801
movb %al, -0x15(%rbp)
jge 0x2db64
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0xb8(%rcx), %ecx
movq -0x10(%rbp), %rdx
movl 0xb4(%rdx), %edx
xorl $-0x1, %edx
andl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
testb $0x1, %al
jne 0x2db6d
jmp 0x2db77
movl -0x14(%rbp), %eax
shll %eax
movl %eax, -0x14(%rbp)
jmp 0x2db2d
cmpl $0x801, -0x14(%rbp)     # imm = 0x801
jge 0x2db88
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x2db8f
xorl %eax, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2db8f
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2db9e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2db00
cmpl $0x40, %eax
jge 0x2df6b
movq -0x10(%rbp), %rdi
callq 0x2dbb0
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x2df6b
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2dfa2
movq -0x10(%rbp), %rax
movl 0x58(%rax), %edi
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rsi
callq 0xfa00
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2df9b
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2dfa2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_connect
int so_connect(struct socket *so) {
	if (so->done & SO_S_CONNECT)
		return 0;

	so->todo |= SO_S_CONNECT;

	return so_exec(so);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0xb4(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x2dfd7
movl $0x0, -0x4(%rbp)
jmp 0x2dff6
movq -0x10(%rbp), %rax
movl 0xb8(%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0xb8(%rax)
movq -0x10(%rbp), %rdi
callq 0x2dbb0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_listen
int so_listen(struct socket *so) {
	if (so->done & SO_S_LISTEN)
		return 0;

	so->todo |= SO_S_LISTEN;

	return so_exec(so);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0xb4(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x2e027
movl $0x0, -0x4(%rbp)
jmp 0x2e046
movq -0x10(%rbp), %rax
movl 0xb8(%rax), %ecx
orl $0x10, %ecx
movl %ecx, 0xb8(%rax)
movq -0x10(%rbp), %rdi
callq 0x2dbb0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
callq 0x10100
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
je 0x2e085
jmp 0x2e107
movq -0x10(%rbp), %rdi
callq 0x2dbb0
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
je 0x2e098
jmp 0x2e107
movq -0x10(%rbp), %rax
movw $0x1, 0xb0(%rax)
movq -0x10(%rbp), %rax
movl 0x58(%rax), %edi
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rsi
movl $0x80000, %ecx          # imm = 0x80000
callq 0xf670
movl %eax, %ecx
movl %ecx, -0x2c(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x2e0d6
jmp 0x2e0de
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2e124
callq 0xf0a0
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl %eax, -0x30(%rbp)
subl $0x4, %eax
je 0x2e0fc
jmp 0x2e0f2
movl -0x3c(%rbp), %eax
subl $0x67, %eax
je 0x2e0fe
jmp 0x2e105
jmp 0x2e0a5
movl $0xb, -0x30(%rbp)
jmp 0x2e107
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
leaq -0x2c(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xf2f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0xc8, %rdi
callq 0x31390
movq -0x8(%rbp), %rax
movl $0x0, 0xd4(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xd0(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0xd8(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0xd9(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xe0(%rax)
je 0x2e4db
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rdi
callq 0xfea0
movq -0x8(%rbp), %rax
movq $0x0, 0xe0(%rax)
movq -0x8(%rbp), %rax
movq 0xf0(%rax), %rdi
callq 0x10060
movq -0x8(%rbp), %rax
movq $0x0, 0xf0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xf8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x100(%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/socket.c
// Function: so_shutdown
int so_shutdown(struct socket *so, int how) {
	switch (how) {
	case SHUT_RD:
		so->todo |= SO_S_SHUTRD;

		break;
	case SHUT_WR:
		so->todo |= SO_S_SHUTWR;

		break;
	case SHUT_RDWR:
		so->todo |= SO_S_SHUTRD|SO_S_SHUTWR;

		break;
	} /* switch (how) */

	return so_exec(so);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
testl %eax, %eax
je 0x2e5af
jmp 0x2e59b
movl -0x10(%rbp), %eax
subl $0x1, %eax
je 0x2e5c7
jmp 0x2e5a5
movl -0x10(%rbp), %eax
subl $0x2, %eax
je 0x2e5df
jmp 0x2e5f5
movq -0x8(%rbp), %rax
movl 0xb8(%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movl %ecx, 0xb8(%rax)
jmp 0x2e5f5
movq -0x8(%rbp), %rax
movl 0xb8(%rax), %ecx
orl $0x400, %ecx            # imm = 0x400
movl %ecx, 0xb8(%rax)
jmp 0x2e5f5
movq -0x8(%rbp), %rax
movl 0xb8(%rax), %ecx
orl $0xc00, %ecx            # imm = 0xC00
movl %ecx, 0xb8(%rax)
movq -0x8(%rbp), %rdi
callq 0x2dbb0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)