#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*/ display(int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rotate(int **, int **);
void main() {
  int source[4][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
  int target[4][4];
  display(source);
  rotate(source, target);
  printf("\n");
  display(target);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x40(%rbp),%rdi
lea    0xeaa(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <display@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1060 <rotate@plt>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <display@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
movaps 0xeef(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <display@plt>
lea    0x40(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <rotate@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1040 <display@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.source = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 10, i32 11, i32 12], [4 x i32] zeroinitializer]
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca [4 x [4 x i32]]
%2 = alloca [4 x [4 x i32]]
%3 = bitcast [4 x [4 x i32]]* %1 to i8*
%4 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0
%5 = bitcast [4 x i32]* %4 to i32**
%6 = call i32 @display(i32** %5)
%7 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0
%8 = bitcast [4 x i32]* %7 to i32**
%9 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%10 = bitcast [4 x i32]* %9 to i32**
%11 = call i32 @rotate(i32** %8, i32** %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%14 = bitcast [4 x i32]* %13 to i32**
%15 = call i32 @display(i32** %14)
ret void
}

LLVM IR (-O2):
@__const.main.source = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 10, i32 11, i32 12], [4 x i32] zeroinitializer]
define void @main() {
%1 = alloca [4 x [4 x i32]]
%2 = alloca [4 x [4 x i32]]
%3 = bitcast [4 x [4 x i32]]* %1 to i8*
%4 = bitcast [4 x [4 x i32]]* %2 to i8*
%5 = bitcast [4 x [4 x i32]]* %1 to i32**
%6 = call i32 @display(i32** %5)
%7 = bitcast [4 x [4 x i32]]* %2 to i32**
%8 = call i32 @rotate(i32** %5, i32** %7)
%9 = call i32 @putchar(i32 10)
%10 = call i32 @display(i32** %7)
ret void
}