#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 dump_raw_data(char *data, int data_len) {
  int i, j;
  int offset = 0;
  char *h, *a;
  char *end = data + data_len;
  h = a = data;
  while (h < end) {
    printf("0x%08x  ", offset);
    offset += 16;
    for (i = 0; i < 4; i++) {
      for (j = 0; j < 4; j++) {
        if (h <= end)
          printf("%02x", *h++);
        else
          printf("  ");
      }
      printf(" ");
    }
    printf("|");
    for (i = 0; i < 16; i++) {
      if (a <= end) {
        if ((*a >= ' ') && (*a <= '~'))
          printf("%c", *a);
        else
          printf(".");
        a++;
      } else
        printf(" ");
    }
    printf("|\n");
  }
}


x86 assembly (clang, -O0):
<dump_raw_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    12b5 <dump_raw_data+0x1a5>
mov    -0x18(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    11fb <dump_raw_data+0xeb>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11df <dump_raw_data+0xcf>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
ja     11be <dump_raw_data+0xae>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11cc <dump_raw_data+0xbc>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d1 <dump_raw_data+0xc1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <dump_raw_data+0x71>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1170 <dump_raw_data+0x60>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    12a2 <dump_raw_data+0x192>
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
ja     1281 <dump_raw_data+0x171>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jl     1262 <dump_raw_data+0x152>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7e,%eax
jg     1262 <dump_raw_data+0x152>
mov    -0x28(%rbp),%rax
movsbl (%rax),%esi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1270 <dump_raw_data+0x160>
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    128f <dump_raw_data+0x17f>
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1294 <dump_raw_data+0x184>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1210 <dump_raw_data+0x100>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1141 <dump_raw_data+0x31>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_raw_data>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    12d0 <dump_raw_data+0x1a0>
mov    %rdi,%r15
movslq %esi,%r14
add    %rdi,%r14
lea    0xeb3(%rip),%rbp
lea    0xeaf(%rip),%r13
mov    %rdi,%rbx
xor    %r12d,%r12d
jmp    1195 <dump_raw_data+0x65>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x4(%rsp),%r12d
add    $0x10,%r12d
lea    0xe8e(%rip),%rdi
call   1040 <puts@plt>
cmp    %r14,%rbx
lea    0xe77(%rip),%rbp
jae    12d0 <dump_raw_data+0x1a0>
lea    0xe64(%rip),%rdi
mov    %r12d,0x4(%rsp)
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%r12d
jmp    11de <dump_raw_data+0xae>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r12d
je     1270 <dump_raw_data+0x140>
cmp    %r14,%rbx
jbe    1220 <dump_raw_data+0xf0>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%rbx
ja     1236 <dump_raw_data+0x106>
movsbl (%rbx),%esi
add    $0x1,%rbx
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%rbx
ja     1245 <dump_raw_data+0x115>
movsbl (%rbx),%esi
add    $0x1,%rbx
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%rbx
ja     11c0 <dump_raw_data+0x90>
jmp    1258 <dump_raw_data+0x128>
movsbl (%rbx),%esi
add    $0x1,%rbx
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%rbx
jbe    11f2 <dump_raw_data+0xc2>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%rbx
jbe    1208 <dump_raw_data+0xd8>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%rbx
ja     11c0 <dump_raw_data+0x90>
movsbl (%rbx),%esi
add    $0x1,%rbx
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11ca <dump_raw_data+0x9a>
xchg   %ax,%ax
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0x10,%ebp
jmp    12a3 <dump_raw_data+0x173>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
je     1170 <dump_raw_data+0x40>
cmp    %r14,%r15
ja     1290 <dump_raw_data+0x160>
movzbl (%r15),%eax
lea    -0x7f(%rax),%ecx
cmp    $0xa1,%cl
mov    $0x2e,%ecx
cmovb  %ecx,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
add    $0xffffffff,%ebp
jne    12a3 <dump_raw_data+0x173>
jmp    1170 <dump_raw_data+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"0x%08x \00"
@.str.1 = [5 x i8] c"%02x\00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [2 x i8] c" \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 = [3 x i8] c"|\0A\00"
define void @dump_raw_data(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8* %14, i8** %10
%15 = load i8*, i8** %3
store i8* %15, i8** %9
store i8* %15, i8** %8
br label %16
16: ; preds = %88, %2
%17 = load i8*, i8** %8
%18 = load i8*, i8** %10
%19 = icmp ult i8* %17, %18
br i1 %19, label %20, label %90
20: ; preds = %16
%21 = load i32, i32* %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 16
store i32 %24, i32* %7
store i32 0, i32* %5
br label %25
25: ; preds = %50, %20
%26 = load i32, i32* %5
%27 = icmp slt i32 %26, 4
br i1 %27, label %28, label %53
28: ; preds = %25
store i32 0, i32* %6
br label %29
29: ; preds = %45, %28
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 4
br i1 %31, label %32, label %48
32: ; preds = %29
%33 = load i8*, i8** %8
%34 = load i8*, i8** %10
%35 = icmp ule i8* %33, %34
br i1 %35, label %36, label %42
36: ; preds = %32
%37 = load i8*, i8** %8
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %8
%39 = load i8, i8* %37
%40 = sext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %40)
br label %44
42: ; preds = %32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42, %36
br label %45
45: ; preds = %44
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %29
48: ; preds = %29
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %50
50: ; preds = %48
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 1
store i32 %52, i32* %5
br label %25
53: ; preds = %25
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %5
br label %55
55: ; preds = %85, %53
%56 = load i32, i32* %5
%57 = icmp slt i32 %56, 16
br i1 %57, label %58, label %88
58: ; preds = %55
%59 = load i8*, i8** %9
%60 = load i8*, i8** %10
%61 = icmp ule i8* %59, %60
br i1 %61, label %62, label %82
62: ; preds = %58
%63 = load i8*, i8** %9
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp sge i32 %65, 32
br i1 %66, label %67, label %77
67: ; preds = %62
%68 = load i8*, i8** %9
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp sle i32 %70, 126
br i1 %71, label %72, label %77
72: ; preds = %67
%73 = load i8*, i8** %9
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %75)
br label %79
77: ; preds = %67, %62
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %79
79: ; preds = %77, %72
%80 = load i8*, i8** %9
%81 = getelementptr inbounds i8, i8* %80, i32 1
store i8* %81, i8** %9
br label %84
82: ; preds = %58
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %84
84: ; preds = %82, %79
br label %85
85: ; preds = %84
%86 = load i32, i32* %5
%87 = add nsw i32 %86, 1
store i32 %87, i32* %5
br label %55
88: ; preds = %55
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %16
90: ; preds = %16
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"0x%08x \00"
@.str.1 = [5 x i8] c"%02x\00"
@.str.2 = [3 x i8] c" \00"
@str = [2 x i8] c"|\00"
define void @dump_raw_data(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %81
6: ; preds = %2, %77
%7 = phi i8* [ %74, %77 ], [ %0, %2 ]
%8 = phi i8* [ %53, %77 ], [ %0, %2 ]
%9 = phi i32 [ %78, %77 ], [ 0, %2 ]
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %6, %52
%12 = phi i32 [ 0, %6 ], [ %55, %52 ]
%13 = phi i8* [ %8, %6 ], [ %53, %52 ]
%14 = icmp ugt i8* %13, %4
br i1 %14, label %20, label %15
15: ; preds = %11
%16 = getelementptr inbounds i8, i8* %13, i64 1
%17 = load i8, i8* %13
%18 = sext i8 %17 to i32
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %22
20: ; preds = %11
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %15, %20
%23 = phi i8* [ %16, %15 ], [ %13, %20 ]
%24 = icmp ugt i8* %23, %4
br i1 %24, label %30, label %25
25: ; preds = %22
%26 = getelementptr inbounds i8, i8* %23, i64 1
%27 = load i8, i8* %23
%28 = sext i8 %27 to i32
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %28)
br label %32
30: ; preds = %22
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %30, %25
%33 = phi i8* [ %26, %25 ], [ %23, %30 ]
%34 = icmp ugt i8* %33, %4
br i1 %34, label %40, label %35
35: ; preds = %32
%36 = getelementptr inbounds i8, i8* %33, i64 1
%37 = load i8, i8* %33
%38 = sext i8 %37 to i32
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %38)
br label %42
40: ; preds = %32
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40, %35
%43 = phi i8* [ %36, %35 ], [ %33, %40 ]
%44 = icmp ugt i8* %43, %4
br i1 %44, label %50, label %45
45: ; preds = %42
%46 = getelementptr inbounds i8, i8* %43, i64 1
%47 = load i8, i8* %43
%48 = sext i8 %47 to i32
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %48)
br label %52
50: ; preds = %42
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %52
52: ; preds = %50, %45
%53 = phi i8* [ %46, %45 ], [ %43, %50 ]
%54 = tail call i32 @putchar(i32 32)
%55 = add nuw nsw i32 %12, 1
%56 = icmp eq i32 %55, 4
br i1 %56, label %57, label %11
57: ; preds = %52
%58 = tail call i32 @putchar(i32 124)
br label %59
59: ; preds = %57, %73
%60 = phi i32 [ 0, %57 ], [ %75, %73 ]
%61 = phi i8* [ %7, %57 ], [ %74, %73 ]
%62 = icmp ugt i8* %61, %4
br i1 %62, label %71, label %63
63: ; preds = %59
%64 = load i8, i8* %61
%65 = add i8 %64, -127
%66 = icmp ult i8 %65, -95
%67 = select i1 %66, i8 46, i8 %64
%68 = zext i8 %67 to i32
%69 = tail call i32 @putchar(i32 %68)
%70 = getelementptr inbounds i8, i8* %61, i64 1
br label %73
71: ; preds = %59
%72 = tail call i32 @putchar(i32 32)
br label %73
73: ; preds = %63, %71
%74 = phi i8* [ %70, %63 ], [ %61, %71 ]
%75 = add nuw nsw i32 %60, 1
%76 = icmp eq i32 %75, 16
br i1 %76, label %77, label %59
77: ; preds = %73
%78 = add nuw nsw i32 %9, 16
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%80 = icmp ult i8* %53, %4
br i1 %80, label %6, label %81
81: ; preds = %77, %2
ret void
}