#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 main(void) {
  int array[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
  int i, j;
  for (i = 0; i <= 2; i++) {
    printf("Address of Vector #%d is %p\n", i + 1, array[i]);
  }
  printf("**********************************\n");
  for (j = 0; j < 3; j++) {
    for (i = 0; i < 3; i++) {
      printf("Element #%d is %d\n", i + 1, *(array[j] + i));
      printf("Address of intger #%d is %p\n", i + 1, array[j] + i);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jg     117f <main+0x5f>
mov    -0x34(%rbp),%esi
add    $0x1,%esi
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rdx
imul   $0xc,%rax,%rax
add    %rax,%rdx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1144 <main+0x24>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jge    1228 <main+0x108>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1215 <main+0xf5>
mov    -0x34(%rbp),%esi
add    $0x1,%esi
movslq -0x38(%rbp),%rcx
lea    -0x30(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
add    $0x1,%esi
movslq -0x38(%rbp),%rax
lea    -0x30(%rbp),%rdx
imul   $0xc,%rax,%rax
add    %rax,%rdx
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a5 <main+0x85>
jmp    121a <main+0xfa>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1194 <main+0x74>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0xeec(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xece(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%r13
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%r12
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%edx
lea    0xe92(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8f(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rbp
mov    0x4(%rsp),%edx
mov    %r15,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rbp
mov    0x8(%rsp),%edx
mov    %r15,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%edx
mov    %r15,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%edx
mov    %r15,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rbp
mov    0x14(%rsp),%edx
mov    %r15,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%edx
mov    %r15,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1c(%rsp),%rbp
mov    0x1c(%rsp),%edx
mov    %r15,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%edx
mov    %r15,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
lea    0x20(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@__const.main.array = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 7, i32 8, i32 9]]
@.str = [29 x i8] c"Address of Vector #%d is %p\0A\00"
@.str.2 = [19 x i8] c"Element #%d is %d\0A\00"
@.str.3 = [29 x i8] c"Address of intger #%d is %p\0A\00"
@str = [35 x i8] c"**********************************\00"
define void @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1, i32* %3)
%5 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 1, i64 0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 2, i32* %5)
%7 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 2, i64 0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 3, i32* %7)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 1, i32* %3)
%13 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 0, i64 1
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 2, i32* %13)
%17 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 0, i64 2
%18 = load i32, i32* %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 3, i32* %17)
%21 = load i32, i32* %5
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 1, i32* %5)
%24 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 1, i64 1
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 2, i32* %24)
%28 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 1, i64 2
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 3, i32* %28)
%32 = load i32, i32* %7
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %32)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 1, i32* %7)
%35 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 2, i64 1
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 2, i32* %35)
%39 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 2, i64 2
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %40)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 3, i32* %39)
ret void
}