#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*/ hexstr;
typedef int /*<<< orphan*/ charstr;
typedef int /*<<< orphan*/ bytestr;
typedef int /*<<< orphan*/ addrstr;

/* Variables and functions */
int /*<<< orphan*/ isprint(unsigned char);
int /*<<< orphan*/ printf(char *, char const *, char *, char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned char);
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void hex_dump(void *data, int size, int printAddr, const char *prefixFirst,
              const char *prefix) {
  unsigned char *p = (unsigned char *)data;
  unsigned char c;
  int n;
  char bytestr[4] = {0};
  char addrstr[10] = {0};
  char hexstr[16 * 3 + 5] = {0};
  char charstr[16 * 1 + 5] = {0};
  if (!prefixFirst) {
    prefixFirst = NULL;
  }
  if (!prefix) {
    prefix = NULL;
  }
  for (n = 1; n <= size; n++) {
    if (n % 16 == 1) {
      unsigned int offset = ((uintptr_t)p - (uintptr_t)data);
      snprintf(addrstr, sizeof(addrstr), "%.4x", offset);
    }
    c = *p;
    if (!isprint(c)) {
      c = '.';
    }
    snprintf(bytestr, sizeof(bytestr), "%02X ", *p);
    strncat(hexstr, bytestr, sizeof(hexstr) - strlen(hexstr) - 1);
    snprintf(bytestr, sizeof(bytestr), "%c", c);
    strncat(charstr, bytestr, sizeof(charstr) - strlen(charstr) - 1);
    if (n % 16 == 0) {
      const char *p = (n <= 16) ? prefixFirst : prefix;
      if (printAddr) {
        printf("%s[%4.4s]   %-50.50s  %s\n", p, addrstr, hexstr, charstr);
      } else {
        printf("%s%-50.50s  %s\n", p, hexstr, charstr);
      }
      hexstr[0] = 0;
      charstr[0] = 0;
    } else if (n % 8 == 0) {
      strncat(hexstr, "  ", sizeof(hexstr) - strlen(hexstr) - 1);
      strncat(charstr, " ", sizeof(charstr) - strlen(charstr) - 1);
    }
    p++;
  }
  if (strlen(hexstr) > 0) {
    const char *p = (n <= 16) ? prefixFirst : prefix;
    if (printAddr) {
      printf("%s[%4.4s]   %-50.50s  %s\n", p, addrstr, hexstr, charstr);
    } else {
      printf("%s%-50.50s  %s\n", p, hexstr, charstr);
    }
  }
}


