#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 *, ...);
void HexDump(char *addr, int len) {
  char *s = addr, *endPtr = (char *)((long)addr + len);
  int i, remainder = len % 16;
  printf("\n");
  printf("Offset      Hex Value                                        Ascii "
         "value\n");
  while (s + 16 <= endPtr) {
    printf("0x%08lx  ", (long)(s - addr));
    for (i = 0; i < 16; i++) {
      printf("%02x ", s[i]);
    }
    printf(" ");
    for (i = 0; i < 16; i++) {
      if (s[i] >= 32 && s[i] <= 125)
        printf("%c", s[i]);
      else
        printf(".");
    }
    s += 16;
    printf("\n");
  }
  if (remainder) {
    printf("0x%08lx  ", (long)(s - addr));
    for (i = 0; i < remainder; i++) {
      printf("%02x ", s[i]);
    }
    for (i = 0; i < (16 - remainder); i++) {
      printf("   ");
    }
    printf(" ");
    for (i = 0; i < remainder; i++) {
      if (s[i] >= 32 && s[i] <= 125)
        printf("%c", s[i]);
      else
        printf(".");
    }
    for (i = 0; i < (16 - remainder); i++) {
      printf(" ");
    }
    printf("\n");
  }
  return;
}


x86 assembly (clang, -O0):
<HexDump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x28(%rbp)
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x10,%rax
cmp    -0x20(%rbp),%rax
ja     126c <HexDump+0x15c>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
sub    %rax,%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10,-0x24(%rbp)
jge    11c4 <HexDump+0xb4>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1192 <HexDump+0x82>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10,-0x24(%rbp)
jge    124d <HexDump+0x13d>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     122c <HexDump+0x11c>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7d,%eax
jg     122c <HexDump+0x11c>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123a <HexDump+0x12a>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123f <HexDump+0x12f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d9 <HexDump+0xc9>
mov    -0x18(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1160 <HexDump+0x50>
cmpl   $0x0,-0x28(%rbp)
je     13cf <HexDump+0x2bf>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
sub    %rax,%rsi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    12ca <HexDump+0x1ba>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1296 <HexDump+0x186>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x10,%ecx
sub    -0x28(%rbp),%ecx
cmp    %ecx,%eax
jge    1300 <HexDump+0x1f0>
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12d1 <HexDump+0x1c1>
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    138b <HexDump+0x27b>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     136a <HexDump+0x25a>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7d,%eax
jg     136a <HexDump+0x25a>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xcfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1378 <HexDump+0x268>
lea    0xcec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    137d <HexDump+0x26d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1315 <HexDump+0x205>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x10,%ecx
sub    -0x28(%rbp),%ecx
cmp    %ecx,%eax
jge    13c1 <HexDump+0x2b1>
lea    0xcb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1392 <HexDump+0x282>
lea    0xc80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HexDump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbp
movslq %esi,%r13
lea    (%rdi,%r13,1),%rbx
lea    0xf(%r13),%eax
test   %r13d,%r13d
cmovns %r13d,%eax
and    $0xfffffff0,%eax
sub    %eax,%r13d
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rbp),%rax
mov    %rbp,(%rsp)
cmp    %rbx,%rax
ja     1441 <HexDump+0x311>
mov    %rbx,%rax
lea    0xe83(%rip),%rbx
mov    $0x2e,%r14d
xor    %r12d,%r12d
mov    (%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xe59(%rip),%rdi
mov    %r12,%rsi
mov    %rax,%rbp
xor    %eax,%eax
call   1050 <printf@plt>
movsbl (%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x1(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x2(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x3(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x4(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x5(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x6(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x7(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x8(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x9(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xa(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xb(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xc(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xd(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xe(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0xf(%r15),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl (%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x1(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x2(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x3(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x4(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x5(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x6(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x7(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x8(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x9(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0xa(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0xb(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0xc(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0xd(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0xe(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl 0xf(%r15),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r14d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbp,%rax
lea    0x10(%r15),%rbp
add    $0x10,%r12
add    $0x20,%r15
cmp    %rax,%r15
mov    %rbp,%r15
jbe    11a0 <HexDump+0x70>
test   %r13d,%r13d
je     1527 <HexDump+0x3f7>
mov    %rbp,%rsi
sub    (%rsp),%rsi
lea    0xba8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13d,%r14d
test   %r13d,%r13d
jle    1488 <HexDump+0x358>
lea    0xb9c(%rip),%r15
xor    %ebx,%ebx
movsbl 0x0(%rbp,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1470 <HexDump+0x340>
lea    -0x10(%r13),%ebx
lea    0xb7d(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
inc    %ebx
jne    14a0 <HexDump+0x370>
mov    $0x20,%edi
call   1030 <putchar@plt>
test   %r13d,%r13d
jle    14f0 <HexDump+0x3c0>
xor    %ebx,%ebx
mov    $0x2e,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x0(%rbp,%rbx,1),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5e,%cl
cmovae %r15d,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    14d0 <HexDump+0x3a0>
add    $0xfffffff0,%r13d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
inc    %r13d
jne    1500 <HexDump+0x3d0>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [74 x i8] c"Offset Hex Value Ascii value\0A\00"
@.str.2 = [10 x i8] c"0x%08lx \00"
@.str.3 = [6 x i8] c"%02x \00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [2 x i8] c".\00"
@.str.7 = [4 x i8] c" \00"
define void @HexDump(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%9 = load i8*, i8** %3
store i8* %9, i8** %5
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %10 to i64
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = add nsw i64 %11, %13
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %6
%16 = load i32, i32* %4
%17 = srem i32 %16, 16
store i32 %17, i32* %8
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %81, %2
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 16
%23 = load i8*, i8** %6
%24 = icmp ule i8* %22, %23
br i1 %24, label %25, label %85
25: ; preds = %20
%26 = load i8*, i8** %5
%27 = load i8*, i8** %3
%28 = ptrtoint i8* %26 to i64
%29 = ptrtoint i8* %27 to i64
%30 = sub i64 %28, %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 %30)
store i32 0, i32* %7
br label %32
32: ; preds = %43, %25
%33 = load i32, i32* %7
%34 = icmp slt i32 %33, 16
br i1 %34, label %35, label %46
35: ; preds = %32
%36 = load i8*, i8** %5
%37 = load i32, i32* %7
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %35
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %32
46: ; preds = %32
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %7
br label %48
48: ; preds = %78, %46
%49 = load i32, i32* %7
%50 = icmp slt i32 %49, 16
br i1 %50, label %51, label %81
51: ; preds = %48
%52 = load i8*, i8** %5
%53 = load i32, i32* %7
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp sge i32 %57, 32
br i1 %58, label %59, label %75
59: ; preds = %51
%60 = load i8*, i8** %5
%61 = load i32, i32* %7
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %60, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp sle i32 %65, 125
br i1 %66, label %67, label %75
67: ; preds = %59
%68 = load i8*, i8** %5
%69 = load i32, i32* %7
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %73)
br label %77
75: ; preds = %59, %51
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %77
77: ; preds = %75, %67
br label %78
78: ; preds = %77
%79 = load i32, i32* %7
%80 = add nsw i32 %79, 1
store i32 %80, i32* %7
br label %48
81: ; preds = %48
%82 = load i8*, i8** %5
%83 = getelementptr inbounds i8, i8* %82, i64 16
store i8* %83, i8** %5
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %20
85: ; preds = %20
%86 = load i32, i32* %8
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %170
88: ; preds = %85
%89 = load i8*, i8** %5
%90 = load i8*, i8** %3
%91 = ptrtoint i8* %89 to i64
%92 = ptrtoint i8* %90 to i64
%93 = sub i64 %91, %92
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 %93)
store i32 0, i32* %7
br label %95
95: ; preds = %107, %88
%96 = load i32, i32* %7
%97 = load i32, i32* %8
%98 = icmp slt i32 %96, %97
br i1 %98, label %99, label %110
99: ; preds = %95
%100 = load i8*, i8** %5
%101 = load i32, i32* %7
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8, i8* %100, i64 %102
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %105)
br label %107
107: ; preds = %99
%108 = load i32, i32* %7
%109 = add nsw i32 %108, 1
store i32 %109, i32* %7
br label %95
110: ; preds = %95
store i32 0, i32* %7
br label %111
111: ; preds = %118, %110
%112 = load i32, i32* %7
%113 = load i32, i32* %8
%114 = sub nsw i32 16, %113
%115 = icmp slt i32 %112, %114
br i1 %115, label %116, label %121
116: ; preds = %111
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %118
118: ; preds = %116
%119 = load i32, i32* %7
%120 = add nsw i32 %119, 1
store i32 %120, i32* %7
br label %111
121: ; preds = %111
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %7
br label %123
123: ; preds = %154, %121
%124 = load i32, i32* %7
%125 = load i32, i32* %8
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %157
127: ; preds = %123
%128 = load i8*, i8** %5
%129 = load i32, i32* %7
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i8, i8* %128, i64 %130
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = icmp sge i32 %133, 32
br i1 %134, label %135, label %151
135: ; preds = %127
%136 = load i8*, i8** %5
%137 = load i32, i32* %7
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8, i8* %136, i64 %138
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = icmp sle i32 %141, 125
br i1 %142, label %143, label %151
143: ; preds = %135
%144 = load i8*, i8** %5
%145 = load i32, i32* %7
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i8, i8* %144, i64 %146
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %149)
br label %153
151: ; preds = %135, %127
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %153
153: ; preds = %151, %143
br label %154
154: ; preds = %153
%155 = load i32, i32* %7
%156 = add nsw i32 %155, 1
store i32 %156, i32* %7
br label %123
157: ; preds = %123
store i32 0, i32* %7
br label %158
158: ; preds = %165, %157
%159 = load i32, i32* %7
%160 = load i32, i32* %8
%161 = sub nsw i32 16, %160
%162 = icmp slt i32 %159, %161
br i1 %162, label %163, label %168
163: ; preds = %158
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %165
165: ; preds = %163
%166 = load i32, i32* %7
%167 = add nsw i32 %166, 1
store i32 %167, i32* %7
br label %158
168: ; preds = %158
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %170
170: ; preds = %168, %85
ret void
}

LLVM IR (-O2):
@.str.2 = [10 x i8] c"0x%08lx \00"
@.str.3 = [6 x i8] c"%02x \00"
@.str.7 = [4 x i8] c" \00"
@str = [73 x i8] c"Offset Hex Value Ascii value\00"
define void @HexDump(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = sext i32 %1 to i64
%5 = add nsw i64 %4, %3
%6 = inttoptr i64 %5 to i8*
%7 = srem i32 %1, 16
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%10 = getelementptr inbounds i8, i8* %0, i64 16
%11 = icmp ugt i8* %10, %6
br i1 %11, label %196, label %12
12: ; preds = %2, %12
%13 = phi i8* [ %194, %12 ], [ %10, %2 ]
%14 = phi i8* [ %13, %12 ], [ %0, %2 ]
%15 = ptrtoint i8* %14 to i64
%16 = sub i64 %15, %3
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 %16)
%18 = load i8, i8* %14
%19 = sext i8 %18 to i32
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds i8, i8* %14, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds i8, i8* %14, i64 2
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds i8, i8* %14, i64 3
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %31)
%33 = getelementptr inbounds i8, i8* %14, i64 4
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds i8, i8* %14, i64 5
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds i8, i8* %14, i64 6
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %43)
%45 = getelementptr inbounds i8, i8* %14, i64 7
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %47)
%49 = getelementptr inbounds i8, i8* %14, i64 8
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %51)
%53 = getelementptr inbounds i8, i8* %14, i64 9
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %55)
%57 = getelementptr inbounds i8, i8* %14, i64 10
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds i8, i8* %14, i64 11
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %63)
%65 = getelementptr inbounds i8, i8* %14, i64 12
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %67)
%69 = getelementptr inbounds i8, i8* %14, i64 13
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %71)
%73 = getelementptr inbounds i8, i8* %14, i64 14
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %75)
%77 = getelementptr inbounds i8, i8* %14, i64 15
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %79)
%81 = tail call i32 @putchar(i32 32)
%82 = load i8, i8* %14
%83 = add i8 %82, -32
%84 = icmp ult i8 %83, 94
%85 = select i1 %84, i8 %82, i8 46
%86 = zext i8 %85 to i32
%87 = tail call i32 @putchar(i32 %86)
%88 = getelementptr inbounds i8, i8* %14, i64 1
%89 = load i8, i8* %88
%90 = add i8 %89, -32
%91 = icmp ult i8 %90, 94
%92 = select i1 %91, i8 %89, i8 46
%93 = zext i8 %92 to i32
%94 = tail call i32 @putchar(i32 %93)
%95 = getelementptr inbounds i8, i8* %14, i64 2
%96 = load i8, i8* %95
%97 = add i8 %96, -32
%98 = icmp ult i8 %97, 94
%99 = select i1 %98, i8 %96, i8 46
%100 = zext i8 %99 to i32
%101 = tail call i32 @putchar(i32 %100)
%102 = getelementptr inbounds i8, i8* %14, i64 3
%103 = load i8, i8* %102
%104 = add i8 %103, -32
%105 = icmp ult i8 %104, 94
%106 = select i1 %105, i8 %103, i8 46
%107 = zext i8 %106 to i32
%108 = tail call i32 @putchar(i32 %107)
%109 = getelementptr inbounds i8, i8* %14, i64 4
%110 = load i8, i8* %109
%111 = add i8 %110, -32
%112 = icmp ult i8 %111, 94
%113 = select i1 %112, i8 %110, i8 46
%114 = zext i8 %113 to i32
%115 = tail call i32 @putchar(i32 %114)
%116 = getelementptr inbounds i8, i8* %14, i64 5
%117 = load i8, i8* %116
%118 = add i8 %117, -32
%119 = icmp ult i8 %118, 94
%120 = select i1 %119, i8 %117, i8 46
%121 = zext i8 %120 to i32
%122 = tail call i32 @putchar(i32 %121)
%123 = getelementptr inbounds i8, i8* %14, i64 6
%124 = load i8, i8* %123
%125 = add i8 %124, -32
%126 = icmp ult i8 %125, 94
%127 = select i1 %126, i8 %124, i8 46
%128 = zext i8 %127 to i32
%129 = tail call i32 @putchar(i32 %128)
%130 = getelementptr inbounds i8, i8* %14, i64 7
%131 = load i8, i8* %130
%132 = add i8 %131, -32
%133 = icmp ult i8 %132, 94
%134 = select i1 %133, i8 %131, i8 46
%135 = zext i8 %134 to i32
%136 = tail call i32 @putchar(i32 %135)
%137 = getelementptr inbounds i8, i8* %14, i64 8
%138 = load i8, i8* %137
%139 = add i8 %138, -32
%140 = icmp ult i8 %139, 94
%141 = select i1 %140, i8 %138, i8 46
%142 = zext i8 %141 to i32
%143 = tail call i32 @putchar(i32 %142)
%144 = getelementptr inbounds i8, i8* %14, i64 9
%145 = load i8, i8* %144
%146 = add i8 %145, -32
%147 = icmp ult i8 %146, 94
%148 = select i1 %147, i8 %145, i8 46
%149 = zext i8 %148 to i32
%150 = tail call i32 @putchar(i32 %149)
%151 = getelementptr inbounds i8, i8* %14, i64 10
%152 = load i8, i8* %151
%153 = add i8 %152, -32
%154 = icmp ult i8 %153, 94
%155 = select i1 %154, i8 %152, i8 46
%156 = zext i8 %155 to i32
%157 = tail call i32 @putchar(i32 %156)
%158 = getelementptr inbounds i8, i8* %14, i64 11
%159 = load i8, i8* %158
%160 = add i8 %159, -32
%161 = icmp ult i8 %160, 94
%162 = select i1 %161, i8 %159, i8 46
%163 = zext i8 %162 to i32
%164 = tail call i32 @putchar(i32 %163)
%165 = getelementptr inbounds i8, i8* %14, i64 12
%166 = load i8, i8* %165
%167 = add i8 %166, -32
%168 = icmp ult i8 %167, 94
%169 = select i1 %168, i8 %166, i8 46
%170 = zext i8 %169 to i32
%171 = tail call i32 @putchar(i32 %170)
%172 = getelementptr inbounds i8, i8* %14, i64 13
%173 = load i8, i8* %172
%174 = add i8 %173, -32
%175 = icmp ult i8 %174, 94
%176 = select i1 %175, i8 %173, i8 46
%177 = zext i8 %176 to i32
%178 = tail call i32 @putchar(i32 %177)
%179 = getelementptr inbounds i8, i8* %14, i64 14
%180 = load i8, i8* %179
%181 = add i8 %180, -32
%182 = icmp ult i8 %181, 94
%183 = select i1 %182, i8 %180, i8 46
%184 = zext i8 %183 to i32
%185 = tail call i32 @putchar(i32 %184)
%186 = getelementptr inbounds i8, i8* %14, i64 15
%187 = load i8, i8* %186
%188 = add i8 %187, -32
%189 = icmp ult i8 %188, 94
%190 = select i1 %189, i8 %187, i8 46
%191 = zext i8 %190 to i32
%192 = tail call i32 @putchar(i32 %191)
%193 = tail call i32 @putchar(i32 10)
%194 = getelementptr inbounds i8, i8* %13, i64 16
%195 = icmp ugt i8* %194, %6
br i1 %195, label %196, label %12
196: ; preds = %12, %2
%197 = phi i8* [ %0, %2 ], [ %13, %12 ]
%198 = icmp eq i32 %7, 0
br i1 %198, label %244, label %199
199: ; preds = %196
%200 = ptrtoint i8* %197 to i64
%201 = sub i64 %200, %3
%202 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 %201)
%203 = icmp sgt i32 %7, 0
br i1 %203, label %204, label %206
204: ; preds = %199
%205 = zext i32 %7 to i64
br label %208
206: ; preds = %208, %199
%207 = sub nsw i32 16, %7
br label %216
208: ; preds = %204, %208
%209 = phi i64 [ 0, %204 ], [ %214, %208 ]
%210 = getelementptr inbounds i8, i8* %197, i64 %209
%211 = load i8, i8* %210
%212 = sext i8 %211 to i32
%213 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %212)
%214 = add nuw nsw i64 %209, 1
%215 = icmp eq i64 %214, %205
br i1 %215, label %206, label %208
216: ; preds = %206, %216
%217 = phi i32 [ %219, %216 ], [ 0, %206 ]
%218 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%219 = add nuw nsw i32 %217, 1
%220 = icmp eq i32 %219, %207
br i1 %220, label %221, label %216
221: ; preds = %216
%222 = tail call i32 @putchar(i32 32)
br i1 %203, label %223, label %236
223: ; preds = %221
%224 = zext i32 %7 to i64
br label %225
225: ; preds = %223, %225
%226 = phi i64 [ 0, %223 ], [ %234, %225 ]
%227 = getelementptr inbounds i8, i8* %197, i64 %226
%228 = load i8, i8* %227
%229 = add i8 %228, -32
%230 = icmp ult i8 %229, 94
%231 = select i1 %230, i8 %228, i8 46
%232 = zext i8 %231 to i32
%233 = tail call i32 @putchar(i32 %232)
%234 = add nuw nsw i64 %226, 1
%235 = icmp eq i64 %234, %224
br i1 %235, label %236, label %225
236: ; preds = %225, %221
br label %237
237: ; preds = %236, %237
%238 = phi i32 [ %240, %237 ], [ 0, %236 ]
%239 = tail call i32 @putchar(i32 32)
%240 = add nuw nsw i32 %238, 1
%241 = icmp eq i32 %240, %207
br i1 %241, label %242, label %237
242: ; preds = %237
%243 = tail call i32 @putchar(i32 10)
br label %244
244: ; preds = %242, %196
ret void
}