void main() {
  int i, j;
  int a[3] = {1, 2, 3};
  int b[2][3] = {{1, 2, 3}, {4, 5, 6}};
  int c[1][2][3] = {{{1, 2, 3}, {4, 5, 6}}};
  printid(a);
  printid(b);
  printid(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedc(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x0,%al
call   1030 <printid@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <printid@plt>
lea    -0x50(%rbp),%rdi
mov    $0x0,%al
call   1030 <printid@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,(%rsp)
mov    0xef0(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xef8(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <printid@plt>
lea    0x30(%rsp),%rdi
xor    %eax,%eax
call   1030 <printid@plt>
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1030 <printid@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.b = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@__const.main.c = [1 x [2 x [3 x i32]]] [[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 i32
%3 = alloca [3 x i32]
%4 = alloca [2 x [3 x i32]]
%5 = alloca [1 x [2 x [3 x i32]]]
%6 = bitcast [3 x i32]* %3 to i8*
%7 = bitcast [2 x [3 x i32]]* %4 to i8*
%8 = bitcast [1 x [2 x [3 x i32]]]* %5 to i8*
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @printid to i32 (i32*, ...)*)(i32* %9)
%11 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %4, i64 0, i64 0
%12 = call i32 ([3 x i32]*, ...) bitcast (i32 (...)* @printid to i32 ([3 x i32]*, ...)*)([3 x i32]* %11)
%13 = getelementptr inbounds [1 x [2 x [3 x i32]]], [1 x [2 x [3 x i32]]]* %5, i64 0, i64 0
%14 = call i32 ([2 x [3 x i32]]*, ...) bitcast (i32 (...)* @printid to i32 ([2 x [3 x i32]]*, ...)*)([2 x [3 x i32]]* %13)
ret void
}

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