main() {
  int a[][4] = {5, 7, 5, 9, 4, 6, 3, 1, 2, 9, 0, 6};
  int *p;
  int(*q)[4];
  p = (int *)a;
  q = a;
  printf("\n%u %u", p, q);
  p++;
  q++;
  printf("\n%u %u", p, q);
}


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
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r14
lea    0xeea(%rip),%rbx
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 5, i32 7, i32 5, i32 9], [4 x i32] [i32 4, i32 6, i32 3, i32 1], [4 x i32] [i32 2, i32 9, i32 0, i32 6]]
@.str = [7 x i8] c"\0A%u %u\00"
define i32 @main() {
%1 = alloca [3 x [4 x i32]]
%2 = alloca i32*
%3 = alloca [4 x i32]*
%4 = bitcast [3 x [4 x i32]]* %1 to i8*
%5 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
%6 = bitcast [4 x 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 0
store [4 x i32]* %7, [4 x i32]** %3
%8 = load i32*, i32** %2
%9 = load [4 x i32]*, [4 x i32]** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %8, [4 x i32]* %9)
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %2
%13 = load [4 x i32]*, [4 x i32]** %3
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i32 1
store [4 x i32]* %14, [4 x i32]** %3
%15 = load i32*, i32** %2
%16 = load [4 x i32]*, [4 x i32]** %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %15, [4 x i32]* %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 5, i32 7, i32 5, i32 9], [4 x i32] [i32 4, i32 6, i32 3, i32 1], [4 x i32] [i32 2, i32 9, i32 0, i32 6]]
@.str = [7 x i8] c"\0A%u %u\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 0
%4 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %4, [4 x i32]* %3)
%6 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0, i64 1
%7 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %6, [4 x i32]* %7)
ret i32 0
}