#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_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ array;
struct TYPE_4__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
  int member_4;
};
struct TYPE_3__ {
  int member_1;
  int member_2;
  int member_3;
  int member_4;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ puts(char *);
void test3() {
  int array[3][2][5] = {{{0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}},
                        {{0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}},
                        {{0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}}};
  printf("%d\n", sizeof(array));
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 5; k++)
        printf("%d:%d  ", array[i][j][k], ((int *)array)[i * 10 + j * 5 + k]);
  puts("");
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x78,%edx
call   1050 <memcpy@plt>
lea    0xf21(%rip),%rdi
mov    $0x78,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x84(%rbp)
cmpl   $0x3,-0x84(%rbp)
jge    1242 <test3+0x112>
movl   $0x0,-0x88(%rbp)
cmpl   $0x2,-0x88(%rbp)
jge    1229 <test3+0xf9>
movl   $0x0,-0x8c(%rbp)
cmpl   $0x5,-0x8c(%rbp)
jge    1210 <test3+0xe0>
movslq -0x84(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x88(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x8c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
imul   $0xa,-0x84(%rbp),%eax
imul   $0x5,-0x88(%rbp),%ecx
add    %ecx,%eax
add    -0x8c(%rbp),%eax
cltq
mov    -0x80(%rbp,%rax,4),%edx
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    119b <test3+0x6b>
jmp    1215 <test3+0xe5>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1184 <test3+0x54>
jmp    122e <test3+0xfe>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    116d <test3+0x3d>
lea    0xe32(%rip),%rdi
call   1030 <puts@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xf4a(%rip),%rdi
mov    $0x78,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebf(%rip),%r14
lea    0xf34(%rip),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%r14,1),%edx
mov    0x4(%rbx,%r14,1),%ebp
mov    %r15,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx,%r14,1),%edx
mov    %r15,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rbx,%r14,1),%edx
mov    %r15,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx,%r14,1),%edx
mov    %r15,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx,%r14,1),%edx
mov    %r15,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx,%r14,1),%edx
mov    %r15,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx,%r14,1),%edx
mov    %r15,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx,%r14,1),%edx
mov    %r15,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rbx,%r14,1),%edx
mov    %r15,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x28,%rbx
cmp    $0x78,%rbx
jne    1150 <test3+0x30>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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