#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 showall(double ***z, int n1, int n2, int n3) {
  int i1, i2, i3;
  int m1, m2, m3;
  m1 = (((n1) < (18)) ? (n1) : (18));
  m2 = (((n2) < (14)) ? (n2) : (14));
  m3 = (((n3) < (18)) ? (n3) : (18));
  printf("\n");
  for (i3 = 0; i3 < m3; i3++) {
    for (i1 = 0; i1 < m1; i1++) {
      for (i2 = 0; i2 < m2; i2++) {
        printf("%6.3f", z[i3][i2][i1]);
      }
      printf("\n");
    }
    printf(" - - - - - - - \n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<showall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x12,-0xc(%rbp)
jge    113a <showall+0x2a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    1147 <showall+0x37>
mov    $0x12,%eax
mov    %eax,-0x30(%rbp)
jmp    1147 <showall+0x37>
mov    -0x30(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0xe,-0x10(%rbp)
jge    1162 <showall+0x52>
mov    -0x10(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    116f <showall+0x5f>
mov    $0xe,%eax
mov    %eax,-0x34(%rbp)
jmp    116f <showall+0x5f>
mov    -0x34(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x12,-0x14(%rbp)
jge    118a <showall+0x7a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1197 <showall+0x87>
mov    $0x12,%eax
mov    %eax,-0x38(%rbp)
jmp    1197 <showall+0x87>
mov    -0x38(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1255 <showall+0x145>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1239 <showall+0x129>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    121d <showall+0x10d>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xdf8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11d8 <showall+0xc8>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11c5 <showall+0xb5>
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11b2 <showall+0xa2>
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showall>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%ebp
mov    %edx,0x4(%rsp)
mov    %esi,(%rsp)
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
jle    1223 <showall+0xf3>
mov    %rbp,%rax
cmp    $0x12,%eax
mov    $0x12,%ecx
cmovae %ecx,%eax
mov    %rax,0x8(%rsp)
mov    0x4(%rsp),%eax
cmp    $0xe,%eax
mov    $0xe,%r14d
cmovl  %eax,%r14d
mov    (%rsp),%eax
cmp    $0x12,%eax
cmovl  %eax,%ecx
cmp    $0x2,%r14d
mov    $0x1,%eax
cmovl  %eax,%r14d
cmp    $0x2,%ecx
cmovl  %eax,%ecx
mov    %rcx,0x10(%rsp)
xor    %r15d,%r15d
lea    0xe55(%rip),%rbp
jmp    11c7 <showall+0x97>
nopl   (%rax)
lea    0xe4f(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%r15
cmp    0x8(%rsp),%r15
je     1223 <showall+0xf3>
cmpl   $0x0,(%rsp)
jle    11b0 <showall+0x80>
xor    %r12d,%r12d
jmp    11f5 <showall+0xc5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
cmp    0x10(%rsp),%r12
je     11b0 <showall+0x80>
cmpl   $0x0,0x4(%rsp)
jle    11e0 <showall+0xb0>
xor    %r13d,%r13d
nop
mov    (%rbx,%r15,8),%rax
mov    (%rax,%r13,8),%rax
movsd  (%rax,%r12,8),%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%r13
cmp    %r13,%r14
jne    1200 <showall+0xd0>
jmp    11e0 <showall+0xb0>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [6 x i8] c"%6.3f\00"
@.str.2 = [17 x i8] c" - - - - - - - \0A\00"
define void @showall(double*** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double***
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store double*** %0, double**** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 18
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = load i32, i32* %6
br label %20
19: ; preds = %4
br label %20
20: ; preds = %19, %17
%21 = phi i32 [ %18, %17 ], [ 18, %19 ]
store i32 %21, i32* %12
%22 = load i32, i32* %7
%23 = icmp slt i32 %22, 14
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %7
br label %27
26: ; preds = %20
br label %27
27: ; preds = %26, %24
%28 = phi i32 [ %25, %24 ], [ 14, %26 ]
store i32 %28, i32* %13
%29 = load i32, i32* %8
%30 = icmp slt i32 %29, 18
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = load i32, i32* %8
br label %34
33: ; preds = %27
br label %34
34: ; preds = %33, %31
%35 = phi i32 [ %32, %31 ], [ 18, %33 ]
store i32 %35, i32* %14
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %11
br label %37
37: ; preds = %76, %34
%38 = load i32, i32* %11
%39 = load i32, i32* %14
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %79
41: ; preds = %37
store i32 0, i32* %9
br label %42
42: ; preds = %71, %41
%43 = load i32, i32* %9
%44 = load i32, i32* %12
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %74
46: ; preds = %42
store i32 0, i32* %10
br label %47
47: ; preds = %66, %46
%48 = load i32, i32* %10
%49 = load i32, i32* %13
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %69
51: ; preds = %47
%52 = load double***, double**** %5
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double**, double*** %52, i64 %54
%56 = load double**, double*** %55
%57 = load i32, i32* %10
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double*, double** %56, i64 %58
%60 = load double*, double** %59
%61 = load i32, i32* %9
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %64)
br label %66
66: ; preds = %51
%67 = load i32, i32* %10
%68 = add nsw i32 %67, 1
store i32 %68, i32* %10
br label %47
69: ; preds = %47
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %71
71: ; preds = %69
%72 = load i32, i32* %9
%73 = add nsw i32 %72, 1
store i32 %73, i32* %9
br label %42
74: ; preds = %42
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %76
76: ; preds = %74
%77 = load i32, i32* %11
%78 = add nsw i32 %77, 1
store i32 %78, i32* %11
br label %37
79: ; preds = %37
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%6.3f\00"
@str = [16 x i8] c" - - - - - - - \00"
define void @showall(double*** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @putchar(i32 10)
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %45
7: ; preds = %4
%8 = icmp ult i32 %3, 18
%9 = select i1 %8, i32 %3, i32 18
%10 = icmp slt i32 %2, 14
%11 = select i1 %10, i32 %2, i32 14
%12 = icmp slt i32 %1, 18
%13 = select i1 %12, i32 %1, i32 18
%14 = icmp sgt i32 %1, 0
%15 = icmp sgt i32 %2, 0
%16 = call i32 @llvm.smax.i32(i32 %11, i32 1)
%17 = call i32 @llvm.smax.i32(i32 %13, i32 1)
%18 = zext i32 %9 to i64
%19 = zext i32 %17 to i64
%20 = zext i32 %16 to i64
br label %21
21: ; preds = %7, %41
%22 = phi i64 [ 0, %7 ], [ %43, %41 ]
br i1 %14, label %23, label %41
23: ; preds = %21
%24 = getelementptr inbounds double**, double*** %0, i64 %22
br label %25
25: ; preds = %23, %37
%26 = phi i64 [ 0, %23 ], [ %39, %37 ]
br i1 %15, label %27, label %37
27: ; preds = %25, %27
%28 = phi i64 [ %35, %27 ], [ 0, %25 ]
%29 = load double**, double*** %24
%30 = getelementptr inbounds double*, double** %29, i64 %28
%31 = load double*, double** %30
%32 = getelementptr inbounds double, double* %31, i64 %26
%33 = load double, double* %32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %33)
%35 = add nuw nsw i64 %28, 1
%36 = icmp eq i64 %35, %20
br i1 %36, label %37, label %27
37: ; preds = %27, %25
%38 = tail call i32 @putchar(i32 10)
%39 = add nuw nsw i64 %26, 1
%40 = icmp eq i64 %39, %19
br i1 %40, label %41, label %25
41: ; preds = %37, %21
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%43 = add nuw nsw i64 %22, 1
%44 = icmp eq i64 %43, %18
br i1 %44, label %45, label %21
45: ; preds = %41, %4
%46 = tail call i32 @putchar(i32 10)
ret void
}