#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 */
scalar_t__ isprint(unsigned char const);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(unsigned char const);
void hex_dump(const unsigned char *data, int size) {
  int i;
  unsigned int offset = 0;
  for (; size >= 8 << 1; size -= 8 << 1) {
    printf("$%04x:"
           " ",
           offset);
    for (i = 0; i < 8; i++, data++)
      printf("%02x"
             " ",
             *data);
    putchar(' ');
    for (i = 0; i < 8; i++, data++)
      printf("%02x"
             " ",
             *data);
    data -= 8 << 1;
    putchar('|');
    for (i = 0; i < 8 << 1; i++, data++) {
      if (isprint(*data))
        putchar(*data);
      else
        putchar('.');
    }
    printf("|\n");
    offset += 8 << 1;
  }
  if (size <= 0)
    return;
  printf("$%04x:"
         " ",
         offset);
  for (i = 0; i < 8; i++, data++, size--) {
    if (size > 0)
      printf("%02x"
             " ",
             *data);
    else
      printf("  "
             " ");
  }
  putchar(' ');
  for (i = 0; i < 8; i++, data++, size--) {
    if (size > 0)
      printf("%02x"
             " ",
             *data);
    else
      printf("  "
             " ");
  }
  data -= 8 << 1;
  size += 8 << 1;
  putchar('|');
  for (i = 0; i < 8 << 1; i++, data++, size--) {
    if (size <= 0) {
      putchar(' ');
      continue;
    }
    if (isprint(*data))
      putchar(*data);
    else
      putchar('.');
  }
  printf("|\n");
}


