#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 *, int);
main() {
  int a[3][4] = {{1, 3, 5, 7}, {9, 11, 13, 15}, {17, 19, 21, 23}};
  int p;
  p = (int)a[1];
  printf("%d\n", a[2][1]);
  printf("%d\n", (int)(a[1]));
  printf("%d\n", (int)(a));
  printf("%d\n", (int)(a + 1));
  printf("%d\n", (int)(*a + 1));
  printf("%d\n", (int)(*(a + 1)));
  printf("%d\n", (int)(a[2] + 1));
  printf("%d\n", (int)(*(a + 1) + 1));
  printf("%d\n", *(*(a + 2) + 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %eax,%esi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
add    $0x20,%rax
add    $0x4,%rax
mov    %eax,%esi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
add    $0x10,%rax
add    $0x4,%rax
mov    %eax,%esi
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x38,%rsp
movaps 0xefe(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r12
lea    0x20(%rsp),%r15
or     $0x4,%r15d
lea    0xedd(%rip),%r14
mov    %r14,%rdi
mov    $0x13,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
or     $0x4,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15d,%esi
call   1030 <printf@plt>
or     $0x4,%r12d
mov    %r14,%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
mov    0x28(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 1, i32 3, i32 5, i32 7], [4 x i32] [i32 9, i32 11, i32 13, i32 15], [4 x i32] [i32 17, i32 19, i32 21, i32 23]]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x [4 x i32]]
%2 = alloca i32
%3 = bitcast [3 x [4 x i32]]* %1 to i8*
%4 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 1
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%6 = ptrtoint i32* %5 to i32
store i32 %6, i32* %2
%7 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 2
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 1
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
%13 = ptrtoint i32* %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
%16 = ptrtoint [4 x i32]* %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %18, i64 1
%20 = ptrtoint [4 x i32]* %19 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %22, i64 0, i64 0
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = ptrtoint i32* %24 to i32
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
%28 = getelementptr inbounds [4 x i32], [4 x i32]* %27, i64 1
%29 = getelementptr inbounds [4 x i32], [4 x i32]* %28, i64 0, i64 0
%30 = ptrtoint i32* %29 to i32
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 2
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %32, i64 0, i64 0
%34 = getelementptr inbounds i32, i32* %33, i64 1
%35 = ptrtoint i32* %34 to i32
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
%38 = getelementptr inbounds [4 x i32], [4 x i32]* %37, i64 1
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %38, i64 0, i64 0
%40 = getelementptr inbounds i32, i32* %39, i64 1
%41 = ptrtoint i32* %40 to i32
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
%44 = getelementptr inbounds [4 x i32], [4 x i32]* %43, i64 2
%45 = getelementptr inbounds [4 x i32], [4 x i32]* %44, i64 0, i64 0
%46 = getelementptr inbounds i32, i32* %45, i64 2
%47 = load i32, i32* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %47)
ret i32 0
}

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