#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*/ dprintf(char *, ...);
void DumpDecodedBlock(int val[8][8]) {
  dprintf("# Decoded 8x8 Block#\n");
  for (int y = 0; y < 8; y++) {
    for (int x = 0; x < 8; x++) {
      dprintf("%2x ", val[x][y]);
    }
    dprintf("\n");
  }
}


x86 assembly (clang, -O0):
<DumpDecodedBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <dprintf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    119a <DumpDecodedBlock+0x8a>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    117e <DumpDecodedBlock+0x6e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <dprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <DumpDecodedBlock+0x32>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <dprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <DumpDecodedBlock+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpDecodedBlock>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    $0xfffffffffffffff8,%rbx
lea    0xedf(%rip),%r14
lea    0xed6(%rip),%r15
xchg   %ax,%ax
mov    0x20(%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    0x40(%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    0x60(%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    0x80(%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    0xa0(%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    0xc0(%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    0xe0(%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    0x100(%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
inc    %rbx
jne    1140 <DumpDecodedBlock+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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