#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int matrix[4][4] = {{10, 20, 30, 40},
                      {50, 60, 70, 80},
                      {90, 100, 110, 120},
                      {130, 140, 150, 160}};
  int(*mp)[4];
  for (mp = matrix; mp < (matrix + 4); mp++)
    printf("%d\n", *(*mp));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
lea    -0x50(%rbp),%rcx
add    $0x40,%rcx
cmp    %rcx,%rax
jae    1184 <main+0x64>
mov    -0x58(%rbp),%rax
mov    (%rax),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x58(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x58(%rbp)
jmp    114c <main+0x2c>
mov    0x2e55(%rip),%rax
mov    (%rax),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x32,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5a,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x82,%esi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.matrix = [4 x [4 x i32]] [[4 x i32] [i32 10, i32 20, i32 30, i32 40], [4 x i32] [i32 50, i32 60, i32 70, i32 80], [4 x i32] [i32 90, i32 100, i32 110, i32 120], [4 x i32] [i32 130, i32 140, i32 150, i32 160]]
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [4 x i32]]
%3 = alloca [4 x i32]*
store i32 0, i32* %1
%4 = bitcast [4 x [4 x i32]]* %2 to i8*
%5 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
store [4 x i32]* %5, [4 x i32]** %3
br label %6
6: ; preds = %16, %0
%7 = load [4 x i32]*, [4 x i32]** %3
%8 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 4
%10 = icmp ult [4 x i32]* %7, %9
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load [4 x i32]*, [4 x i32]** %3
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 0
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %11
%17 = load [4 x i32]*, [4 x i32]** %3
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %17, i32 1
store [4 x i32]* %18, [4 x i32]** %3
br label %6
19: ; preds = %6
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 50)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 90)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 130)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}