#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ curl_msnprintf(char *, int, char *, unsigned char);
void md5_to_ascii(unsigned char *source, unsigned char *dest) {
  int i;
  for (i = 0; i < 16; i++)
    curl_msnprintf((char *)&dest[i * 2], 3, "%02x", source[i]);
}


x86 assembly (clang, -O0):
<md5_to_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    116b <md5_to_ascii+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%rdi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    $0x3,%esi
lea    0xeac(%rip),%rdx
movzbl (%rax,%rcx,1),%ecx
call   1030 <curl_msnprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <md5_to_ascii+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5_to_ascii>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
movzbl (%rdi),%ecx
lea    0xedb(%rip),%r15
mov    %rsi,%rdi
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x2(%rbx),%rdi
movzbl 0x1(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x4(%rbx),%rdi
movzbl 0x2(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x6(%rbx),%rdi
movzbl 0x3(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x8(%rbx),%rdi
movzbl 0x4(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0xa(%rbx),%rdi
movzbl 0x5(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0xc(%rbx),%rdi
movzbl 0x6(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0xe(%rbx),%rdi
movzbl 0x7(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x10(%rbx),%rdi
movzbl 0x8(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x12(%rbx),%rdi
movzbl 0x9(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x14(%rbx),%rdi
movzbl 0xa(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x16(%rbx),%rdi
movzbl 0xb(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x18(%rbx),%rdi
movzbl 0xc(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x1a(%rbx),%rdi
movzbl 0xd(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
lea    0x1c(%rbx),%rdi
movzbl 0xe(%r14),%ecx
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <curl_msnprintf@plt>
add    $0x1e,%rbx
movzbl 0xf(%r14),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <curl_msnprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
define void @md5_to_ascii(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 16
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = call i32 @curl_msnprintf(i8* %14, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %19)
br label %21
21: ; preds = %9
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @md5_to_ascii(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = tail call i32 @curl_msnprintf(i8* %1, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
%5 = getelementptr inbounds i8, i8* %1, i64 2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = tail call i32 @curl_msnprintf(i8* %5, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
%9 = getelementptr inbounds i8, i8* %1, i64 4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = tail call i32 @curl_msnprintf(i8* %9, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %11)
%13 = getelementptr inbounds i8, i8* %1, i64 6
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = tail call i32 @curl_msnprintf(i8* %13, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
%17 = getelementptr inbounds i8, i8* %1, i64 8
%18 = getelementptr inbounds i8, i8* %0, i64 4
%19 = load i8, i8* %18
%20 = tail call i32 @curl_msnprintf(i8* %17, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %19)
%21 = getelementptr inbounds i8, i8* %1, i64 10
%22 = getelementptr inbounds i8, i8* %0, i64 5
%23 = load i8, i8* %22
%24 = tail call i32 @curl_msnprintf(i8* %21, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %23)
%25 = getelementptr inbounds i8, i8* %1, i64 12
%26 = getelementptr inbounds i8, i8* %0, i64 6
%27 = load i8, i8* %26
%28 = tail call i32 @curl_msnprintf(i8* %25, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %27)
%29 = getelementptr inbounds i8, i8* %1, i64 14
%30 = getelementptr inbounds i8, i8* %0, i64 7
%31 = load i8, i8* %30
%32 = tail call i32 @curl_msnprintf(i8* %29, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %31)
%33 = getelementptr inbounds i8, i8* %1, i64 16
%34 = getelementptr inbounds i8, i8* %0, i64 8
%35 = load i8, i8* %34
%36 = tail call i32 @curl_msnprintf(i8* %33, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %35)
%37 = getelementptr inbounds i8, i8* %1, i64 18
%38 = getelementptr inbounds i8, i8* %0, i64 9
%39 = load i8, i8* %38
%40 = tail call i32 @curl_msnprintf(i8* %37, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %39)
%41 = getelementptr inbounds i8, i8* %1, i64 20
%42 = getelementptr inbounds i8, i8* %0, i64 10
%43 = load i8, i8* %42
%44 = tail call i32 @curl_msnprintf(i8* %41, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %43)
%45 = getelementptr inbounds i8, i8* %1, i64 22
%46 = getelementptr inbounds i8, i8* %0, i64 11
%47 = load i8, i8* %46
%48 = tail call i32 @curl_msnprintf(i8* %45, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %47)
%49 = getelementptr inbounds i8, i8* %1, i64 24
%50 = getelementptr inbounds i8, i8* %0, i64 12
%51 = load i8, i8* %50
%52 = tail call i32 @curl_msnprintf(i8* %49, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %51)
%53 = getelementptr inbounds i8, i8* %1, i64 26
%54 = getelementptr inbounds i8, i8* %0, i64 13
%55 = load i8, i8* %54
%56 = tail call i32 @curl_msnprintf(i8* %53, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %55)
%57 = getelementptr inbounds i8, i8* %1, i64 28
%58 = getelementptr inbounds i8, i8* %0, i64 14
%59 = load i8, i8* %58
%60 = tail call i32 @curl_msnprintf(i8* %57, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %59)
%61 = getelementptr inbounds i8, i8* %1, i64 30
%62 = getelementptr inbounds i8, i8* %0, i64 15
%63 = load i8, i8* %62
%64 = tail call i32 @curl_msnprintf(i8* %61, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %63)
ret void
}