#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 printf(char *, int, int, int, int, int, int);
int p1(int a[][3]) {
  return printf("{{%d, %d, %d}, {%d, %d, %d}}\n", a[0][0], a[0][1], a[0][2],
                a[1][0], a[1][1], a[1][2]);
}


x86 assembly (clang, -O0):
<p1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xeb2(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p1>:
push   %rax
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
mov    0xc(%rdi),%r8d
mov    0x10(%rdi),%r9d
mov    0x14(%rdi),%eax
mov    %eax,(%rsp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"{{%d, %d, %d}, {%d, %d, %d}}\0A\00"
define i32 @p1([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
%3 = load [3 x i32]*, [3 x i32]** %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = load [3 x i32]*, [3 x i32]** %2
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 1
%10 = load i32, i32* %9
%11 = load [3 x i32]*, [3 x i32]** %2
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %12, i64 0, i64 2
%14 = load i32, i32* %13
%15 = load [3 x i32]*, [3 x i32]** %2
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 1
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 0
%18 = load i32, i32* %17
%19 = load [3 x i32]*, [3 x i32]** %2
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %19, i64 1
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %20, i64 0, i64 1
%22 = load i32, i32* %21
%23 = load [3 x i32]*, [3 x i32]** %2
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %23, i64 1
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %24, i64 0, i64 2
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %10, i32 %14, i32 %18, i32 %22, i32 %26)
ret i32 %27
}

LLVM IR (-O2):
@.str = [30 x i8] c"{{%d, %d, %d}, {%d, %d, %d}}\0A\00"
define i32 @p1([3 x i32]* nocapture %0) {
%2 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 2
%7 = load i32, i32* %6
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 2
%13 = load i32, i32* %12
%14 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %9, i32 %11, i32 %13)
ret i32 %14
}