#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 */
typedef struct TYPE_6__ TYPE_3__;
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_6__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
};
struct TYPE_5__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
};
struct TYPE_4__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int array[3][3][4] = {
      {
          {1, 2, 3, 4},
          {5, 6, 7, 8},
          {9, 10, 11, 12},
      },
      {
          {13, 14},
          {15, 16},
      },
      [2][0][0] = 17,
      [2][0][1] = 18,
      [2][0][2] = 19,
      [2][2][3] = 20,
      [2][2][0] = 21,
      [2][2][1] = 22,
      [2][2][2] = 23,
      [2][2][3] = 24,
  };
  for (int i = 0; i < 3; i++) {
    printf("PAGE %d:\n", i);
    for (int y = 0; y < 3; y++) {
      for (int j = 0; j < 4; j++) {
        printf("%2d, ", array[i][y][j]);
      }
      printf("\n");
    }
    printf("\n");
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xa0(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x90,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x3,-0xa4(%rbp)
jge    1236 <main+0x116>
mov    -0xa4(%rbp),%esi
lea    0xf22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xa8(%rbp)
cmpl   $0x3,-0xa8(%rbp)
jge    1214 <main+0xf4>
movl   $0x0,-0xac(%rbp)
cmpl   $0x4,-0xac(%rbp)
jge    11f2 <main+0xd2>
movslq -0xa4(%rbp),%rcx
lea    -0xa0(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movslq -0xa8(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0xac(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    1196 <main+0x76>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    117f <main+0x5f>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1154 <main+0x34>
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xefd(%rip),%rbx
lea    0xf5a(%rip),%r14
lea    0xf5d(%rip),%r15
xor    %r12d,%r12d
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x2c(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x28(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x24(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x20(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x18(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x14(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x10(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x8(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x4(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
add    $0x30,%rbx
cmp    $0x3,%r12
jne    1140 <main+0x20>
mov    0x2db7(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.array = [3 x [3 x [4 x i32]]] [[3 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]], [3 x [4 x i32]] [[4 x i32] [i32 13, i32 14, i32 0, i32 0], [4 x i32] [i32 15, i32 16, i32 0, i32 0], [4 x i32] zeroinitializer], [3 x [4 x i32]] [[4 x i32] [i32 17, i32 18, i32 19, i32 0], [4 x i32] zeroinitializer, [4 x i32] [i32 21, i32 22, i32 23, i32 24]]]
@.str = [10 x i8] c"PAGE %d:\0A\00"
@.str.1 = [6 x i8] c"%2d, \00"
@.str.2 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [3 x [4 x i32]]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [3 x [3 x [4 x i32]]]* %2 to i8*
store i32 0, i32* %3
br label %7
7: ; preds = %42, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %45
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 0, i32* %4
br label %13
13: ; preds = %37, %10
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %40
16: ; preds = %13
store i32 0, i32* %5
br label %17
17: ; preds = %32, %16
%18 = load i32, i32* %5
%19 = icmp slt i32 %18, 4
br i1 %19, label %20, label %35
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* %2, i64 0, i64 %22
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %23, i64 0, i64 %25
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %20
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %17
35: ; preds = %17
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %13
40: ; preds = %13
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %7
45: ; preds = %7
%46 = load i32, i32* @EXIT_SUCCESS
ret i32 %46
}

LLVM IR (-O2):
@__const.main.array = [3 x [3 x [4 x i32]]] [[3 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]], [3 x [4 x i32]] [[4 x i32] [i32 13, i32 14, i32 0, i32 0], [4 x i32] [i32 15, i32 16, i32 0, i32 0], [4 x i32] zeroinitializer], [3 x [4 x i32]] [[4 x i32] [i32 17, i32 18, i32 19, i32 0], [4 x i32] zeroinitializer, [4 x i32] [i32 21, i32 22, i32 23, i32 24]]]
@.str = [10 x i8] c"PAGE %d:\0A\00"
@.str.1 = [6 x i8] c"%2d, \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %3
1: ; preds = %3
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %47, %3 ]
%5 = trunc i64 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 0, i64 0
%8 = load i32, i32* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 0, i64 1
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 0, i64 2
%14 = load i32, i32* %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 0, i64 3
%17 = load i32, i32* %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = tail call i32 @putchar(i32 10)
%20 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 1, i64 0
%21 = load i32, i32* %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 1, i64 1
%24 = load i32, i32* %23
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 1, i64 2
%27 = load i32, i32* %26
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 1, i64 3
%30 = load i32, i32* %29
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = tail call i32 @putchar(i32 10)
%33 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 2, i64 0
%34 = load i32, i32* %33
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 2, i64 1
%37 = load i32, i32* %36
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 2, i64 2
%40 = load i32, i32* %39
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds [3 x [3 x [4 x i32]]], [3 x [3 x [4 x i32]]]* @__const.main.array, i64 0, i64 %4, i64 2, i64 3
%43 = load i32, i32* %42
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%45 = tail call i32 @putchar(i32 10)
%46 = tail call i32 @putchar(i32 10)
%47 = add nuw nsw i64 %4, 1
%48 = icmp eq i64 %47, 3
br i1 %48, label %1, label %3
}