#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 */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump(int32_t output[]) {
  for (int y = 0; y < 160; y++) {
    printf("%d", y);
    for (int x = 0; x < 6; x++) {
      printf(":%08x", output[x + y * 6]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa0,-0xc(%rbp)
jge    119d <dump+0x8d>
mov    -0xc(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    1181 <dump+0x71>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   $0x6,-0xc(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <dump+0x38>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <dump+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x14,%rbx
lea    0xeca(%rip),%r14
lea    0xec6(%rip),%r15
xor    %r12d,%r12d
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x14(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x10(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0xc(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x8(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x4(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
add    $0x18,%rbx
cmp    $0xa0,%r12
jne    1140 <dump+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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