// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4c8, %rsp            # imm = 0x4C8
movq %rdi, %r12
movq %rdi, 0x8(%rsp)
leaq (%rdi,%rsi), %rbx
movq %rbx, 0x18(%rsp)
andl $0x0, 0x20(%rsp)
movq %r8, %r15
andq $0x0, 0x28(%rsp)
movq %rcx, %r13
movq %rdx, %r14
cmpl $0x1, (%rdx)
jne 0x252dd
testq %rsi, %rsi
jle 0x2538e
movb $0x3b, (%r12)
incq %r12
xorl %ebp, %ebp
movzwl 0x4(%r14), %edx
leaq 0xb8(%rsp), %rdi
leaq 0x34(%rsp), %r8
movl $0x100, %esi            # imm = 0x100
movq %r13, %rcx
callq 0xff50
testq %rax, %rax
je 0x25366
movq %rbp, 0x38(%rsp)
movq %r13, 0x48(%rsp)
movq %r15, 0x40(%rsp)
movl $0xff, %r13d
cmpq %r13, %rax
cmovbq %rax, %r13
movq %rbx, %rbp
subq %r12, %rbp
cmpq %r13, %rbp
movq %r13, %r15
cmovbq %rbp, %r15
leaq 0xb8(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0xfad0
addq %r12, %r15
movq %r15, 0x10(%rsp)
subq %rbp, %r13
jbe 0x2536f
movq 0x38(%rsp), %rax
addq %r13, %rax
movq %rax, 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
jmp 0x25374
movl 0x34(%rsp), %eax
jmp 0x254d0
movq 0x38(%rsp), %rax
cmpl $0x1, (%r14)
je 0x253d4
cmpq %rbx, %r15
jae 0x253a7
leaq 0x1(%r15), %rax
movq %rax, 0x10(%rsp)
movb $0x20, (%r15)
jmp 0x253b7
movq $0x1, 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
pushq $0x1
popq %rbp
jmp 0x252df
incq %rax
movq %rax, 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
movl 0x10(%r14), %esi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
xorl %edx, %edx
callq 0x25591
movq 0x8(%r12), %r15
movq 0x10(%r12), %rbx
cmpq %rbx, %r15
jae 0x253e8
leaq 0x1(%r15), %rax
movq %rax, 0x10(%rsp)
movb $0x20, (%r15)
jmp 0x253f5
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
movq 0x40(%rsp), %r15
movl 0xc(%r14), %edi
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
pushq $0x30
popq %rdx
callq 0x10190
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x25689
movq 0x8(%r12), %rax
cmpq 0x10(%r12), %rax
jae 0x25446
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rsp)
movb $0x20, (%rax)
jmp 0x25453
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
movl 0x8(%r14), %edi
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
pushq $0x30
popq %rdx
callq 0xf5d0
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x25689
cmpl $0x1, (%r14)
je 0x25500
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %r12
cmpq %r12, %r13
jae 0x2549e
movb $0x20, (%r13)
incq %r13
jmp 0x254ab
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
leaq 0xb8(%rsp), %rdi
movq $0x400, (%rdi)          # imm = 0x400
andq $0x0, 0x8(%rdi)
movq %r14, %rsi
movq 0x48(%rsp), %rdx
callq 0xff00
testl %eax, %eax
je 0x254d7
movl %eax, (%r15)
xorl %eax, %eax
jmp 0x2550a
subq %r13, %r12
movl 0x8(%r14), %ecx
leaq 0xb8(%rsp), %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0xf8b0
cmpq %r12, %rax
cmovbq %rax, %r12
addq %r13, %r12
movq %r12, 0x10(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x25899
addq $0x4c8, %rsp            # imm = 0x4C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq