#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x;
  int y;
  int array[9][9];
  for (x = 0; x < 9; x++) {
    for (y = 0; y < 9; y++)
      array[x][y] = x * y;
  }
  printf("Array indices:\n");
  for (x = 0; x < 9; x++) {
    for (y = 0; y < 9; y++) {
      printf("[%d][%d]=%d", x, y, array[x][y]);
    }
    printf("\n");
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jge    1195 <main+0x75>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1182 <main+0x62>
mov    -0x8(%rbp),%edx
imul   -0xc(%rbp),%edx
movslq -0x8(%rbp),%rcx
lea    -0x150(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x2a>
jmp    1187 <main+0x67>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jge    121c <main+0xfc>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1200 <main+0xe0>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movslq -0x8(%rbp),%rcx
lea    -0x150(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11bb <main+0x9b>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11aa <main+0x8a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x150,%rsp
xor    %eax,%eax
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %r10d,%r10d
xor    %edi,%edi
xor    %ebx,%ebx
xor    %ecx,%ecx
xor    %edx,%edx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movl   $0x0,(%rsp,%rax,1)
mov    %r8d,0x4(%rsp,%rax,1)
mov    %r9d,0x8(%rsp,%rax,1)
mov    %r10d,0xc(%rsp,%rax,1)
mov    %edi,0x10(%rsp,%rax,1)
mov    %ebx,0x14(%rsp,%rax,1)
mov    %ecx,0x18(%rsp,%rax,1)
mov    %edx,0x1c(%rsp,%rax,1)
mov    %esi,0x20(%rsp,%rax,1)
add    $0x8,%esi
add    $0x7,%edx
add    $0x6,%ecx
add    $0x5,%ebx
add    $0x4,%edi
add    $0x3,%r10d
add    $0x2,%r9d
add    $0x1,%r8d
add    $0x24,%rax
cmp    $0x144,%rax
jne    1170 <main+0x30>
lea    0xe44(%rip),%rdi
call   1040 <puts@plt>
lea    0x20(%rsp),%r15
lea    0xe27(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    -0x20(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x1c(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x18(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x14(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x10(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0xc(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x8(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x4(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
add    $0x24,%r15
cmp    $0x9,%rbx
jne    11e0 <main+0xa0>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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