void main() {
  int i;
  int a[3] = {1, 2, 3}, c[2][3] = {{1, 2, 3}, {4, 5, 6}};
  printid(a);
  for (i = 0; i < 2; i++)
    print(c[i]);
  printid(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <printid@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    119d <main+0x7d>
movslq -0x4(%rbp),%rax
lea    -0x30(%rbp),%rdi
imul   $0xc,%rax,%rax
add    %rax,%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <main+0x4f>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1040 <printid@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xedd(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xeca(%rip),%rax
mov    %rax,(%rsp)
mov    0xedf(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <printid@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <print@plt>
lea    0x1c(%rsp),%rdi
xor    %eax,%eax
call   1030 <print@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printid@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.c = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
define void @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca [2 x [3 x i32]]
%4 = bitcast [3 x i32]* %2 to i8*
%5 = bitcast [2 x [3 x i32]]* %3 to i8*
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @printid to i32 (i32*, ...)*)(i32* %6)
store i32 0, i32* %1
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %3, i64 0, i64 %13
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %14, i64 0, i64 0
%16 = call i32 (i32*, ...) bitcast (i32 (...)* @print to i32 (i32*, ...)*)(i32* %15)
br label %17
17: ; preds = %11
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %8
20: ; preds = %8
%21 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %3, i64 0, i64 0
%22 = call i32 ([3 x i32]*, ...) bitcast (i32 (...)* @printid to i32 ([3 x i32]*, ...)*)([3 x i32]* %21)
ret void
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.c = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
define void @main() {
%1 = alloca [3 x i32]
%2 = alloca [2 x [3 x i32]]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [2 x [3 x i32]]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = call i32 (i32*, ...) bitcast (i32 (...)* @printid to i32 (i32*, ...)*)(i32* %5)
%7 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 0, i64 0
%8 = call i32 (i32*, ...) bitcast (i32 (...)* @print to i32 (i32*, ...)*)(i32* %7)
%9 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 1, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @print to i32 (i32*, ...)*)(i32* %9)
%11 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 0
%12 = call i32 ([3 x i32]*, ...) bitcast (i32 (...)* @printid to i32 ([3 x i32]*, ...)*)([3 x i32]* %11)
ret void
}