x86 assembly (clang, -O0):
<hex_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x34(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
lea    -0x3e(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <memset@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x35,%edx
call   1060 <memset@plt>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1060 <memset@plt>
cmpq   $0x0,-0x18(%rbp)
jne    11db <hex_dump+0x7b>
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11ee <hex_dump+0x8e>
movq   $0x0,-0x20(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1477 <hex_dump+0x317>
mov    -0x30(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1244 <hex_dump+0xe4>
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0xa4(%rbp)
lea    -0x3e(%rbp),%rdi
mov    -0xa4(%rbp),%eax
mov    $0xa,%esi
lea    0xdc4(%rip),%rdx
movzbl %al,%ecx
call   1050 <snprintf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
movzbl -0x29(%rbp),%edi
call   1080 <isprint@plt>
cmp    $0x0,%eax
jne    1263 <hex_dump+0x103>
movb   $0x2e,-0x29(%rbp)
lea    -0x34(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    $0x4,%esi
lea    0xd8e(%rip),%rdx
movzbl (%rax),%ecx
call   1050 <snprintf@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0xd8(%rbp)
lea    -0x34(%rbp),%rax
mov    %rax,-0xd0(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xd8(%rbp),%rdi
mov    -0xd0(%rbp),%rsi
movslq %eax,%rcx
mov    $0x35,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
call   1070 <strncat@plt>
lea    -0x34(%rbp),%rdi
mov    $0x4,%esi
lea    0xd39(%rip),%rdx
movzbl -0x29(%rbp),%ecx
call   1050 <snprintf@plt>
lea    -0xa0(%rbp),%rax
mov    %rax,-0xc8(%rbp)
lea    -0x34(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    -0xa0(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xc8(%rbp),%rdi
mov    -0xc0(%rbp),%rsi
movslq %eax,%rcx
mov    $0x15,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
call   1070 <strncat@plt>
mov    -0x30(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    13ce <hex_dump+0x26e>
cmpl   $0x10,-0x30(%rbp)
jg     1352 <hex_dump+0x1f2>
mov    -0x18(%rbp),%rax
mov    %rax,-0xe0(%rbp)
jmp    135d <hex_dump+0x1fd>
mov    -0x20(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rax
mov    %rax,-0xb0(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     139e <hex_dump+0x23e>
mov    -0xb0(%rbp),%rsi
lea    -0x3e(%rbp),%rdx
lea    -0x80(%rbp),%rcx
lea    -0xa0(%rbp),%r8
lea    0xc7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13be <hex_dump+0x25e>
mov    -0xb0(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
lea    0xc71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x0,-0x80(%rbp)
movb   $0x0,-0xa0(%rbp)
jmp    145d <hex_dump+0x2fd>
mov    -0x30(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1458 <hex_dump+0x2f8>
lea    -0x80(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xf0(%rbp),%rdi
movslq %eax,%rcx
mov    $0x35,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
lea    0xc23(%rip),%rsi
call   1070 <strncat@plt>
lea    -0xa0(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0xa0(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xe8(%rbp),%rdi
movslq %eax,%rcx
mov    $0x15,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
lea    0xbe6(%rip),%rsi
call   1070 <strncat@plt>
jmp    145d <hex_dump+0x2fd>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11f5 <hex_dump+0x95>
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jle    1514 <hex_dump+0x3b4>
cmpl   $0x10,-0x30(%rbp)
jg     14a3 <hex_dump+0x343>
mov    -0x18(%rbp),%rax
mov    %rax,-0xf8(%rbp)
jmp    14ae <hex_dump+0x34e>
mov    -0x20(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0xb8(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     14ef <hex_dump+0x38f>
mov    -0xb8(%rbp),%rsi
lea    -0x3e(%rbp),%rdx
lea    -0x80(%rbp),%rcx
lea    -0xa0(%rbp),%r8
lea    0xb2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    150f <hex_dump+0x3af>
mov    -0xb8(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
lea    0xb20(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1514 <hex_dump+0x3b4>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r8,%rbx
mov    %rcx,0x40(%rsp)
mov    %edx,0x4(%rsp)
movl   $0x0,0x1c(%rsp)
movw   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movq   $0x0,0x7d(%rsp)
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x2d(%rsp)
test   %esi,%esi
jle    1367 <hex_dump+0x217>
mov    %rdi,%rbp
mov    %rbx,0x38(%rsp)
mov    %esi,%eax
mov    %rax,0x48(%rsp)
add    $0x1,%esi
mov    %esi,0x18(%rsp)
lea    0x1c(%rsp),%r14
xor    %r15d,%r15d
jmp    1203 <hex_dump+0xb3>
lea    0xe4b(%rip),%rdi
lea    0x50(%rsp),%rdx
lea    0x20(%rsp),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x50(%rsp)
movb   $0x0,0x20(%rsp)
cmp    %r15d,0x48(%rsp)
je     135c <hex_dump+0x20c>
mov    %r15,%rbx
add    $0x1,%r15
mov    %r15d,%r12d
and    $0xf,%r12d
cmp    $0x1,%r12d
jne    1230 <hex_dump+0xe0>
movzbl %bl,%ecx
lea    0x8(%rsp),%rdi
mov    $0xa,%esi
lea    0xdd5(%rip),%rdx
call   1050 <snprintf@plt>
movzbl 0x0(%rbp,%rbx,1),%r13d
mov    %r13d,%edi
call   1070 <isprint@plt>
test   %eax,%eax
mov    $0x2e,%eax
cmove  %eax,%r13d
movzbl 0x0(%rbp,%rbx,1),%ecx
mov    %r14,%rdi
mov    $0x4,%esi
lea    0xda8(%rip),%rdx
call   1050 <snprintf@plt>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x34,%edx
sub    %eax,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strncat@plt>
mov    %r14,%rdi
mov    $0x4,%esi
lea    0xd7b(%rip),%rdx
mov    %r13d,%ecx
call   1050 <snprintf@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x14,%edx
sub    %eax,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strncat@plt>
test   %r12d,%r12d
je     1320 <hex_dump+0x1d0>
test   $0x7,%r15b
jne    11f8 <hex_dump+0xa8>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x34,%edx
sub    %eax,%edx
mov    %rbx,%rdi
lea    0xd54(%rip),%rsi
call   1060 <strncat@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x14,%edx
sub    %eax,%edx
mov    %rbx,%rdi
lea    0xd32(%rip),%rsi
call   1060 <strncat@plt>
jmp    11f8 <hex_dump+0xa8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x11,%r15d
mov    0x38(%rsp),%rsi
cmovb  0x40(%rsp),%rsi
cmpl   $0x0,0x4(%rsp)
je     11d6 <hex_dump+0x86>
lea    0xccd(%rip),%rdi
lea    0x8(%rsp),%rdx
lea    0x50(%rsp),%rcx
lea    0x20(%rsp),%r8
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ee <hex_dump+0x9e>
mov    0x38(%rsp),%rbx
mov    0x18(%rsp),%ebp
jmp    136c <hex_dump+0x21c>
mov    $0x1,%ebp
lea    0x50(%rsp),%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    13c7 <hex_dump+0x277>
cmp    $0x11,%ebp
cmovb  0x40(%rsp),%rbx
cmpl   $0x0,0x4(%rsp)
je     13ac <hex_dump+0x25c>
lea    0xc7d(%rip),%rdi
lea    0x8(%rsp),%rdx
lea    0x50(%rsp),%rcx
lea    0x20(%rsp),%r8
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    13c7 <hex_dump+0x277>
lea    0xc75(%rip),%rdi
lea    0x50(%rsp),%rdx
lea    0x20(%rsp),%rcx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.4x\00"
@.str.1 = [6 x i8] c"%02X \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [26 x i8] c"%s[%4.4s] %-50.50s %s\0A\00"
@.str.4 = [16 x i8] c"%s%-50.50s %s\0A\00"
@.str.5 = [3 x i8] c" \00"
@.str.6 = [2 x i8] c" \00"
define void @hex_dump(i8* %0, i32 %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca [10 x i8]
%8 = alloca [53 x i8]
%9 = alloca [21 x i8]
%10 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds [53 x i8], [53 x i8]* %8, i64 0, i64 0
%13 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%14 = icmp slt i32 %1, 1
br i1 %14, label %66, label %15
15: ; preds = %5
%16 = ptrtoint i8* %0 to i64
%17 = icmp eq i32 %2, 0
%18 = add nuw i32 %1, 1
br label %19
19: ; preds = %15, %62
%20 = phi i8* [ %0, %15 ], [ %63, %62 ]
%21 = phi i32 [ 1, %15 ], [ %64, %62 ]
%22 = and i32 %21, 15
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %29
24: ; preds = %19
%25 = ptrtoint i8* %20 to i64
%26 = sub i64 %25, %16
%27 = trunc i64 %26 to i8
%28 = call i32 @snprintf(i8* %11, i32 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %27)
br label %29
29: ; preds = %24, %19
%30 = load i8, i8* %20
%31 = call i32 @isprint(i8 zeroext %30)
%32 = icmp eq i32 %31, 0
%33 = select i1 %32, i8 46, i8 %30
%34 = load i8, i8* %20
%35 = call i32 @snprintf(i8* %10, i32 4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %34)
%36 = call i32 @strlen(i8* %12)
%37 = sub i32 52, %36
%38 = call i32 @strncat(i8* %12, i8* %10, i32 %37)
%39 = call i32 @snprintf(i8* %10, i32 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %33)
%40 = call i32 @strlen(i8* %13)
%41 = sub i32 20, %40
%42 = call i32 @strncat(i8* %13, i8* %10, i32 %41)
%43 = icmp eq i32 %22, 0
br i1 %43, label %44, label %52
44: ; preds = %29
%45 = icmp ult i32 %21, 17
%46 = select i1 %45, i8* %3, i8* %4
br i1 %17, label %49, label %47
47: ; preds = %44
%48 = call i32 (i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %46, i8* %11, i8* %12, i8* %13)
br label %51
49: ; preds = %44
%50 = call i32 (i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %46, i8* %12, i8* %13)
br label %51
51: ; preds = %49, %47
store i8 0, i8* %12
store i8 0, i8* %13
br label %62
52: ; preds = %29
%53 = and i32 %21, 7
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %62
55: ; preds = %52
%56 = call i32 @strlen(i8* %12)
%57 = sub i32 52, %56
%58 = call i32 @strncat(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %57)
%59 = call i32 @strlen(i8* %13)
%60 = sub i32 20, %59
%61 = call i32 @strncat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 %60)
br label %62
62: ; preds = %52, %55, %51
%63 = getelementptr inbounds i8, i8* %20, i64 1
%64 = add nuw i32 %21, 1
%65 = icmp eq i32 %21, %1
br i1 %65, label %66, label %19
66: ; preds = %62, %5
%67 = phi i32 [ 1, %5 ], [ %18, %62 ]
%68 = call i32 @strlen(i8* %12)
%69 = icmp sgt i32 %68, 0
br i1 %69, label %70, label %78
70: ; preds = %66
%71 = icmp ult i32 %67, 17
%72 = select i1 %71, i8* %3, i8* %4
%73 = icmp eq i32 %2, 0
br i1 %73, label %76, label %74
74: ; preds = %70
%75 = call i32 (i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %72, i8* %11, i8* %12, i8* %13)
br label %78
76: ; preds = %70
%77 = call i32 (i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %72, i8* %12, i8* %13)
br label %78
78: ; preds = %74, %76, %66
ret void
}