#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 *, ...);
int main(void) {
  int matrix[8][8] = {
      {8, 7, 6, 5, 4, 3, 2, 1},         {16, 15, 14, 13, 12, 11, 10, 9},
      {24, 23, 22, 21, 20, 19, 18, 17}, {32, 31, 30, 29, 28, 27, 26, 25},
      {40, 39, 38, 37, 36, 35, 34, 33}, {48, 47, 46, 45, 44, 43, 42, 41},
      {56, 55, 54, 53, 52, 51, 50, 49}, {64, 63, 62, 61, 60, 59, 58, 57}};
  int i, j;
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++) {
      printf("%2d ", matrix[i][j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x100,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x114(%rbp)
cmpl   $0x8,-0x114(%rbp)
jge    11db <main+0xbb>
movl   $0x0,-0x118(%rbp)
cmpl   $0x8,-0x118(%rbp)
jge    11b9 <main+0x99>
movslq -0x114(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x118(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xf62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    116b <main+0x4b>
lea    0xf45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1154 <main+0x34>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%r14
lea    0xfcb(%rip),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%r14,1),%esi
mov    0x4(%rbx,%r14,1),%ebp
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx,%r14,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rbx,%r14,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx,%r14,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx,%r14,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx,%r14,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx,%r14,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rbx
cmp    $0x100,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@__const.main.matrix = [8 x [8 x i32]] [[8 x i32] [i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1], [8 x i32] [i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9], [8 x i32] [i32 24, i32 23, i32 22, i32 21, i32 20, i32 19, i32 18, i32 17], [8 x i32] [i32 32, i32 31, i32 30, i32 29, i32 28, i32 27, i32 26, i32 25], [8 x i32] [i32 40, i32 39, i32 38, i32 37, i32 36, i32 35, i32 34, i32 33], [8 x i32] [i32 48, i32 47, i32 46, i32 45, i32 44, i32 43, i32 42, i32 41], [8 x i32] [i32 56, i32 55, i32 54, i32 53, i32 52, i32 51, i32 50, i32 49], [8 x i32] [i32 64, i32 63, i32 62, i32 61, i32 60, i32 59, i32 58, i32 57]]
@.str = [5 x i8] c"%2d \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %28, %1 ]
%3 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* @__const.main.matrix, i64 0, i64 %2, i64 0
%4 = load i32, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* @__const.main.matrix, i64 0, i64 %2, i64 1
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* @__const.main.matrix, i64 0, i64 %2, i64 2
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* @__const.main.matrix, i64 0, i64 %2, i64 3
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* @__const.main.matrix, i64 0, i64 %2, i64 4
%16 = load i32, i32* %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* @__const.main.matrix, i64 0, i64 %2, i64 5
%19 = load i32, i32* %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* @__const.main.matrix, i64 0, i64 %2, i64 6
%22 = load i32, i32* %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* @__const.main.matrix, i64 0, i64 %2, i64 7
%25 = load i32, i32* %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = tail call i32 @putchar(i32 10)
%28 = add nuw nsw i64 %2, 1
%29 = icmp eq i64 %28, 8
br i1 %29, label %30, label %1
30: ; preds = %1
ret i32 0
}