// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/lib/dns.c
// Function: dns_sshfp_print
size_t dns_sshfp_print(void *_dst, size_t lim, struct dns_sshfp *fp) {
	static const unsigned char hex[16] = "0123456789abcdef";
	struct dns_buf dst = DNS_B_INTO(_dst, lim);
	size_t i;

	dns_b_fmtju(&dst, fp->algo, 0);
	dns_b_putc(&dst, ' ');
	dns_b_fmtju(&dst, fp->type, 0);
	dns_b_putc(&dst, ' ');

	switch (fp->type) {
	case DNS_SSHFP_SHA1:
		for (i = 0; i < sizeof fp->digest.sha1; i++) {
			dns_b_putc(&dst, hex[0x0f & (fp->digest.sha1[i] >> 4)]);
			dns_b_putc(&dst, hex[0x0f & (fp->digest.sha1[i] >> 0)]);
		}

		break;
	default:
		dns_b_putc(&dst, '0');

		break;
	} /* switch() */

	return dns_b_strllen(&dst);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r8
movl (%rdx), %r9d
xorl %r14d, %r14d
movabsq $-0x3333333333333333, %r11 # imm = 0xCCCCCCCCCCCCCCCD
movq %r9, %rcx
incq %r14
movq %rcx, %rax
mulq %r11
shrq $0x3, %rdx
cmpq $0x9, %rcx
movq %rdx, %rcx
ja 0x2a749
leaq (%rdi,%rsi), %r10
xorl %ecx, %ecx
subq %rsi, %r14
cmovbq %rcx, %r14
movl $0x1, %esi
movq %rdi, %rbx
cmpq %rsi, %r14
jae 0x2a79f
cmpq %r10, %rbx
jae 0x2a79c
movq %r9, %rax
mulq %r11
shrl $0x2, %edx
andl $-0x2, %edx
leal (%rdx,%rdx,4), %eax
movl %r9d, %edx
subl %eax, %edx
orb $0x30, %dl
movb %dl, (%rbx)
incq %rbx
jmp 0x2a79f
incq %rcx
movq %r9, %rax
mulq %r11
shrq $0x3, %rdx
incq %rsi
cmpq $0x9, %r9
movq %rdx, %r9
ja 0x2a774
cmpq %rdi, %rbx
jbe 0x2a7e0
leaq 0x1(%rdi), %rax
movq %rbx, %rdx
movb -0x1(%rdx), %sil
movb -0x1(%rax), %r9b
movb %r9b, -0x1(%rdx)
decq %rdx
movb %sil, -0x1(%rax)
leaq 0x1(%rax), %rsi
cmpq %rdx, %rax
movq %rsi, %rax
jb 0x2a7c1
cmpq %r10, %rbx
jae 0x2a7ed
movb $0x20, (%rbx)
incq %rbx
jmp 0x2a7f0
incq %rcx
movl 0x4(%r8), %esi
xorl %r15d, %r15d
movq %rsi, %r9
incq %r15
movq %r9, %rax
mulq %r11
shrq $0x3, %rdx
cmpq $0x9, %r9
movq %rdx, %r9
ja 0x2a7fa
movq %r10, %rax
subq %rbx, %rax
xorl %r14d, %r14d
subq %rax, %r15
cmovaeq %r15, %r14
movl $0x1, %r15d
movq %rbx, %r9
cmpq %r15, %r14
jae 0x2a854
cmpq %r10, %r9
jae 0x2a851
movq %rsi, %rax
mulq %r11
shrl $0x2, %edx
andl $-0x2, %edx
leal (%rdx,%rdx,4), %eax
movl %esi, %edx
subl %eax, %edx
orb $0x30, %dl
movb %dl, (%r9)
incq %r9
jmp 0x2a854
incq %rcx
movq %rsi, %rax
mulq %r11
shrq $0x3, %rdx
incq %r15
cmpq $0x9, %rsi
movq %rdx, %rsi
ja 0x2a829
cmpq %r9, %rbx
jae 0x2a892
incq %rbx
movq %r9, %rax
movb -0x1(%rax), %dl
movb -0x1(%rbx), %sil
movb %sil, -0x1(%rax)
decq %rax
movb %dl, -0x1(%rbx)
leaq 0x1(%rbx), %rdx
cmpq %rax, %rbx
movq %rdx, %rbx
jb 0x2a875
cmpq %r10, %r9
jae 0x2a8a0
movb $0x20, (%r9)
incq %r9
jmp 0x2a8a3
incq %rcx
cmpl $0x1, 0x4(%r8)
jne 0x2a8f9
movl $0x8, %eax
leaq 0xe39a(%rip), %rdx      # 0x38c50
cmpq %r10, %r9
jae 0x2a8cf
movzbl (%r8,%rax), %esi
shrl $0x4, %esi
movb (%rsi,%rdx), %sil
movb %sil, (%r9)
incq %r9
jmp 0x2a8d2
incq %rcx
cmpq %r10, %r9
jae 0x2a8eb
movzbl (%r8,%rax), %esi
andl $0xf, %esi
movb (%rsi,%rdx), %sil
movb %sil, (%r9)
incq %r9
jmp 0x2a8ee
incq %rcx
incq %rax
cmpq $0x1c, %rax
jne 0x2a8b6
jmp 0x2a90a
cmpq %r10, %r9
jae 0x2a907
movb $0x30, (%r9)
incq %r9
jmp 0x2a90a
incq %rcx
cmpq %r10, %r9
jae 0x2a91b
movb $0x0, (%r9)
subq %rdi, %r9
movq %r9, %rax
jmp 0x2a938
cmpq %rdi, %r9
jbe 0x2a936
leaq -0x1(%r9), %rax
cmpb $0x0, -0x1(%r9)
je 0x2a931
incq %rcx
movb $0x0, (%rax)
subq %rdi, %rax
jmp 0x2a938
xorl %eax, %eax
addq %rax, %rcx
movq %rcx, %rax
popq %rbx
popq %r14
popq %r15
retq