#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
void Vec_MemDumpDigit(FILE *pFile, int HexDigit) {
  assert(HexDigit >= 0 && HexDigit < 16);
  if (HexDigit < 10)
    fprintf(pFile, "%d", HexDigit);
  else
    fprintf(pFile, "%c", 'A' + HexDigit - 10);
}


x86 assembly (clang, -O0):
<Vec_MemDumpDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1148 <Vec_MemDumpDigit+0x28>
cmpl   $0x10,-0xc(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xa,-0xc(%rbp)
jge    117a <Vec_MemDumpDigit+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
lea    0xe93(%rip),%rsi
movsbl %al,%edx
call   1040 <fprintf@plt>
jmp    1196 <Vec_MemDumpDigit+0x76>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
lea    0xe75(%rip),%rsi
movsbl %al,%edx
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vec_MemDumpDigit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x10,%esi
setb   %dil
call   1040 <assert@plt>
cmp    $0x9,%ebp
jg     1164 <Vec_MemDumpDigit+0x34>
movsbl %bpl,%edx
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <fprintf@plt>
add    $0x37,%bpl
movsbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define void @Vec_MemDumpDigit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 16
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 10
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = trunc i32 %18 to i8
%20 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %19)
br label %28
21: ; preds = %10
%22 = load i32*, i32** %3
%23 = load i32, i32* %4
%24 = add nsw i32 65, %23
%25 = sub nsw i32 %24, 10
%26 = trunc i32 %25 to i8
%27 = call i32 @fprintf(i32* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %26)
br label %28
28: ; preds = %21, %16
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @Vec_MemDumpDigit(i32* nocapture %0, i32 %1) {
%3 = icmp ult i32 %1, 16
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp slt i32 %1, 10
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = trunc i32 %1 to i8
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
br label %15
10: ; preds = %2
%11 = shl i32 %1, 24
%12 = add i32 %11, 922746880
%13 = ashr exact i32 %12, 24
%14 = tail call i32 @fputc(i32 %13, i32* %0)
br label %15
15: ; preds = %10, %7
ret void
}