LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: resconf_stub
static int resconf_stub(lua_State *L) {
	struct dns_resolv_conf **resconf = lua_newuserdata(L, sizeof *resconf);
	int error;

	*resconf = 0;

	if (!(*resconf = dns_resconf_local(&error)))
		return lua_pushboolean(L, 0), lua_pushinteger(L, error), 2;

	luaL_setmetatable(L, RESCONF_CLASS);

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x8
popq %rsi
callq 0xfb70
movq %rax, %r14
andq $0x0, (%rax)
leaq 0x4(%rsp), %rdi
callq 0xf2e0
movq %rax, (%r14)
testq %rax, %rax
je 0x1f08c
leaq 0x1214f(%rip), %rsi     # 0x311cf
movq %rbx, %rdi
callq 0x10280
pushq $0x1
jmp 0x1f0a5
movq %rbx, %rdi
xorl %esi, %esi
callq 0x108d0
movslq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: resconf_root
static int resconf_root(lua_State *L) {
	struct dns_resolv_conf **resconf = lua_newuserdata(L, sizeof *resconf);
	int error;

	*resconf = 0;

	if (!(*resconf = dns_resconf_root(&error)))
		return lua_pushboolean(L, 0), lua_pushinteger(L, error), 2;

	luaL_setmetatable(L, RESCONF_CLASS);

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x8
popq %rsi
callq 0xfb70
movq %rax, %r14
andq $0x0, (%rax)
leaq 0x4(%rsp), %rdi
callq 0xf620
movq %rax, (%r14)
testq %rax, %rax
je 0x1f0e9
leaq 0x120f2(%rip), %rsi     # 0x311cf
movq %rbx, %rdi
callq 0x10280
pushq $0x1
jmp 0x1f102
movq %rbx, %rdi
xorl %esi, %esi
callq 0x108d0
movslq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: resconf_type
static int resconf_type(lua_State *L) {
	if (resconf_test(L, 1)) {
		lua_pushstring(L, "dns config");
	} else {
		lua_pushnil(L);
	}

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1f149
testq %rax, %rax
je 0x1f13c
leaq 0x123a0(%rip), %rsi     # 0x314d2
movq %rbx, %rdi
callq 0xfc50
jmp 0x1f144
movq %rbx, %rdi
callq 0xf9d0
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hosts_loadfile
static int hosts_loadfile(lua_State *L) {
	struct dns_hosts *hosts = hosts_check(L, 1);
	luaL_Stream *file = luaL_checkudata(L, 2, LUA_FILEHANDLE);
	int error;

	if ((error = dns_hosts_loadfile(hosts, file->f)))
		return lua_pushboolean(L, 0), lua_pushinteger(L, error), 2;

	return lua_pushboolean(L, 1), 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x1f34c
movq %rax, %r15
leaq 0x11624(%rip), %rdx     # 0x307a4
pushq $0x2
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
callq 0xfd80
movq (%rax), %rsi
movq %r15, %rdi
callq 0x10430
testl %eax, %eax
je 0x1f1b5
movl %eax, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x108d0
movslq %ebp, %rsi
movq %r14, %rdi
callq 0xf960
jmp 0x1f1c2
pushq $0x1
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
callq 0x108d0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hosts_loadpath
static int hosts_loadpath(lua_State *L) {
	struct dns_hosts *hosts = hosts_check(L, 1);
	const char *path = luaL_checkstring(L, 2);
	int error;

	if ((error = dns_hosts_loadpath(hosts, path)))
		return lua_pushboolean(L, 0), lua_pushinteger(L, error), 2;

	return lua_pushboolean(L, 1), 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x1f34c
movq %rax, %r15
pushq $0x2
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0xf660
movq %r15, %rdi
movq %rax, %rsi
callq 0x105d0
testl %eax, %eax
je 0x1f218
movl %eax, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x108d0
movslq %ebp, %rsi
movq %r14, %rdi
callq 0xf960
jmp 0x1f225
pushq $0x1
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
callq 0x108d0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hosts_insert
static int hosts_insert(lua_State *L) {
	struct dns_hosts *hosts = hosts_check(L, 1);
	const char *ip = luaL_checkstring(L, 2);
	const char *dn = luaL_checkstring(L, 3);
	_Bool alias = (!lua_isnoneornil(L, 4))? lua_toboolean(L, 4) : 0;
	union { struct sockaddr_storage other; struct sockaddr_in in; struct sockaddr_in6 in6; } any;
	int error;

	if ((error = dns_resconf_pton(&any.other, ip)))
		goto error;

	switch (any.other.ss_family) {
	case AF_INET:
		if ((error = dns_hosts_insert(hosts, AF_INET, &any.in.sin_addr, dn, alias)))
			goto error;
		break;
	case AF_INET6:
		if ((error = dns_hosts_insert(hosts, AF_INET6, &any.in6.sin6_addr, dn, alias)))
			goto error;
		break;
	default:
		break;
	}

	return lua_pushboolean(L, 1), 1;
error:
	return luaL_error(L, "%s: %s", ip, cqs_strerror(error));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
callq 0x1f34c
movq %rax, %r15
xorl %r13d, %r13d
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf660
movq %rax, %r14
pushq $0x3
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf660
movq %rax, %r12
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0xf270
testl %eax, %eax
jle 0x1f291
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0xf560
testl %eax, %eax
setne %r13b
movq %rsp, %rdi
movq %r14, %rsi
callq 0x10a30
testl %eax, %eax
je 0x1f2f1
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x80, %edx
movl %eax, %edi
callq 0xf260
leaq 0x11056(%rip), %rsi     # 0x30333
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xfdf0
movl %eax, %ebp
jmp 0x1f338
movzwl (%rsp), %eax
cmpl $0xa, %eax
je 0x1f30c
cmpl $0x2, %eax
jne 0x1f32b
leaq 0x4(%rsp), %rdx
movzbl %r13b, %r8d
pushq $0x2
jmp 0x1f317
leaq 0x8(%rsp), %rdx
movzbl %r13b, %r8d
pushq $0xa
popq %rsi
movq %r15, %rdi
movq %r12, %rcx
callq 0xf760
testl %eax, %eax
jne 0x1f2a0
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x108d0
movl %ebp, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hosts__tostring
static int hosts__tostring(lua_State *L) {
	struct dns_hosts *hosts = hosts_check(L, 1);
	char line[1024];
	luaL_Buffer B;
	FILE *fp;

	if (!(fp = tmpfile()))
		return luaL_error(L, "tmpfile: %s", cqs_strerror(errno));

	dns_hosts_dump(hosts, fp);

	luaL_buffinit(L, &B);

	rewind(fp);

	while (fgets(line, sizeof line, fp))
		luaL_addstring(&B, line);

	fclose(fp);

	luaL_pushresult(&B);

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x24a0, %rsp           # imm = 0x24A0
movq %rdi, %rbx
callq 0x1f34c
movq %rax, %r15
callq 0x10290
testq %rax, %rax
je 0x1f3ef
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x103a0
leaq 0x480(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x106e0
movq %r14, %rdi
callq 0xf160
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10600
testq %rax, %rax
je 0x1f3d5
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf8a0
jmp 0x1f3b3
movq %r14, %rdi
callq 0xfd70
leaq 0x480(%rsp), %rdi
callq 0x107d0
pushq $0x1
popq %rax
jmp 0x1f439
callq 0xf0a0
movl (%rax), %edi
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
movl $0x80, %edx
callq 0xf260
leaq 0x12006(%rip), %rsi     # 0x31432
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfdf0
addq $0x24a0, %rsp           # imm = 0x24A0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hosts__gc
static int hosts__gc(lua_State *L) {
	struct dns_hosts **hosts = luaL_checkudata(L, 1, HOSTS_CLASS);

	dns_hosts_close(*hosts);
	*hosts = 0;

	return 0;
}

// Assembly:
pushq %rbx
leaq 0x11dc6(%rip), %rdx     # 0x31214
pushq $0x1
popq %rsi
callq 0xfd80
movq %rax, %rbx
movq (%rax), %rdi
callq 0x107f0
andq $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hosts_new
static int hosts_new(lua_State *L) {
	struct dns_hosts **hosts = lua_newuserdata(L, sizeof *hosts);
	int error;

	*hosts = 0;

	if (!(*hosts = dns_hosts_open(&error)))
		return lua_pushboolean(L, 0), lua_pushinteger(L, error), 2;

	luaL_setmetatable(L, HOSTS_CLASS);

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x8
popq %rsi
callq 0xfb70
movq %rax, %r14
andq $0x0, (%rax)
leaq 0x4(%rsp), %rdi
callq 0xf7d0
movq %rax, (%r14)
testq %rax, %rax
je 0x1f4a4
leaq 0x11d7c(%rip), %rsi     # 0x31214
movq %rbx, %rdi
callq 0x10280
pushq $0x1
jmp 0x1f4bd
movq %rbx, %rdi
xorl %esi, %esi
callq 0x108d0
movslq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hosts_type
static int hosts_type(lua_State *L) {
	if (hosts_test(L, 1)) {
		lua_pushstring(L, "dns hosts");
	} else {
		lua_pushnil(L);
	}

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0x1f507
testq %rax, %rax
je 0x1f4fa
leaq 0x11ff4(%rip), %rsi     # 0x314e4
movq %rbx, %rdi
callq 0xfc50
jmp 0x1f502
movq %rbx, %rdi
callq 0xf9d0
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hints_insert
static int hints_insert(lua_State *L) {
	struct dns_hints *hints = hints_check(L, 1);
	const char *zone = luaL_checkstring(L, 2), *ns;
	int priority = luaL_optint(L, 4, 0);
	int error = 0;

	if (!lua_isnone(L, 3) && lua_isuserdata(L, 3)) {
		dns_hints_insert_resconf(hints, zone, resconf_check(L, 3), &error);
	} else {
		ns = luaL_checkstring(L, 3);
		struct sockaddr_storage any;

		if (!(error = dns_resconf_pton(&any, ns)))
			error = dns_hints_insert(hints, zone, (struct sockaddr *)&any, priority);
	}

	if (error)
		return luaL_error(L, "%s: %s", zone, cqs_strerror(error));

	return lua_pushboolean(L, 1), 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rdi, %rbx
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x1f6c0
movq %rax, %r15
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf660
movq %rax, %r14
pushq $0x4
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf420
movq %rax, %r12
andl $0x0, 0xc(%rsp)
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xf270
cmpl $-0x1, %eax
je 0x1f5ac
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x10740
testl %eax, %eax
je 0x1f5ac
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x1edfb
leaq 0xc(%rsp), %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %r12, %rcx
callq 0xf8c0
movl (%r12), %eax
jmp 0x1f5e5
pushq $0x3
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf660
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x10a30
movl %eax, 0xc(%rsp)
testl %eax, %eax
jne 0x1f5e5
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %ecx
callq 0xf980
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x1f63a
xorps %xmm0, %xmm0
leaq 0x90(%rsp), %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x80, %edx
movl %eax, %edi
callq 0xf260
leaq 0x10d0d(%rip), %rsi     # 0x30333
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xfdf0
movl %eax, %ebp
jmp 0x1f644
movq %rbx, %rdi
movl %ebp, %esi
callq 0x108d0
movl %ebp, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hints_grep
static int hints_grep(lua_State *L) {
	struct dns_hints_i *i;

	hints_check(L, 1);

	lua_settop(L, 2);
	i = memset(lua_newuserdata(L, sizeof *i), 0, sizeof *i);
	i->zone = luaL_optstring(L, 2, ".");

	lua_pushcclosure(L, &hints_next, 3);

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rbx
movl %ebx, %esi
callq 0x1f6c0
pushq $0x2
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x106f0
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0xfb70
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x14871(%rip), %rdx     # 0x33f03
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0xf900
movq %rax, (%r15)
leaq 0x2a(%rip), %rsi        # 0x1f6d2
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0x10ad0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hints_next
static int hints_next(lua_State *L) {
	struct dns_hints *hints = hints_check(L, lua_upvalueindex(1));
	struct dns_hints_i *i = lua_touserdata(L, lua_upvalueindex(3));
	union { struct sockaddr *sa; struct sockaddr_in *in; struct sockaddr_in6 *in6; } any;
	socklen_t salen;
	char ip[INET6_ADDRSTRLEN + 1] = "";
	int port;

	while (dns_hints_grep(&any.sa, &salen, 1, i, hints)) {
		switch (any.sa->sa_family) {
		case AF_INET:
			inet_ntop(AF_INET, &any.in->sin_addr, ip, sizeof ip);
			port = ntohs(any.in->sin_port);
			break;
		case AF_INET6:
			inet_ntop(AF_INET6, &any.in6->sin6_addr, ip, sizeof ip);
			port = ntohs(any.in6->sin6_port);
			break;
		default:
			continue;
		}

		if (port && port != 53)
			lua_pushfstring(L, "[%s]:%d", ip, port);
		else
			lua_pushstring(L, ip);

		return 1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl $0xfff0b9d7, %esi       # imm = 0xFFF0B9D7
callq 0x1f6c0
movq %rax, %r14
movq %rbx, %rdi
movl $0xfff0b9d5, %esi       # imm = 0xFFF0B9D5
callq 0x103f0
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x2f(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq %rsp, %r12
leaq 0xc(%rsp), %r13
pushq $0x1
popq %rbp
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %edx
movq %r15, %rcx
movq %r14, %r8
callq 0x10360
testl %eax, %eax
je 0x1f74c
movq (%rsp), %rsi
movzwl (%rsi), %eax
cmpl $0xa, %eax
je 0x1f750
cmpl $0x2, %eax
jne 0x1f71d
pushq $0x2
popq %rdi
pushq $0x4
jmp 0x1f755
xorl %ebp, %ebp
jmp 0x1f7a4
pushq $0xa
popq %rdi
pushq $0x8
popq %rax
addq %rax, %rsi
leaq 0x10(%rsp), %rdx
pushq $0x2f
popq %rcx
callq 0xfe30
movq (%rsp), %rax
movzwl 0x2(%rax), %eax
rolw $0x8, %ax
testw %ax, %ax
je 0x1f77f
movzwl %ax, %ecx
cmpl $0x35, %ecx
jne 0x1f78e
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xfc50
jmp 0x1f7a4
leaq 0x11d1c(%rip), %rsi     # 0x314b1
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10080
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hints__tostring
static int hints__tostring(lua_State *L) {
	struct dns_hints *hints = hints_check(L, 1);
	char line[1024];
	luaL_Buffer B;
	FILE *fp;

	if (!(fp = tmpfile()))
		return luaL_error(L, "tmpfile: %s", cqs_strerror(errno));

	dns_hints_dump(hints, fp);

	luaL_buffinit(L, &B);

	rewind(fp);

	while (fgets(line, sizeof line, fp))
		luaL_addstring(&B, line);

	fclose(fp);

	luaL_pushresult(&B);

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x24a8, %rsp           # imm = 0x24A8
movq %rdi, %r14
pushq $0x1
popq %rbx
movl %ebx, %esi
callq 0x1f6c0
movq %rax, %r12
callq 0x10290
testq %rax, %rax
je 0x1f847
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
callq 0x10920
leaq 0x488(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x106e0
movq %r15, %rdi
callq 0xf160
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x10600
testq %rax, %rax
je 0x1f830
movq %r12, %rdi
movq %r14, %rsi
callq 0xf8a0
jmp 0x1f80e
movq %r15, %rdi
callq 0xfd70
leaq 0x488(%rsp), %rdi
callq 0x107d0
jmp 0x1f893
callq 0xf0a0
movl (%rax), %edi
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
movl $0x80, %edx
callq 0xf260
leaq 0x11bae(%rip), %rsi     # 0x31432
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfdf0
movl %eax, %ebx
movl %ebx, %eax
addq $0x24a8, %rsp           # imm = 0x24A8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hints__gc
static int hints__gc(lua_State *L) {
	struct dns_hints **hints = luaL_checkudata(L, 1, HINTS_CLASS);

	dns_hints_close(*hints);
	*hints = 0;

	return 0;
}

// Assembly:
pushq %rbx
leaq 0x11972(%rip), %rdx     # 0x3121e
pushq $0x1
popq %rsi
callq 0xfd80
movq %rax, %rbx
movq (%rax), %rdi
callq 0xfc20
andq $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hints_new
static int hints_new(lua_State *L) {
	struct dns_resolv_conf *resconf = resconf_test(L, 1);
	struct dns_hints **hints;
	int error;

	hints = lua_newuserdata(L, sizeof *hints);
	*hints = 0;

	if (!(*hints = dns_hints_open(resconf, &error)))
		return lua_pushboolean(L, 0), lua_pushinteger(L, error), 2;

	luaL_setmetatable(L, HINTS_CLASS);

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x1f149
movq %rax, %r14
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0xfb70
movq %rax, %r15
andq $0x0, (%rax)
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0xf030
movq %rax, (%r15)
testq %rax, %rax
je 0x1f915
leaq 0x11915(%rip), %rsi     # 0x3121e
movq %rbx, %rdi
callq 0x10280
pushq $0x1
jmp 0x1f92e
movq %rbx, %rdi
xorl %esi, %esi
callq 0x108d0
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x2
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hints_root
static int hints_root(lua_State *L) {
	struct dns_resolv_conf *resconf = resconf_test(L, 1);
	struct dns_hints **hints;
	int error;

	hints = lua_newuserdata(L, sizeof *hints);
	*hints = 0;

	if (!(*hints = dns_hints_root(resconf, &error)))
		return lua_pushboolean(L, 0), lua_pushinteger(L, error), 2;

	luaL_setmetatable(L, HINTS_CLASS);

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x1f149
movq %rax, %r14
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0xfb70
movq %rax, %r15
andq $0x0, (%rax)
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0xf230
movq %rax, (%r15)
testq %rax, %rax
je 0x1f987
leaq 0x118a3(%rip), %rsi     # 0x3121e
movq %rbx, %rdi
callq 0x10280
pushq $0x1
jmp 0x1f9a0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x108d0
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x2
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hints_stub
static int hints_stub(lua_State *L) {
	struct dns_resolv_conf *resconf = resconf_test(L, 1);
	struct dns_hints **hints;
	int error;

	hints = lua_newuserdata(L, sizeof *hints);
	*hints = 0;

	if (!(*hints = dns_hints_local(resconf, &error)))
		return lua_pushboolean(L, 0), lua_pushinteger(L, error), 2;

	luaL_setmetatable(L, HINTS_CLASS);

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x1f149
movq %rax, %r14
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0xfb70
movq %rax, %r15
andq $0x0, (%rax)
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0xf250
movq %rax, (%r15)
testq %rax, %rax
je 0x1f9f9
leaq 0x11831(%rip), %rsi     # 0x3121e
movq %rbx, %rdi
callq 0x10280
pushq $0x1
jmp 0x1fa12
movq %rbx, %rdi
xorl %esi, %esi
callq 0x108d0
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x2
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: hints_type
static int hints_type(lua_State *L) {
	if (hints_test(L, 1)) {
		lua_pushstring(L, "dns hints");
	} else {
		lua_pushnil(L);
	}

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0x1fa5e
testq %rax, %rax
je 0x1fa51
leaq 0x11aa7(%rip), %rsi     # 0x314ee
movq %rbx, %rdi
callq 0xfc50
jmp 0x1fa59
movq %rbx, %rdi
callq 0xf9d0
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: res_submit
static int res_submit(lua_State *L) {
	struct dns_resolver *R = res_check(L, 1);
	const char *name = luaL_checkstring(L, 2);
	int type = luaL_optint(L, 3, DNS_T_A);
	int class = luaL_optint(L, 4, DNS_C_IN);
	int error;

	if (!(error = dns_res_submit(R, name, type, class))) {
		lua_pushboolean(L, 1);

		return 1;
	} else {
		lua_pushboolean(L, 0);
		lua_pushinteger(L, error);

		return 2;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x1fe90
movq %rax, %r15
pushq $0x2
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0xf660
movq %rax, %r12
pushq $0x3
popq %rsi
pushq $0x1
popq %r13
movq %r14, %rdi
movq %r13, %rdx
callq 0xf420
movq %rax, %rbp
pushq $0x4
popq %rsi
movq %r14, %rdi
movq %r13, %rdx
callq 0xf420
movq %r15, %rdi
movq %r12, %rsi
movl %ebp, %edx
movl %eax, %ecx
callq 0xf350
testl %eax, %eax
je 0x1faf0
movl %eax, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x108d0
movslq %ebp, %rsi
movq %r14, %rdi
callq 0xf960
jmp 0x1fafd
pushq $0x1
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
callq 0x108d0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: res_fetch
static int res_fetch(lua_State *L) {
	struct dns_resolver *R = res_check(L, 1);
	struct dns_packet *pkt;
	size_t size;
	int error;

	if ((error = dns_res_check(R)) || !(pkt = dns_res_fetch(R, &error))) {
error:
		lua_pushboolean(L, 0);
		lua_pushinteger(L, error);

		return 2;
	}

	/* FIXME: Leaks packet if lua_newuserdata throws */
	size = dns_p_sizeof(pkt);
	error = dns_p_study(dns_p_copy(dns_p_init(lua_newuserdata(L, size), size), pkt));
	free(pkt);

	if (error)
		goto error;

	luaL_setmetatable(L, PACKET_CLASS);

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x1fe90
movq %rax, %r14
movq %rax, %rdi
callq 0xf530
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x1fb56
movq %rbx, %rdi
xorl %esi, %esi
callq 0x108d0
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x2
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x10100
testq %rax, %rax
je 0x1fb32
movq %rax, %r14
movq 0x50(%rax), %rax
leaq 0x5c(%rax), %rcx
cmpq $0xc, %rax
pushq $0x68
popq %r15
cmovaeq %rcx, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfb70
movq %rax, %rdi
movq %r15, %rsi
callq 0x10b10
movq %rax, %rdi
movq %r14, %rsi
callq 0x10240
movq %rax, %rdi
callq 0xf7e0
movl %eax, 0xc(%rsp)
movq %r14, %rdi
callq 0xffc0
cmpl $0x0, 0xc(%rsp)
jne 0x1fb32
leaq 0x115e9(%rip), %rsi     # 0x311af
movq %rbx, %rdi
callq 0x10280
pushq $0x1
jmp 0x1fb4b
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: res_events
static int res_events(lua_State *L) {
	struct dns_resolver *R = res_check(L, 1);

	switch (dns_res_events(R)) {
	case POLLIN|POLLOUT:
		lua_pushliteral(L, "rw");
		break;
	case POLLIN:
		lua_pushliteral(L, "r");
		break;
	case POLLOUT:
		lua_pushliteral(L, "w");
		break;
	default:
		lua_pushnil(L);
		break;
	}

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1fe90
movq %rax, %rdi
callq 0xf840
cmpl $0x1, %eax
je 0x1fc28
cmpl $0x4, %eax
je 0x1fc1f
cmpl $0x5, %eax
jne 0x1fc39
leaq 0x10af0(%rip), %rsi     # 0x3070d
jmp 0x1fc2f
leaq 0x10525(%rip), %rsi     # 0x3014b
jmp 0x1fc2f
leaq 0x10a4d(%rip), %rsi     # 0x3067c
movq %rbx, %rdi
callq 0xfc50
jmp 0x1fc41
movq %rbx, %rdi
callq 0xf9d0
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: res_stat
static int res_stat(lua_State *L) {
	struct dns_resolver *R = res_check(L, 1);
	const struct dns_stat *st = dns_res_stat(R);

	lua_newtable(L);

	lua_pushinteger(L, st->queries);
	lua_setfield(L, -2, "queries");

#define setboth(st, table) do { \
	lua_newtable(L); \
	lua_pushinteger(L, (st).count); \
	lua_setfield(L, -2, "count"); \
	lua_pushinteger(L, (st).bytes); \
	lua_setfield(L, -2, "bytes"); \
	lua_setfield(L, -2, table); \
} while (0)

	lua_newtable(L);
	setboth(st->udp.sent, "sent");
	setboth(st->udp.rcvd, "rcvd");
	lua_setfield(L, -2, "udp");

	lua_newtable(L);
	setboth(st->tcp.sent, "sent");
	setboth(st->tcp.rcvd, "rcvd");
	lua_setfield(L, -2, "tcp");

#undef setboth

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1fe90
movq %rax, %rdi
callq 0x10150
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10270
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xf960
leaq 0x11871(%rip), %rdx     # 0x31516
pushq $-0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf550
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10270
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10270
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xf960
leaq 0x104ac(%rip), %r15     # 0x30189
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xf550
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xf960
leaq 0x11c42(%rip), %r12     # 0x3193f
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0xf550
leaq 0x10bd6(%rip), %rdx     # 0x308e7
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf550
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10270
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf960
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xf550
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0xf960
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0xf550
leaq 0x10b8c(%rip), %r13     # 0x308ec
movq %rbx, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0xf550
leaq 0x117aa(%rip), %rdx     # 0x3151e
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf550
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10270
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10270
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xf960
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xf550
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0xf960
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0xf550
movq %rbx, %rdi
movl %ebp, %esi
leaq 0x10b13(%rip), %rdx     # 0x308e7
callq 0xf550
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10270
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0xf960
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xf550
movq 0x40(%r14), %rsi
movq %rbx, %rdi
callq 0xf960
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0xf550
movq %rbx, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0xf550
leaq 0x1426b(%rip), %rdx     # 0x34096
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf550
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: res_close
static int res_close(lua_State *L) {
	struct resolver *R = luaL_checkudata(L, 1, RESOLVER_CLASS);

	if (!R->mainthread) {
		R->mainthread = L;
		dns_res_close(R->res);
		R->res = 0;
		R->mainthread = 0;
	} else {
		dns_res_close(R->res);
		R->res = 0;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x113e7(%rip), %rdx     # 0x3123c
pushq $0x1
popq %rsi
callq 0xfd80
movq %rax, %rbx
cmpq $0x0, 0x8(%rax)
je 0x1fe71
movq (%rbx), %rdi
callq 0xfe70
jmp 0x1fe82
movq %r14, 0x8(%rbx)
movq (%rbx), %rdi
callq 0xfe70
andq $0x0, 0x8(%rbx)
andq $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: res_check
static inline struct dns_resolver *res_check(lua_State *L, int index) {
	struct resolver *R = luaL_checkudata(L, index, RESOLVER_CLASS);

	if (!R->res)
		luaL_argerror(L, index, "resolver defunct");

	return R->res;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1139e(%rip), %rdx     # 0x3123c
pushq $0x1
popq %rsi
callq 0xfd80
movq %rax, %r14
movq (%rax), %rax
testq %rax, %rax
jne 0x1fec6
leaq 0x1164d(%rip), %rdx     # 0x31505
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xf410
movq (%r14), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: res__gc
static int res__gc(lua_State *L) {
	struct resolver *R = luaL_checkudata(L, 1, RESOLVER_CLASS);

	R->mainthread = 0;

	dns_res_close(R->res);
	R->res = 0;

	return 0;
}

// Assembly:
pushq %rbx
leaq 0x11366(%rip), %rdx     # 0x3123c
pushq $0x1
popq %rsi
callq 0xfd80
movq %rax, %rbx
andq $0x0, 0x8(%rax)
movq (%rax), %rdi
callq 0xfe70
andq $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/dns.c
// Function: res_type
static int res_type(lua_State *L) {
	struct resolver *R;

	if ((R = luaL_testudata(L, 1, RESOLVER_CLASS))) {
		lua_pushstring(L, (R->res)? "dns resolver" : "closed dns resolver");
	} else {
		lua_pushnil(L);
	}

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x11168(%rip), %rdx     # 0x3123c
pushq $0x1
popq %rsi
callq 0x107e0
testq %rax, %rax
je 0x20101
cmpq $0x0, (%rax)
leaq 0x11436(%rip), %rax     # 0x31522
leaq 0x11436(%rip), %rsi     # 0x31529
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0xfc50
jmp 0x20109
movq %rbx, %rdi
callq 0xf9d0
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
movq 0x8(%rsi), %rdi
testq %rdi, %rdi
je 0x20131
movl (%rbx), %esi
callq 0xfc90
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0x20131
callq 0x10af0
orl $-0x1, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
callq 0x10510
movslq %eax, %rsi
movq %rbx, %rdi
callq 0xf960
callq 0x10840
movslq %eax, %rsi
movq %rbx, %rdi
callq 0xf960
callq 0x10350
movslq %eax, %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x3
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
movsd 0x10f70(%rip), %xmm0    # 0x310f0
callq 0xf7c0
ucomisd 0x10f63(%rip), %xmm0    # 0x310f0
jae 0x201e5
cvttsd2si %xmm0, %r14
cmpl $0x1, %r14d
ja 0x201bc
leaq 0x1139c(%rip), %rsi     # 0x3153d
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x10080
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xf410
movl %r14d, %eax
negl %eax
xorl %edx, %edx
divl %r14d
movl %edx, %ebp
callq 0x10610
callq *(%rax)
cmpl %ebp, %eax
jb 0x201c8
xorl %edx, %edx
divl %r14d
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xf960
jmp 0x201fb
callq 0x10610
callq *(%rax)
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movq %rbx, %rdi
callq 0xf2d0
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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:
testl %edi, %edi
jns 0xf490
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x8c9c94c7, %edi       # imm = 0x8C9C94C7
jne 0x20264
callq 0xf090
testq %rax, %rax
je 0x2028a
movq %rax, %r14
leaq 0x24d0a(%rip), %rdi     # 0x44f50
callq 0x10800
leaq (%rax), %rbx
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10720
jmp 0x20291
addl $0x73636b39, %edi       # imm = 0x73636B39
cmpl $0x4, %edi
ja 0x20281
movl %edi, %eax
leaq 0x11334(%rip), %rcx     # 0x315ac
movslq (%rcx,%rax,4), %rbx
addq %rcx, %rbx
jmp 0x20291
leaq 0x11639(%rip), %rbx     # 0x318c1
jmp 0x20291
leaq 0x1161a(%rip), %rbx     # 0x318ab
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/lib/socket.c
// Function: sa_ntop
char *sa_ntop(char *dst, size_t lim, const void *src, const char *def, int *_error) {
	union sockaddr_any *any = (void *)src;
	const char *unspec = "0.0.0.0";
	char text[SA_ADDRSTRLEN];
	int error;

	switch (*sa_family(&any->sa)) {
	case AF_INET:
		unspec = "0.0.0.0";

		if (!inet_ntop(AF_INET, &any->sin.sin_addr, text, sizeof text))
			goto syerr;

		break;
	case AF_INET6:
		unspec = "::";

		if (!inet_ntop(AF_INET6, &any->sin6.sin6_addr, text, sizeof text))
			goto syerr;

		break;
#if SA_UNIX
	case AF_UNIX:
		unspec = "/nonexistent";

		memset(text, 0, sizeof text);
		memcpy(text, any->sun.sun_path, SO_MIN(sizeof text - 1, sizeof any->sun.sun_path));

		break;
#endif
	default:
		error = EAFNOSUPPORT;

		goto error;
	} /* switch() */

	if (dns_strlcpy(dst, text, lim) >= lim) {
		error = ENOSPC;

		goto error;
	}

	return dst;
syerr:
	error = so_syerr();
error:
	if (_error)
		*_error = error;

	/*
	 * NOTE: Always write something in case caller ignores errors, such
	 * as when caller is using the sa_ntoa() macro.
	 */
	dns_strlcpy(dst, (def)? def : unspec, lim);

	return (char *)def;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %r8, %r12
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movzwl (%rdx), %eax
cmpl $0x1, %eax
je 0x20319
cmpl $0xa, %eax
je 0x202ec
cmpl $0x2, %eax
jne 0x20356
addq $0x4, %rdx
pushq $0x2
popq %rdi
movq %rsp, %rax
pushq $0x6d
popq %rcx
movq %rdx, %rsi
movq %rax, %rdx
callq 0xfe30
leaq 0x115ec(%rip), %r13     # 0x318d6
jmp 0x2030b
addq $0x8, %rdx
pushq $0xa
popq %rdi
movq %rsp, %rax
pushq $0x6d
popq %rcx
movq %rdx, %rsi
movq %rax, %rdx
callq 0xfe30
leaq 0x115d3(%rip), %r13     # 0x318de
testq %rax, %rax
jne 0x20339
callq 0xf0a0
movl (%rax), %eax
jmp 0x20360
addq $0x2, %rdx
movq %rsp, %rdi
movb $0x0, 0x6c(%rdi)
pushq $0x6c
popq %rax
movq %rdx, %rsi
movq %rax, %rdx
callq 0xfad0
leaq 0x115a8(%rip), %r13     # 0x318e1
movq %rsp, %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0xf4f0
cmpq %r14, %rax
jae 0x20351
movq %r15, %rbx
jmp 0x2037e
pushq $0x1c
popq %rax
jmp 0x20360
pushq $0x61
popq %rax
leaq 0x11576(%rip), %r13     # 0x318d6
testq %r12, %r12
je 0x20369
movl %eax, (%r12)
testq %rbx, %rbx
cmovneq %rbx, %r13
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0xf4f0
movq %rbx, %rax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %r8, (%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r15
leaq 0x10(%rsp), %rbp
xorl %ebx, %ebx
movl $0x100, %edx            # imm = 0x100
movq %rbp, %rdi
xorl %esi, %esi
callq 0xf790
movw $0x2, (%rbp)
movw $0xa, 0x80(%rbp)
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xf790
pushq $0x61
popq %r14
cmpq $0xff, %rbx
ja 0x20459
leaq (%rsp,%rbx), %rbp
addq $0x10, %rbp
movzwl (%rbp), %edi
cmpl $0x1, %edi
je 0x2041c
cmpl $0xa, %edi
je 0x20416
cmpl $0x2, %edi
jne 0x20422
leaq (%rsp,%rbx), %rdx
addq $0x14, %rdx
jmp 0x20424
leaq 0x8(%rbp), %rdx
jmp 0x20424
leaq 0x2(%rbp), %rdx
jmp 0x20424
xorl %edx, %edx
movq %r13, %rsi
callq 0x10a40
cmpl $-0x1, %eax
je 0x20451
cmpl $0x1, %eax
je 0x2043c
subq $-0x80, %rbx
jmp 0x203e8
movq %rbp, %rdi
callq 0x2048c
movl %eax, %edx
cmpq %r12, %rdx
jbe 0x2047f
pushq $0x1c
popq %r14
jmp 0x20459
callq 0xf0a0
movl (%rax), %r14d
movq (%rsp), %rax
testq %rax, %rax
je 0x20465
movl %r14d, (%rax)
movq 0x8(%rsp), %r15
movq %r15, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %rbp, %rsi
callq 0xfad0
jmp 0x2046a
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movl %esi, %edx
xorl %ebx, %ebx
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0xf7f0
cmpl $-0x1, %eax
jne 0x206b3
callq 0xf0a0
movl (%rax), %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x206d2
movq 0x30(%rsi), %rax
testq %rax, %rax
je 0x206d2
movq 0x28(%rsi), %rsi
movq %rbx, %rdi
callq *%rax
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0x206e1
callq 0x10af0
orl $-0x1, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movq %rdx, %rbx
movl %esi, %r15d
movl %edi, %r12d
orl $0x80000, %esi          # imm = 0x80000
xorl %edx, %edx
callq 0xf310
movl %eax, 0x4(%rsp)
cmpl $-0x1, %eax
je 0x2074e
movl %eax, %ebp
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x2077a
movl %eax, %r14d
movl $0xc000, %edi           # imm = 0xC000
movl %r12d, %esi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x207d9
movq %rsp, %rcx
andl (%rcx), %eax
movl %ebp, %edi
movl %r14d, %esi
movl %eax, %edx
movl $0xfffffd1f, %ecx       # imm = 0xFFFFFD1F
callq 0xfa50
testl %eax, %eax
jne 0x20755
jmp 0x20769
callq 0xf0a0
movl (%rax), %eax
movl %eax, (%r13)
leaq 0x4(%rsp), %rdi
movq %rbx, %rsi
callq 0xf2c0
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
andl $0x0, (%rsi)
xorl %ecx, %ecx
leaq 0x23e9a(%rip), %rdx     # 0x44620
xorl %r8d, %r8d
xorl %eax, %eax
cmpq $0xef, %r8
ja 0x207be
movq 0x10(%r8,%rdx), %r10
cmpq $-0x1, %r10
je 0x207b8
movl (%r8,%rdx), %r9d
cmpb $0x0, (%rdi,%r10)
movl %r9d, %r10d
jne 0x207b0
xorl %r10d, %r10d
orl %r10d, %eax
orl %r9d, %ecx
movl %ecx, (%rsi)
addq $0x18, %r8
jmp 0x2078b
movl 0x18(%rdi), %edx
cmpl $0x2, %edx
je 0x207d0
cmpl $0x1, %edx
jne 0x207d8
orl $0x100, %eax            # imm = 0x100
orl $0x100, %ecx            # imm = 0x100
movl %ecx, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/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:
andl $0xf000, %edi           # imm = 0xF000
movl $0x83, %eax
cmpl $0xc000, %edi           # imm = 0xC000
jne 0x20833
testl %ecx, %ecx
jne 0x20808
movl %esi, %eax
andl $-0x9, %eax
xorl %ecx, %ecx
cmpl $0x2, %eax
jne 0x20808
cmpl $0x1, %edx
pushq $0x6
popq %rax
pushq $0x11
popq %rcx
cmovel %eax, %ecx
xorl %eax, %eax
cmpl $0xa, %esi
sete %al
shll $0x8, %eax
xorl %esi, %esi
cmpl $0x2, %edx
sete %sil
shll $0x4, %esi
orl %eax, %esi
cmpl $0x6, %ecx
movl $0x2ef, %ecx            # imm = 0x2EF
movl $0x28f, %eax            # imm = 0x28F
cmovel %ecx, %eax
orl %esi, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/lib/socket.c
// Function: so_bind
int (so_bind)(int fd, sockaddr_arg_t arg, const struct so_options *opts) {
#if SA_UNIX
	if (*sa_family(arg) == AF_UNIX) {
		char *path = strncpy((char [sizeof sockaddr_ref(arg).sun->sun_path + 1]){ 0 }, sockaddr_ref(arg).sun->sun_path, sizeof sockaddr_ref(arg).sun->sun_path);
		_Bool nochmod = 0;
		int error;

		if (opts->sun_unlink && *path)
			(void)unlink(path);

		if (opts->sun_mode) {
			if (0 == fchmod(fd, (opts->sun_mode & 0777)))
				nochmod = 1;
			else if (errno != EINVAL) /* BSDs return EINVAL */
				return errno;
		}

		if (opts->sun_mask) {
			mode_t omask = umask(opts->sun_mask & 0777);
			error = (0 == bind(fd, sockaddr_ref(arg).sa, sa_len(arg)))? 0 : errno;
			umask(omask);
		} else {
			error = (0 == bind(fd, sockaddr_ref(arg).sa, sa_len(arg)))? 0 : errno;
		}

		if (error)
			return error;

		if (opts->sun_mode && !nochmod && *path) {
			if (0 != chmod(path, (opts->sun_mode & 0777)))
				return errno;
		}

		return 0;
	}
#endif

	if (0 != bind(fd, sockaddr_ref(arg).sa, sa_len(arg)))
		return so_soerr();

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movl %edi, %ebp
cmpw $0x1, (%rsi)
jne 0x208c2
movq %rdx, %rbx
leaq 0xb(%rsp), %rdi
movb $0x0, 0x6c(%rdi)
leaq 0x2(%r14), %rsi
pushq $0x6c
popq %rdx
callq 0xf6c0
cmpb $0x1, 0x10(%rbx)
jne 0x20893
cmpb $0x0, 0xb(%rsp)
je 0x20893
leaq 0xb(%rsp), %rdi
callq 0xf5f0
movl 0x8(%rbx), %esi
testl %esi, %esi
je 0x208bd
andl $0x1ff, %esi            # imm = 0x1FF
movl %ebp, %edi
callq 0xf5e0
testl %eax, %eax
je 0x208e9
callq 0xf0a0
movl (%rax), %r15d
cmpl $0x16, %r15d
jne 0x20955
xorl %r13d, %r13d
jmp 0x208ec
movq %r14, %rdi
callq 0x2048c
movl %ebp, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0xf190
testl %eax, %eax
je 0x208e4
callq 0xf0a0
movl (%rax), %r15d
jmp 0x20955
xorl %r15d, %r15d
jmp 0x20955
movb $0x1, %r13b
movl 0xc(%rbx), %edi
testl %edi, %edi
je 0x20923
andl $0x1ff, %edi            # imm = 0x1FF
callq 0x108e0
movl %eax, %r12d
movq %r14, %rdi
callq 0x2048c
movl %ebp, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0xf190
testl %eax, %eax
je 0x20945
callq 0xf0a0
movl (%rax), %r15d
jmp 0x20948
movq %r14, %rdi
callq 0x2048c
movl %ebp, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0xf190
testl %eax, %eax
je 0x20967
callq 0xf0a0
movl (%rax), %r15d
jmp 0x20950
xorl %r15d, %r15d
movl %r12d, %edi
callq 0x108e0
testl %r15d, %r15d
je 0x20967
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %esi
testl %esi, %esi
sete %al
xorl %r15d, %r15d
orb %al, %r13b
jne 0x20955
cmpb $0x0, 0xb(%rsp)
je 0x20955
andl $0x1ff, %esi            # imm = 0x1FF
leaq 0xb(%rsp), %rdi
callq 0xfc80
testl %eax, %eax
jne 0x208da
jmp 0x20955
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x3
popq %rsi
xorl %eax, %eax
callq 0xf7f0
cmpl $-0x1, %eax
je 0x209d8
movzbl %r14b, %ecx
negl %ecx
orl $0xfffff7ff, %ecx       # imm = 0xFFFFF7FF
orl $0x800, %eax            # imm = 0x800
andl %ecx, %eax
pushq $0x4
popq %rsi
movl %ebp, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0xf7f0
cmpl $-0x1, %eax
jne 0x209df
callq 0xf0a0
movl (%rax), %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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)
pushq $0x4
popq %r8
movq %rax, %rcx
callq 0x108f0
testl %eax, %eax
je 0x20a1e
callq 0xf0a0
movl (%rax), %eax
movl %eax, %ecx
orl $0x4, %ecx
cmpl $0x5c, %ecx
jne 0x20a20
pushq $0x5f
popq %rax
jmp 0x20a20
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
pushq $0xf
popq %rdx
movl %ebx, %ecx
callq 0x209f0
testl %ebx, %ebx
pushq $0x5f
popq %rcx
cmovel %ebx, %ecx
cmpl $0x5f, %eax
cmovel %ecx, %eax
popq %rbx
retq