x86 assembly (clang, -O0):
<hex_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0xc(%rbp)
jl     1287 <hex_dump+0x157>
mov    -0x14(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11a1 <hex_dump+0x71>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <hex_dump+0x38>
mov    $0x20,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11eb <hex_dump+0xbb>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11b2 <hex_dump+0x82>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x8(%rbp)
mov    $0x7c,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    1262 <hex_dump+0x132>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     1239 <hex_dump+0x109>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <putchar@plt>
jmp    1243 <hex_dump+0x113>
mov    $0x2e,%edi
call   1030 <putchar@plt>
jmp    1248 <hex_dump+0x118>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1208 <hex_dump+0xd8>
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <hex_dump+0x16>
cmpl   $0x0,-0xc(%rbp)
jg     1296 <hex_dump+0x166>
jmp    1437 <hex_dump+0x307>
mov    -0x14(%rbp),%esi
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1312 <hex_dump+0x1e2>
cmpl   $0x0,-0xc(%rbp)
jle    12dc <hex_dump+0x1ac>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12ea <hex_dump+0x1ba>
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12ef <hex_dump+0x1bf>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    12ae <hex_dump+0x17e>
mov    $0x20,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1387 <hex_dump+0x257>
cmpl   $0x0,-0xc(%rbp)
jle    1351 <hex_dump+0x221>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
lea    0xcc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    135f <hex_dump+0x22f>
lea    0xcb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1364 <hex_dump+0x234>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1323 <hex_dump+0x1f3>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    $0x7c,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    1429 <hex_dump+0x2f9>
cmpl   $0x0,-0xc(%rbp)
jg     13d0 <hex_dump+0x2a0>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1406 <hex_dump+0x2d6>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     13f7 <hex_dump+0x2c7>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <putchar@plt>
jmp    1401 <hex_dump+0x2d1>
mov    $0x2e,%edi
call   1030 <putchar@plt>
jmp    1406 <hex_dump+0x2d6>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    13ad <hex_dump+0x27d>
lea    0xbde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r12d
mov    %rdi,%r14
xor    %ebp,%ebp
cmp    $0x10,%esi
jl     12de <hex_dump+0x19e>
lea    0xea5(%rip),%rbx
xor    %ebp,%ebp
mov    %r14,%rax
jmp    1195 <hex_dump+0x55>
nopw   0x0(%rax,%rax,1)
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%ebp
lea    -0x10(%r12),%r15d
lea    (%r14,%r13,1),%rax
cmp    $0x1f,%r12d
mov    %r15d,%r12d
jle    1321 <hex_dump+0x1e1>
mov    %rax,%r14
lea    0xe61(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl (%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x2(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x3(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x4(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x5(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x6(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x7(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl 0x8(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x9(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xa(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xb(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xc(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xd(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xe(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0xf(%r14),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
xor    %r13d,%r13d
jmp    12cb <hex_dump+0x18b>
movzbl (%r14,%r13,1),%eax
movzbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
cmp    $0x10,%r13d
je     1170 <hex_dump+0x30>
movzbl (%r14,%r13,1),%edi
call   1060 <isprint@plt>
test   %rax,%rax
jne    12b0 <hex_dump+0x170>
mov    $0x2e,%al
jmp    12b5 <hex_dump+0x175>
mov    %r12d,%r15d
test   %r15d,%r15d
jle    1329 <hex_dump+0x1e9>
lea    0xd13(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl (%r14),%esi
lea    0xd07(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x1,%r15d
jne    1338 <hex_dump+0x1f8>
lea    0xcf9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    14d3 <hex_dump+0x393>
add    %r13,%r14
test   %r15d,%r15d
jg     12e6 <hex_dump+0x1a6>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movzbl 0x1(%r14),%esi
lea    0xcc4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x2,%r15d
jbe    14d3 <hex_dump+0x393>
movzbl 0x2(%r14),%esi
lea    0xca7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x3,%r15d
je     14e1 <hex_dump+0x3a1>
movzbl 0x3(%r14),%esi
lea    0xc8a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x4,%r15d
jbe    14ef <hex_dump+0x3af>
movzbl 0x4(%r14),%esi
lea    0xc6d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x5,%r15d
je     14fd <hex_dump+0x3bd>
movzbl 0x5(%r14),%esi
lea    0xc50(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x6,%r15d
jbe    150b <hex_dump+0x3cb>
movzbl 0x6(%r14),%esi
lea    0xc33(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x7,%r15d
je     1519 <hex_dump+0x3d9>
movzbl 0x7(%r14),%esi
lea    0xc16(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
cmp    $0x8,%r15d
je     1531 <hex_dump+0x3f1>
movzbl 0x8(%r14),%esi
lea    0xbef(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x9,%r15d
je     153f <hex_dump+0x3ff>
movzbl 0x9(%r14),%esi
lea    0xbd2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xa,%r15d
je     154d <hex_dump+0x40d>
movzbl 0xa(%r14),%esi
lea    0xbb5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xb,%r15d
je     155b <hex_dump+0x41b>
movzbl 0xb(%r14),%esi
lea    0xb98(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xc,%r15d
je     1569 <hex_dump+0x429>
movzbl 0xc(%r14),%esi
lea    0xb7b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xd,%r15d
je     1577 <hex_dump+0x437>
movzbl 0xd(%r14),%esi
lea    0xb5e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xe,%r15d
je     1585 <hex_dump+0x445>
movzbl 0xe(%r14),%esi
lea    0xb41(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1593 <hex_dump+0x453>
lea    0xb34(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xb26(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xb18(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xb0a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xafc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xaee(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xad6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xac8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xaba(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xaac(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xa9e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xa90(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xa82(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xa74(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
jmp    15c7 <hex_dump+0x487>
nop
mov    $0x20,%al
movzbl %al,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r15d
add    $0x1,%rbx
cmp    $0x10,%ebx
je     15f4 <hex_dump+0x4b4>
test   %r15d,%r15d
jle    15b0 <hex_dump+0x470>
movzbl (%r14,%rbx,1),%edi
call   1060 <isprint@plt>
test   %rax,%rax
je     15f0 <hex_dump+0x4b0>
movzbl (%r14,%rbx,1),%eax
jmp    15b2 <hex_dump+0x472>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2e,%al
jmp    15b2 <hex_dump+0x472>
lea    0xa17(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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

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