#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 *, ...);
void main() {
  int arr[5][3] = {
      {11, 12, 13}, {21, 22, 23}, {31, 32, 33}, {41, 42, 43}, {51, 52, 53},
  };
  int(*q)[3];
  q = arr;
  int i, j;
  for (i = 0; i < 5; i++) {
    for (j = 0; j < 3; j++) {
      printf("%d\t", *(q[i] + j));
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x3c,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x5,-0x4c(%rbp)
jge    11b5 <main+0x95>
movl   $0x0,-0x50(%rbp)
cmpl   $0x3,-0x50(%rbp)
jge    1199 <main+0x79>
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    115d <main+0x3d>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    114c <main+0x2c>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x15,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x1f,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x21,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x29,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x33,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x35,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 11)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 13)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 21)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 22)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 23)
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 31)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 32)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 33)
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 41)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 42)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 43)
%16 = tail call i32 @putchar(i32 10)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 51)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 52)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 53)
%20 = tail call i32 @putchar(i32 10)
ret void
}