LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_so_newanswer
static int dns_so_newanswer(struct dns_socket *so, size_t len) {
	size_t size	= offsetof(struct dns_packet, data) + DNS_PP_MAX(len, DNS_SO_MINBUF);
	void *p;

	if (!(p = realloc(so->answer, size)))
		return dns_syerr();

	so->answer	= dns_p_init(p, size);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x301, %rsi            # imm = 0x301
movl $0x300, %r14d           # imm = 0x300
cmovaeq %rsi, %r14
leaq 0x5c(%r14), %rsi
movq 0x2e8(%rdi), %rdi
callq 0x10620
testq %rax, %rax
je 0x2def9
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r14, 0x48(%rax)
movq $0xc, 0x50(%rax)
movl $0x0, 0x64(%rax)
movq $0x0, 0x5c(%rax)
movq %rax, 0x2e8(%rbx)
xorl %eax, %eax
jmp 0x2df00
callq 0xf0a0
movl (%rax), %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_so_verify
static int dns_so_verify(struct dns_socket *so, struct dns_packet *P) {
	char qname[DNS_D_MAXNAME + 1];
	size_t qlen;
	struct dns_rr rr;
	int error = -1;

	if (so->qid != dns_header(so->answer)->qid)
		goto reject;

	if (!dns_p_count(so->answer, DNS_S_QD))
		goto reject;

	if (0 != dns_rr_parse(&rr, 12, so->answer))
		goto reject;

	if (rr.type != so->qtype || rr.class != so->qclass)
		goto reject;

	if (!(qlen = dns_d_expand(qname, sizeof qname, rr.dn.p, P, &error)))
		goto error;
	else if (qlen >= sizeof qname || qlen != so->qlen)
		goto reject;

	if (0 != strcasecmp(so->qname, qname))
		goto reject;

	return 0;
reject:
	error = DNS_EUNKNOWN;
error:
	DNS_SHOW(P, "rejecting packet (%s)", dns_strerror(error));

	return error;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movq 0x2e8(%rdi), %rdx
movq 0x5c(%rdx), %rax
cmpw %ax, 0x1b4(%rdi)
setne %cl
shrq $0x20, %rax
testw %ax, %ax
sete %al
orb %cl, %al
jne 0x2e54e
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movl $0xc, %esi
callq 0xf710
testl %eax, %eax
jne 0x2e54e
movl 0x10(%rsp), %eax
cmpl 0x2c0(%rbx), %eax
jne 0x2e54e
movl 0x14(%rsp), %eax
cmpl 0x2c4(%rbx), %eax
jne 0x2e54e
movzwl 0xc(%rsp), %edx
leaq 0x20(%rsp), %rdi
leaq 0x4(%rsp), %r8
movl $0x100, %esi            # imm = 0x100
movq %r14, %rcx
callq 0xfec0
testq %rax, %rax
je 0x2e55e
cmpq $0xff, %rax
ja 0x2e54e
cmpq 0x2b8(%rbx), %rax
jne 0x2e54e
addq $0x1b6, %rbx            # imm = 0x1B6
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0xfe40
testl %eax, %eax
je 0x2e564
movl $0x9b918cc4, %eax       # imm = 0x9B918CC4
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r14
retq
movl 0x4(%rsp), %eax
jmp 0x2e553
xorl %eax, %eax
jmp 0x2e553
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_so_closefd
static int dns_so_closefd(struct dns_socket *so, int *fd) {
	int error;

	if (*fd == -1)
		return 0;

	if (so->opts.closefd.cb) {
		if ((error = so->opts.closefd.cb(fd, so->opts.closefd.arg))) {
			return error;
		} else if (*fd == -1)
			return 0;
	}

	if (!(so->onum < so->olim)) {
		unsigned olim = DNS_PP_MAX(4, so->olim * 2);
		void *old;

		if (!(old = realloc(so->old, sizeof so->old[0] * olim)))
			return dns_syerr();

		so->old  = old;
		so->olim = olim;
	}

	so->old[so->onum++] = *fd;
	*fd = -1;

	return 0;
}

// Assembly:
movl (%rsi), %ecx
cmpl $-0x1, %ecx
je 0x2e5a8
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2e596
movq (%r14), %rsi
movq %rbx, %rdi
callq *%rax
testl %eax, %eax
jne 0x2e5f2
movl (%rbx), %ecx
cmpl $-0x1, %ecx
je 0x2e5f0
movl 0x28(%r14), %edx
movl 0x2c(%r14), %eax
cmpl %eax, %edx
jae 0x2e5ab
movq 0x20(%r14), %rax
jmp 0x2e5de
xorl %eax, %eax
retq
addl %eax, %eax
cmpl $0x5, %eax
movl $0x4, %r15d
cmovael %eax, %r15d
movq 0x20(%r14), %rdi
leaq (,%r15,4), %rsi
callq 0x10620
testq %rax, %rax
je 0x2e5f8
movq %rax, 0x20(%r14)
movl %r15d, 0x2c(%r14)
movl (%rbx), %ecx
movl 0x28(%r14), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x28(%r14)
movl %edx, %edx
movl %ecx, (%rax,%rdx,4)
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
callq 0xf0a0
movl (%rax), %eax
jmp 0x2e5f2
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_so_query
struct dns_packet *dns_so_query(struct dns_socket *so, struct dns_packet *Q, struct sockaddr *host, int *error_) {
	struct dns_packet *A;
	int error;

	if (!so->state) {
		if ((error = dns_so_submit(so, Q, host)))
			goto error;
	}

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

	if (!(A = dns_so_fetch(so, &error)))
		goto error;

	dns_so_reset(so);

	return A;
error:
	*error_	= error;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdi, %r14
cmpl $0x0, 0x1b0(%rdi)
je 0x2e7c6
movq %r14, %rdi
callq 0xf3d0
testl %eax, %eax
jne 0x2e7d6
leaq 0x1b0(%r14), %rdi
movl (%rdi), %ecx
cmpl $0xa, %ecx
je 0x2e7a1
movl $0x9b918cc4, %eax       # imm = 0x9B918CC4
cmpl $0x5, %ecx
jne 0x2e7d6
movq 0x2e8(%r14), %r15
movq $0x0, 0x2e8(%r14)
testq %r15, %r15
je 0x2e7d4
movl $0x150, %edx            # imm = 0x150
xorl %esi, %esi
callq 0xf750
jmp 0x2e7db
movq %r14, %rdi
callq 0x103d0
testl %eax, %eax
jne 0x2e7d6
jmp 0x2e77d
xorl %eax, %eax
movl %eax, (%rbx)
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_elapsed
static time_t dns_elapsed(struct dns_clock *clk) {
	time_t curtime;

	if ((time_t)-1 == time(&curtime))
		return clk->elapsed;

	if (curtime > clk->sample)
		clk->elapsed += (time_t)DNS_PP_MIN(difftime(curtime, clk->sample), DNS_MAXINTERVAL);

	clk->sample = curtime;

	return clk->elapsed;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %rdi
callq 0xfc20
cmpq $-0x1, %rax
je 0x2e82a
movq (%rsp), %r14
movq (%rbx), %rsi
cmpq %rsi, %r14
jle 0x2e827
movq %r14, %rdi
callq 0xf640
minsd 0xa452(%rip), %xmm0     # 0x38c70
cvttsd2si %xmm0, %rax
addq %rax, 0x8(%rbx)
movq %r14, (%rbx)
movq 0x8(%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_so_closefds
static void dns_so_closefds(struct dns_socket *so, int which) {
	if (DNS_SO_CLOSE_UDP & which)
		dns_socketclose(&so->udp, &so->opts);
	if (DNS_SO_CLOSE_TCP & which)
		dns_socketclose(&so->tcp, &so->opts);
	if (DNS_SO_CLOSE_OLD & which) {
		unsigned i;
		for (i = 0; i < so->onum; i++)
			dns_socketclose(&so->old[i], &so->opts);
		so->onum = 0;
		free(so->old);
		so->old  = 0;
		so->olim = 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
testb $0x1, %bpl
je 0x2e85b
leaq 0x18(%rbx), %rdi
movq %rbx, %rsi
callq 0x33269
testb $0x2, %bpl
je 0x2e86d
leaq 0x1c(%rbx), %rdi
movq %rbx, %rsi
callq 0x33269
cmpl $0x0, 0x28(%rbx)
je 0x2e897
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x20(%rbx), %rdi
addq %r14, %rdi
movq %rbx, %rsi
callq 0x33269
incq %r15
movl 0x28(%rbx), %eax
addq $0x4, %r14
cmpq %rax, %r15
jb 0x2e879
xorl %ebp, %ebp
movl %ebp, 0x28(%rbx)
movq 0x20(%rbx), %rdi
callq 0xff30
movq $0x0, 0x20(%rbx)
movl %ebp, 0x2c(%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_so_pollfd
int dns_so_pollfd(struct dns_socket *so) {
	switch (so->state) {
	case DNS_SO_UDP_CONN:
	case DNS_SO_UDP_SEND:
	case DNS_SO_UDP_RECV:
		return so->udp;
	case DNS_SO_TCP_CONN:
	case DNS_SO_TCP_SEND:
	case DNS_SO_TCP_RECV:
		return so->tcp;
	} /* switch() */

	return -1;
}

// Assembly:
movl 0x1b0(%rdi), %eax
leal -0x7(%rax), %ecx
cmpl $0x3, %ecx
jb 0x2e914
addl $-0x2, %eax
cmpl $0x2, %eax
ja 0x2e918
movl 0x18(%rdi), %eax
retq
movl 0x1c(%rdi), %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_poll
static int dns_poll(int fd, short events, int timeout) {
	fd_set rset, wset;

	if (!events)
		return 0;

	assert(fd >= 0 && (unsigned)fd < FD_SETSIZE);

	FD_ZERO(&rset);
	FD_ZERO(&wset);

	if (events & DNS_POLLIN)
		FD_SET(fd, &rset);

	if (events & DNS_POLLOUT)
		FD_SET(fd, &wset);

	select(fd + 1, &rset, &wset, 0, (timeout >= 0)? &(struct timeval){ timeout, 0 } : NULL);

	return 0;
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
testw %si, %si
je 0x2ea58
cmpl $0x3ff, %edi            # imm = 0x3FF
ja 0x2ea60
xorps %xmm0, %xmm0
movaps %xmm0, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
movzwl %si, %eax
testb $0x1, %al
je 0x2ea0f
movl $0x1, %esi
movl %edi, %ecx
shlq %cl, %rsi
movl %edi, %ecx
shrl $0x6, %ecx
orq %rsi, 0x80(%rsp,%rcx,8)
testb $0x4, %al
je 0x2ea26
movl $0x1, %eax
movl %edi, %ecx
shlq %cl, %rax
movl %edi, %ecx
shrl $0x6, %ecx
orq %rax, (%rsp,%rcx,8)
incl %edi
testl %edx, %edx
js 0x2ea43
movl %edx, %eax
leaq 0x108(%rsp), %r8
movq %rax, (%r8)
movq $0x0, 0x8(%r8)
jmp 0x2ea46
xorl %r8d, %r8d
leaq 0x80(%rsp), %rsi
movq %rsp, %rdx
xorl %ecx, %ecx
callq 0xfc60
addq $0x118, %rsp            # imm = 0x118
retq
leaq 0xa9a4(%rip), %rdi      # 0x3940b
leaq 0xa40f(%rip), %rsi      # 0x38e7d
leaq 0xa9bb(%rip), %rcx      # 0x39430
movl $0x452, %edx            # imm = 0x452
callq 0xf890
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_res_open
struct dns_resolver *dns_res_open(struct dns_resolv_conf *resconf, struct dns_hosts *hosts, struct dns_hints *hints, struct dns_cache *cache, const struct dns_options *opts, int *_error) {
	static const struct dns_resolver R_initializer
		= { .refcount = 1, };
	struct dns_resolver *R	= 0;
	int type, error;

	/*
	 * Grab ref count early because the caller may have passed us a mortal
	 * reference, and we want to do the right thing if we return early
	 * from an error.
	 */
	if (resconf)
		dns_resconf_acquire(resconf);
	if (hosts)
		dns_hosts_acquire(hosts);
	if (hints)
		dns_hints_acquire(hints);
	if (cache)
		dns_cache_acquire(cache);

	/*
	 * Don't try to load it ourselves because a NULL object might be an
	 * error from, say, dns_resconf_root(), and loading
	 * dns_resconf_local() by default would create undesirable surpises.
	 */
	if (!resconf || !hosts || !hints) {
		if (!*_error)
			*_error = EINVAL;
		goto _error;
	}

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

	*R	= R_initializer;
	type	= dns_res_tcp2type(resconf->options.tcp);

	if (!dns_so_init(&R->so, (struct sockaddr *)&resconf->iface, type, opts, &error))
		goto error;

	R->resconf	= resconf;
	R->hosts	= hosts;
	R->hints	= hints;
	R->cache	= cache;

	return R;
syerr:
	error	= dns_syerr();
error:
	*_error	= error;
_error:
	dns_res_close(R);

	dns_resconf_close(resconf);
	dns_hosts_close(hosts);
	dns_hints_close(hints);
	dns_cache_close(cache);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
testq %rdi, %rdi
je 0x2eab2
lock
incq 0x648(%r12)
testq %r15, %r15
je 0x2eabc
lock
incq 0x10(%r15)
testq %r14, %r14
je 0x2eac5
lock
incq (%r14)
testq %rbx, %rbx
je 0x2eacf
lock
incq 0x68(%rbx)
testq %r14, %r14
setne %al
testq %r15, %r15
setne %cl
testq %r12, %r12
setne %dl
andb %cl, %dl
testb %al, %dl
je 0x2eb70
movq %r9, 0x8(%rsp)
movl $0xd38, %edi            # imm = 0xD38
callq 0x10110
movq %rax, %rbp
testq %rax, %rax
je 0x2eb8b
leaq 0x8d13(%rip), %rsi      # 0x37820
movl $0xd38, %edx            # imm = 0xD38
movq %rbp, %rdi
callq 0xfa60
movl 0x5c4(%r12), %eax
xorl %edx, %edx
cmpl $0x2, %eax
sete %dl
addl %edx, %edx
cmpl $0x1, %eax
cmovel %eax, %edx
leaq 0x5c8(%r12), %rsi
movq %r13, %rcx
leaq 0x14(%rsp), %r13
movq %rbp, %rdi
movq %r13, %r8
callq 0x2da32
testq %rax, %rax
je 0x2eb93
movq %r12, 0x300(%rbp)
movq %r15, 0x308(%rbp)
movq %r14, 0x310(%rbp)
movq %rbx, 0x318(%rbp)
jmp 0x2ebe1
cmpl $0x0, (%r9)
jne 0x2eb7d
movl $0x16, (%r9)
xorl %edi, %edi
callq 0xfde0
testq %r12, %r12
jne 0x2eba6
jmp 0x2ebc4
callq 0xf0a0
movq %rax, %r13
movl (%r13), %eax
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movq %rbp, %rdi
callq 0xfde0
movq $-0x1, %rax
lock
xaddq %rax, 0x648(%r12)
cmpl $0x1, %eax
jne 0x2ebc4
movq %r12, %rdi
callq 0xff30
movq %r15, %rdi
callq 0x10730
movq %r14, %rdi
callq 0xfba0
testq %rbx, %rbx
je 0x2ebdf
movq %rbx, %rdi
callq *0x10(%rbx)
xorl %ebp, %ebp
movq %rbp, %rax
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_res_close
void dns_res_close(struct dns_resolver *R) {
	if (!R || 1 < dns_res_release(R))
		return;

	dns_res_reset(R);

	dns_so_destroy(&R->so);

	dns_hints_close(R->hints);
	dns_hosts_close(R->hosts);
	dns_resconf_close(R->resconf);
	dns_cache_close(R->cache);

	free(R);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2ec13
movq %rdi, %rbx
movq $-0x1, %rax
lock
xaddq %rax, 0x320(%rdi)
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x2ec15
popq %rbx
retq
movq %rbx, %rdi
callq 0xfb10
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
movq 0x310(%rbx), %rdi
callq 0xfba0
movq 0x308(%rbx), %rdi
callq 0x10730
movq 0x300(%rbx), %rdi
testq %rdi, %rdi
je 0x2ec87
movq $-0x1, %rax
lock
xaddq %rax, 0x648(%rdi)
cmpl $0x1, %eax
jne 0x2ec87
callq 0xff30
movq 0x318(%rbx), %rdi
testq %rdi, %rdi
je 0x2ec96
callq *0x10(%rdi)
movq %rbx, %rdi
popq %rbx
jmp 0xff30
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_res_stub
struct dns_resolver *dns_res_stub(const struct dns_options *opts, int *error) {
	struct dns_resolv_conf *resconf	= 0;
	struct dns_hosts *hosts		= 0;
	struct dns_hints *hints		= 0;
	struct dns_resolver *res	= 0;

	if (!(resconf = dns_resconf_local(error)))
		goto epilog;

	if (!(hosts = dns_hosts_local(error)))
		goto epilog;

	if (!(hints = dns_hints_local(resconf, error)))
		goto epilog;

	if (!(res = dns_res_open(resconf, hosts, hints, NULL, opts, error)))
		goto epilog;

epilog:
	dns_resconf_close(resconf);
	dns_hosts_close(hosts);
	dns_hints_close(hints);

	return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %r13
movq %rsi, %rdi
callq 0xf2d0
testq %rax, %rax
je 0x2ed21
movq %rax, %r15
movq %r12, %rdi
callq 0x10210
movq %rax, %rbx
testq %rax, %rax
je 0x2ecfc
movq %r15, %rdi
movq %r12, %rsi
callq 0xf240
testq %rax, %rax
je 0x2ecfc
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
movq %r13, %r8
movq %r12, %r9
callq 0xf960
movq %rax, %r12
jmp 0x2ed02
xorl %r14d, %r14d
xorl %r12d, %r12d
movq $-0x1, %rax
lock
xaddq %rax, 0x648(%r15)
cmpl $0x1, %eax
jne 0x2ed29
movq %r15, %rdi
callq 0xff30
jmp 0x2ed29
xorl %r12d, %r12d
xorl %r14d, %r14d
xorl %ebx, %ebx
movq %rbx, %rdi
callq 0x10730
movq %r14, %rdi
callq 0xfba0
movq %r12, %rax
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_res_reset
void dns_res_reset(struct dns_resolver *R) {
	unsigned i;

	dns_so_reset(&R->so);
	dns_p_setptr(&R->nodata, NULL);

	for (i = 0; i < lengthof(R->stack); i++)
		dns_res_frame_destroy(R, &R->stack[i]);

	memset(&R->qname, '\0', sizeof *R - offsetof(struct dns_resolver, qname));

	for (i = 0; i < lengthof(R->stack); i++)
		dns_res_frame_init(R, &R->stack[i]);
}

// Assembly:
pushq %r15
pushq %r14
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 0x4a8(%rbx), %rdi
callq 0xff30
movq $0x0, 0x4a8(%rbx)
movl $0x4b8, %r14d           # imm = 0x4B8
leaq (%rbx,%r14), %rdi
callq 0x2ee1c
addq $0x110, %r14            # imm = 0x110
cmpq $0xd38, %r14            # imm = 0xD38
jne 0x2ed8a
leaq 0x328(%rbx), %rdi
movl $0xa10, %edx            # imm = 0xA10
xorl %esi, %esi
callq 0xf750
movq 0x300(%rbx), %r14
movl $0x4c4, %r15d           # imm = 0x4C4
leaq (%rbx,%r15), %rdi
addq $-0xc, %rdi
movl $0x110, %edx            # imm = 0x110
xorl %esi, %esi
callq 0xf750
testq %r14, %r14
je 0x2ee06
movl $0x2, %eax
cmpb $0x0, 0x5c1(%r14)
jne 0x2edf8
movl $0x1, (%rbx,%r15)
movl $0x3, %eax
cmpb $0x1, 0x5b0(%r14)
jne 0x2ee06
movl %eax, (%rbx,%r15)
addq $0x110, %r15            # imm = 0x110
cmpq $0xd44, %r15            # imm = 0xD44
jne 0x2edc3
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_res_events2
static int dns_res_events2(struct dns_resolver *R, enum dns_events type) {
	int events;

	switch (R->stack[R->sp].state) {
	case DNS_R_CHECK:
		events = R->cache->events(R->cache);

		return (type == DNS_LIBEVENT)? DNS_POLL2EV(events) : events;
	default:
		return dns_so_events2(&R->so, type);
	}
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movl 0x4b0(%rdi), %eax
imulq $0x110, %rax, %rax      # imm = 0x110
cmpl $0x6, 0x4b8(%rdi,%rax)
jne 0x2eef6
movq 0x318(%rdi), %rdi
callq *0x40(%rdi)
movswl %ax, %ecx
movl %ecx, %eax
andl $0x1, %eax
movl %ecx, %edx
andl $0x4, %edx
cmpl $0x1, %ebx
leal (%rdx,%rax,2), %eax
cmovnel %ecx, %eax
popq %rbx
retq
movl 0x1b0(%rdi), %edi
movl %ebx, %esi
popq %rbx
jmp 0x2e8c6
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_res_pollfd
int dns_res_pollfd(struct dns_resolver *R) {
	switch (R->stack[R->sp].state) {
	case DNS_R_CHECK:
		return R->cache->pollfd(R->cache);
	default:
		return dns_so_pollfd(&R->so);
	}
}

// Assembly:
movl 0x4b0(%rdi), %eax
imulq $0x110, %rax, %rax      # imm = 0x110
cmpl $0x6, 0x4b8(%rdi,%rax)
jne 0x2ef25
movq 0x318(%rdi), %rdi
jmpq *0x38(%rdi)
movl 0x1b0(%rdi), %eax
leal -0x7(%rax), %ecx
cmpl $0x3, %ecx
jb 0x2ef3f
addl $-0x2, %eax
cmpl $0x2, %eax
ja 0x2ef43
movl 0x18(%rdi), %eax
retq
movl 0x1c(%rdi), %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_res_timeout
time_t dns_res_timeout(struct dns_resolver *R) {
	time_t elapsed;

	switch (R->stack[R->sp].state) {
#if 0
	case DNS_R_QUERY_AAAA:
#endif
	case DNS_R_QUERY_A:
		elapsed = dns_so_elapsed(&R->so);

		if (elapsed <= dns_resconf_timeout(R->resconf))
			return R->resconf->options.timeout - elapsed;

		break;
	default:
		break;
	} /* switch() */

	/*
	 * NOTE: We're not in a pollable state, or the user code hasn't
	 * called dns_res_check properly. The calling code is probably
	 * broken. Put them into a slow-burn pattern.
	 */
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x4b0(%rdi), %eax
imulq $0x110, %rax, %rax      # imm = 0x110
movl $0x1, %ebx
cmpl $0x10, 0x4b8(%rdi,%rax)
jne 0x2ef9a
movq %rdi, %r14
addq $0x2d8, %rdi            # imm = 0x2D8
callq 0x2e7ed
movq 0x300(%r14), %rcx
movl 0x5b8(%rcx), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpl %edx, %ecx
cmovbl %ecx, %edx
cmpq %rdx, %rax
jg 0x2ef9a
subq %rax, %rcx
movq %rcx, %rbx
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_res_fetch
struct dns_packet *dns_res_fetch(struct dns_resolver *R, int *error) {
	struct dns_packet *P = NULL;

	if (R->stack[0].state != DNS_R_DONE)
		return *error = DNS_EUNKNOWN, (void *)0;

	if (!dns_p_movptr(&P, &R->stack[0].answer))
		return *error = DNS_EFETCHED, (void *)0;

	return P;
}

// Assembly:
movl $0x9b918cc4, %eax       # imm = 0x9B918CC4
cmpl $0x16, 0x4b8(%rdi)
jne 0x31431
movq 0x4d8(%rdi), %rax
movq $0x0, 0x4d8(%rdi)
testq %rax, %rax
je 0x3142c
retq
movl $0x9b918cc8, %eax       # imm = 0x9B918CC8
movl %eax, (%rsi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_res_query
struct dns_packet *dns_res_query(struct dns_resolver *res, const char *qname, enum dns_type qtype, enum dns_class qclass, int timeout, int *error_) {
	int error;

	if ((error = dns_res_submit(res, qname, qtype, qclass)))
		goto error;

	while ((error = dns_res_check(res))) {
		if (dns_res_elapsed(res) > timeout)
			error = DNS_ETIMEDOUT;

		if (error != DNS_EAGAIN)
			goto error;

		if ((error = dns_res_poll(res, 1)))
			goto error;
	}

	return dns_res_fetch(res, error_);
error:
	*error_ = error;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %r12d
movq %rdi, %r14
callq 0xf340
movq %r14, %rdi
callq 0xf510
testl %eax, %eax
je 0x3149c
movl %eax, %ebp
leaq 0x438(%r14), %r15
movslq %r12d, %r12
movl $0x6e, %r13d
movq %r15, %rdi
callq 0x2e7ed
cmpq %r12, %rax
cmovgl %r13d, %ebp
cmpl $0xb, %ebp
jne 0x314c7
movq %r14, %rdi
movl $0x1, %esi
callq 0xfdf0
movq %r14, %rdi
callq 0xf510
movl %eax, %ebp
testl %eax, %eax
jne 0x3146d
movl $0x9b918cc4, %ebp       # imm = 0x9B918CC4
cmpl $0x16, 0x4b8(%r14)
jne 0x314c7
movq 0x4d8(%r14), %rax
movq $0x0, 0x4d8(%r14)
testq %rax, %rax
jne 0x314cb
movl $0x9b918cc8, %ebp       # imm = 0x9B918CC8
movl %ebp, (%rbx)
xorl %eax, %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_ai_close
void dns_ai_close(struct dns_addrinfo *ai) {
	if (!ai)
		return;

	dns_res_close(ai->res);

	if (ai->answer != ai->glue)
		dns_p_free(ai->glue);

	dns_p_free(ai->answer);
	free(ai);
}

// Assembly:
testq %rdi, %rdi
je 0x3173d
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0xfde0
movq 0x158(%rbx), %rdi
movq 0x160(%rbx), %rax
cmpq %rax, %rdi
je 0x3172f
movq %rax, %rdi
callq 0xff30
movq 0x158(%rbx), %rdi
callq 0xff30
movq %rbx, %rdi
popq %rbx
jmp 0xff30
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_ai_setent
static int dns_ai_setent(struct addrinfo **ent, union dns_any *any, enum dns_type type, struct dns_addrinfo *ai) {
	union { struct sockaddr saddr; struct sockaddr_in sin; struct sockaddr_in6 sin6; } saddr = {0};
	const char *cname;
	size_t clen;

	switch (type) {
	case DNS_T_A:
		saddr.sin.sin_family = AF_INET;
		saddr.sin.sin_port = htons(ai->port);

		memcpy(&saddr.sin.sin_addr, any, sizeof saddr.sin.sin_addr);

		break;
	case DNS_T_AAAA:
		saddr.sin6.sin6_family = AF_INET6;
		saddr.sin6.sin6_port = htons(ai->port);

		memcpy(&saddr.sin6.sin6_addr, any, sizeof saddr.sin6.sin6_addr);

		break;
	default:
		return EINVAL;
	} /* switch() */

	if (ai->hints.ai_flags & AI_CANONNAME) {
		cname	= (*ai->cname)? ai->cname : ai->qname;
		clen	= strlen(cname);
	} else {
		cname	= NULL;
		clen	= 0;
	}

	if (!(*ent = malloc(sizeof **ent + dns_sa_len(&saddr) + ((ai->hints.ai_flags & AI_CANONNAME)? clen + 1 : 0))))
		return dns_syerr();

	memset(*ent, '\0', sizeof **ent);

	(*ent)->ai_family	= saddr.saddr.sa_family;
	(*ent)->ai_socktype	= ai->hints.ai_socktype;
	(*ent)->ai_protocol	= ai->hints.ai_protocol;

	(*ent)->ai_addr		= memcpy((unsigned char *)*ent + sizeof **ent, &saddr, dns_sa_len(&saddr));
	(*ent)->ai_addrlen	= dns_sa_len(&saddr);

	if (ai->hints.ai_flags & AI_CANONNAME)
		(*ent)->ai_canonname	= memcpy((unsigned char *)*ent + sizeof **ent + dns_sa_len(&saddr), cname, clen + 1);

	ai->found++;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x1c(%rsp)
movaps %xmm0, 0x10(%rsp)
cmpl $0x1c, %edx
je 0x32075
movl $0x16, %eax
cmpl $0x1, %edx
jne 0x32171
movw $0x2, 0x10(%rsp)
movzwl 0x13e(%rbx), %eax
rolw $0x8, %ax
movw %ax, 0x12(%rsp)
movl (%rsi), %eax
movl %eax, 0x14(%rsp)
movw $0x2, %bp
jmp 0x32098
movw $0xa, 0x10(%rsp)
movzwl 0x13e(%rbx), %eax
rolw $0x8, %ax
movw %ax, 0x12(%rsp)
movups (%rsi), %xmm0
movups %xmm0, 0x18(%rsp)
movw $0xa, %bp
movl (%rbx), %eax
testb $0x2, %al
movl %eax, 0x4(%rsp)
movq %rdi, %r12
jne 0x320b9
movl $0x1, %eax
movq %rax, 0x8(%rsp)
movl $0x30, %edi
xorl %r15d, %r15d
jmp 0x320e6
leaq 0x230(%rbx), %r15
leaq 0x38(%rbx), %rax
cmpb $0x0, 0x230(%rbx)
cmoveq %rax, %r15
movq %r15, %rdi
callq 0xf560
movq %rax, %rdi
incq %rax
movq %rax, 0x8(%rsp)
addq $0x31, %rdi
movzwl %bp, %r14d
leaq 0x669f(%rip), %rax      # 0x38790
movq (%rax,%r14,8), %r13
addq %r13, %rdi
callq 0x10110
movq %rax, (%r12)
testq %rax, %rax
je 0x3216a
movq %rax, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movl %r14d, 0x4(%rax)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%rbp)
movq %rbp, %r14
addq $0x30, %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %r13, %rdx
callq 0xfa60
movq %r14, 0x18(%rbp)
movl %r13d, 0x10(%rbp)
testb $0x2, 0x4(%rsp)
je 0x32160
addq %r13, %r14
movq %r14, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
callq 0xfa60
movq %r14, 0x20(%rbp)
incl 0x538(%rbx)
xorl %eax, %eax
jmp 0x32171
callq 0xf0a0
movl (%rax), %eax
addq $0x38, %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_strsection
const char *(dns_strsection)(enum dns_section section, void *_dst, size_t lim) {
	struct dns_buf dst = DNS_B_INTO(_dst, lim);
	unsigned i;

	for (i = 0; i < lengthof(dns_sections); i++) {
		if (dns_sections[i].type & section) {
			dns_b_puts(&dst, dns_sections[i].name);
			section &= ~dns_sections[i].type;
			if (section)
				dns_b_putc(&dst, '|');
		}
	}

	if (section || dst.p == dst.base)
		dns_b_fmtju(&dst, (0xffff & section), 0);

	return dns_b_tostring(&dst);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbp
movq %rsi, %r14
addq %rsi, %rbp
xorl %ebx, %ebx
leaq 0x5ae4(%rip), %rax      # 0x38560
movq %rsi, 0x10(%rsp)
movl 0x10(%rbx,%rax), %r15d
testl %edi, %r15d
je 0x32adc
leaq (%rax,%rbx), %r12
movl %edi, 0xc(%rsp)
movq %r12, %rdi
callq 0xf560
movq %rbp, %r13
subq %r14, %r13
cmpq %rax, %r13
cmovaeq %rax, %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xfa60
movl 0xc(%rsp), %edi
addq %r13, %r14
notl %r15d
andl %r15d, %edi
je 0x32ad3
cmpq %rbp, %r14
jae 0x32ad5
movb $0x7c, (%r14)
incq %r14
jmp 0x32ad5
xorl %edi, %edi
leaq 0x5a84(%rip), %rax      # 0x38560
addq $0x14, %rbx
cmpq $0xa0, %rbx
jne 0x32a81
testl %edi, %edi
movq 0x10(%rsp), %r11
jne 0x32afb
cmpq %r11, %r14
jne 0x32ba2
movzwl %di, %ecx
xorl %r8d, %r8d
movabsq $-0x3333333333333333, %rdi # imm = 0xCCCCCCCCCCCCCCCD
movq %rcx, %rsi
incq %r8
movq %rsi, %rax
mulq %rdi
shrq $0x3, %rdx
cmpq $0x9, %rsi
movq %rdx, %rsi
ja 0x32b0e
movq %rbp, %rax
subq %r14, %rax
xorl %r9d, %r9d
subq %rax, %r8
cmovaeq %r8, %r9
movl $0x1, %r10d
movq %r14, %r8
movq %rcx, %rsi
movq %rcx, %rax
mulq %rdi
movq %rdx, %rcx
shrq $0x3, %rcx
cmpq %r10, %r9
jae 0x32b6e
cmpq %rbp, %r8
jae 0x32b6e
leaq (%rcx,%rcx), %rax
leaq (%rax,%rax,4), %rax
movq %rsi, %rdx
subq %rax, %rdx
orb $0x30, %dl
movb %dl, (%r8)
incq %r8
incq %r10
cmpq $0x9, %rsi
ja 0x32b3d
cmpq %r8, %r14
jae 0x32b9f
incq %r14
movq %r8, %rax
movb -0x1(%rax), %cl
movb -0x1(%r14), %dl
movb %dl, -0x1(%rax)
decq %rax
movb %cl, -0x1(%r14)
leaq 0x1(%r14), %rcx
cmpq %rax, %r14
movq %rcx, %r14
jb 0x32b82
movq %r8, %r14
cmpq %rbp, %r14
jb 0x32bb6
cmpq %r11, %r14
jbe 0x32bbc
cmpb $0x0, -0x1(%r14)
je 0x32bc3
decq %r14
movb $0x0, (%r14)
jmp 0x32bc3
leaq 0x6448(%rip), %r11      # 0x3900b
movq %r11, %rax
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_isection
enum dns_section dns_isection(const char *src) {
	enum dns_section section = 0;
	char sbuf[128];
	char *name, *next;
	unsigned i;

	dns_strlcpy(sbuf, src, sizeof sbuf);
	next = sbuf;

	while ((name = dns_strsep(&next, "|+, \t"))) {
		for (i = 0; i < lengthof(dns_sections); i++) {
			if (!strcasecmp(dns_sections[i].name, name)) {
				section |= dns_sections[i].type;
				break;
			}
		}
	}

	return section;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
xorl %eax, %eax
movb (%rdi,%rax), %cl
movb %cl, 0x10(%rsp,%rax)
testb %cl, %cl
je 0x32c12
incq %rax
cmpq $0x80, %rax
jne 0x32be8
movb $0x0, 0x8f(%rsp)
addq %rax, %rdi
cmpb $0x0, (%rdi)
leaq 0x1(%rdi), %rdi
jne 0x32c09
leaq 0x10(%rsp), %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x656c(%rip), %rsi      # 0x39192
callq 0xf810
testq %rax, %rax
je 0x32c85
movq %rax, %r12
xorl %ebx, %ebx
leaq 0x5924(%rip), %r13      # 0x38560
leaq 0x654f(%rip), %r14      # 0x39192
leaq 0x8(%rsp), %r15
xorl %ebp, %ebp
movq %r13, %rdi
addq %rbp, %rdi
movq %r12, %rsi
callq 0xfe40
testl %eax, %eax
je 0x32c6b
addq $0x14, %rbp
cmpq $0xa0, %rbp
jne 0x32c4a
jmp 0x32c70
orl 0x10(%rbp,%r13), %ebx
movq %r15, %rdi
movq %r14, %rsi
callq 0xf810
movq %rax, %r12
testq %rax, %rax
jne 0x32c48
jmp 0x32c87
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x98, %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_iclass
enum dns_class dns_iclass(const char *name) {
	unsigned i, class;

	for (i = 0; i < lengthof(dns_classes); i++) {
		if (!strcasecmp(dns_classes[i].name, name))
			return dns_classes[i].type;
	}

	class = 0;
	while (dns_isdigit(*name)) {
		class *= 10;
		class += *name++ - '0';
	}

	return DNS_PP_MIN(class, 0xffff);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x595a(%rip), %rdi      # 0x38600
movq %rbx, %rsi
callq 0xfe40
testl %eax, %eax
je 0x32cf0
callq 0xfe30
movq (%rax), %rax
movzbl (%rbx), %ecx
xorl %edx, %edx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x32ce4
incq %rbx
xorl %edx, %edx
leal (%rdx,%rdx,4), %edx
movsbl %cl, %ecx
leal (%rcx,%rdx,2), %edx
addl $-0x30, %edx
movzbl (%rbx), %ecx
incq %rbx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x32ccb
movl $0xffff, %eax           # imm = 0xFFFF
cmpl %eax, %edx
cmovbl %edx, %eax
jmp 0x32cf5
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_itype
enum dns_type dns_itype(const char *name) {
	unsigned i, type;

	for (i = 0; i < lengthof(dns_rrtypes); i++) {
		if (!strcasecmp(dns_rrtypes[i].name, name))
			return dns_rrtypes[i].type;
	}

	type = 0;
	while (dns_isdigit(*name)) {
		type *= 10;
		type += *name++ - '0';
	}

	return DNS_PP_MIN(type, 0xffff);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x8, %r14d
leaq 0x13a74(%rip), %r15     # 0x46780
movq (%r14,%r15), %rdi
movq %rbx, %rsi
callq 0xfe40
testl %eax, %eax
je 0x32d67
addq $0x40, %r14
cmpq $0x348, %r14            # imm = 0x348
jne 0x32d0c
callq 0xfe30
movq (%rax), %rax
movzbl (%rbx), %ecx
xorl %edx, %edx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x32d5b
incq %rbx
xorl %edx, %edx
leal (%rdx,%rdx,4), %edx
movsbl %cl, %ecx
leal (%rcx,%rdx,2), %edx
addl $-0x30, %edx
movzbl (%rbx), %ecx
incq %rbx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x32d42
movl $0xffff, %eax           # imm = 0xFFFF
cmpl %eax, %edx
cmovbl %edx, %eax
jmp 0x32d6c
movl -0x8(%r14,%r15), %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_stropcode
const char *dns_stropcode(enum dns_opcode opcode) {
	opcode = (unsigned)opcode % lengthof(dns_opcodes);

	if ('\0' == dns_opcodes[opcode][0])
		return dns__strcode(opcode, dns_opcodes[opcode], sizeof dns_opcodes[opcode]);

	return dns_opcodes[opcode];
}

// Assembly:
pushq %rbx
andl $0xf, %edi
movl %edi, %eax
shll $0x4, %eax
leaq 0x1555e(%rip), %rcx     # 0x482e0
leaq (%rcx,%rax), %rbx
cmpb $0x0, (%rax,%rcx)
jne 0x32d94
movq %rbx, %rsi
callq 0x32d99
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns__strcode
static const char *dns__strcode(int code, volatile char *dst, size_t lim) {
	char _tmp[48] = "";
	struct dns_buf tmp;
	size_t p;

	assert(lim > 0);
	dns_b_fmtju(dns_b_into(&tmp, _tmp, DNS_PP_MIN(sizeof _tmp, lim - 1)), code, 0);

	/* copy downwards so first byte is copied last (see below) */
	p = (size_t)(tmp.p - tmp.base);
	dst[p] = '\0';
	while (p--)
		dst[p] = _tmp[p];

	return (const char *)dst;
}

// Assembly:
pushq %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x10(%rsp)
movaps %xmm0, -0x20(%rsp)
movaps %xmm0, -0x30(%rsp)
movl %edi, %ecx
xorl %r8d, %r8d
movabsq $-0x3333333333333333, %r9 # imm = 0xCCCCCCCCCCCCCCCD
movq %rcx, %rdi
incq %r8
movq %rdi, %rax
mulq %r9
shrq $0x3, %rdx
cmpq $0x9, %rdi
movq %rdx, %rdi
ja 0x32dbe
xorl %edi, %edi
subq $0xf, %r8
cmovbq %rdi, %r8
movl $0x1, %r10d
cmpq %r10, %r8
setb %r11b
cmpq $0xf, %rdi
setl %bl
movq %rcx, %rax
mulq %r9
andb %r11b, %bl
shrq $0x3, %rdx
cmpb $0x1, %bl
jne 0x32e1e
leaq (%rdx,%rdx), %rax
leaq (%rax,%rax,4), %rax
movq %rcx, %r11
subq %rax, %r11
orb $0x30, %r11b
movb %r11b, -0x30(%rsp,%rdi)
incq %rdi
incq %r10
cmpq $0x9, %rcx
movq %rdx, %rcx
ja 0x32de4
testq %rdi, %rdi
jle 0x32e59
leaq (%rsp,%rdi), %rcx
addq $-0x30, %rcx
leaq -0x2f(%rsp), %rax
movb -0x1(%rcx), %dl
movb -0x1(%rax), %r8b
movb %r8b, -0x1(%rcx)
decq %rcx
movb %dl, -0x1(%rax)
leaq 0x1(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0x32e3c
movb $0x0, (%rsi,%rdi)
testq %rdi, %rdi
je 0x32e75
movq %rdi, %rax
movb -0x31(%rsp,%rdi), %cl
movb %cl, -0x1(%rsi,%rdi)
decq %rax
movq %rax, %rdi
jne 0x32e65
movq %rsi, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_iopcode
enum dns_opcode dns_iopcode(const char *name) {
	unsigned opcode;

	for (opcode = 0; opcode < lengthof(dns_opcodes); opcode++) {
		if (!strcasecmp(name, dns_opcodes[opcode]))
			return opcode;
	}

	opcode = 0;
	while (dns_isdigit(*name)) {
		opcode *= 10;
		opcode += *name++ - '0';
	}

	return DNS_PP_MIN(opcode, 0x0f);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x15457(%rip), %r15     # 0x482e0
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfe40
testl %eax, %eax
je 0x32ee7
incq %r14
addq $0x10, %r15
cmpq $0x10, %r14
jne 0x32e8c
callq 0xfe30
movq (%rax), %rax
movzbl (%rbx), %ecx
xorl %edx, %edx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x32eda
incq %rbx
xorl %edx, %edx
leal (%rdx,%rdx,4), %edx
movsbl %cl, %ecx
leal (%rcx,%rdx,2), %edx
addl $-0x30, %edx
movzbl (%rbx), %ecx
incq %rbx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x32ec1
cmpl $0xf, %edx
movl $0xf, %eax
cmovbl %edx, %eax
jmp 0x32eea
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_strrcode
const char *dns_strrcode(enum dns_rcode rcode) {
	rcode = (unsigned)rcode % lengthof(dns_rcodes);

	if ('\0' == dns_rcodes[rcode][0])
		return dns__strcode(rcode, dns_rcodes[rcode], sizeof dns_rcodes[rcode]);

	return dns_rcodes[rcode];
}

// Assembly:
pushq %rbx
andl $0x1f, %edi
movl %edi, %eax
shll $0x4, %eax
leaq 0x154e0(%rip), %rcx     # 0x483e0
leaq (%rcx,%rax), %rbx
cmpb $0x0, (%rax,%rcx)
jne 0x32f12
movq %rbx, %rsi
callq 0x32d99
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_ircode
enum dns_rcode dns_ircode(const char *name) {
	unsigned rcode;

	for (rcode = 0; rcode < lengthof(dns_rcodes); rcode++) {
		if (!strcasecmp(name, dns_rcodes[rcode]))
			return rcode;
	}

	rcode = 0;
	while (dns_isdigit(*name)) {
		rcode *= 10;
		rcode += *name++ - '0';
	}

	return DNS_PP_MIN(rcode, 0xfff);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x154ba(%rip), %r15     # 0x483e0
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfe40
testl %eax, %eax
je 0x32f83
incq %r14
addq $0x10, %r15
cmpq $0x20, %r14
jne 0x32f29
callq 0xfe30
movq (%rax), %rax
movzbl (%rbx), %ecx
xorl %edx, %edx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x32f77
incq %rbx
xorl %edx, %edx
leal (%rdx,%rdx,4), %edx
movsbl %cl, %ecx
leal (%rcx,%rdx,2), %edx
addl $-0x30, %edx
movzbl (%rbx), %ecx
incq %rbx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x32f5e
movl $0xfff, %eax            # imm = 0xFFF
cmpl %eax, %edx
cmovbl %edx, %eax
jmp 0x32f86
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_s_study
static int dns_s_study(struct dns_s_memo *m, enum dns_section section, unsigned short base, struct dns_packet *P) {
	unsigned short count, rp;

	count = dns_p_count(P, section);

	for (rp = base; count && rp < P->end; count--)
		rp = dns_rr_skip(rp, P);

	m->base = base;
	m->end  = rp;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movl %edx, %ebx
movq %rdi, %r14
movq %rcx, %rdi
callq 0x10790
movl %eax, %ebp
movl %ebx, %eax
testw %bp, %bp
je 0x32fc8
movq 0x50(%r15), %r12
movl %ebx, %eax
movzwl %ax, %edi
cmpq %rdi, %r12
jbe 0x32fc8
movq %r15, %rsi
callq 0xf2e0
decw %bp
jne 0x32fb3
movw %bx, (%r14)
movw %ax, 0x2(%r14)
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_rr_i_match
static _Bool dns_rr_i_match(struct dns_rr *rr, struct dns_rr_i *i, struct dns_packet *P) {
	if (i->section && !(rr->section & i->section))
		return 0;

	if (i->type && rr->type != i->type && i->type != DNS_T_ALL)
		return 0;

	if (i->class && rr->class != i->class && i->class != DNS_C_ANY)
		return 0;

	if (i->name) {
		char dn[DNS_D_MAXNAME + 1];
		size_t len;
		int error;

		if (!(len = dns_d_expand(dn, sizeof dn, rr->dn.p, P, &error))
		||  len >= sizeof dn)
			return 0;

		if (0 != strcasecmp(dn, i->name))
			return 0;
	}

	if (i->data && i->type && rr->section > DNS_S_QD) {
		union dns_any rd;
		int error;

		if ((error = dns_any_parse(&rd, rr, P)))
			return 0;

		if (0 != dns_any_cmp(&rd, rr->type, i->data, i->type))
			return 0;
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %eax
testl %eax, %eax
je 0x33003
testl %eax, (%r14)
je 0x330ef
movl 0x10(%rbx), %r13d
testl %r13d, %r13d
je 0x3301f
cmpl $0xff, %r13d
je 0x3301f
cmpl %r13d, 0x8(%r14)
jne 0x330ef
movl 0x14(%rbx), %eax
testl %eax, %eax
je 0x33037
cmpl $0xff, %eax
je 0x33037
cmpl %eax, 0xc(%r14)
jne 0x330ef
movq 0x8(%rbx), %r12
testq %r12, %r12
je 0x3307f
movzwl 0x4(%r14), %edx
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %r8
movl $0x100, %esi            # imm = 0x100
movq %r15, %rcx
callq 0xfec0
addq $-0x100, %rax
cmpq $-0xff, %rax
jb 0x330ef
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0xfe40
testl %eax, %eax
jne 0x330ef
movb $0x1, %bpl
testl %r13d, %r13d
je 0x330f1
cmpq $0x0, 0x18(%rbx)
je 0x330f1
cmpl $0x2, (%r14)
jb 0x330f1
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xfe70
testl %eax, %eax
jne 0x330ef
movl 0x8(%r14), %eax
cmpl 0x10(%rbx), %eax
jne 0x330ef
movq 0x18(%rbx), %rsi
movq $-0x40, %rcx
leaq 0x136bd(%rip), %rdx     # 0x46780
cmpl %eax, 0x40(%rcx,%rdx)
jne 0x330d1
cmpq $0x0, 0x58(%rcx,%rdx)
jne 0x330e0
addq $0x40, %rcx
cmpq $0x300, %rcx            # imm = 0x300
jb 0x330c3
jmp 0x330ef
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq *0x68(%rcx,%rdx)
testl %eax, %eax
je 0x330f1
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x428, %rsp            # imm = 0x428
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_anyconf_match
static _Bool dns_anyconf_match(const char *pat, int mc) {
	_Bool match;
	int pc;

	if (*pat == '^') {
		match = 0;
		++pat;
	} else {
		match = 1;
	}

	while ((pc = *(const unsigned char *)pat++)) {
		switch (pc) {
		case '%':
			if (!(pc = *(const unsigned char *)pat++))
				return !match;

			switch (pc) {
			case 'a':
				if (dns_isalpha(mc))
					return match;
				break;
			case 'd':
				if (dns_isdigit(mc))
					return match;
				break;
			case 'w':
				if (dns_isalnum(mc))
					return match;
				break;
			case 's':
				if (dns_isspace(mc))
					return match;
				break;
			default:
				if (mc == pc)
					return match;
				break;
			} /* switch() */

			break;
		default:
			if (mc == pc)
				return match;
			break;
		} /* switch() */
	} /* while() */

	return !match;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
xorl %ebx, %ebx
cmpb $0x5e, (%rdi)
setne %r14b
sete %bl
movq %rbx, %r15
addq %rdi, %r15
movzbl %bpl, %r12d
movzbl (%r15), %eax
cmpl $0x25, %eax
je 0x3313b
testl %eax, %eax
je 0x331ad
incq %r15
cmpl %ebp, %eax
jne 0x33125
jmp 0x331aa
movzbl 0x1(%r15), %eax
addq $0x2, %r15
cmpl $0x72, %eax
jg 0x33165
cmpl $0x61, %eax
je 0x33180
cmpl $0x64, %eax
jne 0x331a4
callq 0xfe30
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r12,2)
je 0x33125
jmp 0x331aa
cmpl $0x73, %eax
je 0x33192
cmpl $0x77, %eax
jne 0x33135
callq 0xfe30
movq (%rax), %rax
testb $0x8, (%rax,%r12,2)
je 0x33125
jmp 0x331aa
callq 0xfe30
movq (%rax), %rax
testb $0x4, 0x1(%rax,%r12,2)
je 0x33125
jmp 0x331aa
callq 0xfe30
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r12,2)
je 0x33125
jmp 0x331aa
testl %eax, %eax
jne 0x33135
jmp 0x331ad
movl %r14d, %ebx
movl %ebx, %eax
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_hints_i_cmp
static int dns_hints_i_cmp(unsigned a, unsigned b, struct dns_hints_i *i, struct dns_hints_soa *soa) {
	int cmp;

	if ((cmp = soa->addrs[a].priority - soa->addrs[b].priority))
		return cmp;

	return dns_k_shuffle16(a, i->state.seed) - dns_k_shuffle16(b, i->state.seed);
}

// Assembly:
movl %edi, %eax
movq %rax, %r8
shlq $0x7, %r8
leaq (%r8,%rax,8), %rax
movl 0x180(%rcx,%rax), %eax
movl %esi, %r8d
movq %r8, %r9
shlq $0x7, %r9
leaq (%r9,%r8,8), %r8
subl 0x180(%rcx,%r8), %eax
je 0x331e5
retq
movl 0xc(%rdx), %ecx
movl %edi, %edx
shrl $0x8, %edx
movl $0x4, %eax
leaq 0x5417(%rip), %r8       # 0x38610
movl %ecx, %r9d
movl %r9d, %r10d
xorb %dil, %r10b
movzbl %r10b, %r10d
movzbl %dl, %r11d
movl %edx, %edi
xorb (%r10,%r8), %dil
movb (%r11,%r8), %dl
xorb %dil, %dl
shrl $0x8, %r9d
decl %eax
jne 0x331fc
movzbl %dil, %eax
shll $0x8, %eax
movl %esi, %edi
shrl $0x8, %edi
movl $0x4, %r9d
movl %ecx, %r10d
xorb %sil, %r10b
movzbl %r10b, %r10d
movzbl %dil, %r11d
movl %edi, %esi
xorb (%r10,%r8), %sil
movb (%r11,%r8), %dil
xorb %sil, %dil
shrl $0x8, %ecx
decl %r9d
jne 0x33231
movzbl %dl, %ecx
orl %ecx, %eax
movzbl %sil, %ecx
movzbl %dil, %edx
shll $0x8, %ecx
orl %edx, %ecx
subl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_socketclose
static void dns_socketclose(int *fd, const struct dns_options *opts) {
	if (opts && opts->closefd.cb)
		opts->closefd.cb(fd, opts->closefd.arg);

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x33283
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x33283
movq (%rsi), %rsi
movq %rbx, %rdi
callq *%rax
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0x33295
callq 0x10a10
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_q_make2
static dns_error_t
dns_q_make2(struct dns_packet **_Q, const char *qname, size_t qlen, enum dns_type qtype, enum dns_class qclass, int qflags)
{
	struct dns_packet *Q = NULL;
	int error;

	if (dns_p_movptr(&Q, _Q)) {
		dns_p_reset(Q);
	} else if (!(Q = dns_p_make(DNS_P_QBUFSIZ, &error))) {
		goto error;
	}

	if ((error = dns_p_push(Q, DNS_S_QD, qname, qlen, qtype, qclass, 0, 0)))
		goto error;

	dns_header(Q)->rd = !!(qflags & DNS_Q_RD);

	if (qflags & DNS_Q_EDNS0) {
		struct dns_opt opt = DNS_OPT_INIT(&opt);

		opt.version = 0; /* RFC 6891 version */
		opt.maxudp = 4096;

		if ((error = dns_p_push(Q, DNS_S_AR, ".", 1, DNS_T_OPT, dns_opt_class(&opt), dns_opt_ttl(&opt), &opt)))
			goto error;
	}

	*_Q = Q;

	return 0;
error:
	dns_p_free(Q);

	return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl %r9d, 0x4(%rsp)
movl %r8d, %r15d
movl %ecx, %r12d
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movq (%rdi), %rbx
movq $0x0, (%rdi)
testq %rbx, %rbx
je 0x332dd
movq 0x48(%rbx), %rsi
addq $0x5c, %rsi
movq %rbx, %rdi
callq 0x10a30
jmp 0x332f6
movq %rsp, %rsi
movl $0x160, %edi            # imm = 0x160
callq 0xfa30
movq %rax, %rbx
testq %rax, %rax
je 0x333a3
movq %rbx, %rdi
movl $0x1, %esi
movq %rbp, %rdx
movq %r13, %rcx
movl %r12d, %r8d
movl %r15d, %r9d
pushq $0x0
pushq $0x0
callq 0x106d0
addq $0x10, %rsp
movl %eax, (%rsp)
testl %eax, %eax
jne 0x333a5
movl 0x4(%rsp), %edx
movl %edx, %eax
andl $0x1, %eax
movq $-0x10001, %rcx         # imm = 0xFFFEFFFF
andq 0x5c(%rbx), %rcx
shll $0x10, %eax
orq %rax, %rcx
movq %rcx, 0x5c(%rbx)
testb $0x2, %dl
je 0x3339c
leaq 0x8(%rsp), %r15
movl $0x120, %edx            # imm = 0x120
movq %r15, %rdi
xorl %esi, %esi
callq 0xf750
movq $0x100, 0x10(%r15)      # imm = 0x100
movw $0x1000, 0x8(%r15)      # imm = 0x1000
leaq 0x5ba4(%rip), %rdx      # 0x38f13
movl $0x1, %ecx
movq %rbx, %rdi
movl $0x8, %esi
movl $0x29, %r8d
movl $0x1000, %r9d           # imm = 0x1000
pushq %r15
pushq $0x0
callq 0x106d0
addq $0x10, %rsp
movl %eax, (%rsp)
testl %eax, %eax
jne 0x333a5
movq %rbx, (%r14)
xorl %eax, %eax
jmp 0x333b0
xorl %ebx, %ebx
movq %rbx, %rdi
callq 0xff30
movl (%rsp), %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq