#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 */
unsigned char hexToByte(char *);
void md5HexToMd5(char hexIn[32], unsigned char md5Out[16]) {
  char *pt = hexIn;
  int i;
  for (i = 0; i < 16; ++i) {
    md5Out[i] = hexToByte(pt);
    pt += 2;
  }
}


x86 assembly (clang, -O0):
<md5HexToMd5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    1169 <md5HexToMd5+0x59>
mov    -0x18(%rbp),%rdi
call   1030 <hexToByte@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <md5HexToMd5+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5HexToMd5>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <hexToByte@plt>
mov    %al,(%r14)
lea    0x2(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0x1(%r14)
lea    0x4(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0x2(%r14)
lea    0x6(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0x3(%r14)
lea    0x8(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0x4(%r14)
lea    0xa(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0x5(%r14)
lea    0xc(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0x6(%r14)
lea    0xe(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0x7(%r14)
lea    0x10(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0x8(%r14)
lea    0x12(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0x9(%r14)
lea    0x14(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0xa(%r14)
lea    0x16(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0xb(%r14)
lea    0x18(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0xc(%r14)
lea    0x1a(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0xd(%r14)
lea    0x1c(%rbx),%rdi
call   1030 <hexToByte@plt>
mov    %al,0xe(%r14)
add    $0x1e,%rbx
mov    %rbx,%rdi
call   1030 <hexToByte@plt>
mov    %al,0xf(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @md5HexToMd5(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
store i32 0, i32* %6
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 16
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i8*, i8** %5
%13 = call zeroext i8 @hexToByte(i8* %12)
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 %13, i8* %17
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8* %19, i8** %5
br label %20
20: ; preds = %11
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @md5HexToMd5(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call zeroext i8 @hexToByte(i8* %0)
store i8 %3, i8* %1
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = tail call zeroext i8 @hexToByte(i8* %4)
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = tail call zeroext i8 @hexToByte(i8* %7)
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 6
%11 = tail call zeroext i8 @hexToByte(i8* %10)
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 8
%14 = tail call zeroext i8 @hexToByte(i8* %13)
%15 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %14, i8* %15
%16 = getelementptr inbounds i8, i8* %0, i64 10
%17 = tail call zeroext i8 @hexToByte(i8* %16)
%18 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %17, i8* %18
%19 = getelementptr inbounds i8, i8* %0, i64 12
%20 = tail call zeroext i8 @hexToByte(i8* %19)
%21 = getelementptr inbounds i8, i8* %1, i64 6
store i8 %20, i8* %21
%22 = getelementptr inbounds i8, i8* %0, i64 14
%23 = tail call zeroext i8 @hexToByte(i8* %22)
%24 = getelementptr inbounds i8, i8* %1, i64 7
store i8 %23, i8* %24
%25 = getelementptr inbounds i8, i8* %0, i64 16
%26 = tail call zeroext i8 @hexToByte(i8* %25)
%27 = getelementptr inbounds i8, i8* %1, i64 8
store i8 %26, i8* %27
%28 = getelementptr inbounds i8, i8* %0, i64 18
%29 = tail call zeroext i8 @hexToByte(i8* %28)
%30 = getelementptr inbounds i8, i8* %1, i64 9
store i8 %29, i8* %30
%31 = getelementptr inbounds i8, i8* %0, i64 20
%32 = tail call zeroext i8 @hexToByte(i8* %31)
%33 = getelementptr inbounds i8, i8* %1, i64 10
store i8 %32, i8* %33
%34 = getelementptr inbounds i8, i8* %0, i64 22
%35 = tail call zeroext i8 @hexToByte(i8* %34)
%36 = getelementptr inbounds i8, i8* %1, i64 11
store i8 %35, i8* %36
%37 = getelementptr inbounds i8, i8* %0, i64 24
%38 = tail call zeroext i8 @hexToByte(i8* %37)
%39 = getelementptr inbounds i8, i8* %1, i64 12
store i8 %38, i8* %39
%40 = getelementptr inbounds i8, i8* %0, i64 26
%41 = tail call zeroext i8 @hexToByte(i8* %40)
%42 = getelementptr inbounds i8, i8* %1, i64 13
store i8 %41, i8* %42
%43 = getelementptr inbounds i8, i8* %0, i64 28
%44 = tail call zeroext i8 @hexToByte(i8* %43)
%45 = getelementptr inbounds i8, i8* %1, i64 14
store i8 %44, i8* %45
%46 = getelementptr inbounds i8, i8* %0, i64 30
%47 = tail call zeroext i8 @hexToByte(i8* %46)
%48 = getelementptr inbounds i8, i8* %1, i64 15
store i8 %47, i8* %48
ret void
}