#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 dprint(unsigned long start, unsigned long size) {
  int i, j;
  char *c = (char *)start;
  for (j = 0; j < (size >> 4); j++) {
    printf("\n0x%lx:  ", (unsigned long)c);
    for (i = 0; i < 16; i++)
      printf("%x ", (unsigned char)(*(c++)));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x4,%rcx
cmp    %rcx,%rax
jae    11a8 <dprint+0x98>
mov    -0x20(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1195 <dprint+0x85>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <dprint+0x4d>
jmp    119a <dprint+0x8a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112f <dprint+0x1f>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dprint>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    $0x10,%rsi
jb     124e <dprint+0x12e>
mov    %rsi,%r14
mov    %rdi,%r12
shr    $0x4,%r14
lea    0xebc(%rip),%r15
lea    0xebf(%rip),%r13
mov    %rdi,%rbx
xchg   %ax,%ax
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x1(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x2(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x3(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x4(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x5(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x6(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x7(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x8(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x9(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xa(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xb(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xc(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xd(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xe(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xf(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x10,%r12
add    $0x10,%rbx
add    $0xffffffffffffffff,%r14
jne    1150 <dprint+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0A0x%lx: \00"
@.str.1 = [4 x i8] c"%x \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @dprint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%8 = load i64, i64* %3
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %7
store i32 0, i32* %6
br label %10
10: ; preds = %33, %2
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = load i64, i64* %4
%14 = lshr i64 %13, 4
%15 = icmp ult i64 %12, %14
br i1 %15, label %16, label %36
16: ; preds = %10
%17 = load i8*, i8** %7
%18 = ptrtoint i8* %17 to i64
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %18)
store i32 0, i32* %5
br label %20
20: ; preds = %29, %16
%21 = load i32, i32* %5
%22 = icmp slt i32 %21, 16
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = load i8*, i8** %7
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %7
%26 = load i8, i8* %24
%27 = zext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %23
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %20
32: ; preds = %20
br label %33
33: ; preds = %32
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %10
36: ; preds = %10
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

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