#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(char *name, char *addr, int size) {
  int active = 0;
  if (!active)
    return;
  int k = 0;
  unsigned char *cp = (unsigned char *)addr;
  printf("\ndump: %s\n", name);
  for (k = 0; k < size; k++) {
    printf("%2X ", *cp);
    cp++;
    if ((k + 1) % 8 == 0)
      printf(" ");
    if ((k + 1) % 16 == 0)
      printf("  ");
    if ((k + 1) % 32 == 0)
      printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1139 <dump+0x29>
jmp    121e <dump+0x10e>
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1210 <dump+0x100>
mov    -0x28(%rbp),%rax
movzbl (%rax),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b3 <dump+0xa3>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11d8 <dump+0xc8>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11fd <dump+0xed>
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1202 <dump+0xf2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1161 <dump+0x51>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0Adump: %s\0A\00"
@.str.1 = [5 x i8] c"%2X \00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [3 x i8] c" \00"
@.str.4 = [2 x i8] c"\0A\00"
define void @dump(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%10 = load i32, i32* %7
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %3
br label %54
13: ; preds = %3
store i32 0, i32* %8
%14 = load i8*, i8** %5
store i8* %14, i8** %9
%15 = load i8*, i8** %4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %15)
store i32 0, i32* %8
br label %17
17: ; preds = %49, %13
%18 = load i32, i32* %8
%19 = load i32, i32* %6
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %52
21: ; preds = %17
%22 = load i8*, i8** %9
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = load i8*, i8** %9
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %9
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
%30 = srem i32 %29, 8
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %21
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %34
34: ; preds = %32, %21
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
%37 = srem i32 %36, 16
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %34
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %39, %34
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
%44 = srem i32 %43, 32
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %48
48: ; preds = %46, %41
br label %49
49: ; preds = %48
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
store i32 %51, i32* %8
br label %17
52: ; preds = %17
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %54
54: ; preds = %52, %12
ret void
}

LLVM IR (-O2):
define void @dump(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}