#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*/ printHexDigit(unsigned char const);
void printDigest(const unsigned char digest[16]) {
  for (int i = 0; i < 16; i++) {
    printHexDigit((digest[i] >> 4) & 0xf);
    printHexDigit(digest[i] & 0xf);
  }
}


x86 assembly (clang, -O0):
<printDigest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    116c <printDigest+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
sar    $0x4,%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <printHexDigit@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <printHexDigit@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printDigest+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDigest>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl (%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0x1(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0x1(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0x2(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0x2(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0x3(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0x3(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0x4(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0x4(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0x5(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0x5(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0x6(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0x6(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0x7(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0x7(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0x8(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0x8(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0x9(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0x9(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0xa(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0xa(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0xb(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0xb(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0xc(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0xc(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0xd(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0xd(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0xe(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0xe(%rbx),%edi
and    $0xf,%edi
call   1030 <printHexDigit@plt>
mov    0xf(%rbx),%al
shr    $0x4,%al
movzbl %al,%edi
call   1030 <printHexDigit@plt>
movzbl 0xf(%rbx),%edi
and    $0xf,%edi
pop    %rbx
jmp    1030 <printHexDigit@plt>

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

LLVM IR (-O2):
define void @printDigest(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = lshr i8 %2, 4
%4 = tail call i32 @printHexDigit(i8 zeroext %3)
%5 = load i8, i8* %0
%6 = and i8 %5, 15
%7 = tail call i32 @printHexDigit(i8 zeroext %6)
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = lshr i8 %9, 4
%11 = tail call i32 @printHexDigit(i8 zeroext %10)
%12 = load i8, i8* %8
%13 = and i8 %12, 15
%14 = tail call i32 @printHexDigit(i8 zeroext %13)
%15 = getelementptr inbounds i8, i8* %0, i64 2
%16 = load i8, i8* %15
%17 = lshr i8 %16, 4
%18 = tail call i32 @printHexDigit(i8 zeroext %17)
%19 = load i8, i8* %15
%20 = and i8 %19, 15
%21 = tail call i32 @printHexDigit(i8 zeroext %20)
%22 = getelementptr inbounds i8, i8* %0, i64 3
%23 = load i8, i8* %22
%24 = lshr i8 %23, 4
%25 = tail call i32 @printHexDigit(i8 zeroext %24)
%26 = load i8, i8* %22
%27 = and i8 %26, 15
%28 = tail call i32 @printHexDigit(i8 zeroext %27)
%29 = getelementptr inbounds i8, i8* %0, i64 4
%30 = load i8, i8* %29
%31 = lshr i8 %30, 4
%32 = tail call i32 @printHexDigit(i8 zeroext %31)
%33 = load i8, i8* %29
%34 = and i8 %33, 15
%35 = tail call i32 @printHexDigit(i8 zeroext %34)
%36 = getelementptr inbounds i8, i8* %0, i64 5
%37 = load i8, i8* %36
%38 = lshr i8 %37, 4
%39 = tail call i32 @printHexDigit(i8 zeroext %38)
%40 = load i8, i8* %36
%41 = and i8 %40, 15
%42 = tail call i32 @printHexDigit(i8 zeroext %41)
%43 = getelementptr inbounds i8, i8* %0, i64 6
%44 = load i8, i8* %43
%45 = lshr i8 %44, 4
%46 = tail call i32 @printHexDigit(i8 zeroext %45)
%47 = load i8, i8* %43
%48 = and i8 %47, 15
%49 = tail call i32 @printHexDigit(i8 zeroext %48)
%50 = getelementptr inbounds i8, i8* %0, i64 7
%51 = load i8, i8* %50
%52 = lshr i8 %51, 4
%53 = tail call i32 @printHexDigit(i8 zeroext %52)
%54 = load i8, i8* %50
%55 = and i8 %54, 15
%56 = tail call i32 @printHexDigit(i8 zeroext %55)
%57 = getelementptr inbounds i8, i8* %0, i64 8
%58 = load i8, i8* %57
%59 = lshr i8 %58, 4
%60 = tail call i32 @printHexDigit(i8 zeroext %59)
%61 = load i8, i8* %57
%62 = and i8 %61, 15
%63 = tail call i32 @printHexDigit(i8 zeroext %62)
%64 = getelementptr inbounds i8, i8* %0, i64 9
%65 = load i8, i8* %64
%66 = lshr i8 %65, 4
%67 = tail call i32 @printHexDigit(i8 zeroext %66)
%68 = load i8, i8* %64
%69 = and i8 %68, 15
%70 = tail call i32 @printHexDigit(i8 zeroext %69)
%71 = getelementptr inbounds i8, i8* %0, i64 10
%72 = load i8, i8* %71
%73 = lshr i8 %72, 4
%74 = tail call i32 @printHexDigit(i8 zeroext %73)
%75 = load i8, i8* %71
%76 = and i8 %75, 15
%77 = tail call i32 @printHexDigit(i8 zeroext %76)
%78 = getelementptr inbounds i8, i8* %0, i64 11
%79 = load i8, i8* %78
%80 = lshr i8 %79, 4
%81 = tail call i32 @printHexDigit(i8 zeroext %80)
%82 = load i8, i8* %78
%83 = and i8 %82, 15
%84 = tail call i32 @printHexDigit(i8 zeroext %83)
%85 = getelementptr inbounds i8, i8* %0, i64 12
%86 = load i8, i8* %85
%87 = lshr i8 %86, 4
%88 = tail call i32 @printHexDigit(i8 zeroext %87)
%89 = load i8, i8* %85
%90 = and i8 %89, 15
%91 = tail call i32 @printHexDigit(i8 zeroext %90)
%92 = getelementptr inbounds i8, i8* %0, i64 13
%93 = load i8, i8* %92
%94 = lshr i8 %93, 4
%95 = tail call i32 @printHexDigit(i8 zeroext %94)
%96 = load i8, i8* %92
%97 = and i8 %96, 15
%98 = tail call i32 @printHexDigit(i8 zeroext %97)
%99 = getelementptr inbounds i8, i8* %0, i64 14
%100 = load i8, i8* %99
%101 = lshr i8 %100, 4
%102 = tail call i32 @printHexDigit(i8 zeroext %101)
%103 = load i8, i8* %99
%104 = and i8 %103, 15
%105 = tail call i32 @printHexDigit(i8 zeroext %104)
%106 = getelementptr inbounds i8, i8* %0, i64 15
%107 = load i8, i8* %106
%108 = lshr i8 %107, 4
%109 = tail call i32 @printHexDigit(i8 zeroext %108)
%110 = load i8, i8* %106
%111 = and i8 %110, 15
%112 = tail call i32 @printHexDigit(i8 zeroext %111)
ret void
}