// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/dns.c
// Function: dns_rr_print
size_t dns_rr_print(void *_dst, size_t lim, struct dns_rr *rr, struct dns_packet *P, int *_error) {
	struct dns_buf dst = DNS_B_INTO(_dst, lim);
	union dns_any any;
	size_t n;
	int error;

	if (rr->section == DNS_S_QD)
		dns_b_putc(&dst, ';');

	if (!(n = dns_d_expand(any.ns.host, sizeof any.ns.host, rr->dn.p, P, &error)))
		goto error;
	dns_b_put(&dst, any.ns.host, DNS_PP_MIN(n, sizeof any.ns.host - 1));

	if (rr->section != DNS_S_QD) {
		dns_b_putc(&dst, ' ');
		dns_b_fmtju(&dst, rr->ttl, 0);
	}

	dns_b_putc(&dst, ' ');
	dns_b_puts(&dst, dns_strclass(rr->class));
	dns_b_putc(&dst, ' ');
	dns_b_puts(&dst, dns_strtype(rr->type));

	if (rr->section == DNS_S_QD)
		goto epilog;

	dns_b_putc(&dst, ' ');

	if ((error = dns_any_parse(dns_any_init(&any, sizeof any), rr, P)))
		goto error;

	n = dns_any_print(dst.p, dst.pe - dst.p, &any, rr->type);
	dst.p += DNS_PP_MIN(n, (size_t)(dst.pe - dst.p));
epilog:
	return dns_b_strllen(&dst);
error:
	*_error = error;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x500, %rsp            # imm = 0x500
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x358c1
leaq -0x58(%rbp), %rdi
movl $0x3b, %esi
callq 0x35b10
leaq -0x468(%rbp), %rdi
movq -0x20(%rbp), %rax
movw 0x4(%rax), %ax
movq -0x28(%rbp), %rcx
movl $0x100, %esi            # imm = 0x100
leaq -0x474(%rbp), %r8
movzwl %ax, %edx
callq 0xffd0
movq %rax, -0x470(%rbp)
cmpq $0x0, %rax
jne 0x358fa
jmp 0x35ae4
leaq -0x468(%rbp), %rax
movq %rax, -0x4e0(%rbp)
cmpq $0xff, -0x470(%rbp)
jae 0x35925
movq -0x470(%rbp), %rax
movq %rax, -0x4e8(%rbp)
jmp 0x35933
movl $0xff, %eax
movq %rax, -0x4e8(%rbp)
jmp 0x35933
movq -0x4e0(%rbp), %rsi
movq -0x4e8(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x35b80
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
je 0x35975
leaq -0x58(%rbp), %rdi
movl $0x20, %esi
callq 0x35b10
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
xorl %edx, %edx
callq 0x35c30
leaq -0x58(%rbp), %rdi
movl $0x20, %esi
callq 0x35b10
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x4f0(%rbp)
leaq -0x4a4(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0xf7d0
movl -0x4f0(%rbp), %edi
leaq -0x4a4(%rbp), %rsi
movl $0x30, %edx
callq 0x10250
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x35e00
leaq -0x58(%rbp), %rdi
movl $0x20, %esi
callq 0x35b10
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x4ec(%rbp)
leaq -0x4d4(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0xf7d0
movl -0x4ec(%rbp), %edi
leaq -0x4d4(%rbp), %rsi
movl $0x30, %edx
callq 0xf610
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x35e00
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x35a25
jmp 0x35ad5
leaq -0x58(%rbp), %rdi
movl $0x20, %esi
callq 0x35b10
leaq -0x468(%rbp), %rdi
movl $0x410, %esi            # imm = 0x410
callq 0x10860
movq %rax, %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xff80
movl %eax, -0x474(%rbp)
cmpl $0x0, %eax
je 0x35a64
jmp 0x35ae4
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rax
subq %rax, %rsi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
leaq -0x468(%rbp), %rdx
callq 0xf8f0
movq %rax, -0x470(%rbp)
movq -0x470(%rbp), %rax
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jae 0x35ab4
movq -0x470(%rbp), %rax
movq %rax, -0x4f8(%rbp)
jmp 0x35ac6
movq -0x48(%rbp), %rax
movq -0x50(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x4f8(%rbp)
movq -0x4f8(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x360d0
movq %rax, -0x8(%rbp)
jmp 0x35af8
movl -0x474(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x500, %rsp            # imm = 0x500
popq %rbp
retq
nopw %cs:(%rax,%rax)