// File: /workspace/github_c_makefile_star2_O1/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 0x2ab16
leaq (%rdi,%rsi), %r10
xorl %ecx, %ecx
subq %rsi, %r14
cmovbq %rcx, %r14
movl $0x1, %esi
movq %rdi, %rbx
cmpq %rsi, %r14
jae 0x2ab6c
cmpq %r10, %rbx
jae 0x2ab69
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 0x2ab6c
incq %rcx
movq %r9, %rax
mulq %r11
shrq $0x3, %rdx
incq %rsi
cmpq $0x9, %r9
movq %rdx, %r9
ja 0x2ab41
cmpq %rdi, %rbx
jbe 0x2abad
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 0x2ab8e
cmpq %r10, %rbx
jae 0x2abba
movb $0x20, (%rbx)
incq %rbx
jmp 0x2abbd
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 0x2abc7
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 0x2ac21
cmpq %r10, %r9
jae 0x2ac1e
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 0x2ac21
incq %rcx
movq %rsi, %rax
mulq %r11
shrq $0x3, %rdx
incq %r15
cmpq $0x9, %rsi
movq %rdx, %rsi
ja 0x2abf6
cmpq %r9, %rbx
jae 0x2ac5f
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 0x2ac42
cmpq %r10, %r9
jae 0x2ac6d
movb $0x20, (%r9)
incq %r9
jmp 0x2ac70
incq %rcx
cmpl $0x1, 0x4(%r8)
jne 0x2acc6
movl $0x8, %eax
leaq 0xe00d(%rip), %rdx      # 0x38c90
cmpq %r10, %r9
jae 0x2ac9c
movzbl (%r8,%rax), %esi
shrl $0x4, %esi
movb (%rsi,%rdx), %sil
movb %sil, (%r9)
incq %r9
jmp 0x2ac9f
incq %rcx
cmpq %r10, %r9
jae 0x2acb8
movzbl (%r8,%rax), %esi
andl $0xf, %esi
movb (%rsi,%rdx), %sil
movb %sil, (%r9)
incq %r9
jmp 0x2acbb
incq %rcx
incq %rax
cmpq $0x1c, %rax
jne 0x2ac83
jmp 0x2acd7
cmpq %r10, %r9
jae 0x2acd4
movb $0x30, (%r9)
incq %r9
jmp 0x2acd7
incq %rcx
cmpq %r10, %r9
jae 0x2ace8
movb $0x0, (%r9)
subq %rdi, %r9
movq %r9, %rax
jmp 0x2ad05
cmpq %rdi, %r9
jbe 0x2ad03
leaq -0x1(%r9), %rax
cmpb $0x0, -0x1(%r9)
je 0x2acfe
incq %rcx
movb $0x0, (%rax)
subq %rdi, %rax
jmp 0x2ad05
xorl %eax, %eax
addq %rax, %rcx
movq %rcx, %rax
popq %rbx
popq %r14
popq %r15
retq