LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/dns.c
// Function: resconf_loadfile
static int resconf_loadfile(lua_State *L) {
	struct dns_resolv_conf *resconf = resconf_check(L, 1);
	luaL_Stream *file = luaL_checkudata(L, 2, LUA_FILEHANDLE);
	int syntax = luaL_optint(L, 3, RESCONF_RESOLV_CONF);
	int error;

	switch (syntax) {
	case RESCONF_NSSWITCH_CONF:
		error = dns_nssconf_loadfile(resconf, file->f);
		break;
	default:
		error = dns_resconf_loadfile(resconf, file->f);
		break;
	}

	if (error)
		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, %rbx
leaq 0x14e34(%rip), %rdx     # 0x36207
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %r14
leaq 0x143e5(%rip), %rdx     # 0x357cc
movq %rbx, %rdi
movl $0x2, %esi
callq 0xfcf0
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0xf400
movq (%r15), %rsi
movq %r14, %rdi
cmpl $0x1, %eax
jne 0x21418
callq 0xf7d0
jmp 0x2141d
callq 0x10a00
movl %eax, %ebp
testl %eax, %eax
je 0x2143f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %ebp
jmp 0x21451
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10800
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/dns.c
// Function: resconf_loadpath
static int resconf_loadpath(lua_State *L) {
	struct dns_resolv_conf *resconf = resconf_check(L, 1);
	const char *path = luaL_checkstring(L, 2);
	int syntax = luaL_optint(L, 3, RESCONF_RESOLV_CONF);
	int error;

	switch (syntax) {
	case RESCONF_NSSWITCH_CONF:
		error = dns_nssconf_loadpath(resconf, path);
		break;
	default:
		error = dns_resconf_loadpath(resconf, path);
		break;
	}

	if (error)
		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, %rbx
leaq 0x14d98(%rip), %rdx     # 0x36207
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %r14
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0xf620
movq %rax, %r15
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0xf400
movq %r14, %rdi
movq %r15, %rsi
cmpl $0x1, %eax
jne 0x214af
callq 0xfc90
jmp 0x214b4
callq 0xfac0
movl %eax, %ebp
testl %eax, %eax
je 0x214d6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %ebp
jmp 0x214e8
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10800
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/dns.c
// Function: resconf_search
static int resconf_search(lua_State *L) {
	dns_resconf_i_t *i;

	resconf_check(L, 1);

	lua_settop(L, 2);
	luaL_checktype(L, 2, LUA_TSTRING);

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

	lua_pushcclosure(L, &resconf__next, 3);

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x14d07(%rip), %rdx     # 0x36207
movl $0x1, %esi
callq 0xfcf0
movq %rbx, %rdi
movl $0x2, %esi
callq 0x10640
movq %rbx, %rdi
movl $0x2, %esi
movl $0x4, %edx
callq 0xf6c0
movl $0x8, %esi
movq %rbx, %rdi
callq 0xfb00
movq $0x0, (%rax)
leaq 0x65(%rip), %rsi        # 0x215a9
movq %rbx, %rdi
movl $0x3, %edx
callq 0x109f0
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/dns.c
// Function: optfbool
static int optfbool(lua_State *L, int t, const char *k, _Bool def) {
	_Bool b;

	lua_getfield(L, t, k);
	b = (lua_isnil(L, -1))? def : lua_toboolean(L, -1);
	lua_pop(L, 1);

	return b;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rdx
movq %rdi, %rbx
movl $0x2, %esi
callq 0xf1e0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf260
testl %eax, %eax
je 0x21591
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf540
testl %eax, %eax
setne %bpl
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movzbl %bpl, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/dns.c
// Function: resconf__next
static int resconf__next(lua_State *L) {
	struct dns_resolv_conf *resconf = *(struct dns_resolv_conf **)lua_touserdata(L, lua_upvalueindex(1));
	size_t len;
	const char *qn = lua_tolstring(L, lua_upvalueindex(2), &len);
	dns_resconf_i_t *i = lua_touserdata(L, lua_upvalueindex(3));
	char dn[DNS_D_MAXNAME + 1];

	if (!(len = dns_resconf_search(dn, sizeof dn, qn, len, resconf, i)))
		return 0;

	lua_pushlstring(L, dn, len);

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
movl $0xfff0b9d7, %esi       # imm = 0xFFF0B9D7
callq 0x10350
movq (%rax), %r14
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movl $0xfff0b9d6, %esi       # imm = 0xFFF0B9D6
movq %r15, %rdx
callq 0xf110
movq %rax, %r12
movq %rbx, %rdi
movl $0xfff0b9d5, %esi       # imm = 0xFFF0B9D5
callq 0x10350
movq (%r15), %rcx
leaq 0x10(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdx
movq %r14, %r8
movq %rax, %r9
callq 0x108a0
movq %rax, (%r15)
testq %rax, %rax
je 0x21626
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xf4c0
movl $0x1, %eax
jmp 0x21628
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/dns.c
// Function: resconf__tostring
static int resconf__tostring(lua_State *L) {
	struct dns_resolv_conf *resconf = resconf_check(L, 1);
	char line[1024];
	luaL_Buffer B;
	FILE *fp;

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

	dns_resconf_dump(resconf, 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
leaq 0x14bba(%rip), %rdx     # 0x36207
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %r15
callq 0x10200
testq %rax, %rax
je 0x216f4
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0xfe50
leaq 0x480(%rsp), %rsi
movq %rbx, %rdi
callq 0x10630
movq %r14, %rdi
callq 0xf150
leaq 0x80(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10550
testq %rax, %rax
je 0x216d8
leaq 0x480(%rsp), %rbx
leaq 0x80(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf850
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10550
testq %rax, %rax
jne 0x216b8
movq %r14, %rdi
callq 0xfce0
leaq 0x480(%rsp), %rdi
callq 0x10710
movl $0x1, %eax
jmp 0x2173e
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 0xf250
leaq 0x14d39(%rip), %rsi     # 0x3646a
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfd60
addq $0x24a0, %rsp           # imm = 0x24A0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/dns.c
// Function: resconf__gc
static int resconf__gc(lua_State *L) {
	struct dns_resolv_conf **resconf = luaL_checkudata(L, 1, RESCONF_CLASS);

	dns_resconf_close(*resconf);
	*resconf = 0;

	return 0;
}

// Assembly:
pushq %rbx
leaq 0x14ab4(%rip), %rdx     # 0x36207
movl $0x1, %esi
callq 0xfcf0
movq %rax, %rbx
movq (%rax), %rdi
callq 0xfee0
movq $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/dns.c
// Function: resconf_new
static int resconf_new(lua_State *L) {
	struct dns_resolv_conf **resconf = lua_newuserdata(L, sizeof *resconf);
	int error;

	*resconf = 0;

	if (!(*resconf = dns_resconf_open(&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
movl $0x8, %esi
callq 0xfb00
movq %rax, %r14
movq $0x0, (%rax)
leaq 0x4(%rsp), %rdi
callq 0xf740
movq %rax, (%r14)
testq %rax, %rax
je 0x217b6
leaq 0x14a60(%rip), %rsi     # 0x36207
movq %rbx, %rdi
callq 0x101f0
movl $0x1, %eax
jmp 0x217d2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x8, %esi
callq 0xfb00
movq %rax, %r14
movq $0x0, (%rax)
leaq 0x4(%rsp), %rdi
callq 0xf2d0
movq %rax, (%r14)
testq %rax, %rax
je 0x2181d
leaq 0x149f9(%rip), %rsi     # 0x36207
movq %rbx, %rdi
callq 0x101f0
movl $0x1, %eax
jmp 0x21839
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x8, %esi
callq 0xfb00
movq %rax, %r14
movq $0x0, (%rax)
leaq 0x4(%rsp), %rdi
callq 0xf5e0
movq %rax, (%r14)
testq %rax, %rax
je 0x21884
leaq 0x14992(%rip), %rsi     # 0x36207
movq %rbx, %rdi
callq 0x101f0
movl $0x1, %eax
jmp 0x218a0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x148d6(%rip), %rdx     # 0x36207
movl $0x1, %esi
callq 0x10720
testq %rax, %rax
je 0x21957
cmpq $0x0, (%rax)
je 0x21957
leaq 0x14bbd(%rip), %rsi     # 0x3650a
movq %rbx, %rdi
callq 0xfbd0
jmp 0x2195f
movq %rbx, %rdi
callq 0xf980
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x148d8(%rip), %rdx     # 0x3624c
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %r14
leaq 0x13e44(%rip), %rdx     # 0x357cc
movl $0x2, %ebp
movq %rbx, %rdi
movl $0x2, %esi
callq 0xfcf0
movq (%rax), %rsi
movq %r14, %rdi
callq 0x10390
testl %eax, %eax
je 0x219c3
movl %eax, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq %r14d, %rsi
movq %rbx, %rdi
callq 0xf910
jmp 0x219d5
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10800
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x14862(%rip), %rdx     # 0x3624c
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %r14
movl $0x2, %ebp
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0xf620
movq %r14, %rdi
movq %rax, %rsi
callq 0x10520
testl %eax, %eax
je 0x21a34
movl %eax, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq %r14d, %rsi
movq %rbx, %rdi
callq 0xf910
jmp 0x21a46
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10800
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x147e4(%rip), %rdx     # 0x3624c
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %r15
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0xf620
movq %rax, %r14
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0xf620
movq %rax, %r12
movq %rbx, %rdi
movl $0x4, %esi
callq 0xf260
testl %eax, %eax
jle 0x21ac0
movq %rbx, %rdi
movl $0x4, %esi
callq 0xf540
testl %eax, %eax
setne %r13b
movq %rsp, %rdi
movq %r14, %rsi
callq 0x10950
testl %eax, %eax
je 0x21b20
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 0xf250
leaq 0x13827(%rip), %rsi     # 0x35333
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xfd60
movl %eax, %ebp
jmp 0x21b74
movzwl (%rsp), %eax
cmpl $0xa, %eax
je 0x21b41
cmpl $0x2, %eax
jne 0x21b62
leaq 0x4(%rsp), %rdx
movzbl %r13b, %r8d
movq %r15, %rdi
movl $0x2, %esi
jmp 0x21b52
leaq 0x8(%rsp), %rdx
movzbl %r13b, %r8d
movq %r15, %rdi
movl $0xa, %esi
movq %r12, %rcx
callq 0xf720
testl %eax, %eax
jne 0x21acf
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10800
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_O1/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
leaq 0x146ae(%rip), %rdx     # 0x3624c
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %r15
callq 0x10200
testq %rax, %rax
je 0x21c45
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x10300
leaq 0x480(%rsp), %rsi
movq %rbx, %rdi
callq 0x10630
movq %r14, %rdi
callq 0xf150
leaq 0x80(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10550
testq %rax, %rax
je 0x21c29
leaq 0x480(%rsp), %rbx
leaq 0x80(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf850
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10550
testq %rax, %rax
jne 0x21c09
movq %r14, %rdi
callq 0xfce0
leaq 0x480(%rsp), %rdi
callq 0x10710
movl $0x1, %eax
jmp 0x21c8f
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 0xf250
leaq 0x147e8(%rip), %rsi     # 0x3646a
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfd60
addq $0x24a0, %rsp           # imm = 0x24A0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x145a8(%rip), %rdx     # 0x3624c
movl $0x1, %esi
callq 0xfcf0
movq %rax, %rbx
movq (%rax), %rdi
callq 0x10730
movq $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x8, %esi
callq 0xfb00
movq %rax, %r14
movq $0x0, (%rax)
leaq 0x4(%rsp), %rdi
callq 0xf790
movq %rax, (%r14)
testq %rax, %rax
je 0x21d07
leaq 0x14554(%rip), %rsi     # 0x3624c
movq %rbx, %rdi
callq 0x101f0
movl $0x1, %eax
jmp 0x21d23
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x14498(%rip), %rdx     # 0x3624c
movl $0x1, %esi
callq 0x10720
testq %rax, %rax
je 0x21dda
cmpq $0x0, (%rax)
je 0x21dda
leaq 0x1474c(%rip), %rsi     # 0x3651c
movq %rbx, %rdi
callq 0xfbd0
jmp 0x21de2
movq %rbx, %rdi
callq 0xf980
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x14454(%rip), %rdx     # 0x36256
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %r15
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0xf620
movq %rax, %r14
movq %rbx, %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0xf400
movq %rax, %r12
movl $0x0, 0xc(%rsp)
movq %rbx, %rdi
movl $0x3, %esi
callq 0xf260
cmpl $-0x1, %eax
je 0x21e87
movq %rbx, %rdi
movl $0x3, %esi
callq 0x10690
testl %eax, %eax
je 0x21e87
leaq 0x143a2(%rip), %rdx     # 0x36207
movq %rbx, %rdi
movl $0x3, %esi
callq 0xfcf0
movq (%rax), %rdx
leaq 0xc(%rsp), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0xf870
jmp 0x21ec2
movq %rbx, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0xf620
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x10950
movl %eax, 0xc(%rsp)
testl %eax, %eax
jne 0x21ec2
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %ecx
callq 0xf930
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %edi
testl %edi, %edi
je 0x21f19
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
callq 0xf250
leaq 0x1342e(%rip), %rsi     # 0x35333
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xfd60
movl %eax, %ebp
jmp 0x21f2b
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10800
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_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1430b(%rip), %rdx     # 0x36256
movl $0x1, %esi
callq 0xfcf0
movq %rbx, %rdi
movl $0x2, %esi
callq 0x10640
movl $0x10, %esi
movq %rbx, %rdi
callq 0xfb00
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x16fd4(%rip), %rdx     # 0x38f53
movq %rbx, %rdi
movl $0x2, %esi
xorl %ecx, %ecx
callq 0xf8b0
movq %rax, (%r14)
leaq 0x1a(%rip), %rsi        # 0x21fb2
movq %rbx, %rdi
movl $0x3, %edx
callq 0x109f0
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x1428d(%rip), %rdx     # 0x36256
movl $0xfff0b9d7, %esi       # imm = 0xFFF0B9D7
callq 0xfcf0
movq (%rax), %r14
movq %rbx, %rdi
movl $0xfff0b9d5, %esi       # imm = 0xFFF0B9D5
callq 0x10350
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
movq %r12, %rdi
movq %r13, %rsi
movl $0x1, %edx
movq %r15, %rcx
movq %r14, %r8
callq 0x102c0
testl %eax, %eax
je 0x2203b
movq (%rsp), %rsi
movzwl (%rsi), %eax
cmpl $0xa, %eax
je 0x2203f
cmpl $0x2, %eax
jne 0x22000
addq $0x4, %rsi
leaq 0x10(%rsp), %rdx
movl $0x2, %edi
jmp 0x2204d
xorl %eax, %eax
jmp 0x2209a
addq $0x8, %rsi
leaq 0x10(%rsp), %rdx
movl $0xa, %edi
movl $0x2f, %ecx
callq 0xfda0
movq (%rsp), %rax
movzwl 0x2(%rax), %eax
rolw $0x8, %ax
testw %ax, %ax
je 0x22070
movzwl %ax, %ecx
cmpl $0x35, %ecx
jne 0x2207f
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xfbd0
jmp 0x22095
leaq 0x14463(%rip), %rsi     # 0x364e9
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfff0
movl $0x1, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x24a0, %rsp           # imm = 0x24A0
movq %rdi, %rbx
leaq 0x14198(%rip), %rdx     # 0x36256
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %r15
callq 0x10200
testq %rax, %rax
je 0x22165
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x10840
leaq 0x480(%rsp), %rsi
movq %rbx, %rdi
callq 0x10630
movq %r14, %rdi
callq 0xf150
leaq 0x80(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10550
testq %rax, %rax
je 0x22149
leaq 0x480(%rsp), %rbx
leaq 0x80(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf850
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10550
testq %rax, %rax
jne 0x22129
movq %r14, %rdi
callq 0xfce0
leaq 0x480(%rsp), %rdi
callq 0x10710
movl $0x1, %eax
jmp 0x221af
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 0xf250
leaq 0x142c8(%rip), %rsi     # 0x3646a
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfd60
addq $0x24a0, %rsp           # imm = 0x24A0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x14092(%rip), %rdx     # 0x36256
movl $0x1, %esi
callq 0xfcf0
movq %rax, %rbx
movq (%rax), %rdi
callq 0xfba0
movq $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x14010(%rip), %rdx     # 0x36207
movl $0x1, %esi
callq 0x10720
testq %rax, %rax
je 0x2220b
movq (%rax), %r14
jmp 0x2220e
xorl %r14d, %r14d
movl $0x8, %esi
movq %rbx, %rdi
callq 0xfb00
movq %rax, %r15
movq $0x0, (%rax)
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0xf030
movq %rax, (%r15)
testq %rax, %rax
je 0x22250
leaq 0x14015(%rip), %rsi     # 0x36256
movq %rbx, %rdi
callq 0x101f0
movl $0x1, %eax
jmp 0x2226c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x13f7e(%rip), %rdx     # 0x36207
movl $0x1, %esi
callq 0x10720
testq %rax, %rax
je 0x2229d
movq (%rax), %r14
jmp 0x222a0
xorl %r14d, %r14d
movl $0x8, %esi
movq %rbx, %rdi
callq 0xfb00
movq %rax, %r15
movq $0x0, (%rax)
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0xf220
movq %rax, (%r15)
testq %rax, %rax
je 0x222e2
leaq 0x13f83(%rip), %rsi     # 0x36256
movq %rbx, %rdi
callq 0x101f0
movl $0x1, %eax
jmp 0x222fe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x13eec(%rip), %rdx     # 0x36207
movl $0x1, %esi
callq 0x10720
testq %rax, %rax
je 0x2232f
movq (%rax), %r14
jmp 0x22332
xorl %r14d, %r14d
movl $0x8, %esi
movq %rbx, %rdi
callq 0xfb00
movq %rax, %r15
movq $0x0, (%rax)
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0xf240
movq %rax, (%r15)
testq %rax, %rax
je 0x22374
leaq 0x13ef1(%rip), %rsi     # 0x36256
movq %rbx, %rdi
callq 0x101f0
movl $0x1, %eax
jmp 0x22390
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x13e33(%rip), %rdx     # 0x36256
movl $0x1, %esi
callq 0x10720
testq %rax, %rax
je 0x22449
cmpq $0x0, (%rax)
je 0x22449
leaq 0x140e7(%rip), %rsi     # 0x36526
movq %rbx, %rdi
callq 0xfbd0
jmp 0x22451
movq %rbx, %rdi
callq 0xf980
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x13e0a(%rip), %rdx     # 0x36274
movl $0x1, %esi
callq 0xfcf0
movq %rax, %r14
cmpq $0x0, (%rax)
jne 0x22491
leaq 0x140b9(%rip), %rdx     # 0x3653d
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf3f0
movq (%r14), %r14
movl $0x2, %ebp
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0xf620
movq %rax, %r15
movl $0x1, %edx
movq %rbx, %rdi
movl $0x3, %esi
callq 0xf400
movq %rax, %r12
movl $0x1, %edx
movq %rbx, %rdi
movl $0x4, %esi
callq 0xf400
movq %r14, %rdi
movq %r15, %rsi
movl %r12d, %edx
movl %eax, %ecx
callq 0xf340
testl %eax, %eax
je 0x22500
movl %eax, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq %r14d, %rsi
movq %rbx, %rdi
callq 0xf910
jmp 0x22512
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10800
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x13d44(%rip), %rdx     # 0x36274
movl $0x1, %esi
callq 0xfcf0
movq %rax, %r14
cmpq $0x0, (%rax)
jne 0x22557
leaq 0x13ff3(%rip), %rdx     # 0x3653d
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf3f0
movq (%r14), %r14
movq %r14, %rdi
callq 0xf510
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x22590
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movslq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x10070
testq %rax, %rax
je 0x2256a
movq %rax, %r14
movq 0x50(%rax), %rax
leaq 0x5c(%rax), %rcx
cmpq $0xc, %rax
movl $0x68, %r15d
cmovaeq %rcx, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfb00
movq %rax, %rdi
movq %r15, %rsi
callq 0x10a30
movq %rax, %rdi
movq %r14, %rsi
callq 0x101b0
movq %rax, %rdi
callq 0xf7a0
movl %eax, 0xc(%rsp)
movq %r14, %rdi
callq 0xff30
cmpl $0x0, 0xc(%rsp)
jne 0x2256a
leaq 0x13be5(%rip), %rsi     # 0x361e7
movq %rbx, %rdi
callq 0x101f0
movl $0x1, %eax
jmp 0x22586
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x13bfd(%rip), %rdx     # 0x36274
movl $0x1, %esi
callq 0xfcf0
movq %rax, %r14
cmpq $0x0, (%rax)
jne 0x2269e
leaq 0x13eac(%rip), %rdx     # 0x3653d
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf3f0
movq (%r14), %rdi
callq 0xf800
cmpl $0x1, %eax
je 0x226c7
cmpl $0x4, %eax
je 0x226be
cmpl $0x5, %eax
jne 0x226d8
leaq 0x13079(%rip), %rsi     # 0x35735
jmp 0x226ce
leaq 0x12a86(%rip), %rsi     # 0x3514b
jmp 0x226ce
leaq 0x12fd6(%rip), %rsi     # 0x356a4
movq %rbx, %rdi
callq 0xfbd0
jmp 0x226e0
movq %rbx, %rdi
callq 0xf980
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x138f0(%rip), %rdx     # 0x36274
movl $0x1, %esi
callq 0xfcf0
movq %rax, %rbx
cmpq $0x0, 0x8(%rax)
je 0x229a9
movq (%rbx), %rdi
callq 0xfde0
movq $0x0, (%rbx)
jmp 0x229bb
movq %r14, 0x8(%rbx)
movq (%rbx), %rdi
callq 0xfde0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
leaq 0x138a4(%rip), %rdx     # 0x36274
movl $0x1, %esi
callq 0xfcf0
movq %rax, %rbx
xorl %r14d, %r14d
movq %r14, 0x8(%rax)
movq (%rax), %rdi
callq 0xfde0
movq %r14, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x135e6(%rip), %rdx     # 0x36274
movl $0x1, %esi
callq 0x10720
testq %rax, %rax
je 0x22cbd
cmpq $0x0, (%rax)
leaq 0x138b2(%rip), %rax     # 0x3655a
leaq 0x138b2(%rip), %rsi     # 0x36561
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0xfbd0
jmp 0x22cc5
movq %rbx, %rdi
callq 0xf980
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x22cf2
movl (%rbx), %esi
callq 0xfc10
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0x22cf2
callq 0x10a10
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x10460
movslq %eax, %rsi
movq %rbx, %rdi
callq 0xf910
callq 0x10780
movslq %eax, %rsi
movq %rbx, %rdi
callq 0xf910
callq 0x102b0
movslq %eax, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x3, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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
movsd 0x133e8(%rip), %xmm0    # 0x36128
movl $0x1, %esi
callq 0xf780
ucomisd 0x133d6(%rip), %xmm0    # 0x36128
jae 0x22dac
cvttsd2si %xmm0, %r14
cmpl $0x1, %r14d
ja 0x22d83
leaq 0x1380f(%rip), %rsi     # 0x36575
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xfff0
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0xf3f0
movl %r14d, %eax
negl %eax
xorl %edx, %edx
divl %r14d
movl %edx, %ebp
callq 0x10560
callq *(%rax)
cmpl %ebp, %eax
jb 0x22d8f
xorl %edx, %edx
divl %r14d
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xf910
jmp 0x22dc5
callq 0x10560
callq *(%rax)
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movq %rbx, %rdi
callq 0xf2c0
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xf470
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x8c9c94c7, %edi       # imm = 0x8C9C94C7
jne 0x22e30
callq 0xf090
testq %rax, %rax
je 0x22e56
movq %rax, %r14
leaq 0x2413e(%rip), %rdi     # 0x46f50
callq 0x10740
leaq (%rax), %rbx
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10670
jmp 0x22e5d
addl $0x73636b39, %edi       # imm = 0x73636B39
cmpl $0x4, %edi
ja 0x22e4d
movl %edi, %eax
leaq 0x13798(%rip), %rcx     # 0x365dc
movslq (%rcx,%rax,4), %rbx
addq %rcx, %rbx
jmp 0x22e5d
leaq 0x13a9d(%rip), %rbx     # 0x368f1
jmp 0x22e5d
leaq 0x13a7e(%rip), %rbx     # 0x368db
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rdx, %rax
movq %rsi, %r14
movq %rdi, %r15
movzwl (%rdx), %ecx
cmpl $0x1, %ecx
je 0x22eea
cmpl $0xa, %ecx
je 0x22ebc
cmpl $0x2, %ecx
jne 0x22f26
addq $0x4, %rax
movq %rsp, %rdx
movl $0x2, %edi
movq %rax, %rsi
movl $0x6d, %ecx
callq 0xfda0
leaq 0x13a4c(%rip), %r13     # 0x36906
jmp 0x22edc
addq $0x8, %rax
movq %rsp, %rdx
movl $0xa, %edi
movq %rax, %rsi
movl $0x6d, %ecx
callq 0xfda0
leaq 0x13a32(%rip), %r13     # 0x3690e
testq %rax, %rax
jne 0x22f09
callq 0xf0a0
movl (%rax), %ecx
jmp 0x22f32
addq $0x2, %rax
movq %rsp, %rdi
movb $0x0, 0x6c(%rdi)
movl $0x6c, %edx
movq %rax, %rsi
callq 0xfa60
leaq 0x13a08(%rip), %r13     # 0x36911
movq %rsp, %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0xf4d0
movl $0x1c, %ecx
cmpq %r14, %rax
jae 0x22f32
movq %r15, %rbx
jmp 0x22f50
movl $0x61, %ecx
leaq 0x139d4(%rip), %r13     # 0x36906
testq %r12, %r12
je 0x22f3b
movl %ecx, (%r12)
testq %rbx, %rbx
cmovneq %rbx, %r13
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0xf4d0
movq %rbx, %rax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: 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 $0x128, %rsp            # imm = 0x128
movq %r8, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x20(%rsp), %r12
xorl %r14d, %r14d
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
xorl %esi, %esi
callq 0xf750
movw $0x2, (%r12)
movw $0xa, 0x80(%r12)
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, 0x8(%rsp)
movq %r15, %rdx
callq 0xf750
movl $0x80, %r15d
leaq 0x24(%rsp), %r12
movl $0x80, %r13d
leaq (%rsp,%r14), %rdx
addq $0x20, %rdx
movzwl -0x4(%r12), %edi
cmpl $0x1, %edi
je 0x22ff9
cmpl $0xa, %edi
je 0x22ff3
cmpl $0x2, %edi
jne 0x22fff
movq %r12, %rdx
jmp 0x23001
addq $0x8, %rdx
jmp 0x23001
addq $0x2, %rdx
jmp 0x23001
xorl %edx, %edx
movq %rbp, %rsi
callq 0x10960
cmpl $-0x1, %eax
je 0x23047
cmpl $0x1, %eax
je 0x23026
addq %r15, %r14
addq %r15, %r12
addq $-0x80, %r13
je 0x22fd1
movl $0x61, %ecx
jmp 0x2306f
movzwl -0x4(%r12), %eax
cmpl $0x1, %eax
je 0x23057
cmpl $0x2, %eax
movq 0x8(%rsp), %rsi
je 0x23050
cmpl $0xa, %eax
jne 0x23063
movl $0x1c, %edx
jmp 0x23065
callq 0xf0a0
movl (%rax), %ecx
jmp 0x2306f
movl $0x10, %edx
jmp 0x23065
movl $0x6e, %edx
movq 0x8(%rsp), %rsi
jmp 0x23065
xorl %edx, %edx
movl $0x1c, %ecx
cmpq %rsi, %rdx
jbe 0x23095
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x2307b
movl %ecx, (%rax)
movq 0x10(%rsp), %rbx
movq %rbx, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $-0x4, %r12
cmpl $0x1, %eax
je 0x230b6
cmpl $0x2, %eax
je 0x230af
cmpl $0xa, %eax
jne 0x230bd
movl $0x1c, %edx
jmp 0x230bf
movl $0x10, %edx
jmp 0x230bf
movl $0x6e, %edx
jmp 0x230bf
xorl %edx, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xfa60
jmp 0x23080
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x2, %esi
xorl %eax, %eax
callq 0xf7b0
cmpl $-0x1, %eax
jne 0x2332d
callq 0xf0a0
movl (%rax), %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2334c
movq 0x30(%rsi), %rax
testq %rax, %rax
je 0x2334c
movq 0x28(%rsi), %rsi
movq %rbx, %rdi
callq *%rax
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0x2335e
callq 0x10a10
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %r12d
movl %edi, %r13d
orl $0x80000, %esi          # imm = 0x80000
xorl %edx, %edx
callq 0xf300
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x23408
movl %eax, %ebp
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x23433
movl %r13d, %ecx
andl $-0x9, %ecx
xorl $0x2, %ecx
movl %r12d, %edx
xorl $0x1, %edx
xorl %esi, %esi
cmpl $0xa, %r13d
sete %sil
shll $0x8, %esi
xorl %edi, %edi
cmpl $0x2, %r12d
sete %dil
shll $0x4, %edi
orl %esi, %edi
orl %ecx, %edx
movl $0x2ef, %edx            # imm = 0x2EF
movl $0x28f, %ecx            # imm = 0x28F
cmovel %edx, %ecx
orl %edi, %ecx
andl (%r15), %ecx
movl %ecx, (%r15)
leaq 0x14(%rsp), %rsi
movl $0x0, (%rsi)
movl %ebp, %edi
movl %eax, %edx
movl $0xfffffd1f, %r8d       # imm = 0xFFFFFD1F
callq 0x10970
testl %eax, %eax
jne 0x2340f
movl 0xc(%rsp), %eax
jmp 0x23424
callq 0xf0a0
movl (%rax), %eax
movl %eax, (%r14)
leaq 0xc(%rsp), %rdi
movq %rbx, %rsi
callq 0xf2b0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq