#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 */
size_t indices(int, int, int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
void print_array(int x, int y, int z, long double *imageArray) {
  int i, j, k;
  for (i = 0; i < x; i++) {
    for (j = 0; j < y; j++) {
      for (k = 0; k < z; k++) {
        printf("%.18Lf ", imageArray[indices(x, y, z, i, j, k)]);
      }
      printf("\n");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11f6 <print_array+0xd6>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11da <print_array+0xba>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11be <print_array+0x9e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <indices@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe57(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1162 <print_array+0x42>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114f <print_array+0x2f>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113c <print_array+0x1c>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,0x20(%rsp)
test   %edi,%edi
jle    120a <print_array+0xda>
mov    %edx,%ebp
mov    %esi,%ebx
xor    %eax,%eax
mov    %edi,0x14(%rsp)
mov    %esi,0x1c(%rsp)
mov    0x20(%rsp),%r15
mov    0x14(%rsp),%r13d
jmp    118d <print_array+0x5d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%eax
add    $0x1,%eax
mov    0x14(%rsp),%edi
cmp    %edi,%eax
je     120a <print_array+0xda>
mov    %eax,0x18(%rsp)
test   %ebx,%ebx
jle    1170 <print_array+0x40>
xor    %r12d,%r12d
jmp    11b7 <print_array+0x87>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
mov    0x1c(%rsp),%ebx
cmp    %ebx,%r12d
je     1170 <print_array+0x40>
test   %ebp,%ebp
mov    0x18(%rsp),%ebx
jle    11a0 <print_array+0x70>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13d,%edi
mov    0x1c(%rsp),%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %r12d,%r8d
mov    %r14d,%r9d
call   1040 <indices@plt>
shl    $0x4,%rax
fldt   (%r15,%rax,1)
fstpt  (%rsp)
lea    0xe08(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r14d
cmp    %r14d,%ebp
jne    11d0 <print_array+0xa0>
jmp    11a0 <print_array+0x70>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%.18Lf \00"
define void @print_array(i32 %0, i32 %1, i32 %2, x86_fp80* nocapture %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %29
6: ; preds = %4
%7 = icmp sgt i32 %1, 0
%8 = icmp sgt i32 %2, 0
br label %9
9: ; preds = %6, %25
%10 = phi i32 [ 0, %6 ], [ %27, %25 ]
br i1 %7, label %11, label %25
11: ; preds = %9, %21
%12 = phi i32 [ %23, %21 ], [ 0, %9 ]
br i1 %8, label %13, label %21
13: ; preds = %11, %13
%14 = phi i32 [ %19, %13 ], [ 0, %11 ]
%15 = tail call i64 @indices(i32 %0, i32 %1, i32 %2, i32 %10, i32 %12, i32 %14)
%16 = getelementptr inbounds x86_fp80, x86_fp80* %3, i64 %15
%17 = load x86_fp80, x86_fp80* %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), x86_fp80 %17)
%19 = add nuw nsw i32 %14, 1
%20 = icmp eq i32 %19, %2
br i1 %20, label %21, label %13
21: ; preds = %13, %11
%22 = tail call i32 @putchar(i32 10)
%23 = add nuw nsw i32 %12, 1
%24 = icmp eq i32 %23, %1
br i1 %24, label %25, label %11
25: ; preds = %21, %9
%26 = tail call i32 @putchar(i32 10)
%27 = add nuw nsw i32 %10, 1
%28 = icmp eq i32 %27, %0
br i1 %28, label %29, label %9
29: ; preds = %25, %4
ret void
}