// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
leaq -0x48(%rbp), %rdi
leaq 0xafa6(%rip), %rsi      # 0x4d697
callq 0x35e00
movq -0x20(%rbp), %rsi
addq $0x38, %rsi
leaq -0x48(%rbp), %rdi
callq 0x35e00
leaq -0x48(%rbp), %rdi
leaq 0xaf88(%rip), %rsi      # 0x4d69a
callq 0x35e00
movq -0x20(%rbp), %rax
cmpl $0x0, 0x138(%rax)
je 0x4276f
movq -0x20(%rbp), %rax
movl 0x138(%rax), %eax
movl %eax, -0x114(%rbp)
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0xf7d0
movl -0x114(%rbp), %edi
leaq -0xb0(%rbp), %rsi
movl $0x30, %edx
callq 0xf610
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x35e00
jmp 0x42805
movq -0x18(%rbp), %rax
cmpl $0x2, 0x4(%rax)
jne 0x427b0
leaq -0xe0(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0xf7d0
leaq -0xe0(%rbp), %rsi
movl $0x1, %edi
movl $0x30, %edx
callq 0xf610
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x35e00
jmp 0x42803
movq -0x18(%rbp), %rax
cmpl $0xa, 0x4(%rax)
jne 0x427f1
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0xf7d0
leaq -0x110(%rbp), %rsi
movl $0x1c, %edi
movl $0x30, %edx
callq 0xf610
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x35e00
jmp 0x42801
leaq -0x48(%rbp), %rdi
leaq 0x757d(%rip), %rsi      # 0x49d79
callq 0x35e00
jmp 0x42803
jmp 0x42805
leaq 0xae93(%rip), %rsi      # 0x4d69f
leaq -0x48(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x35e00
movq -0x120(%rbp), %rdi
leaq 0xae79(%rip), %rsi      # 0x4d6a3
callq 0x35e00
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x118(%rbp)
subl $0x2, %eax
je 0x42850
jmp 0x42843
movl -0x118(%rbp), %eax
subl $0xa, %eax
je 0x42862
jmp 0x42874
leaq -0x48(%rbp), %rdi
leaq 0x5eef(%rip), %rsi      # 0x4874a
callq 0x35e00
jmp 0x42887
leaq -0x48(%rbp), %rdi
leaq 0x5ee5(%rip), %rsi      # 0x48752
callq 0x35e00
jmp 0x42887
movq -0x18(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0x35c30
leaq -0x48(%rbp), %rdi
movq %rdi, -0x130(%rbp)
movl $0xa, %esi
callq 0x35b10
movq -0x130(%rbp), %rdi
leaq 0xae0a(%rip), %rsi      # 0x4d6b4
callq 0x35e00
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x124(%rbp)
subl $0x1, %eax
je 0x428d0
jmp 0x428c3
movl -0x124(%rbp), %eax
subl $0x2, %eax
je 0x428e2
jmp 0x428f4
leaq -0x48(%rbp), %rdi
leaq 0x5e88(%rip), %rsi      # 0x48763
callq 0x35e00
jmp 0x42907
leaq -0x48(%rbp), %rdi
leaq 0x5e91(%rip), %rsi      # 0x4877e
callq 0x35e00
jmp 0x42907
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rsi
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0x35c30
leaq -0x48(%rbp), %rdi
movl $0xa, %esi
callq 0x35b10
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movzwl (%rax), %eax
movl %eax, -0x134(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movzwl (%rax), %edi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x3a110
movl -0x134(%rbp), %edi
movq %rax, %rsi
leaq -0x80(%rbp), %rdx
movl $0x2f, %ecx
callq 0xfeb0
leaq -0x48(%rbp), %rdi
leaq 0xad61(%rip), %rsi      # 0x4d6c5
callq 0x35e00
leaq -0x80(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x35e00
leaq -0x48(%rbp), %rdi
leaq 0xad56(%rip), %rsi      # 0x4d6d7
callq 0x35e00
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movzwl (%rax), %edi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x3a1b0
movzwl (%rax), %edi
callq 0x10a80
movzwl %ax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0x35c30
leaq -0x48(%rbp), %rdi
movl $0xa, %esi
callq 0x35b10
leaq -0x48(%rbp), %rdi
leaq 0xad0b(%rip), %rsi      # 0x4d6da
callq 0x35e00
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x429f0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x140(%rbp)
jmp 0x42a00
leaq 0xacf4(%rip), %rax      # 0x4d6eb
movq %rax, -0x140(%rbp)
jmp 0x42a00
movq -0x140(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x35e00
leaq -0x48(%rbp), %rdi
movl $0xa, %esi
callq 0x35b10
leaq -0x48(%rbp), %rdi
callq 0x360d0
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq