LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_sshfp_cmp
int dns_sshfp_cmp(const struct dns_sshfp *a, const struct dns_sshfp *b) {
	int cmp;

	if ((cmp = a->algo - b->algo) || (cmp = a->type - b->type))
		return cmp;

	switch (a->type) {
	case DNS_SSHFP_SHA1:
		return memcmp(a->digest.sha1, b->digest.sha1, sizeof a->digest.sha1);
	default:
		return 0;
	} /* switch() */

	/* NOT REACHED */
}

// Assembly:
movl (%rdi), %eax
subl (%rsi), %eax
jne 0x2a72d
movl 0x4(%rdi), %ecx
movl %ecx, %eax
subl 0x4(%rsi), %eax
jne 0x2a72d
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x2a72d
addq $0x8, %rdi
addq $0x8, %rsi
movl $0x14, %edx
jmp 0xf580
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_txt_parse
int dns_txt_parse(struct dns_txt *txt, struct dns_rr *rr, struct dns_packet *P) {
	struct { unsigned char *b; size_t p, end; } dst, src;
	unsigned n;

	dst.b	= txt->data;
	dst.p	= 0;
	dst.end	= txt->size;

	src.b	= P->data;
	src.p	= rr->rd.p;
	src.end	= src.p + rr->rd.len;

	while (src.p < src.end) {
		n	= 0xff & P->data[src.p++];

		if (src.end - src.p < n || dst.end - dst.p < n)
			return DNS_EILLEGAL;

		memcpy(&dst.b[dst.p], &src.b[src.p], n);

		dst.p	+= n;
		src.p	+= n;
	}

	txt->len	= dst.p;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movzwl 0x16(%rsi), %r12d
xorl %r13d, %r13d
testq %r12, %r12
movq %rdi, 0x8(%rsp)
je 0x2a9fd
movq %rdx, %r14
leaq 0x10(%rdi), %rax
movq %rax, 0x10(%rsp)
movq (%rdi), %rbx
addq $0x5c, %r14
movzwl 0x14(%rsi), %ebp
addq %rbp, %r12
xorl %r13d, %r13d
movzbl (%r14,%rbp), %r15d
incq %rbp
movq %r12, %rcx
subq %rbp, %rcx
movl $0x9b918cc1, %eax       # imm = 0x9B918CC1
cmpq %r15, %rcx
jb 0x2aa08
movq %rbx, %rcx
subq %r13, %rcx
cmpq %r15, %rcx
jb 0x2aa08
movq 0x10(%rsp), %rax
leaq (%rax,%r13), %rdi
leaq (%r14,%rbp), %rsi
movq %r15, %rdx
callq 0xfa60
addq %r15, %r13
addq %r15, %rbp
cmpq %r12, %rbp
jb 0x2a9ba
movq 0x8(%rsp), %rax
movq %r13, 0x8(%rax)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_txt_push
int dns_txt_push(struct dns_packet *P, struct dns_txt *txt) {
	struct { unsigned char *b; size_t p, end; } dst, src;
	unsigned n;

	dst.b	= P->data;
	dst.p	= P->end;
	dst.end	= P->size;

	src.b	= txt->data;
	src.p	= 0;
	src.end	= txt->len;

	if (dst.end - dst.p < 2)
		return DNS_ENOBUFS;

	n	= txt->len + ((txt->len + 254) / 255);

	dst.b[dst.p++]	= 0xff & (n >> 8);
	dst.b[dst.p++]	= 0xff & (n >> 0);

	while (src.p < src.end) {
		n	= DNS_PP_MIN(255, src.end - src.p);

		if (dst.p >= dst.end)
			return DNS_ENOBUFS;

		dst.b[dst.p++]	= n;

		if (dst.end - dst.p < n)
			return DNS_ENOBUFS;

		memcpy(&dst.b[dst.p], &src.b[src.p], n);

		dst.p	+= n;
		src.p	+= n;
	}

	P->end	= dst.p;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x48(%rdi), %rbp
movq 0x50(%rdi), %r13
movq %rbp, %rcx
subq %r13, %rcx
movl $0x9b918cc0, %eax       # imm = 0x9B918CC0
cmpq $0x2, %rcx
jb 0x2aae2
movq 0x8(%rsi), %rbx
leaq 0xfe(%rbx), %rax
movabsq $-0x7f7f7f7f7f7f7f7f, %rcx # imm = 0x8080808080808081
mulq %rcx
shrl $0x7, %edx
leal (%rbx,%rdx), %eax
rolw $0x8, %ax
movq %rdi, 0x8(%rsp)
leaq 0x5c(%rdi), %r14
movw %ax, (%r14,%r13)
addq $0x2, %r13
testq %rbx, %rbx
je 0x2aad0
addq $0x10, %rsi
movq %rsi, 0x10(%rsp)
xorl %r15d, %r15d
cmpq %rbp, %r13
jae 0x2aadd
movq %rbx, %r12
subq %r15, %r12
movl $0xff, %eax
cmpq %rax, %r12
cmovaeq %rax, %r12
movb %r12b, (%r14,%r13)
incq %r13
movq %rbp, %rax
subq %r13, %rax
cmpq %r12, %rax
jb 0x2aadd
leaq (%r14,%r13), %rdi
movq 0x10(%rsp), %rax
leaq (%rax,%r15), %rsi
movq %r12, %rdx
callq 0xfa60
addq %r12, %r13
addq %r12, %r15
cmpq %rbx, %r15
jb 0x2aa87
movq 0x8(%rsp), %rax
movq %r13, 0x50(%rax)
xorl %eax, %eax
jmp 0x2aae2
movl $0x9b918cc0, %eax       # imm = 0x9B918CC0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_any_cname
size_t dns_any_cname(void *dst, size_t lim, union dns_any *any, enum dns_type type) {
	const struct dns_rrtype *t;

	if ((t = dns_rrtype(type)) && t->cname)
		return t->cname(dst, lim, any);

	return 0;
}

// Assembly:
movq $-0x40, %rax
leaq 0x1ba18(%rip), %r8      # 0x46780
cmpl %ecx, 0x40(%rax,%r8)
jne 0x2ad77
cmpq $0x0, 0x58(%rax,%r8)
jne 0x2ad86
addq $0x40, %rax
cmpq $0x300, %rax            # imm = 0x300
jb 0x2ad68
xorl %eax, %eax
retq
movq 0x78(%rax,%r8), %rcx
testq %rcx, %rcx
je 0x2ad83
xorl %eax, %eax
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hosts_open
struct dns_hosts *dns_hosts_open(int *error) {
	static const struct dns_hosts hosts_initializer	= { .refcount = 1 };
	struct dns_hosts *hosts;

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

	*hosts	= hosts_initializer;

	hosts->tail	= &hosts->head;

	return hosts;
syerr:
	*error	= dns_syerr();

	free(hosts);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x18, %edi
callq 0x10110
movq %rax, %rbx
testq %rax, %rax
je 0x2adc8
movups 0xbef4(%rip), %xmm0     # 0x36ca8
movups %xmm0, (%rbx)
movq 0xbefa(%rip), %rax      # 0x36cb8
movq %rax, 0x10(%rbx)
movq %rbx, 0x8(%rbx)
jmp 0x2add2
callq 0xf0a0
movl (%rax), %eax
movl %eax, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hosts_close
void dns_hosts_close(struct dns_hosts *hosts) {
	struct dns_hosts_entry *ent, *xnt;

	if (!hosts || 1 != dns_hosts_release(hosts))
		return;

	for (ent = hosts->head; ent; ent = xnt) {
		xnt	= ent->next;

		free(ent);
	}

	free(hosts);

	return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2ae26
movq %rdi, %rbx
movq $-0x1, %rax
lock
xaddq %rax, 0x10(%rdi)
cmpl $0x1, %eax
jne 0x2ae26
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2ae17
movq 0x168(%rdi), %r14
callq 0xff30
movq %r14, %rdi
testq %r14, %r14
jne 0x2ae03
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xff30
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hosts_local
struct dns_hosts *dns_hosts_local(int *error_) {
	struct dns_hosts *hosts;
	int error;

	if (!(hosts = dns_hosts_open(&error)))
		goto error;

	if ((error = dns_hosts_loadpath(hosts, "/etc/hosts")))
		goto error;

	return hosts;
error:
	*error_	= error;

	dns_hosts_close(hosts);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x4(%rsp), %rdi
callq 0xf790
testq %rax, %rax
je 0x2ae93
movq %rax, %rbx
leaq 0xe156(%rip), %rsi      # 0x38fd0
movq %rax, %rdi
callq 0x10520
testl %eax, %eax
je 0x2ae9c
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x10730
jmp 0x2ae9a
movl 0x4(%rsp), %eax
movl %eax, (%r14)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hosts_loadpath
int dns_hosts_loadpath(struct dns_hosts *hosts, const char *path) {
	FILE *fp;
	int error;

	if (!(fp = dns_fopen(path, "rt", &error)))
		return error;

	error = dns_hosts_loadfile(hosts, fp);

	fclose(fp);

	return error;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
movq %rax, %rdi
callq 0x2b1e8
testq %rax, %rax
je 0x2aedf
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x10390
movl %eax, %ebx
movq %r14, %rdi
callq 0xfce0
movl %ebx, %eax
jmp 0x2aee3
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hosts_insert
int dns_hosts_insert(struct dns_hosts *hosts, int af, const void *addr, const void *host, _Bool alias) {
	struct dns_hosts_entry *ent;
	int error;

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

	dns_d_anchor(ent->host, sizeof ent->host, host, strlen(host));

	switch ((ent->af = af)) {
	case AF_INET6:
		memcpy(&ent->addr.a6, addr, sizeof ent->addr.a6);

		dns_aaaa_arpa(ent->arpa, sizeof ent->arpa, addr);

		break;
	case AF_INET:
		memcpy(&ent->addr.a4, addr, sizeof ent->addr.a4);

		dns_a_arpa(ent->arpa, sizeof ent->arpa, addr);

		break;
	default:
		error	= EINVAL;

		goto error;
	} /* switch() */

	ent->alias	= alias;

	ent->next	= 0;
	*hosts->tail	= ent;
	hosts->tail	= &ent->next;

	return 0;
syerr:
	error	= dns_syerr();
error:
	free(ent);

	return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r13d
movq %rcx, %rbp
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %r14
movl $0x170, %edi            # imm = 0x170
callq 0x10110
movq %rax, %rbx
testq %rax, %rax
je 0x2b17c
movl %r13d, 0x4(%rsp)
movq %rbp, %rdi
callq 0xf560
testq %rax, %rax
je 0x2b13e
movq %rax, %r13
movl $0x100, %edx            # imm = 0x100
cmpq %rdx, %rax
cmovbq %rax, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xfa60
cmpb $0x2e, -0x1(%rbp,%r13)
je 0x2b12e
cmpq $0xff, %r13
ja 0x2b12b
movb $0x2e, (%rbx,%r13)
incq %r13
movl $0xff, %eax
cmpq %rax, %r13
cmovbq %r13, %rax
movb $0x0, (%rbx,%rax)
movl %r12d, 0x14c(%rbx)
cmpl $0x2, %r12d
je 0x2b18d
movl $0x16, %ebp
cmpl $0xa, %r12d
movl 0x4(%rsp), %r12d
jne 0x2b183
movups (%r15), %xmm0
movups %xmm0, 0x150(%rbx)
leaq 0x100(%rbx), %rdi
movl $0x4a, %esi
movq %r15, %rdx
callq 0x10610
jmp 0x2b1af
callq 0xf0a0
movl (%rax), %ebp
movq %rbx, %rdi
callq 0xff30
jmp 0x2b1d7
movl (%r15), %eax
movl %eax, 0x150(%rbx)
leaq 0x100(%rbx), %rdi
movl $0x4a, %esi
movq %r15, %rdx
callq 0xff40
movl 0x4(%rsp), %r12d
movb %r12b, 0x160(%rbx)
movq %rbx, %rax
addq $0x168, %rax            # imm = 0x168
movq $0x0, 0x168(%rbx)
movq 0x8(%r14), %rcx
movq %rbx, (%rcx)
movq %rax, 0x8(%r14)
xorl %ebp, %ebp
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_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_fopen
static FILE *dns_fopen(const char *path, const char *mode, dns_error_t *_error) {
	FILE *fp;
	char mode_cloexec[32];
	int error;

	assert(path && mode && *mode);
	if (!*path) {
		error = EINVAL;
		goto error;
	}

#if _WIN32 || _WIN64
	if ((error = dns_fopen_addflag(mode_cloexec, mode, sizeof mode_cloexec, 'N')))
		goto error;
	if (!(fp = fopen(path, mode_cloexec)))
		goto syerr;
#else
	if ((error = dns_fopen_addflag(mode_cloexec, mode, sizeof mode_cloexec, 'e')))
		goto error;
	if (!(fp = fopen(path, mode_cloexec))) {
		if (errno != EINVAL)
			goto syerr;
		if (!(fp = fopen(path, mode)))
			goto syerr;
	}
#endif

	return fp;
syerr:
	error = dns_syerr();
error:
	*_error = error;

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x2b2ee
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, (%rdi)
je 0x2b25a
movb $0x72, %bpl
xorl %r13d, %r13d
leaq 0xe132(%rip), %r15      # 0x39349
leaq 0xde84(%rip), %r12      # 0x390a2
movsbl %bpl, %esi
movl $0x7, %edx
movq %r15, %rdi
callq 0xfe90
testq %rax, %rax
je 0x2b261
leaq 0x1(%r13), %rcx
movb %bpl, (%rsp,%r13)
movb 0x1(%r13,%r12), %bpl
movq %rcx, %r13
cmpq $0x2, %rcx
jne 0x2b21e
leaq 0x2(%rsp), %rax
addq %rcx, %r12
movl $0x2, %r13d
jmp 0x2b273
movl $0x16, %eax
jmp 0x2b2db
movl $0xc, %eax
cmpq $0x1f, %r13
ja 0x2b2db
addq %r13, %r12
leaq (%rsp,%r13), %rax
movb $0x65, (%rax)
movq %rsp, %rax
addq %r13, %rax
incq %rax
movl $0x1f, %ecx
subq %r13, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x2b2d6
movb (%r12,%rdx), %sil
movb %sil, (%rax,%rdx)
incq %rdx
testb %sil, %sil
jne 0x2b289
movq %rsp, %rsi
movq %r14, %rdi
callq 0xff10
testq %rax, %rax
jne 0x2b2df
callq 0xf0a0
movq %rax, %r15
movl (%rax), %eax
cmpl $0x16, %eax
jne 0x2b2db
leaq 0xddde(%rip), %rsi      # 0x390a2
movq %r14, %rdi
callq 0xff10
testq %rax, %rax
jne 0x2b2df
movl (%r15), %eax
jmp 0x2b2db
movl $0xc, %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe00b(%rip), %rdi      # 0x39300
leaq 0xdb81(%rip), %rsi      # 0x38e7d
leaq 0xe013(%rip), %rcx      # 0x39316
movl $0x4c3, %edx            # imm = 0x4C3
callq 0xf890
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hosts_dump
int dns_hosts_dump(struct dns_hosts *hosts, FILE *fp) {
	struct dns_hosts_entry *ent, *xnt;
	char addr[INET6_ADDRSTRLEN + 1];
	unsigned i;

	for (ent = hosts->head; ent; ent = xnt) {
		xnt	= ent->next;

		dns_inet_ntop(ent->af, &ent->addr, addr, sizeof addr);

		fputs(addr, fp);

		for (i = strlen(addr); i < INET_ADDRSTRLEN; i++)
			fputc(' ', fp);

		fputc(' ', fp);

		fputs(ent->host, fp);
		fputc('\n', fp);
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq (%rdi), %r15
testq %r15, %r15
je 0x2b3b1
movq %rsi, %rbx
movq %rsp, %r14
movq 0x168(%r15), %r13
movl 0x14c(%r15), %edi
leaq 0x150(%r15), %rsi
movq %r14, %rdx
movl $0x2f, %ecx
callq 0xfda0
movq %r14, %rdi
movq %rbx, %rsi
callq 0xfea0
movq %r14, %rdi
callq 0xf560
movq %rax, %r12
cmpl $0xf, %r12d
ja 0x2b380
addl $-0x10, %r12d
movl $0x20, %edi
movq %rbx, %rsi
callq 0x10000
incl %r12d
jne 0x2b36e
movl $0x20, %edi
movq %rbx, %rsi
callq 0x10000
movq %r15, %rdi
movq %rbx, %rsi
callq 0xfea0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10000
movq %r13, %r15
testq %r13, %r13
jne 0x2b32c
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_resconf_open
struct dns_resolv_conf *dns_resconf_open(int *error) {
	static const struct dns_resolv_conf resconf_initializer = {
		.lookup = "bf",
		.family = { AF_INET, AF_INET6 },
		.options = { .ndots = 1, .timeout = 5, .attempts = 2, .tcp = DNS_RESCONF_TCP_ENABLE, },
		.iface = { .ss_family = AF_INET },
	};
	struct dns_resolv_conf *resconf;
	struct sockaddr_in *sin;
	size_t len;

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

	*resconf = resconf_initializer;

	sin = (struct sockaddr_in *)&resconf->nameserver[0];
	sin->sin_family      = AF_INET;
	sin->sin_addr.s_addr = INADDR_ANY;
	sin->sin_port        = htons(53);
#if defined(SA_LEN)
	sin->sin_len         = sizeof *sin;
#endif

	if (0 != gethostname(resconf->search[0], sizeof resconf->search[0]))
		goto syerr;

	len = strlen(resconf->search[0]);
	len = dns_d_anchor(resconf->search[0], sizeof resconf->search[0], resconf->search[0], len);
	len = dns_d_cleave(resconf->search[0], sizeof resconf->search[0], resconf->search[0], len);
	if (1 == len) /* gethostname() returned a string without any label */
		resconf->search[0][0] = '\0';

	dns_resconf_acquire(resconf);

	return resconf;
syerr:
	*error	= dns_syerr();

	free(resconf);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
movl $0x650, %edi            # imm = 0x650
callq 0x10110
movq %rax, %rbx
testq %rax, %rax
je 0x2b65b
movq %rax, %r14
leaq 0xb691(%rip), %rsi      # 0x36cc0
movl $0x650, %edx            # imm = 0x650
movq %rbx, %rdi
callq 0xfa60
movq $0x35000002, (%rbx)     # imm = 0x35000002
addq $0x180, %r14            # imm = 0x180
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
callq 0x10420
testl %eax, %eax
je 0x2b671
callq 0xf0a0
movl (%rax), %eax
movl %eax, (%r15)
movq %rbx, %rdi
callq 0xff30
xorl %ebx, %ebx
jmp 0x2b6d0
movq %r14, %rdi
callq 0xf560
testq %rax, %rax
je 0x2b6a9
cmpb $0x2e, -0x1(%r14,%rax)
je 0x2b696
cmpq $0xff, %rax
ja 0x2b693
movb $0x2e, (%r14,%rax)
incq %rax
movl $0xff, %ecx
cmpq %rcx, %rax
cmovbq %rax, %rcx
movb $0x0, (%r14,%rcx)
jmp 0x2b6ab
xorl %eax, %eax
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
movq %r14, %rdx
movq %rax, %rcx
callq 0x104f0
cmpq $0x1, %rax
jne 0x2b6c8
movb $0x0, (%r14)
lock
incq 0x648(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_resconf_local
struct dns_resolv_conf *dns_resconf_local(int *error_) {
	struct dns_resolv_conf *resconf;
	int error;

	if (!(resconf = dns_resconf_open(&error)))
		goto error;

	if ((error = dns_resconf_loadpath(resconf, "/etc/resolv.conf"))) {
		/*
		 * NOTE: Both the glibc and BIND9 resolvers ignore a missing
		 * /etc/resolv.conf, defaulting to a nameserver of
		 * 127.0.0.1. See also dns_hints_insert_resconf, and the
		 * default initialization of nameserver[0] in
		 * dns_resconf_open.
		 */
		if (error != ENOENT)
			goto error;
	}

	if ((error = dns_nssconf_loadpath(resconf, "/etc/nsswitch.conf"))) {
		if (error != ENOENT)
			goto error;
	}

	return resconf;
error:
	*error_	= error;

	dns_resconf_close(resconf);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x4(%rsp), %rdi
callq 0xf740
testq %rax, %rax
je 0x2b794
movq %rax, %rbx
leaq 0xd88e(%rip), %rsi      # 0x38fdb
movq %rax, %rdi
callq 0xfac0
testl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jne 0x2b772
leaq 0xd889(%rip), %rsi      # 0x38fec
movq %rbx, %rdi
callq 0xfc90
testl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
je 0x2b79d
movl %eax, (%r14)
movq $-0x1, %rax
lock
xaddq %rax, 0x648(%rbx)
cmpl $0x1, %eax
jne 0x2b79b
movq %rbx, %rdi
callq 0xff30
jmp 0x2b79b
movl 0x4(%rsp), %eax
movl %eax, (%r14)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_resconf_loadpath
int dns_resconf_loadpath(struct dns_resolv_conf *resconf, const char *path) {
	FILE *fp;
	int error;

	if (!(fp = dns_fopen(path, "rt", &error)))
		return error;

	error = dns_resconf_loadfile(resconf, fp);

	fclose(fp);

	return error;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
movq %rax, %rdi
callq 0x2b1e8
testq %rax, %rax
je 0x2b7de
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x10a00
movq %r14, %rdi
callq 0xfce0
xorl %eax, %eax
jmp 0x2b7e2
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_nssconf_loadpath
int dns_nssconf_loadpath(struct dns_resolv_conf *resconf, const char *path) {
	FILE *fp;
	int error;

	if (!(fp = dns_fopen(path, "rt", &error)))
		return error;

	error = dns_nssconf_loadfile(resconf, fp);

	fclose(fp);

	return error;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
movq %rax, %rdi
callq 0x2b1e8
testq %rax, %rax
je 0x2b820
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0xf7d0
movq %r14, %rdi
callq 0xfce0
xorl %eax, %eax
jmp 0x2b824
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_resconf_root
struct dns_resolv_conf *dns_resconf_root(int *error) {
	struct dns_resolv_conf *resconf;

	if ((resconf = dns_resconf_local(error)))
		resconf->options.recurse = 1;

	return resconf;
}

// Assembly:
pushq %rax
callq 0xf2d0
testq %rax, %rax
je 0x2b83e
movb $0x1, 0x5c1(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_resconf_pton
int dns_resconf_pton(struct sockaddr_storage *ss, const char *src) {
	struct { char buf[128], *p; } addr = { "", addr.buf };
	unsigned short port = 0;
	int ch, af = AF_INET, error;

	while ((ch = *src++)) {
		switch (ch) {
		case ' ':
			/* FALL THROUGH */
		case '\t':
			break;
		case '[':
			break;
		case ']':
			while ((ch = *src++)) {
				if (dns_isdigit(ch)) {
					port *= 10;
					port += ch - '0';
				}
			}

			goto inet;
		case ':':
			af = AF_INET6;

			/* FALL THROUGH */
		default:
			if (addr.p < endof(addr.buf) - 1)
				*addr.p++ = ch;

			break;
		} /* switch() */
	} /* while() */
inet:

	if ((error = dns_pton(af, addr.buf, dns_sa_addr(af, ss, NULL))))
		return error;

	port = (!port)? 53 : port;
	*dns_sa_port(af, ss) = htons(port);
	dns_sa_family(ss) = af;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rax
movaps %xmm0, 0x70(%rax)
movaps %xmm0, 0x60(%rax)
movaps %xmm0, 0x50(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rax, 0x80(%rax)
movl $0x2, %ebp
leaq 0x7f(%rsp), %rax
incq %r14
movb -0x1(%r14), %cl
movzbl %cl, %edx
cmpl $0x39, %edx
jg 0x2b8aa
cmpl $0x9, %edx
je 0x2b88b
cmpl $0x20, %edx
je 0x2b88b
testl %edx, %edx
je 0x2b91d
jmp 0x2b8c0
cmpl $0x5b, %edx
je 0x2b88b
cmpl $0x3a, %edx
je 0x2b8bb
cmpl $0x5d, %edx
je 0x2b8dd
jmp 0x2b8c0
movl $0xa, %ebp
movq 0x80(%rsp), %rdx
cmpq %rax, %rdx
jae 0x2b88b
leaq 0x1(%rdx), %rsi
movq %rsi, 0x80(%rsp)
movb %cl, (%rdx)
jmp 0x2b88b
movb (%r14), %r12b
testb %r12b, %r12b
je 0x2b91d
incq %r14
callq 0xfe30
movq (%rax), %rax
xorl %ecx, %ecx
movsbl %r12b, %edx
movzbl %dl, %esi
leal (%rcx,%rcx), %edi
testb $0x8, 0x1(%rax,%rsi,2)
leal (%rdi,%rdi,4), %esi
leal -0x30(%rdx,%rsi), %r15d
cmovel %ecx, %r15d
movb (%r14), %r12b
incq %r14
movl %r15d, %ecx
testb %r12b, %r12b
jne 0x2b8f2
jmp 0x2b920
xorl %r15d, %r15d
cmpl $0x2, %ebp
je 0x2b930
cmpl $0xa, %ebp
jne 0x2b936
leaq 0x8(%rbx), %rdx
jmp 0x2b938
leaq 0x4(%rbx), %rdx
jmp 0x2b938
xorl %edx, %edx
movq %rsp, %rsi
movl %ebp, %edi
callq 0x2b984
testl %eax, %eax
jne 0x2b974
testw %r15w, %r15w
movl $0x35, %ecx
cmovnel %r15d, %ecx
rolw $0x8, %cx
cmpl $0x2, %ebp
je 0x2b961
cmpl $0xa, %ebp
jne 0x2b967
leaq 0x2(%rbx), %rdx
jmp 0x2b96e
leaq 0x1cce2(%rip), %rdx     # 0x48650
movw %cx, (%rdx)
movw %bp, (%rbx)
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_pton
static dns_error_t dns_pton(int af, const void *src, void *dst) {
	switch (dns_inet_pton(af, src, dst)) {
	case 1:
		return 0;
	case -1:
		return dns_soerr();
	default:
		return DNS_EADDRESS;
	}
}

// Assembly:
pushq %rax
callq 0x10960
cmpl $0x1, %eax
je 0x2b99d
cmpl $-0x1, %eax
jne 0x2b9a1
callq 0xf0a0
movl (%rax), %eax
jmp 0x2b9a6
xorl %eax, %eax
jmp 0x2b9a6
movl $0x9b918cc5, %eax       # imm = 0x9B918CC5
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_resconf_keyword
static enum dns_resconf_keyword dns_resconf_keyword(const char *word) {
	static const char *words[]	= {
		[DNS_RESCONF_NAMESERVER]	= "nameserver",
		[DNS_RESCONF_DOMAIN]		= "domain",
		[DNS_RESCONF_SEARCH]		= "search",
		[DNS_RESCONF_LOOKUP]		= "lookup",
		[DNS_RESCONF_FILE]		= "file",
		[DNS_RESCONF_BIND]		= "bind",
		[DNS_RESCONF_CACHE]		= "cache",
		[DNS_RESCONF_FAMILY]		= "family",
		[DNS_RESCONF_INET4]		= "inet4",
		[DNS_RESCONF_INET6]		= "inet6",
		[DNS_RESCONF_OPTIONS]		= "options",
		[DNS_RESCONF_EDNS0]		= "edns0",
		[DNS_RESCONF_ROTATE]		= "rotate",
		[DNS_RESCONF_RECURSE]		= "recurse",
		[DNS_RESCONF_SMART]		= "smart",
		[DNS_RESCONF_TCP]		= "tcp",
		[DNS_RESCONF_INTERFACE]		= "interface",
		[DNS_RESCONF_ZERO]		= "0",
		[DNS_RESCONF_ONE]		= "1",
		[DNS_RESCONF_ENABLE]		= "enable",
		[DNS_RESCONF_ONLY]		= "only",
		[DNS_RESCONF_DISABLE]		= "disable",
	};
	unsigned i;

	for (i = 0; i < lengthof(words); i++) {
		if (words[i] && 0 == strcasecmp(words[i], word))
			return i;
	}

	if (0 == strncasecmp(word, "ndots:", sizeof "ndots:" - 1))
		return DNS_RESCONF_NDOTS;

	if (0 == strncasecmp(word, "timeout:", sizeof "timeout:" - 1))
		return DNS_RESCONF_TIMEOUT;

	if (0 == strncasecmp(word, "attempts:", sizeof "attempts:" - 1))
		return DNS_RESCONF_ATTEMPTS;

	if (0 == strncasecmp(word, "tcp:", sizeof "tcp:" - 1))
		return DNS_RESCONF_TCPx;

	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1abe9(%rip), %r15     # 0x46ac0
xorl %r14d, %r14d
movl $0x87000, %r12d         # imm = 0x87000
btq %r14, %r12
jb 0x2bef9
movq (%r15), %rdi
movq %rbx, %rsi
callq 0xfe40
testl %eax, %eax
je 0x2bf86
incq %r14
addq $0x8, %r15
cmpq $0x1a, %r14
jne 0x2bee0
leaq 0xd47a(%rip), %rsi      # 0x39387
movl $0x6, %edx
movq %rbx, %rdi
callq 0x10050
testl %eax, %eax
je 0x2bf70
leaq 0xd469(%rip), %rsi      # 0x3938e
movl $0x8, %edx
movq %rbx, %rdi
callq 0x10050
testl %eax, %eax
je 0x2bf78
leaq 0xd45a(%rip), %rsi      # 0x39397
movl $0x9, %edx
movq %rbx, %rdi
callq 0x10050
testl %eax, %eax
je 0x2bf80
leaq 0xd44c(%rip), %rsi      # 0x393a1
movl $0x4, %edx
movq %rbx, %rdi
callq 0x10050
xorl %r14d, %r14d
negl %eax
sbbl %r14d, %r14d
orl $0x13, %r14d
jmp 0x2bf86
movl $0xc, %r14d
jmp 0x2bf86
movl $0xd, %r14d
jmp 0x2bf86
movl $0xe, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_resconf_setiface
int dns_resconf_setiface(struct dns_resolv_conf *resconf, const char *addr, unsigned short port) {
	int af = (strchr(addr, ':'))? AF_INET6 : AF_INET;
	int error;

	if ((error = dns_pton(af, addr, dns_sa_addr(af, &resconf->iface, NULL))))
		return error;

	*dns_sa_port(af, &resconf->iface)	= htons(port);
	resconf->iface.ss_family		= af;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x3a, %esi
callq 0xf4e0
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
leal 0x2(,%rcx,8), %r14d
leaq (%rbx,%rcx,4), %rdx
addq $0x5cc, %rdx            # imm = 0x5CC
movl %r14d, %edi
movq %r15, %rsi
callq 0x2b984
testl %eax, %eax
jne 0x2bfee
rolw $0x8, %bp
movw %bp, 0x5ca(%rbx)
movw %r14w, 0x5c8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_anyconf_skip
static size_t dns_anyconf_skip(const char *pat, FILE *fp) {
	size_t count = 0;
	int ch;

	while (EOF != (ch = getc(fp))) {
		if (dns_anyconf_match(pat, ch)) {
			count++;
			continue;
		}

		ungetc(ch, fp);

		break;
	}

	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0xf360
cmpl $-0x1, %eax
je 0x2c45b
movl %eax, %ebp
xorl %r14d, %r14d
movq %r15, %rdi
movl %ebp, %esi
callq 0x33105
testb %al, %al
je 0x2c460
incq %r14
movq %rbx, %rdi
callq 0xf360
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x2c439
jmp 0x2c46a
xorl %r14d, %r14d
jmp 0x2c46a
movl %ebp, %edi
movq %rbx, %rsi
callq 0xf1a0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_anyconf_scan
static size_t dns_anyconf_scan(struct dns_anyconf *cf, const char *pat, FILE *fp, int *error) {
	size_t len;
	int ch;

	while (EOF != (ch = getc(fp))) {
		if (dns_anyconf_match(pat, ch)) {
			if ((*error = dns_anyconf_addc(cf, ch)))
				return 0;

			continue;
		} else {
			ungetc(ch, fp);

			break;
		}
	}

	if ((len = cf->cp - cf->tp)) {
		if ((*error = dns_anyconf_push(cf)))
			return 0;

		return len;
	} else {
		*error = 0;

		return 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
callq 0xf360
cmpl $-0x1, %eax
je 0x2c4f6
movl %eax, %ebp
leaq 0x484(%r15), %r14
leaq 0xcb56(%rip), %r13      # 0x38fff
movq %r13, %rdi
movl %ebp, %esi
callq 0x33105
testb %al, %al
je 0x2c4ec
movq 0x490(%r15), %rax
cmpq %r14, %rax
jae 0x2c564
leaq 0x1(%rax), %rcx
movq %rcx, 0x490(%r15)
movb %bpl, (%rax)
movl $0x0, (%rbx)
movq %r12, %rdi
callq 0xf360
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x2c4a9
jmp 0x2c4f6
movl %ebp, %edi
movq %r12, %rsi
callq 0xf1a0
movq 0x490(%r15), %rcx
movq %rcx, %rax
subq 0x488(%r15), %rax
je 0x2c560
leaq 0x484(%r15), %rdx
movl $0xc, %esi
cmpq %rdx, %rcx
jae 0x2c569
cmpl $0xf, 0x80(%r15)
ja 0x2c569
leaq 0x1(%rcx), %rdx
movq %rdx, 0x490(%r15)
movb $0x0, (%rcx)
movq 0x488(%r15), %rsi
movl 0x80(%r15), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x80(%r15)
movq %rsi, (%r15,%rcx,8)
movq 0x490(%r15), %rcx
movq %rcx, 0x488(%r15)
xorl %esi, %esi
jmp 0x2c56b
xorl %esi, %esi
jmp 0x2c569
movl $0xc, %esi
xorl %eax, %eax
movl %esi, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_nssconf_dump_status
static int dns_nssconf_dump_status(int status, int action, unsigned *count, FILE *fp) {
	switch (status) {
	case DNS_NSSCONF_SUCCESS:
		if (action == DNS_NSSCONF_RETURN)
			return 0;
		break;
	default:
		if (action == DNS_NSSCONF_CONTINUE)
			return 0;
		break;
	}

	fputc(' ', fp);

	if (!*count)
		fputc('[', fp);

	fprintf(fp, "%s=%s", dns_nssconf_k2s(status), dns_nssconf_k2s(action));

	++*count;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %r15d
movl %edi, %r12d
cmpl $0x2, %edi
jne 0x2c7c9
cmpl $0x7, %r15d
jne 0x2c7cf
jmp 0x2c83a
cmpl $0x6, %r15d
je 0x2c83a
movl $0x20, %edi
movq %r14, %rsi
callq 0x10000
cmpl $0x0, (%rbx)
jne 0x2c7ee
movl $0x5b, %edi
movq %r14, %rsi
callq 0x10000
leal -0xb(%r12), %eax
leaq 0xc811(%rip), %rcx      # 0x3900b
movq %rcx, %rdx
cmpl $-0x9, %eax
jb 0x2c810
movl %r12d, %eax
leaq 0x1a3e4(%rip), %rdx     # 0x46bf0
movq (%rdx,%rax,8), %rdx
leal -0xb(%r15), %eax
cmpl $-0x9, %eax
jb 0x2c827
movl %r15d, %eax
leaq 0x1a3cd(%rip), %rcx     # 0x46bf0
movq (%rcx,%rax,8), %rcx
leaq 0xcbd7(%rip), %rsi      # 0x39405
movq %r14, %rdi
xorl %eax, %eax
callq 0x102e0
incl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hints_open
struct dns_hints *dns_hints_open(struct dns_resolv_conf *resconf, int *error) {
	static const struct dns_hints H_initializer;
	struct dns_hints *H;

	(void)resconf;

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

	*H	= H_initializer;

	dns_hints_acquire(H);

	return H;
syerr:
	*error	= dns_syerr();

	free(H);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl $0x1, %edi
movl $0x10, %esi
callq 0xf8a0
movq %rax, %r14
testq %rax, %rax
je 0x2cffd
lock
incq (%r14)
jmp 0x2d006
callq 0xf0a0
movl (%rax), %eax
movl %eax, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hints_close
void dns_hints_close(struct dns_hints *H) {
	struct dns_hints_soa *soa, *nxt;

	if (!H || 1 != dns_hints_release(H))
		return /* void */;

	for (soa = H->head; soa; soa = nxt) {
		nxt	= soa->next;

		free(soa);
	}

	free(H);

	return /* void */;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2d067
movq %rdi, %rbx
movq $-0x1, %rax
lock
xaddq %rax, (%rdi)
cmpl $0x1, %eax
jne 0x2d067
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x2d058
movq 0x988(%rdi), %r14
callq 0xff30
movq %r14, %rdi
testq %r14, %r14
jne 0x2d044
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xff30
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hints_local
struct dns_hints *dns_hints_local(struct dns_resolv_conf *resconf, int *error_) {
	struct dns_hints *hints		= 0;
	int error;

	if (resconf)
		dns_resconf_acquire(resconf);
	else if (!(resconf = dns_resconf_local(&error)))
		goto error;

	if (!(hints = dns_hints_open(resconf, &error)))
		goto error;

	error	= 0;

	if (0 == dns_hints_insert_resconf(hints, ".", resconf, &error) && error)
		goto error;

	dns_resconf_close(resconf);

	return hints;
error:
	*error_	= error;

	dns_resconf_close(resconf);
	dns_hints_close(hints);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
testq %rdi, %rdi
je 0x2d0a8
movq %rdi, %r14
lock
incq 0x648(%rdi)
jmp 0x2d0be
leaq 0x4(%rsp), %rdi
callq 0xf2d0
movq %rax, %r14
testq %rax, %rax
je 0x2d149
leaq 0x4(%rsp), %rsi
callq 0xf030
movq %rax, %rbx
testq %rax, %rax
je 0x2d123
leaq 0x4(%rsp), %r12
movl $0x0, (%r12)
leaq 0xbe2f(%rip), %rsi      # 0x38f13
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0xf870
testl %eax, %eax
sete %cl
movl (%r12), %eax
testl %eax, %eax
setne %dl
testb %dl, %cl
jne 0x2d127
movq $-0x1, %rax
lock
xaddq %rax, 0x648(%r14)
cmpl $0x1, %eax
jne 0x2d15c
movq %r14, %rdi
callq 0xff30
jmp 0x2d15c
movl 0x4(%rsp), %eax
movl %eax, (%r15)
movq $-0x1, %rax
lock
xaddq %rax, 0x648(%r14)
cmpl $0x1, %eax
jne 0x2d152
movq %r14, %rdi
callq 0xff30
jmp 0x2d152
movl 0x4(%rsp), %eax
movl %eax, (%r15)
xorl %ebx, %ebx
movq %rbx, %rdi
callq 0xfba0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hints_insert_resconf
unsigned dns_hints_insert_resconf(struct dns_hints *H, const char *zone, const struct dns_resolv_conf *resconf, int *error_) {
	unsigned i, n, p;
	int error;

	for (i = 0, n = 0, p = 1; i < lengthof(resconf->nameserver) && resconf->nameserver[i].ss_family != AF_UNSPEC; i++, n++) {
		union { struct sockaddr_in sin; } tmp;
		struct sockaddr *ns;

		/*
		 * dns_resconf_open initializes nameserver[0] to INADDR_ANY.
		 *
		 * Traditionally the semantics of 0.0.0.0 meant the default
		 * interface, which evolved to mean the loopback interface.
		 * See comment block preceding resolv/res_init.c:res_init in
		 * glibc 2.23. As of 2.23, glibc no longer translates
		 * 0.0.0.0 despite the code comment, but it does default to
		 * 127.0.0.1 when no nameservers are present.
		 *
		 * BIND9 as of 9.10.3 still translates 0.0.0.0 to 127.0.0.1.
		 * See lib/lwres/lwconfig.c:lwres_create_addr and the
		 * convert_zero flag. 127.0.0.1 is also the default when no
		 * nameservers are present.
		 */
		if (dns_hints_isinaddr_any(&resconf->nameserver[i])) {
			memcpy(&tmp.sin, &resconf->nameserver[i], sizeof tmp.sin);
			tmp.sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
			ns = (struct sockaddr *)&tmp.sin;
		} else {
			ns = (struct sockaddr *)&resconf->nameserver[i];
		}

		if ((error = dns_hints_insert(H, zone, ns, p)))
			goto error;

		p += !resconf->options.rotate;
	}

	return n;
error:
	*error_ = error;

	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movl $0x1, %ebp
xorl %ebx, %ebx
movq %rdx, %r15
movzwl (%r15), %eax
testw %ax, %ax
je 0x2d1fc
movq %r15, %rdx
cmpw $0x2, %ax
jne 0x2d1c3
cmpl $0x0, 0x4(%r15)
movq %r15, %rdx
jne 0x2d1c3
movups (%r15), %xmm0
movaps %xmm0, 0x10(%rsp)
movl $0x100007f, 0x14(%rsp)  # imm = 0x100007F
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
movl %ebp, %ecx
callq 0xf930
testl %eax, %eax
jne 0x2d1f5
movzbl 0x5c0(%r14), %eax
xorl $0x1, %eax
addl %eax, %ebp
incq %rbx
subq $-0x80, %r15
cmpq $0x3, %rbx
jne 0x2d191
movl $0x3, %ebx
jmp 0x2d1fc
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hints_insert
int dns_hints_insert(struct dns_hints *H, const char *zone, const struct sockaddr *sa, unsigned priority) {
	static const struct dns_hints_soa soa_initializer;
	struct dns_hints_soa *soa;
	unsigned i;

	if (!(soa = dns_hints_fetch(H, zone))) {
		if (!(soa = malloc(sizeof *soa)))
			return dns_syerr();
		*soa = soa_initializer;
		dns_strlcpy((char *)soa->zone, zone, sizeof soa->zone);

		soa->next = H->head;
		H->head = soa;
	}

	i = soa->count % lengthof(soa->addrs);

	memcpy(&soa->addrs[i].ss, sa, dns_sa_len(sa));

	soa->addrs[i].priority = DNS_PP_MAX(1, priority);

	if (soa->count < lengthof(soa->addrs))
		soa->count++;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
movq 0x8(%rdi), %rbp
testq %rbp, %rbp
je 0x2d333
movq %rbp, %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0xfe40
testl %eax, %eax
je 0x2d38a
movq 0x988(%r14), %r14
testq %r14, %r14
jne 0x2d318
movl $0x1, %edi
movl $0x990, %esi            # imm = 0x990
callq 0xf8a0
testq %rax, %rax
je 0x2d3e8
movq %rax, %r14
xorl %eax, %eax
movb (%r13,%rax), %cl
movb %cl, (%r14,%rax)
testb %cl, %cl
je 0x2d37e
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x2d350
movb $0x0, 0xff(%r14)
addq %rax, %r13
cmpb $0x0, (%r13)
leaq 0x1(%r13), %r13
jne 0x2d373
movq %rbp, 0x988(%r14)
movq %r14, 0x8(%r12)
movl 0x980(%r14), %eax
andl $0xf, %eax
movl %eax, %ecx
shll $0x7, %ecx
leal (%rcx,%rax,8), %eax
leaq (%r14,%rax), %r12
addq $0x100, %r12            # imm = 0x100
movzwl (%r15), %eax
leaq 0xb3de(%rip), %rcx      # 0x38790
movq (%rcx,%rax,8), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0xfa60
cmpl $0x1, %ebx
adcl $0x0, %ebx
movl %ebx, 0x80(%r12)
movl 0x980(%r14), %ecx
xorl %eax, %eax
cmpl $0xf, %ecx
ja 0x2d3ef
incl %ecx
movl %ecx, 0x980(%r14)
jmp 0x2d3ef
callq 0xf0a0
movl (%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hints_grep
unsigned dns_hints_grep(struct sockaddr **sa, socklen_t *sa_len, unsigned lim, struct dns_hints_i *i, struct dns_hints *H) {
	struct dns_hints_soa *soa;
	unsigned n;

	if (!(soa = dns_hints_fetch(H, i->zone)))
		return 0;

	n	= 0;

	while (i->state.next < soa->count && n < lim) {
		*sa	= (struct sockaddr *)&soa->addrs[i->state.next].ss;
		*sa_len	= dns_sa_len(*sa);

		sa++;
		sa_len++;
		n++;

		i->state.next	= dns_hints_i_skip(i->state.next, i, soa);
	}

	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x8(%r8), %r13
xorl %r15d, %r15d
testq %r13, %r13
je 0x2d570
movq %rcx, %r14
movl %edx, %r12d
movq %rdi, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq (%rcx), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xfe40
testl %eax, %eax
je 0x2d44f
movq 0x988(%r13), %r13
testq %r13, %r13
jne 0x2d42f
jmp 0x2d570
movl 0x8(%r14), %ebp
cmpl 0x980(%r13), %ebp
setae %al
testl %r12d, %r12d
sete %cl
orb %al, %cl
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
jne 0x2d570
leaq 0x100(%r13), %rax
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
movl %r12d, 0x1c(%rsp)
movl %ebp, %eax
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rax
movq 0x20(%rsp), %rdi
leaq (%rdi,%rax), %rcx
movq %rsi, 0x8(%rsp)
movq %rcx, (%rsi)
movzwl (%rdi,%rax), %eax
leaq 0xb2de(%rip), %rcx      # 0x38790
movl (%rcx,%rax,8), %eax
movq %rdx, 0x10(%rsp)
movl %eax, (%rdx)
incl %r15d
movl %r15d, 0x4(%rsp)
movl 0x980(%r13), %r12d
movl $0x0, %ebp
testl %r12d, %r12d
je 0x2d537
movl 0x8(%r14), %ebx
xorl %ebp, %ebp
movl %ebp, %edi
movl %ebx, %esi
movq %r14, %rdx
movq %r13, %rcx
callq 0x331b8
testl %eax, %eax
jg 0x2d4f7
incl %ebp
cmpl %ebp, %r12d
jne 0x2d4db
jmp 0x2d567
leal 0x1(%rbp), %r15d
cmpl %r12d, %r15d
jae 0x2d537
movl %r15d, %edi
movl %ebx, %esi
movq %r14, %rdx
movq %r13, %rcx
callq 0x331b8
testl %eax, %eax
jle 0x2d52f
movl %r15d, %edi
movl %ebp, %esi
movq %r14, %rdx
movq %r13, %rcx
callq 0x331b8
movl %r15d, %ecx
testl %eax, %eax
js 0x2d52d
movl %ebp, %ecx
movl %ecx, %ebp
incl %r15d
cmpl %r15d, %r12d
jne 0x2d500
movl %ebp, 0x8(%r14)
cmpl %r12d, %ebp
jae 0x2d56b
movq 0x8(%rsp), %rsi
addq $0x8, %rsi
movq 0x10(%rsp), %rdx
addq $0x4, %rdx
movl 0x4(%rsp), %r15d
movl 0x1c(%rsp), %r12d
cmpl %r12d, %r15d
jb 0x2d489
jmp 0x2d570
movl %r12d, 0x8(%r14)
movl 0x4(%rsp), %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_hints_dump
int dns_hints_dump(struct dns_hints *hints, FILE *fp) {
	struct dns_hints_soa *soa;
	char addr[INET6_ADDRSTRLEN];
	unsigned i;
	int af, error;

	for (soa = hints->head; soa; soa = soa->next) {
		fprintf(fp, "ZONE \"%s\"\n", soa->zone);

		for (i = 0; i < soa->count; i++) {
			af = soa->addrs[i].ss.ss_family;

			if ((error = dns_ntop(af, dns_sa_addr(af, &soa->addrs[i].ss, NULL), addr, sizeof addr)))
				return error;

			fprintf(fp, "\t(%d) [%s]:%hu\n", (int)soa->addrs[i].priority, addr, ntohs(*dns_sa_port(af, &soa->addrs[i].ss)));
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, 0x8(%rsp)
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x2d972
movq 0x8(%rsp), %rdi
leaq 0xb841(%rip), %rsi      # 0x390d6
movq %r14, %rdx
xorl %eax, %eax
callq 0x102e0
cmpl $0x0, 0x980(%r14)
je 0x2d966
leaq 0x100(%r14), %r15
leaq 0x180(%r14), %r13
xorl %r12d, %r12d
movq %r12, %rax
shlq $0x7, %rax
leaq (%rax,%r12,8), %rbx
addq %r15, %rbx
movzwl -0x80(%r13), %ebp
cmpl $0x2, %ebp
je 0x2d8e1
cmpl $0xa, %ebp
jne 0x2d8e7
leaq -0x78(%r13), %rsi
jmp 0x2d8e9
leaq 0x4(%rbx), %rsi
jmp 0x2d8e9
xorl %esi, %esi
movl %ebp, %edi
leaq 0x10(%rsp), %rdx
movl $0x2e, %ecx
callq 0xfda0
testq %rax, %rax
jne 0x2d90a
callq 0xf0a0
movl (%rax), %eax
testl %eax, %eax
jne 0x2d974
cmpl $0x2, %ebp
je 0x2d921
leaq 0x1ad3a(%rip), %rbx     # 0x48650
cmpl $0xa, %ebp
jne 0x2d925
leaq -0x7e(%r13), %rbx
jmp 0x2d925
addq $0x2, %rbx
movl (%r13), %edx
movzwl (%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %r8d
movq 0x8(%rsp), %rdi
leaq 0xb7a1(%rip), %rsi      # 0x390e1
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x102e0
incq %r12
movl 0x980(%r14), %eax
addq $0x88, %r13
cmpq %rax, %r12
jb 0x2d8be
movq 0x988(%r14), %r14
jmp 0x2d880
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_so_open
struct dns_socket *dns_so_open(const struct sockaddr *local, int type, const struct dns_options *opts, int *error) {
	struct dns_socket *so;

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

	if (!dns_so_init(so, local, type, opts, error))
		goto error;

	return so;
syerr:
	*error	= dns_syerr();
error:
	dns_so_close(so);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r12
movl $0x300, %edi            # imm = 0x300
callq 0x10110
testq %rax, %rax
je 0x2da1a
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
movl %ebp, %edx
movq %r15, %rcx
movq %r14, %r8
callq 0x2da32
testq %rax, %rax
jne 0x2da26
movq %rbx, %rdi
callq 0xf6a0
jmp 0x2da24
callq 0xf0a0
movl (%rax), %eax
movl %eax, (%r14)
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_so_init
static struct dns_socket *dns_so_init(struct dns_socket *so, const struct sockaddr *local, int type, const struct dns_options *opts, int *error) {
	static const struct dns_socket so_initializer = { .opts = DNS_OPTS_INITIALIZER, .udp = -1, .tcp = -1, };

	*so		= so_initializer;
	so->type	= type;

	if (opts)
		so->opts = *opts;

	if (local)
		memcpy(&so->local, local, dns_sa_len(local));

	if (-1 == (so->udp = dns_socket((struct sockaddr *)&so->local, SOCK_DGRAM, error)))
		goto error;

	dns_k_permutor_init(&so->qids, 1, 65535);

	return so;
error:
	dns_so_destroy(so);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %r14
movq %rcx, %r12
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xaead(%rip), %rsi      # 0x38900
movl $0x300, %edx            # imm = 0x300
callq 0xfa60
movl %ebp, 0x30(%rbx)
testq %r12, %r12
je 0x2da76
movq 0x10(%r12), %rax
movq %rax, 0x10(%rbx)
movups (%r12), %xmm0
movups %xmm0, (%rbx)
testq %r15, %r15
je 0x2da96
leaq 0x38(%rbx), %rdi
movzwl (%r15), %eax
leaq 0xad06(%rip), %rcx      # 0x38790
movq (%rcx,%rax,8), %rdx
movq %r15, %rsi
callq 0xfa60
leaq 0x38(%rbx), %rdi
movl $0x2, %esi
movq %r14, %rdx
callq 0x2e601
movl %eax, 0x18(%rbx)
cmpl $-0x1, %eax
je 0x2dafb
movaps 0xb17a(%rip), %xmm0     # 0x38c30
movups %xmm0, 0x138(%rbx)
movabsq $0x8000000ff, %rax      # imm = 0x8000000FF
movq %rax, 0x148(%rbx)
xorl %r14d, %r14d
callq *0x1a7f9(%rip)          # 0x482d0
movl %eax, (%rsp,%r14,4)
incq %r14
cmpq $0x4, %r14
jne 0x2dad1
movaps (%rsp), %xmm0
movups %xmm0, 0x150(%rbx)
movl $0x20, 0x160(%rbx)
jmp 0x2db29
movq 0x2e8(%rbx), %rdi
callq 0xff30
leaq 0x1b0(%rbx), %rdi
movl $0x150, %edx            # imm = 0x150
xorl %esi, %esi
callq 0xf750
movq %rbx, %rdi
movl $0x7, %esi
callq 0x2e83d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_so_close
void dns_so_close(struct dns_socket *so) {
	if (!so)
		return;

	dns_so_destroy(so);

	free(so);
}

// Assembly:
testq %rdi, %rdi
je 0x2db77
pushq %rbx
movq %rdi, %rbx
movq 0x2e8(%rdi), %rdi
callq 0xff30
leaq 0x1b0(%rbx), %rdi
movl $0x150, %edx            # imm = 0x150
xorl %esi, %esi
callq 0xf750
movq %rbx, %rdi
movl $0x7, %esi
callq 0x2e83d
movq %rbx, %rdi
popq %rbx
jmp 0xff30
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_so_submit
int dns_so_submit(struct dns_socket *so, struct dns_packet *Q, struct sockaddr *host) {
	struct dns_rr rr;
	int error = DNS_EUNKNOWN;

	dns_so_reset(so);

	if ((error = dns_rr_parse(&rr, 12, Q)))
		goto error;

	if (!(so->qlen = dns_d_expand(so->qname, sizeof so->qname, rr.dn.p, Q, &error)))
		goto error;
	/*
	 * NOTE: Don't bail if expansion is too long; caller may be
	 * intentionally sending long names. However, we won't be able to
	 * verify it on return.
	 */

	so->qtype	= rr.type;
	so->qclass	= rr.class;

	if ((error = dns_so_newanswer(so, (Q->memo.opt.maxudp)? Q->memo.opt.maxudp : DNS_SO_MINBUF)))
		goto syerr;

	memcpy(&so->remote, host, dns_sa_len(host));

	so->query	= Q;
	so->qout	= 0;

	dns_begin(&so->elapsed);

	if (dns_header(so->query)->qid == 0)
		dns_header(so->query)->qid	= dns_so_mkqid(so);

	so->qid		= dns_header(so->query)->qid;
	so->state	= (so->type == SOCK_STREAM)? DNS_SO_TCP_INIT : DNS_SO_UDP_INIT;

	so->stat.queries++;

	return 0;
syerr:
	error	= dns_syerr();
error:
	dns_so_reset(so);

	return error;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movq 0x2e8(%rdi), %rdi
callq 0xff30
leaq 0x1b0(%rbx), %r14
movl $0x150, %edx            # imm = 0x150
movq %r14, %rdi
xorl %esi, %esi
callq 0xf750
leaq 0x8(%rsp), %rdi
movl $0xc, %esi
movq %r15, %rdx
callq 0xf710
movl %eax, %r13d
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0x2dd86
movq 0x2e8(%rbx), %rdi
callq 0xff30
movl $0x150, %edx            # imm = 0x150
movq %r14, %rdi
xorl %esi, %esi
callq 0xf750
movl %r13d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1b6(%rbx), %rdi
movzwl 0xc(%rsp), %edx
leaq 0x4(%rsp), %r8
movl $0x100, %esi            # imm = 0x100
movq %r15, %rcx
callq 0xfec0
movq %rax, 0x2b8(%rbx)
testq %rax, %rax
je 0x2dde8
movq 0x10(%rsp), %rax
movq %rax, 0x2c0(%rbx)
movzwl 0x32(%r15), %eax
testw %ax, %ax
movl $0x300, %ecx            # imm = 0x300
cmovnel %eax, %ecx
movzwl %cx, %esi
movq %rbx, %rdi
callq 0x2de8c
testl %eax, %eax
je 0x2ddf2
callq 0xf0a0
movl (%rax), %r13d
jmp 0x2dd5a
movl 0x4(%rsp), %r13d
jmp 0x2dd5a
leaq 0xb8(%rbx), %rdi
movzwl (%r12), %eax
leaq 0xa98b(%rip), %rcx      # 0x38790
movq (%rcx,%rax,8), %rdx
movq %r12, %rsi
callq 0xfa60
movq %r15, 0x2c8(%rbx)
xorl %r13d, %r13d
movq %r13, 0x2d0(%rbx)
xorl %edi, %edi
callq 0xfc20
movq %rax, 0x2d8(%rbx)
movq %r13, 0x2e0(%rbx)
movq 0x2c8(%rbx), %rax
movzwl 0x5c(%rax), %eax
testq %rax, %rax
jne 0x2de65
movq %rbx, %rdi
callq 0x10340
movq 0x2c8(%rbx), %rcx
movw %ax, 0x5c(%rcx)
movq 0x2c8(%rbx), %rax
movq 0x5c(%rax), %rax
movw %ax, 0x1b4(%rbx)
xorl %eax, %eax
cmpl $0x1, 0x30(%rbx)
sete %al
leal (%rax,%rax,4), %eax
incl %eax
movl %eax, 0x1b0(%rbx)
incq 0x168(%rbx)
jmp 0x2dd75