#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 *, ...);
int printingQ(unsigned char);
void dump(const char *message, const char *data, int len, char *format,
          int rowSize, char *whiteSpace) {
  printf("%s", message);
  for (int i = 0; i < len / rowSize + (len % rowSize != 0); i++) {
    printf("%06x: ", i * rowSize);
    for (int j = 0; j < rowSize; j++) {
      if (i * rowSize + j < len)
        printf(format, (unsigned char)data[rowSize * i + j]);
      else
        printf("%s", whiteSpace);
    }
    printf(" |");
    for (int j = 0; j < rowSize && i * rowSize + j < len; j++) {
      printf("%c", printingQ((unsigned char)data[rowSize * i + j]));
    }
    printf("|");
    printf("\n");
  }
  printf("len: %d\n", len);
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x24(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idivl  -0x24(%rbp)
mov    -0x40(%rbp),%eax
cmp    $0x0,%edx
setne  %dl
and    $0x1,%dl
movzbl %dl,%edx
add    %edx,%ecx
cmp    %ecx,%eax
jge    12b7 <dump+0x197>
mov    -0x34(%rbp),%esi
imul   -0x24(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    120c <dump+0xec>
mov    -0x34(%rbp),%eax
imul   -0x24(%rbp),%eax
add    -0x38(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11e7 <dump+0xc7>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f9 <dump+0xd9>
mov    -0x30(%rbp),%rsi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fe <dump+0xde>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11a3 <dump+0x83>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x24(%rbp),%ecx
mov    %al,-0x41(%rbp)
jge    1245 <dump+0x125>
mov    -0x34(%rbp),%eax
imul   -0x24(%rbp),%eax
add    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
setl   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    1255 <dump+0x135>
jmp    128d <dump+0x16d>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1040 <printingQ@plt>
mov    %eax,%esi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1221 <dump+0x101>
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1158 <dump+0x38>
mov    -0x14(%rbp),%esi
lea    0xd4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,0x40(%rsp)
mov    %r8d,%ebp
mov    %rcx,%r13
mov    %edx,%ebx
mov    %rsi,0x18(%rsp)
mov    %rdi,%rsi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,0x4(%rsp)
mov    %ebx,%eax
cltd
mov    %ebp,(%rsp)
idiv   %ebp
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
test   %eax,%eax
jle    12db <dump+0x1ab>
movslq 0x4(%rsp),%r14
mov    (%rsp),%ecx
movslq %ecx,%rdx
mov    %rdx,0x28(%rsp)
mov    %eax,%eax
mov    %rax,0x20(%rsp)
mov    %ecx,%r15d
mov    0x18(%rsp),%rbx
xor    %r12d,%r12d
xor    %ecx,%ecx
mov    %r13,0x30(%rsp)
mov    %r15,0x8(%rsp)
jmp    11e3 <dump+0xb3>
nopl   0x0(%rax,%rax,1)
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x38(%rsp),%rcx
add    $0x1,%rcx
mov    0x28(%rsp),%rax
add    %rax,%r12
add    %rax,%rbx
cmp    0x20(%rsp),%rcx
je     12db <dump+0x1ab>
mov    %rbx,0x10(%rsp)
mov    %rcx,0x38(%rsp)
mov    %ecx,%esi
mov    (%rsp),%r13d
imul   %r13d,%esi
lea    0xe05(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rbp
mov    %r12,%r15
test   %r13d,%r13d
mov    0x30(%rsp),%r13
lea    0xde6(%rip),%rbx
jg     1259 <dump+0x129>
lea    0xde7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%r15
mov    0x10(%rsp),%rbx
jmp    11b0 <dump+0x80>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    0x40(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
add    $0xffffffffffffffff,%rbp
je     1280 <dump+0x150>
cmp    %r14,%r15
jge    1240 <dump+0x110>
mov    0x18(%rsp),%rax
movzbl (%rax,%r15,1),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    124f <dump+0x11f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xd83(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,(%rsp)
mov    0x8(%rsp),%r15
mov    0x10(%rsp),%rbx
jle    11b0 <dump+0x80>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%r12,%rbp,1),%rax
cmp    %r14,%rax
jge    11b0 <dump+0x80>
movzbl (%rbx,%rbp,1),%edi
call   1050 <printingQ@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    12b0 <dump+0x180>
jmp    11b0 <dump+0x80>
lea    0xd2b(%rip),%rdi
mov    0x4(%rsp),%esi
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"%06x: \00"
@.str.2 = [3 x i8] c" |\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [2 x i8] c"|\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [9 x i8] c"len: %d\0A\00"
define void @dump(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%16 = load i8*, i8** %7
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 0, i32* %13
br label %18
18: ; preds = %101, %6
%19 = load i32, i32* %13
%20 = load i32, i32* %9
%21 = load i32, i32* %11
%22 = sdiv i32 %20, %21
%23 = load i32, i32* %9
%24 = load i32, i32* %11
%25 = srem i32 %23, %24
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i32
%28 = add nsw i32 %22, %27
%29 = icmp slt i32 %19, %28
br i1 %29, label %30, label %104
30: ; preds = %18
%31 = load i32, i32* %13
%32 = load i32, i32* %11
%33 = mul nsw i32 %31, %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %33)
store i32 0, i32* %14
br label %35
35: ; preds = %64, %30
%36 = load i32, i32* %14
%37 = load i32, i32* %11
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %67
39: ; preds = %35
%40 = load i32, i32* %13
%41 = load i32, i32* %11
%42 = mul nsw i32 %40, %41
%43 = load i32, i32* %14
%44 = add nsw i32 %42, %43
%45 = load i32, i32* %9
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %60
47: ; preds = %39
%48 = load i8*, i8** %10
%49 = load i8*, i8** %8
%50 = load i32, i32* %11
%51 = load i32, i32* %13
%52 = mul nsw i32 %50, %51
%53 = load i32, i32* %14
%54 = add nsw i32 %52, %53
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %49, i64 %55
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* %48, i32 %58)
br label %63
60: ; preds = %39
%61 = load i8*, i8** %12
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %61)
br label %63
63: ; preds = %60, %47
br label %64
64: ; preds = %63
%65 = load i32, i32* %14
%66 = add nsw i32 %65, 1
store i32 %66, i32* %14
br label %35
67: ; preds = %35
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %15
br label %69
69: ; preds = %95, %67
%70 = load i32, i32* %15
%71 = load i32, i32* %11
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %81
73: ; preds = %69
%74 = load i32, i32* %13
%75 = load i32, i32* %11
%76 = mul nsw i32 %74, %75
%77 = load i32, i32* %15
%78 = add nsw i32 %76, %77
%79 = load i32, i32* %9
%80 = icmp slt i32 %78, %79
br label %81
81: ; preds = %73, %69
%82 = phi i1 [ false, %69 ], [ %80, %73 ]
br i1 %82, label %83, label %98
83: ; preds = %81
%84 = load i8*, i8** %8
%85 = load i32, i32* %11
%86 = load i32, i32* %13
%87 = mul nsw i32 %85, %86
%88 = load i32, i32* %15
%89 = add nsw i32 %87, %88
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %84, i64 %90
%92 = load i8, i8* %91
%93 = call i32 @printingQ(i8 zeroext %92)
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %93)
br label %95
95: ; preds = %83
%96 = load i32, i32* %15
%97 = add nsw i32 %96, 1
store i32 %97, i32* %15
br label %69
98: ; preds = %81
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %101
101: ; preds = %98
%102 = load i32, i32* %13
%103 = add nsw i32 %102, 1
store i32 %103, i32* %13
br label %18
104: ; preds = %18
%105 = load i32, i32* %9
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %105)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"%06x: \00"
@.str.2 = [3 x i8] c" |\00"
@.str.6 = [9 x i8] c"len: %d\0A\00"
define void @dump(i8* %0, i8* nocapture %1, i32 %2, i8* nocapture %3, i32 %4, i8* %5) {
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = sdiv i32 %2, %4
%9 = srem i32 %2, %4
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = add i32 %8, %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %6
%15 = icmp sgt i32 %4, 0
%16 = sext i32 %2 to i64
%17 = sext i32 %4 to i64
%18 = zext i32 %12 to i64
%19 = zext i32 %4 to i64
%20 = zext i32 %4 to i64
br label %23
21: ; preds = %50, %6
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %2)
ret void
23: ; preds = %14, %50
%24 = phi i64 [ 0, %14 ], [ %53, %50 ]
%25 = mul nsw i64 %24, %17
%26 = trunc i64 %25 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br i1 %15, label %32, label %28
28: ; preds = %23
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %50
30: ; preds = %43
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br i1 %15, label %46, label %50
32: ; preds = %23, %43
%33 = phi i64 [ %44, %43 ], [ 0, %23 ]
%34 = add nsw i64 %33, %25
%35 = icmp slt i64 %34, %16
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = getelementptr inbounds i8, i8* %1, i64 %34
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %3, i32 %39)
br label %43
41: ; preds = %32
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %43
43: ; preds = %36, %41
%44 = add nuw nsw i64 %33, 1
%45 = icmp eq i64 %44, %19
br i1 %45, label %30, label %32
46: ; preds = %30, %55
%47 = phi i64 [ %60, %55 ], [ 0, %30 ]
%48 = add nsw i64 %47, %25
%49 = icmp slt i64 %48, %16
br i1 %49, label %55, label %50
50: ; preds = %46, %55, %28, %30
%51 = tail call i32 @putchar(i32 124)
%52 = tail call i32 @putchar(i32 10)
%53 = add nuw nsw i64 %24, 1
%54 = icmp eq i64 %53, %18
br i1 %54, label %21, label %23
55: ; preds = %46
%56 = getelementptr inbounds i8, i8* %1, i64 %48
%57 = load i8, i8* %56
%58 = tail call i32 @printingQ(i8 zeroext %57)
%59 = tail call i32 @putchar(i32 %58)
%60 = add nuw nsw i64 %47, 1
%61 = icmp eq i64 %60, %20
br i1 %61, label %50, label %46
}