#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
void aml_array_dbl_3d_save(FILE *file, double ***arr, int s1, int s2, int s3) {
  int i, j, k;
  for (i = 0; i < s1; i++)
    for (j = 0; j < s2; j++)
      for (k = 0; k < s3; k++)
        fprintf(file, "%.20lf ", arr[i][j][k]);
}


x86 assembly (clang, -O0):
<aml_array_dbl_3d_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c4 <aml_array_dbl_3d_save+0xb4>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11b1 <aml_array_dbl_3d_save+0xa1>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    119e <aml_array_dbl_3d_save+0x8e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe75(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1157 <aml_array_dbl_3d_save+0x47>
jmp    11a3 <aml_array_dbl_3d_save+0x93>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1144 <aml_array_dbl_3d_save+0x34>
jmp    11b6 <aml_array_dbl_3d_save+0xa6>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1131 <aml_array_dbl_3d_save+0x21>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aml_array_dbl_3d_save>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8d,0xc(%rsp)
mov    %ecx,0x8(%rsp)
test   %edx,%edx
jle    11c9 <aml_array_dbl_3d_save+0xb9>
mov    %rsi,%rbx
mov    %rdi,%r13
mov    %edx,%eax
mov    %rax,0x10(%rsp)
mov    0x8(%rsp),%eax
mov    %rax,0x18(%rsp)
mov    0xc(%rsp),%eax
xor    %r14d,%r14d
lea    0xead(%rip),%rbp
mov    %rax,0x20(%rsp)
jmp    116b <aml_array_dbl_3d_save+0x5b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14
cmp    0x10(%rsp),%r14
je     11c9 <aml_array_dbl_3d_save+0xb9>
cmpl   $0x0,0x8(%rsp)
jle    1160 <aml_array_dbl_3d_save+0x50>
xor    %r15d,%r15d
jmp    118b <aml_array_dbl_3d_save+0x7b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    0x18(%rsp),%r15
je     1160 <aml_array_dbl_3d_save+0x50>
cmpl   $0x0,0xc(%rsp)
jle    1180 <aml_array_dbl_3d_save+0x70>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%r14,8),%rax
mov    (%rax,%r15,8),%rax
movsd  (%rax,%r12,8),%xmm0
mov    %r13,%rdi
mov    %rbp,%rsi
call   1030 <fprintf@plt>
mov    0x20(%rsp),%rax
add    $0x1,%r12
cmp    %r12,%rax
jne    11a0 <aml_array_dbl_3d_save+0x90>
jmp    1180 <aml_array_dbl_3d_save+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"%.20lf \00"
define void @aml_array_dbl_3d_save(i32* %0, double*** %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca double***
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %6
store double*** %1, double**** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store i32 0, i32* %11
br label %14
14: ; preds = %52, %5
%15 = load i32, i32* %11
%16 = load i32, i32* %8
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %55
18: ; preds = %14
store i32 0, i32* %12
br label %19
19: ; preds = %48, %18
%20 = load i32, i32* %12
%21 = load i32, i32* %9
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %51
23: ; preds = %19
store i32 0, i32* %13
br label %24
24: ; preds = %44, %23
%25 = load i32, i32* %13
%26 = load i32, i32* %10
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %47
28: ; preds = %24
%29 = load i32*, i32** %6
%30 = load double***, double**** %7
%31 = load i32, i32* %11
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double**, double*** %30, i64 %32
%34 = load double**, double*** %33
%35 = load i32, i32* %12
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double*, double** %34, i64 %36
%38 = load double*, double** %37
%39 = load i32, i32* %13
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
%42 = load double, double* %41
%43 = call i32 @fprintf(i32* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %42)
br label %44
44: ; preds = %28
%45 = load i32, i32* %13
%46 = add nsw i32 %45, 1
store i32 %46, i32* %13
br label %24
47: ; preds = %24
br label %48
48: ; preds = %47
%49 = load i32, i32* %12
%50 = add nsw i32 %49, 1
store i32 %50, i32* %12
br label %19
51: ; preds = %19
br label %52
52: ; preds = %51
%53 = load i32, i32* %11
%54 = add nsw i32 %53, 1
store i32 %54, i32* %11
br label %14
55: ; preds = %14
ret void
}

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