// File: /workspace/github_c_makefile_star2_O1/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 $0x4a8, %rsp            # imm = 0x4A8
movq %r8, %rbx
movq %rcx, %rbp
movq %rdx, %r13
cmpl $0x1, (%rdx)
movq %rdi, 0x10(%rsp)
jne 0x286b7
movq %rsi, %r14
testq %rsi, %rsi
jle 0x286bf
leaq 0x1(%rdi), %r15
movb $0x3b, (%rdi)
xorl %r12d, %r12d
jmp 0x286c8
movq %rsi, %r14
xorl %r12d, %r12d
jmp 0x286c5
movl $0x1, %r12d
movq %rdi, %r15
movzwl 0x4(%r13), %edx
leaq 0x98(%rsp), %rdi
leaq 0x4(%rsp), %r8
movl $0x100, %esi            # imm = 0x100
movq %rbp, %rcx
callq 0xfec0
testq %rax, %rax
je 0x28958
movq %rbp, 0x28(%rsp)
movq %rbx, 0x18(%rsp)
addq 0x10(%rsp), %r14
movl $0xff, %ecx
cmpq %rcx, %rax
cmovbq %rax, %rcx
movq %r14, %rax
subq %r15, %rax
cmpq %rcx, %rax
movq %rcx, %rbp
cmovbq %rax, %rbp
movq %rcx, %rdx
subq %rbp, %rdx
xorl %ebx, %ebx
cmpq %rcx, %rax
cmovbq %rdx, %rbx
leaq 0x98(%rsp), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0xfa60
addq %r15, %rbp
addq %r12, %rbx
cmpl $0x1, (%r13)
je 0x2880b
cmpq %r14, %rbp
jae 0x2875c
movb $0x20, (%rbp)
incq %rbp
jmp 0x2875f
incq %rbx
movl 0x10(%r13), %ecx
xorl %r9d, %r9d
movabsq $-0x3333333333333333, %rdi # imm = 0xCCCCCCCCCCCCCCCD
movq %rcx, %rsi
incq %r9
movq %rsi, %rax
mulq %rdi
shrq $0x3, %rdx
cmpq $0x9, %rsi
movq %rdx, %rsi
ja 0x28773
movq %r14, %rax
subq %rbp, %rax
xorl %r8d, %r8d
subq %rax, %r9
cmovaeq %r9, %r8
movl $0x1, %r9d
movq %rbp, %rsi
cmpq %r9, %r8
jae 0x287cc
cmpq %r14, %rsi
jae 0x287c9
movq %rcx, %rax
mulq %rdi
shrl $0x2, %edx
andl $-0x2, %edx
leal (%rdx,%rdx,4), %eax
movl %ecx, %edx
subl %eax, %edx
orb $0x30, %dl
movb %dl, (%rsi)
incq %rsi
jmp 0x287cc
incq %rbx
movq %rcx, %rax
mulq %rdi
shrq $0x3, %rdx
incq %r9
cmpq $0x9, %rcx
movq %rdx, %rcx
ja 0x287a2
cmpq %rsi, %rbp
jae 0x28808
incq %rbp
movq %rsi, %rax
movb -0x1(%rax), %cl
movb -0x1(%rbp), %dl
movb %dl, -0x1(%rax)
decq %rax
movb %cl, -0x1(%rbp)
leaq 0x1(%rbp), %rcx
cmpq %rax, %rbp
movq %rcx, %rbp
jb 0x287ed
movq %rsi, %rbp
cmpq %r14, %rbp
jae 0x28819
movb $0x20, (%rbp)
incq %rbp
jmp 0x2881c
incq %rbx
movq %r13, 0x20(%rsp)
movl 0xc(%r13), %edi
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x30, %edx
callq 0x10100
movq %rax, %r15
movq %rax, %rdi
callq 0xf560
movq %r14, %rcx
subq %rbp, %rcx
cmpq %rax, %rcx
movq %rax, %r13
cmovbq %rcx, %r13
movq %rax, %rdx
subq %r13, %rdx
xorl %r12d, %r12d
cmpq %rax, %rcx
cmovbq %rdx, %r12
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0xfa60
addq %rbp, %r13
addq %rbx, %r12
cmpq %r14, %r13
movq %r14, 0x8(%rsp)
jae 0x28895
movb $0x20, (%r13)
incq %r13
jmp 0x28898
incq %r12
movq 0x20(%rsp), %rax
movl 0x8(%rax), %edi
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x30, %edx
callq 0xf590
movq %rax, %rbx
movq %rax, %rdi
callq 0xf560
movq 0x8(%rsp), %r14
movq %r14, %rcx
subq %r13, %rcx
cmpq %rax, %rcx
movq %rax, %r15
cmovbq %rcx, %r15
movq %rax, %rdx
subq %r15, %rdx
xorl %ebp, %ebp
cmpq %rax, %rcx
cmovbq %rdx, %rbp
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xfa60
movq 0x20(%rsp), %rsi
addq %r13, %r15
addq %r12, %rbp
cmpl $0x1, (%rsi)
jne 0x28911
movq 0x10(%rsp), %r12
jmp 0x2898b
cmpq %r14, %r15
movq 0x10(%rsp), %r12
jae 0x28924
movb $0x20, (%r15)
incq %r15
jmp 0x28927
incq %rbp
movq 0x18(%rsp), %rbx
leaq 0x98(%rsp), %rdi
movq $0x400, (%rdi)          # imm = 0x400
movq $0x0, 0x8(%rdi)
movq 0x28(%rsp), %rdx
movq %rsi, %r14
callq 0xfe70
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0x28962
movl 0x4(%rsp), %eax
movl %eax, (%rbx)
xorl %ebp, %ebp
jmp 0x289be
movq 0x8(%rsp), %rbx
subq %r15, %rbx
movl 0x8(%r14), %ecx
leaq 0x98(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf860
cmpq %rbx, %rax
cmovbq %rax, %rbx
addq %rbx, %r15
cmpq 0x8(%rsp), %r15
jae 0x2899e
movb $0x0, (%r15)
subq %r12, %r15
movq %r15, %rax
jmp 0x289bb
cmpq %r12, %r15
jbe 0x289b9
leaq -0x1(%r15), %rax
cmpb $0x0, -0x1(%r15)
je 0x289b4
incq %rbp
movb $0x0, (%rax)
subq %r12, %rax
jmp 0x289bb
xorl %eax, %eax
addq %rax, %rbp
movq %rbp, %rax
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq