#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_l(void *addr, int n) {
  unsigned long *p;
  int i;
  p = (unsigned long *)addr;
  while (n--) {
    printf("%08x  ", (long)addr);
    for (i = 0; i < 4; i++)
      printf("%08x ", *p++);
    printf("\n");
    addr += 16;
  }
}


x86 assembly (clang, -O0):
<dump_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     11ab <dump_l+0x9b>
mov    -0x8(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    118c <dump_l+0x7c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1154 <dump_l+0x44>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
jmp    1127 <dump_l+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_l>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
je     11ac <dump_l+0x8c>
mov    %esi,%r12d
mov    %rdi,%rbp
lea    0xec3(%rip),%r14
lea    0xec3(%rip),%r15
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rbp
add    $0x20,%rbx
add    $0xffffffff,%r12d
jne    1150 <dump_l+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%08x \00"
@.str.1 = [6 x i8] c"%08x \00"
define void @dump_l(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %28, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i64*
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %24, %6 ], [ %1, %4 ]
%8 = phi i64* [ %21, %6 ], [ %5, %4 ]
%9 = phi i8* [ %26, %6 ], [ %0, %4 ]
%10 = ptrtoint i8* %9 to i64
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = getelementptr inbounds i64, i64* %8, i64 1
%13 = load i64, i64* %8
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %13)
%15 = getelementptr inbounds i64, i64* %8, i64 2
%16 = load i64, i64* %12
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %16)
%18 = getelementptr inbounds i64, i64* %8, i64 3
%19 = load i64, i64* %15
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %19)
%21 = getelementptr inbounds i64, i64* %8, i64 4
%22 = load i64, i64* %18
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %22)
%24 = add nsw i32 %7, -1
%25 = tail call i32 @putchar(i32 10)
%26 = getelementptr i8, i8* %9, i64 16
%27 = icmp eq i32 %24, 0
br i1 %27, label %28, label %6
28: ; preds = %6, %2
ret void
}