#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*/ print_array_values(int const *, int *);
int main(int argc, char *argv[]) {
  int index = 0;
  int i, j, k, nvals;
  int values[3][4][5];
  for (i = 0; i < 3; ++i)
    for (j = 0; j < 4; ++j)
      for (k = 0; k < 5; ++k)
        values[i][j][k] = index++;
  nvals = 3 * 4 * 5;
  print_array_values((const int *)values, &nvals);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    11c6 <main+0xb6>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    11b3 <main+0xa3>
movl   $0x0,-0x20(%rbp)
cmpl   $0x5,-0x20(%rbp)
jge    11a0 <main+0x90>
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x18(%rbp),%rcx
lea    -0x120(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1159 <main+0x49>
jmp    11a5 <main+0x95>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1148 <main+0x38>
jmp    11b8 <main+0xa8>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1137 <main+0x27>
movl   $0x3c,-0x24(%rbp)
lea    -0x120(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1030 <print_array_values@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef2(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xefe(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xeff(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xf00(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xf01(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf03(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movl   $0x3c,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <print_array_values@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [3 x [4 x [5 x i32]]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %12
12: ; preds = %43, %2
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %46
15: ; preds = %12
store i32 0, i32* %8
br label %16
16: ; preds = %39, %15
%17 = load i32, i32* %8
%18 = icmp slt i32 %17, 4
br i1 %18, label %19, label %42
19: ; preds = %16
store i32 0, i32* %9
br label %20
20: ; preds = %35, %19
%21 = load i32, i32* %9
%22 = icmp slt i32 %21, 5
br i1 %22, label %23, label %38
23: ; preds = %20
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %11, i64 0, i64 %27
%29 = load i32, i32* %8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [4 x [5 x i32]], [4 x [5 x i32]]* %28, i64 0, i64 %30
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [5 x i32], [5 x i32]* %31, i64 0, i64 %33
store i32 %24, i32* %34
br label %35
35: ; preds = %23
%36 = load i32, i32* %9
%37 = add nsw i32 %36, 1
store i32 %37, i32* %9
br label %20
38: ; preds = %20
br label %39
39: ; preds = %38
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 1
store i32 %41, i32* %8
br label %16
42: ; preds = %16
br label %43
43: ; preds = %42
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %12
46: ; preds = %12
store i32 60, i32* %10
%47 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %11, i64 0, i64 0
%48 = bitcast [4 x [5 x i32]]* %47 to i32*
%49 = call i32 @print_array_values(i32* %48, i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [3 x [4 x [5 x i32]]]
%5 = bitcast i32* %3 to i8*
%6 = bitcast [3 x [4 x [5 x i32]]]* %4 to i8*
%7 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 0, i64 0, i64 0
%8 = bitcast [3 x [4 x [5 x i32]]]* %4 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %8
%9 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 0, i64 0, i64 4
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %10
%11 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 0, i64 1, i64 3
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %12
%13 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 0, i64 2, i64 2
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %14
%15 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 0, i64 3, i64 1
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, <4 x i32>* %16
%17 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 1, i64 0, i64 0
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, <4 x i32>* %18
%19 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 1, i64 0, i64 4
%20 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, <4 x i32>* %20
%21 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 1, i64 1, i64 3
%22 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> <i32 28, i32 29, i32 30, i32 31>, <4 x i32>* %22
%23 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 1, i64 2, i64 2
%24 = bitcast i32* %23 to <4 x i32>*
store <4 x i32> <i32 32, i32 33, i32 34, i32 35>, <4 x i32>* %24
%25 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 1, i64 3, i64 1
%26 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> <i32 36, i32 37, i32 38, i32 39>, <4 x i32>* %26
%27 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 2, i64 0, i64 0
%28 = bitcast i32* %27 to <4 x i32>*
store <4 x i32> <i32 40, i32 41, i32 42, i32 43>, <4 x i32>* %28
%29 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 2, i64 0, i64 4
%30 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> <i32 44, i32 45, i32 46, i32 47>, <4 x i32>* %30
%31 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 2, i64 1, i64 3
%32 = bitcast i32* %31 to <4 x i32>*
store <4 x i32> <i32 48, i32 49, i32 50, i32 51>, <4 x i32>* %32
%33 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 2, i64 2, i64 2
%34 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> <i32 52, i32 53, i32 54, i32 55>, <4 x i32>* %34
%35 = getelementptr inbounds [3 x [4 x [5 x i32]]], [3 x [4 x [5 x i32]]]* %4, i64 0, i64 2, i64 3, i64 1
%36 = bitcast i32* %35 to <4 x i32>*
store <4 x i32> <i32 56, i32 57, i32 58, i32 59>, <4 x i32>* %36
store i32 60, i32* %3
%37 = call i32 @print_array_values(i32* %7, i32* %3)
ret i32 0
}