#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*/ slog_file(char *, ...);
void dump_data(unsigned char *data, int size) {
  int i, j;
  for (i = 0; i < size; i++) {
    if (i && i % 16 == 0) {
      slog_file("         ");
      for (j = i - 16; j < i; j++) {
        if (data[j] >= 32 && data[j] <= 128)
          slog_file("%c", (unsigned char)data[j]);
        else
          slog_file(".");
      }
      slog_file("\n");
    }
    if (i % 16 == 0)
      slog_file("   ");
    slog_file(" %02X", (unsigned int)data[i]);
    if (i == size - 1) {
      for (j = 0; j < 15 - i % 16; j++)
        slog_file("   ");
      slog_file("         ");
      for (j = i - i % 16; j <= i; j++) {
        if (data[j] >= 32 && data[j] <= 128)
          slog_file("%c", (unsigned char)data[j]);
        else
          slog_file(".");
      }
      slog_file("\n");
    }
  }
  slog_file("\n");
}


x86 assembly (clang, -O0):
<dump_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1340 <dump_data+0x230>
cmpl   $0x0,-0x10(%rbp)
je     11ed <dump_data+0xdd>
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ed <dump_data+0xdd>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
mov    -0x10(%rbp),%eax
sub    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11df <dump_data+0xcf>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     11be <dump_data+0xae>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x80,%eax
jg     11be <dump_data+0xae>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
jmp    11cc <dump_data+0xbc>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
jmp    11d1 <dump_data+0xc1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <dump_data+0x57>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    120f <dump_data+0xff>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    132d <dump_data+0x21d>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
mov    $0xf,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    1280 <dump_data+0x170>
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1241 <dump_data+0x131>
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     131f <dump_data+0x20f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     12fe <dump_data+0x1ee>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x80,%eax
jg     12fe <dump_data+0x1ee>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
jmp    130c <dump_data+0x1fc>
lea    0xd08(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
jmp    1311 <dump_data+0x201>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12a7 <dump_data+0x197>
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
jmp    1332 <dump_data+0x222>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_data+0x16>
lea    0xcc8(%rip),%rdi
mov    $0x0,%al
call   1030 <slog_file@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_data>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    12b8 <dump_data+0x1a8>
mov    %rdi,%r14
lea    -0x1(%rsi),%r12d
mov    %esi,%r15d
mov    $0xf,%bpl
mov    %rdi,%rbx
xor    %eax,%eax
mov    %r15,0x10(%rsp)
jmp    116d <dump_data+0x5d>
nop
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
mov    0x10(%rsp),%r15
mov    0x8(%rsp),%rax
add    $0x1,%rax
add    $0xf,%bpl
add    $0x1,%rbx
cmp    %r15,%rax
je     12b8 <dump_data+0x1a8>
mov    %eax,%ecx
and    $0xf,%ecx
test   %rax,%rax
mov    %rax,0x8(%rsp)
je     11eb <dump_data+0xdb>
test   %ecx,%ecx
jne    11eb <dump_data+0xdb>
mov    %ecx,%r13d
mov    %ebp,0x4(%rsp)
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
mov    $0xfffffffffffffff0,%rbp
jmp    11b3 <dump_data+0xa3>
xchg   %ax,%ax
lea    0xe66(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
inc    %rbp
je     11d1 <dump_data+0xc1>
movzbl (%rbx,%rbp,1),%esi
lea    -0x20(%rsi),%eax
cmp    $0x60,%al
ja     11a0 <dump_data+0x90>
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
inc    %rbp
jne    11b3 <dump_data+0xa3>
lea    0xe37(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
mov    0x4(%rsp),%ebp
mov    0x8(%rsp),%rax
mov    %r13d,%ecx
mov    %ecx,%r13d
test   %ecx,%ecx
jne    1205 <dump_data+0xf5>
lea    0xe0d(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
mov    0x8(%rsp),%rax
movzbl %bpl,%ebp
and    $0xf,%ebp
movzbl (%r14,%rax,1),%esi
lea    0xdf9(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
mov    0x8(%rsp),%rax
cmp    %r12,%rax
jne    1158 <dump_data+0x48>
mov    %ebp,0x4(%rsp)
mov    %rax,%r15
and    $0xfffffffffffffff0,%r15
cmp    $0xf,%r13d
lea    0xdc3(%rip),%r13
je     125f <dump_data+0x14f>
mov    0x4(%rsp),%ebp
nopl   0x0(%rax)
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
add    $0xffffffff,%ebp
jne    1250 <dump_data+0x140>
add    $0xffffffffffffffff,%r15
lea    0xd96(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
mov    0x4(%rsp),%ebp
jmp    129b <dump_data+0x18b>
nopw   0x0(%rax,%rax,1)
lea    0xd86(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
add    $0x1,%r15
cmp    %r12,%r15
jae    1140 <dump_data+0x30>
movzbl 0x1(%r14,%r15,1),%esi
lea    -0x20(%rsi),%eax
cmp    $0x60,%al
ja     1280 <dump_data+0x170>
lea    0xd5b(%rip),%rdi
xor    %eax,%eax
call   1030 <slog_file@plt>
jmp    128e <dump_data+0x17e>
lea    0xd50(%rip),%rdi
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <slog_file@plt>

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

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