char *BLI_hash_md5_to_hexdigest(void *resblock, char r_hex_digest[33]) {
  static const char hex_map[17] = "0123456789abcdef";
  const unsigned char *p;
  char *q;
  short len;
  for (q = r_hex_digest, p = (const unsigned char *)resblock, len = 0; len < 16;
       ++p, ++len) {
    const unsigned char c = *p;
    *q++ = hex_map[c >> 4];
    *q++ = hex_map[c & 15];
  }
  *q = '\0';
  return r_hex_digest;
}


x86 assembly (clang, -O0):
<BLI_hash_md5_to_hexdigest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0x0,-0x22(%rbp)
movswl -0x22(%rbp),%eax
cmp    $0x10,%eax
jge    119f <BLI_hash_md5_to_hexdigest+0x9f>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x23(%rbp)
movzbl -0x23(%rbp),%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0xeb7(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
movzbl -0x23(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xe92(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x22(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x22(%rbp)
jmp    1122 <BLI_hash_md5_to_hexdigest+0x22>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BLI_hash_md5_to_hexdigest>:
mov    %rsi,%rax
movzbl (%rdi),%edx
mov    %rdx,%rsi
shr    $0x4,%rsi
lea    0xeec(%rip),%r8
mov    (%rsi,%r8,1),%cl
mov    %cl,(%rax)
and    $0xf,%edx
mov    (%rdx,%r8,1),%cl
mov    %cl,0x1(%rax)
movzbl 0x1(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x2(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x3(%rax)
movzbl 0x2(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x4(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x5(%rax)
movzbl 0x3(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x6(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x7(%rax)
movzbl 0x4(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x8(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x9(%rax)
movzbl 0x5(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0xa(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0xb(%rax)
movzbl 0x6(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0xc(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0xd(%rax)
movzbl 0x7(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0xe(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0xf(%rax)
movzbl 0x8(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x10(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x11(%rax)
movzbl 0x9(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x12(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x13(%rax)
movzbl 0xa(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x14(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x15(%rax)
movzbl 0xb(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x16(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x17(%rax)
movzbl 0xc(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x18(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x19(%rax)
movzbl 0xd(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x1a(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x1b(%rax)
movzbl 0xe(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x1c(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x1d(%rax)
movzbl 0xf(%rdi),%ecx
mov    %rcx,%rdx
shr    $0x4,%rdx
mov    (%rdx,%r8,1),%dl
mov    %dl,0x1e(%rax)
and    $0xf,%ecx
mov    (%rcx,%r8,1),%cl
mov    %cl,0x1f(%rax)
movb   $0x0,0x20(%rax)
ret

LLVM IR (-O0):
@BLI_hash_md5_to_hexdigest.hex_map = internal constant [17 x i8] c"0123456789abcdef\00"
define i8* @BLI_hash_md5_to_hexdigest(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i16
%8 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %4
store i8* %9, i8** %6
%10 = load i8*, i8** %3
store i8* %10, i8** %5
store i16 0, i16* %7
br label %11
11: ; preds = %34, %2
%12 = load i16, i16* %7
%13 = sext i16 %12 to i32
%14 = icmp slt i32 %13, 16
br i1 %14, label %15, label %39
15: ; preds = %11
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
store i8 %17, i8* %8
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = ashr i32 %19, 4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = load i8*, i8** %6
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %6
store i8 %23, i8* %24
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = and i32 %27, 15
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = load i8*, i8** %6
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %6
store i8 %31, i8* %32
br label %34
34: ; preds = %15
%35 = load i8*, i8** %5
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %5
%37 = load i16, i16* %7
%38 = add i16 %37, 1
store i16 %38, i16* %7
br label %11
39: ; preds = %11
%40 = load i8*, i8** %6
store i8 0, i8* %40
%41 = load i8*, i8** %4
ret i8* %41
}

LLVM IR (-O2):
@BLI_hash_md5_to_hexdigest.hex_map = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define i8* @BLI_hash_md5_to_hexdigest(i8* nocapture %0, i8* returned writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = lshr i32 %4, 4
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %8, i8* %1
%10 = and i32 %4, 15
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %13, i8* %9
%15 = getelementptr inbounds i8, i8* %0, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = lshr i32 %17, 4
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %21, i8* %14
%23 = and i32 %17, 15
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %26, i8* %22
%28 = getelementptr inbounds i8, i8* %0, i64 2
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = lshr i32 %30, 4
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %34, i8* %27
%36 = and i32 %30, 15
%37 = zext i32 %36 to i64
%38 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = getelementptr inbounds i8, i8* %1, i64 6
store i8 %39, i8* %35
%41 = getelementptr inbounds i8, i8* %0, i64 3
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = lshr i32 %43, 4
%45 = zext i32 %44 to i64
%46 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = getelementptr inbounds i8, i8* %1, i64 7
store i8 %47, i8* %40
%49 = and i32 %43, 15
%50 = zext i32 %49 to i64
%51 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = getelementptr inbounds i8, i8* %1, i64 8
store i8 %52, i8* %48
%54 = getelementptr inbounds i8, i8* %0, i64 4
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = lshr i32 %56, 4
%58 = zext i32 %57 to i64
%59 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = getelementptr inbounds i8, i8* %1, i64 9
store i8 %60, i8* %53
%62 = and i32 %56, 15
%63 = zext i32 %62 to i64
%64 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = getelementptr inbounds i8, i8* %1, i64 10
store i8 %65, i8* %61
%67 = getelementptr inbounds i8, i8* %0, i64 5
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = lshr i32 %69, 4
%71 = zext i32 %70 to i64
%72 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %71
%73 = load i8, i8* %72
%74 = getelementptr inbounds i8, i8* %1, i64 11
store i8 %73, i8* %66
%75 = and i32 %69, 15
%76 = zext i32 %75 to i64
%77 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = getelementptr inbounds i8, i8* %1, i64 12
store i8 %78, i8* %74
%80 = getelementptr inbounds i8, i8* %0, i64 6
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = lshr i32 %82, 4
%84 = zext i32 %83 to i64
%85 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = getelementptr inbounds i8, i8* %1, i64 13
store i8 %86, i8* %79
%88 = and i32 %82, 15
%89 = zext i32 %88 to i64
%90 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %89
%91 = load i8, i8* %90
%92 = getelementptr inbounds i8, i8* %1, i64 14
store i8 %91, i8* %87
%93 = getelementptr inbounds i8, i8* %0, i64 7
%94 = load i8, i8* %93
%95 = zext i8 %94 to i32
%96 = lshr i32 %95, 4
%97 = zext i32 %96 to i64
%98 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %97
%99 = load i8, i8* %98
%100 = getelementptr inbounds i8, i8* %1, i64 15
store i8 %99, i8* %92
%101 = and i32 %95, 15
%102 = zext i32 %101 to i64
%103 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %102
%104 = load i8, i8* %103
%105 = getelementptr inbounds i8, i8* %1, i64 16
store i8 %104, i8* %100
%106 = getelementptr inbounds i8, i8* %0, i64 8
%107 = load i8, i8* %106
%108 = zext i8 %107 to i32
%109 = lshr i32 %108, 4
%110 = zext i32 %109 to i64
%111 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %110
%112 = load i8, i8* %111
%113 = getelementptr inbounds i8, i8* %1, i64 17
store i8 %112, i8* %105
%114 = and i32 %108, 15
%115 = zext i32 %114 to i64
%116 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %115
%117 = load i8, i8* %116
%118 = getelementptr inbounds i8, i8* %1, i64 18
store i8 %117, i8* %113
%119 = getelementptr inbounds i8, i8* %0, i64 9
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = lshr i32 %121, 4
%123 = zext i32 %122 to i64
%124 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %123
%125 = load i8, i8* %124
%126 = getelementptr inbounds i8, i8* %1, i64 19
store i8 %125, i8* %118
%127 = and i32 %121, 15
%128 = zext i32 %127 to i64
%129 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %128
%130 = load i8, i8* %129
%131 = getelementptr inbounds i8, i8* %1, i64 20
store i8 %130, i8* %126
%132 = getelementptr inbounds i8, i8* %0, i64 10
%133 = load i8, i8* %132
%134 = zext i8 %133 to i32
%135 = lshr i32 %134, 4
%136 = zext i32 %135 to i64
%137 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %136
%138 = load i8, i8* %137
%139 = getelementptr inbounds i8, i8* %1, i64 21
store i8 %138, i8* %131
%140 = and i32 %134, 15
%141 = zext i32 %140 to i64
%142 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %141
%143 = load i8, i8* %142
%144 = getelementptr inbounds i8, i8* %1, i64 22
store i8 %143, i8* %139
%145 = getelementptr inbounds i8, i8* %0, i64 11
%146 = load i8, i8* %145
%147 = zext i8 %146 to i32
%148 = lshr i32 %147, 4
%149 = zext i32 %148 to i64
%150 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %149
%151 = load i8, i8* %150
%152 = getelementptr inbounds i8, i8* %1, i64 23
store i8 %151, i8* %144
%153 = and i32 %147, 15
%154 = zext i32 %153 to i64
%155 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %154
%156 = load i8, i8* %155
%157 = getelementptr inbounds i8, i8* %1, i64 24
store i8 %156, i8* %152
%158 = getelementptr inbounds i8, i8* %0, i64 12
%159 = load i8, i8* %158
%160 = zext i8 %159 to i32
%161 = lshr i32 %160, 4
%162 = zext i32 %161 to i64
%163 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %162
%164 = load i8, i8* %163
%165 = getelementptr inbounds i8, i8* %1, i64 25
store i8 %164, i8* %157
%166 = and i32 %160, 15
%167 = zext i32 %166 to i64
%168 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %167
%169 = load i8, i8* %168
%170 = getelementptr inbounds i8, i8* %1, i64 26
store i8 %169, i8* %165
%171 = getelementptr inbounds i8, i8* %0, i64 13
%172 = load i8, i8* %171
%173 = zext i8 %172 to i32
%174 = lshr i32 %173, 4
%175 = zext i32 %174 to i64
%176 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %175
%177 = load i8, i8* %176
%178 = getelementptr inbounds i8, i8* %1, i64 27
store i8 %177, i8* %170
%179 = and i32 %173, 15
%180 = zext i32 %179 to i64
%181 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %180
%182 = load i8, i8* %181
%183 = getelementptr inbounds i8, i8* %1, i64 28
store i8 %182, i8* %178
%184 = getelementptr inbounds i8, i8* %0, i64 14
%185 = load i8, i8* %184
%186 = zext i8 %185 to i32
%187 = lshr i32 %186, 4
%188 = zext i32 %187 to i64
%189 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %188
%190 = load i8, i8* %189
%191 = getelementptr inbounds i8, i8* %1, i64 29
store i8 %190, i8* %183
%192 = and i32 %186, 15
%193 = zext i32 %192 to i64
%194 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %193
%195 = load i8, i8* %194
%196 = getelementptr inbounds i8, i8* %1, i64 30
store i8 %195, i8* %191
%197 = getelementptr inbounds i8, i8* %0, i64 15
%198 = load i8, i8* %197
%199 = zext i8 %198 to i32
%200 = lshr i32 %199, 4
%201 = zext i32 %200 to i64
%202 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %201
%203 = load i8, i8* %202
%204 = getelementptr inbounds i8, i8* %1, i64 31
store i8 %203, i8* %196
%205 = and i32 %199, 15
%206 = zext i32 %205 to i64
%207 = getelementptr inbounds [17 x i8], [17 x i8]* @BLI_hash_md5_to_hexdigest.hex_map, i64 0, i64 %206
%208 = load i8, i8* %207
%209 = getelementptr inbounds i8, i8* %1, i64 32
store i8 %208, i8* %204
store i8 0, i8* %209
ret i8* %1
}