#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);
int main(int argc, char *argv[]) {
  int src[2][2] = {{1, 2}, {3, 4}};
  typedef int(*dest)[2];
  dest num = (dest)src;
  int i, j;
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) {
      printf("____%d____\n", num[i][j]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jge    11a9 <main+0x99>
movl   $0x0,-0x30(%rbp)
cmpl   $0x2,-0x30(%rbp)
jge    1196 <main+0x86>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    115c <main+0x4c>
jmp    119b <main+0x8b>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114b <main+0x3b>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.src = [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]]
@.str = [12 x i8] c"____%d____\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x [2 x i32]]
%7 = alloca [2 x i32]*
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [2 x [2 x i32]]* %6 to i8*
%11 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %6, i64 0, i64 0
store [2 x i32]* %11, [2 x i32]** %7
store i32 0, i32* %8
br label %12
12: ; preds = %33, %2
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %36
15: ; preds = %12
store i32 0, i32* %9
br label %16
16: ; preds = %29, %15
%17 = load i32, i32* %9
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %32
19: ; preds = %16
%20 = load [2 x i32]*, [2 x i32]** %7
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %20, i64 %22
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %23, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %19
%30 = load i32, i32* %9
%31 = add nsw i32 %30, 1
store i32 %31, i32* %9
br label %16
32: ; preds = %16
br label %33
33: ; preds = %32
%34 = load i32, i32* %8
%35 = add nsw i32 %34, 1
store i32 %35, i32* %8
br label %12
36: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"____%d____\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}