// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_txt_print
size_t dns_txt_print(void *_dst, size_t lim, struct dns_txt *txt) {
	struct dns_buf src = DNS_B_FROM(txt->data, txt->len);
	struct dns_buf dst = DNS_B_INTO(_dst, lim);
	unsigned i;

	if (src.p < src.pe) {
		do {
			dns_b_putc(&dst, '"');

			for (i = 0; i < 256 && src.p < src.pe; i++, src.p++) {
				if (*src.p < 32 || *src.p > 126 || *src.p == '"' || *src.p == '\\') {
					dns_b_putc(&dst, '\\');
					dns_b_fmtju(&dst, *src.p, 3);
				} else {
					dns_b_putc(&dst, *src.p);
				}
			}

			dns_b_putc(&dst, '"');
			dns_b_putc(&dst, ' ');
		} while (src.p < src.pe);

		dns_b_popc(&dst);
	} else {
		dns_b_putc(&dst, '"');
		dns_b_putc(&dst, '"');
	}

	return dns_b_strllen(&dst);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x8(%rdx), %rax
leaq (%rdi,%rsi), %r9
testq %rax, %rax
jle 0x2acf5
movq %rdx, %rcx
leaq (%rdx,%rax), %rbx
addq $0x10, %rbx
addq $0x10, %rcx
xorl %r11d, %r11d
movabsq $-0x3333333333333333, %r14 # imm = 0xCCCCCCCCCCCCCCCD
movq %rdi, %r10
movl $0x3, %edi
movq %r10, -0x8(%rsp)
cmpq %r9, %r10
jae 0x2ab49
movb $0x22, (%r10)
incq %r10
jmp 0x2ab4c
incq %r11
xorl %ebp, %ebp
cmpq %rbx, %rcx
jae 0x2acb1
movb (%rcx), %al
leal -0x7f(%rax), %edx
cmpb $-0x5f, %dl
jb 0x2ab71
cmpb $0x5c, %al
je 0x2ab71
movzbl %al, %edx
cmpl $0x22, %edx
jne 0x2ac9f
cmpq %r9, %r10
jae 0x2ab81
movb $0x5c, (%r10)
incq %r10
movb (%rcx), %al
jmp 0x2ab84
incq %r11
movzbl %al, %esi
movl $0x3, %r12d
movl $0x1, %eax
movq %rsi, %r8
xorl %r13d, %r13d
movq %rax, %r15
incq %r13
movq %r8, %rax
mulq %r14
shrq $0x3, %rdx
incq %r12
leaq 0x1(%r15), %rax
cmpq $0x9, %r8
movq %rdx, %r8
ja 0x2ab98
movq %r9, %rdx
subq %r10, %rdx
cmpq $0x3, %r13
movl $0x3, %eax
cmovbq %r13, %rax
subq %rax, %r12
cmpq %r12, %rdx
cmovbq %rdx, %r12
cmpq $0x2, %r13
ja 0x2abfd
cmpq $0x3, %r15
cmovaeq %rdi, %r15
addq $-0x3, %r15
cmpq %r9, %r10
jae 0x2abf5
movb $0x30, (%r10)
incq %r10
jmp 0x2abf8
incq %r11
incq %r15
jne 0x2abe7
addq %rax, %r12
negq %r12
leaq (%r12,%r13), %r15
addq $0x3, %r15
movl $0x1, %r12d
movq %r10, %r8
cmpq %r12, %r15
jae 0x2ac3f
cmpq %r9, %r8
jae 0x2ac3c
movq %rsi, %rax
mulq %r14
shrl $0x2, %edx
andl $-0x2, %edx
leal (%rdx,%rdx,4), %eax
movl %esi, %edx
subl %eax, %edx
orb $0x30, %dl
movb %dl, (%r8)
incq %r8
jmp 0x2ac3f
incq %r11
movq %rsi, %rax
mulq %r14
shrq $0x3, %rdx
incq %r12
cmpq $0x9, %rsi
movq %rdx, %rsi
ja 0x2ac14
cmpq %r8, %r10
jae 0x2ac7e
incq %r10
movq %r8, %rax
movb -0x1(%rax), %dl
movb -0x1(%r10), %sil
movb %sil, -0x1(%rax)
decq %rax
movb %dl, -0x1(%r10)
leaq 0x1(%r10), %rdx
cmpq %rax, %r10
movq %rdx, %r10
jb 0x2ac60
movq %r8, %r10
incq %rcx
cmpq %rbx, %rcx
setb %al
cmpl $0xfe, %ebp
ja 0x2acb3
incl %ebp
cmpq %rbx, %rcx
jb 0x2ab57
jmp 0x2acb3
cmpq %r9, %r10
jae 0x2acac
movb %al, (%r10)
incq %r10
jmp 0x2ac81
incq %r11
jmp 0x2ac81
xorl %eax, %eax
cmpq %r9, %r10
jae 0x2acc1
movb $0x22, (%r10)
incq %r10
jmp 0x2acc4
incq %r11
cmpq %r9, %r10
jae 0x2acd2
movb $0x20, (%r10)
incq %r10
jmp 0x2acd5
incq %r11
testb %al, %al
jne 0x2ab3b
xorl %eax, %eax
subq $0x1, %r11
cmovaeq %r11, %rax
movq -0x8(%rsp), %rdi
cmpq %r10, %rdi
sbbq $0x0, %r10
jmp 0x2ad1e
testq %rsi, %rsi
jle 0x2ad05
leaq 0x1(%rdi), %r10
movb $0x22, (%rdi)
xorl %eax, %eax
jmp 0x2ad0d
movl $0x1, %eax
movq %rdi, %r10
cmpq %r9, %r10
jae 0x2ad1b
movb $0x22, (%r10)
incq %r10
jmp 0x2ad1e
incq %rax
cmpq %r9, %r10
jae 0x2ad2f
movb $0x0, (%r10)
subq %rdi, %r10
movq %r10, %rcx
jmp 0x2ad4c
cmpq %rdi, %r10
jbe 0x2ad4a
leaq -0x1(%r10), %rcx
cmpb $0x0, -0x1(%r10)
je 0x2ad45
incq %rax
movb $0x0, (%rcx)
subq %rdi, %rcx
jmp 0x2ad4c
xorl %ecx, %ecx
addq %rcx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq