// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x30, %rsp
movq 0x8(%rdx), %rcx
movq %rdi, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
leaq (%rdi,%rsi), %rax
movq %rax, 0x18(%rsp)
andl $0x0, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
testq %rcx, %rcx
jle 0x26f1d
movq %rdx, %r14
leaq (%rdx,%rcx), %r15
addq $0x10, %r15
addq $0x10, %r14
leaq 0x8(%rsp), %rbx
pushq $0x3
popq %rbp
cmpq %rax, %rdi
jae 0x26dfe
leaq 0x1(%rdi), %rax
movq %rax, 0x10(%rsp)
movb $0x22, (%rdi)
jmp 0x26e0b
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
xorl %r12d, %r12d
leaq (%r14,%r12), %rcx
cmpl $0xff, %r12d
ja 0x26e97
cmpq %r15, %rcx
jae 0x26e97
movb (%rcx), %al
leal -0x7f(%rax), %edx
cmpb $-0x5f, %dl
jb 0x26e36
cmpb $0x5c, %al
je 0x26e36
movzbl %al, %edx
cmpl $0x22, %edx
jne 0x26e6f
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x26e50
leaq 0x1(%rax), %rdx
movq %rdx, 0x10(%rsp)
movb $0x5c, (%rax)
jmp 0x26e5d
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
movzbl (%rcx), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x25591
incq %r12
jmp 0x26e0e
movq 0x10(%rsp), %rcx
cmpq 0x18(%rsp), %rcx
jae 0x26e88
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rsp)
movb %al, (%rcx)
jmp 0x26e6a
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
jmp 0x26e6a
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
cmpq %rax, %rdi
jae 0x26eb7
leaq 0x1(%rdi), %rdx
movq %rdx, 0x10(%rsp)
movb $0x22, (%rdi)
movq %rdx, %rdi
jmp 0x26ec4
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
cmpq %rax, %rdi
jae 0x26eda
leaq 0x1(%rdi), %rdx
movq %rdx, 0x10(%rsp)
movb $0x20, (%rdi)
movq %rdx, %rdi
jmp 0x26ee7
incq 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
movq %rcx, %r14
cmpq %r15, %rcx
jb 0x26deb
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x26f0c
decq %rax
movq %rax, 0x28(%rsp)
jne 0x26f0c
andl $0x0, 0x20(%rsp)
cmpq 0x8(%rsp), %rdi
jbe 0x26f6a
decq %rdi
movq %rdi, 0x10(%rsp)
jmp 0x26f6a
testq %rsi, %rsi
jle 0x26f36
leaq 0x1(%rdi), %rdx
movq %rdx, 0x10(%rsp)
movb $0x22, (%rdi)
pushq $0x1
popq %rcx
movq %rdx, %rdi
jmp 0x26f4a
movq $0x1, 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
pushq $0x2
popq %rcx
cmpq %rax, %rdi
jae 0x26f5d
leaq 0x1(%rdi), %rax
movq %rax, 0x10(%rsp)
movb $0x22, (%rdi)
jmp 0x26f6a
movq %rcx, 0x28(%rsp)
movl $0x9b918cc0, 0x20(%rsp) # imm = 0x9B918CC0
leaq 0x8(%rsp), %rdi
callq 0x25899
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq