#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_long(unsigned char *src, unsigned cnt, unsigned addr, unsigned skip) {
  unsigned *p = (unsigned *)src;
  int i = skip >> 2;
  while (cnt >= 4) {
    printf("%08x:", addr);
    while (skip >= 4) {
      printf("         ");
      skip -= 4;
    }
    while (cnt >= 4) {
      printf((i == 4) ? "  %08x" : " %08x", p[0]);
      p++;
      cnt -= 4;
      addr += 4;
      i++;
      if (i == 8)
        break;
    }
    printf("\n");
    i = 0;
  }
}


x86 assembly (clang, -O0):
<dump_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x2,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x4,-0xc(%rbp)
jb     1200 <dump_long+0xf0>
mov    -0x10(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x4,-0x14(%rbp)
jb     1177 <dump_long+0x67>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <dump_long+0x41>
jmp    117c <dump_long+0x6c>
cmpl   $0x4,-0xc(%rbp)
jb     11e6 <dump_long+0xd6>
mov    -0x24(%rbp),%ecx
lea    0xe81(%rip),%rdi
lea    0xe79(%rip),%rax
cmp    $0x4,%ecx
cmove  %rax,%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x8,-0x24(%rbp)
jne    11e1 <dump_long+0xd1>
jmp    11e6 <dump_long+0xd6>
jmp    117c <dump_long+0x6c>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
jmp    1136 <dump_long+0x26>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_long>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
cmp    $0x4,%esi
jb     1216 <dump_long+0xf6>
mov    %ecx,%r15d
mov    %esi,%r14d
mov    %ecx,%ebx
shr    $0x2,%ebx
lea    0xeb8(%rip),%rbp
jmp    1180 <dump_long+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%r14d
sub    %r13d,%r14d
mov    0xc(%rsp),%edx
add    %r13d,%edx
add    %r13,0x10(%rsp)
xor    %ebx,%ebx
cmp    $0x3,%ebp
lea    0xe8c(%rip),%rbp
jbe    1216 <dump_long+0xf6>
lea    0xe79(%rip),%rdi
mov    %edx,0xc(%rsp)
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x4,%r15d
jb     11b4 <dump_long+0x94>
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xfffffffc,%r15d
cmp    $0x3,%r15d
ja     11a0 <dump_long+0x80>
mov    %r14d,0x8(%rsp)
mov    %r14d,%r12d
add    $0xfffffff9,%ebx
mov    $0xfffffffc,%r14d
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
cmp    $0xfffffffd,%ebx
lea    0xe37(%rip),%rdi
lea    0xe2f(%rip),%rax
cmove  %rax,%rdi
mov    0x10(%rsp),%rax
mov    (%rax,%r13,1),%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r12,%r14,1),%ebp
add    $0x4,%r13
test   %ebx,%ebx
je     1150 <dump_long+0x30>
add    $0xfffffffffffffffc,%r14
add    $0x1,%ebx
cmp    $0x3,%ebp
ja     11d0 <dump_long+0xb0>
jmp    1150 <dump_long+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%08x:\00"
@.str.1 = [10 x i8] c" \00"
@.str.2 = [7 x i8] c" %08x\00"
@.str.3 = [6 x i8] c" %08x\00"
define void @dump_long(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ugt i32 %1, 3
br i1 %5, label %6, label %42
6: ; preds = %4
%7 = lshr i32 %3, 2
%8 = bitcast i8* %0 to i32*
br label %9
9: ; preds = %6, %40
%10 = phi i32 [ 0, %40 ], [ %7, %6 ]
%11 = phi i32* [ %33, %40 ], [ %8, %6 ]
%12 = phi i32 [ %18, %40 ], [ %3, %6 ]
%13 = phi i32 [ %35, %40 ], [ %2, %6 ]
%14 = phi i32 [ %34, %40 ], [ %1, %6 ]
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13)
%16 = icmp ugt i32 %12, 3
br i1 %16, label %19, label %17
17: ; preds = %19, %9
%18 = phi i32 [ %12, %9 ], [ %22, %19 ]
br label %24
19: ; preds = %9, %19
%20 = phi i32 [ %22, %19 ], [ %12, %9 ]
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%22 = add i32 %20, -4
%23 = icmp ugt i32 %22, 3
br i1 %23, label %19, label %17
24: ; preds = %17, %24
%25 = phi i32 [ %34, %24 ], [ %14, %17 ]
%26 = phi i32 [ %35, %24 ], [ %13, %17 ]
%27 = phi i32* [ %33, %24 ], [ %11, %17 ]
%28 = phi i32 [ %36, %24 ], [ %10, %17 ]
%29 = icmp eq i32 %28, 4
%30 = select i1 %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%31 = load i32, i32* %27
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %30, i32 %31)
%33 = getelementptr inbounds i32, i32* %27, i64 1
%34 = add i32 %25, -4
%35 = add i32 %26, 4
%36 = add nuw nsw i32 %28, 1
%37 = icmp ne i32 %36, 8
%38 = icmp ugt i32 %34, 3
%39 = select i1 %37, i1 %38, i1 false
br i1 %39, label %24, label %40
40: ; preds = %24
%41 = tail call i32 @putchar(i32 10)
br i1 %38, label %9, label %42
42: ; preds = %40, %4
ret void
}