// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/lib/dns.c
// Function: dns_ai_print
size_t dns_ai_print(void *_dst, size_t lim, struct addrinfo *ent, struct dns_addrinfo *ai) {
	struct dns_buf dst = DNS_B_INTO(_dst, lim);
	char addr[DNS_PP_MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 1];

	dns_b_puts(&dst, "[ ");
	dns_b_puts(&dst, ai->qname);
	dns_b_puts(&dst, " IN ");
	if (ai->qtype) {
		dns_b_puts(&dst, dns_strtype(ai->qtype));
	} else if (ent->ai_family == AF_INET) {
		dns_b_puts(&dst, dns_strtype(DNS_T_A));
	} else if (ent->ai_family == AF_INET6) {
		dns_b_puts(&dst, dns_strtype(DNS_T_AAAA));
	} else {
		dns_b_puts(&dst, "0");
	}
	dns_b_puts(&dst, " ]\n");

	dns_b_puts(&dst, ".ai_family    = ");
	switch (ent->ai_family) {
	case AF_INET:
		dns_b_puts(&dst, "AF_INET");
		break;
	case AF_INET6:
		dns_b_puts(&dst, "AF_INET6");
		break;
	default:
		dns_b_fmtju(&dst, ent->ai_family, 0);
		break;
	}
	dns_b_putc(&dst, '\n');

	dns_b_puts(&dst, ".ai_socktype  = ");
	switch (ent->ai_socktype) {
	case SOCK_STREAM:
		dns_b_puts(&dst, "SOCK_STREAM");
		break;
	case SOCK_DGRAM:
		dns_b_puts(&dst, "SOCK_DGRAM");
		break;
	default:
		dns_b_fmtju(&dst, ent->ai_socktype, 0);
		break;
	}
	dns_b_putc(&dst, '\n');

	dns_inet_ntop(dns_sa_family(ent->ai_addr), dns_sa_addr(dns_sa_family(ent->ai_addr), ent->ai_addr, NULL), addr, sizeof addr);
	dns_b_puts(&dst, ".ai_addr      = [");
	dns_b_puts(&dst, addr);
	dns_b_puts(&dst, "]:");
	dns_b_fmtju(&dst, ntohs(*dns_sa_port(dns_sa_family(ent->ai_addr), ent->ai_addr)), 0);
	dns_b_putc(&dst, '\n');

	dns_b_puts(&dst, ".ai_canonname = ");
	dns_b_puts(&dst, (ent->ai_canonname)? ent->ai_canonname : "[NULL]");
	dns_b_putc(&dst, '\n');

	return dns_b_strllen(&dst);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xf0, %rsp
movq %rcx, %r14
leaq 0x8(%rsp), %r15
movq %rdi, (%r15)
movq %rdi, 0x8(%r15)
addq %rdi, %rsi
movq %rsi, 0x10(%r15)
andl $0x0, 0x18(%r15)
movq %rdx, %rbx
andq $0x0, 0x20(%r15)
leaq 0x690c(%rip), %rsi      # 0x34127
movq %r15, %rdi
callq 0x25689
leaq 0x38(%r14), %rsi
movq %r15, %rdi
callq 0x25689
leaq 0x68f4(%rip), %rsi      # 0x3412a
movq %r15, %rdi
callq 0x25689
movl 0x138(%r14), %edi
testl %edi, %edi
je 0x2d861
xorps %xmm0, %xmm0
leaq 0xc0(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
jmp 0x2d8a2
movl 0x4(%rbx), %eax
cmpl $0xa, %eax
je 0x2d88c
cmpl $0x2, %eax
jne 0x2daca
xorps %xmm0, %xmm0
leaq 0x90(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
pushq $0x1
jmp 0x2d8a1
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
pushq $0x1c
popq %rdi
pushq $0x30
popq %rdx
callq 0xf5d0
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x25689
leaq 0x6871(%rip), %rsi      # 0x3412f
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x25689
leaq 0x6861(%rip), %rsi      # 0x34133
movq %r14, %rdi
callq 0x25689
movslq 0x4(%rbx), %rsi
cmpq $0xa, %rsi
je 0x2d8f2
cmpl $0x2, %esi
jne 0x2d905
leaq 0x2c86(%rip), %rsi      # 0x30576
jmp 0x2d8f9
leaq 0x2c85(%rip), %rsi      # 0x3057e
leaq 0x8(%rsp), %rdi
callq 0x25689
jmp 0x2d911
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x25591
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x2d92b
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rsp)
movb $0xa, (%rax)
jmp 0x2d938
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
leaq 0x6805(%rip), %rsi      # 0x34144
leaq 0x8(%rsp), %rdi
callq 0x25689
movslq 0x8(%rbx), %rsi
cmpq $0x2, %rsi
je 0x2d961
cmpl $0x1, %esi
jne 0x2d974
leaq 0x2c30(%rip), %rsi      # 0x3058f
jmp 0x2d968
leaq 0x2c42(%rip), %rsi      # 0x305aa
leaq 0x8(%rsp), %rdi
callq 0x25689
jmp 0x2d980
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x25591
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x2d99a
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rsp)
movb $0xa, (%rax)
jmp 0x2d9a7
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
movq 0x18(%rbx), %rsi
movzwl (%rsi), %edi
cmpl $0x2, %edi
je 0x2d9be
cmpl $0xa, %edi
jne 0x2d9c4
addq $0x8, %rsi
jmp 0x2d9c6
addq $0x4, %rsi
jmp 0x2d9c6
xorl %esi, %esi
leaq 0x30(%rsp), %r14
pushq $0x2f
popq %rcx
movq %r14, %rdx
callq 0xfe30
leaq 0x6778(%rip), %rsi      # 0x34155
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x25689
movq %r15, %rdi
movq %r14, %rsi
callq 0x25689
leaq 0x676b(%rip), %rsi      # 0x34167
movq %r15, %rdi
callq 0x25689
movq 0x18(%rbx), %rax
movzwl (%rax), %ecx
cmpl $0x2, %ecx
je 0x2da15
cmpl $0xa, %ecx
jne 0x2da1b
addq $0x2, %rax
jmp 0x2da22
leaq 0x18c9e(%rip), %rax     # 0x466c0
movzwl (%rax), %eax
rolw $0x8, %ax
movzwl %ax, %esi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x25591
movq 0x8(%r14), %rax
cmpq 0x10(%r14), %rax
jae 0x2da53
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rsp)
movb $0xa, (%rax)
jmp 0x2da60
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
leaq 0x6703(%rip), %rsi      # 0x3416a
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x25689
movq 0x20(%rbx), %rax
testq %rax, %rax
leaq 0x66f9(%rip), %rsi      # 0x3417b
cmovneq %rax, %rsi
movq %r14, %rdi
callq 0x25689
movq 0x8(%r14), %rax
cmpq 0x10(%r14), %rax
jae 0x2daa6
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rsp)
movb $0xa, (%rax)
jmp 0x2dab3
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
leaq 0x8(%rsp), %rdi
callq 0x25899
addq $0xf0, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3ef4(%rip), %rsi      # 0x319c5
leaq 0x8(%rsp), %rdi
jmp 0x2d8b2