#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*/ printf(char *, ...);
int MD5Print(unsigned char *digest) {
  int i;
  if (!digest) {
    printf("<empty hash>\n");
    return -1;
  }
  for (i = 0; i < 16; i++)
    printf("%02x", digest[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<MD5Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1141 <MD5Print+0x31>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118f <MD5Print+0x7f>
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    117a <MD5Print+0x6a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1148 <MD5Print+0x38>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MD5Print>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1235 <MD5Print+0x105>
mov    %rdi,%rbx
movzbl (%rdi),%esi
lea    0xeb6(%rip),%rbp
xor    %r14d,%r14d
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x2(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x3(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x4(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x5(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x6(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x7(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x8(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x9(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xa(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xb(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xc(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xd(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xe(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xf(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1247 <MD5Print+0x117>
lea    0xdc9(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"<empty hash>\0A\00"
@.str.1 = [5 x i8] c"%02x\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @MD5Print(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %26
9: ; preds = %1
store i32 0, i32* %4
br label %10
10: ; preds = %21, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 16
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %13
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %10
24: ; preds = %10
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %26
26: ; preds = %24, %7
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%02x\00"
@str = [13 x i8] c"<empty hash>\00"
define i32 @MD5Print(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %68, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = zext i8 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds i8, i8* %0, i64 4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds i8, i8* %0, i64 5
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds i8, i8* %0, i64 6
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds i8, i8* %0, i64 7
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds i8, i8* %0, i64 8
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds i8, i8* %0, i64 9
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds i8, i8* %0, i64 10
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds i8, i8* %0, i64 11
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = getelementptr inbounds i8, i8* %0, i64 12
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %53)
%55 = getelementptr inbounds i8, i8* %0, i64 13
%56 = load i8, i8* %55
%57 = zext i8 %56 to i32
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = getelementptr inbounds i8, i8* %0, i64 14
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %61)
%63 = getelementptr inbounds i8, i8* %0, i64 15
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %65)
%67 = tail call i32 @putchar(i32 10)
br label %70
68: ; preds = %1
%69 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %70
70: ; preds = %3, %68
%71 = phi i32 [ 0, %3 ], [ -1, %68 ]
ret i32 %71
}