#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_4d_variable_2nd_save(FILE *file, double ****arr, int s1,
                                        int *s2, int s3, int s4) {
  int i, j, k, l;
  for (i = 0; i < s1; i++)
    for (j = 0; j < s2[i]; j++)
      for (k = 0; k < s3; k++)
        for (l = 0; l < s4; l++)
          fprintf(file, "%.20lf ", arr[i][j][k][l]);
}


x86 assembly (clang, -O0):
<aml_array_dbl_4d_variable_2nd_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ff <aml_array_dbl_4d_variable_2nd_save+0xef>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x20(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    11ec <aml_array_dbl_4d_variable_2nd_save+0xdc>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11d9 <aml_array_dbl_4d_variable_2nd_save+0xc9>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    11c6 <aml_array_dbl_4d_variable_2nd_save+0xb6>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe4d(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1177 <aml_array_dbl_4d_variable_2nd_save+0x67>
jmp    11cb <aml_array_dbl_4d_variable_2nd_save+0xbb>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1164 <aml_array_dbl_4d_variable_2nd_save+0x54>
jmp    11de <aml_array_dbl_4d_variable_2nd_save+0xce>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1149 <aml_array_dbl_4d_variable_2nd_save+0x39>
jmp    11f1 <aml_array_dbl_4d_variable_2nd_save+0xe1>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1136 <aml_array_dbl_4d_variable_2nd_save+0x26>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aml_array_dbl_4d_variable_2nd_save>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,0xc(%rsp)
mov    %r8d,0x8(%rsp)
mov    %rcx,0x10(%rsp)
test   %edx,%edx
jle    11f1 <aml_array_dbl_4d_variable_2nd_save+0xe1>
mov    %rdi,%r15
mov    %edx,%eax
mov    %rax,0x18(%rsp)
mov    0x8(%rsp),%eax
mov    %rax,0x20(%rsp)
mov    0xc(%rsp),%r12d
xor    %r14d,%r14d
lea    0xea9(%rip),%r13
mov    %rsi,0x28(%rsp)
jmp    116f <aml_array_dbl_4d_variable_2nd_save+0x5f>
xchg   %ax,%ax
add    $0x1,%r14
cmp    0x18(%rsp),%r14
je     11f1 <aml_array_dbl_4d_variable_2nd_save+0xe1>
mov    0x10(%rsp),%rax
mov    (%rax,%r14,4),%eax
test   %eax,%eax
jle    1160 <aml_array_dbl_4d_variable_2nd_save+0x50>
xor    %ebx,%ebx
jmp    1195 <aml_array_dbl_4d_variable_2nd_save+0x85>
mov    0x10(%rsp),%rax
mov    (%rax,%r14,4),%eax
add    $0x1,%rbx
movslq %eax,%rcx
cmp    %rcx,%rbx
jge    1160 <aml_array_dbl_4d_variable_2nd_save+0x50>
cmpl   $0x0,0x8(%rsp)
jle    1189 <aml_array_dbl_4d_variable_2nd_save+0x79>
xor    %ecx,%ecx
jmp    11ab <aml_array_dbl_4d_variable_2nd_save+0x9b>
add    $0x1,%rcx
cmp    0x20(%rsp),%rcx
je     1180 <aml_array_dbl_4d_variable_2nd_save+0x70>
cmpl   $0x0,0xc(%rsp)
jle    11a0 <aml_array_dbl_4d_variable_2nd_save+0x90>
xor    %ebp,%ebp
mov    %rcx,0x30(%rsp)
nopl   0x0(%rax)
mov    (%rsi,%r14,8),%rax
mov    (%rax,%rbx,8),%rax
mov    (%rax,%rcx,8),%rax
movsd  (%rax,%rbp,8),%xmm0
mov    %r15,%rdi
mov    %r13,%rsi
call   1030 <fprintf@plt>
mov    0x30(%rsp),%rcx
mov    0x28(%rsp),%rsi
add    $0x1,%rbp
cmp    %rbp,%r12
jne    11c0 <aml_array_dbl_4d_variable_2nd_save+0xb0>
jmp    11a0 <aml_array_dbl_4d_variable_2nd_save+0x90>
add    $0x38,%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_4d_variable_2nd_save(i32* %0, double**** %1, i32 %2, i32* %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca double****
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32* %0, i32** %7
store double**** %1, double***** %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store i32 0, i32* %13
br label %17
17: ; preds = %72, %6
%18 = load i32, i32* %13
%19 = load i32, i32* %9
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %75
21: ; preds = %17
store i32 0, i32* %14
br label %22
22: ; preds = %68, %21
%23 = load i32, i32* %14
%24 = load i32*, i32** %10
%25 = load i32, i32* %13
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = icmp slt i32 %23, %28
br i1 %29, label %30, label %71
30: ; preds = %22
store i32 0, i32* %15
br label %31
31: ; preds = %64, %30
%32 = load i32, i32* %15
%33 = load i32, i32* %11
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %67
35: ; preds = %31
store i32 0, i32* %16
br label %36
36: ; preds = %60, %35
%37 = load i32, i32* %16
%38 = load i32, i32* %12
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %63
40: ; preds = %36
%41 = load i32*, i32** %7
%42 = load double****, double***** %8
%43 = load i32, i32* %13
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double***, double**** %42, i64 %44
%46 = load double***, double**** %45
%47 = load i32, i32* %14
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double**, double*** %46, i64 %48
%50 = load double**, double*** %49
%51 = load i32, i32* %15
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double*, double** %50, i64 %52
%54 = load double*, double** %53
%55 = load i32, i32* %16
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
%59 = call i32 @fprintf(i32* %41, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %58)
br label %60
60: ; preds = %40
%61 = load i32, i32* %16
%62 = add nsw i32 %61, 1
store i32 %62, i32* %16
br label %36
63: ; preds = %36
br label %64
64: ; preds = %63
%65 = load i32, i32* %15
%66 = add nsw i32 %65, 1
store i32 %66, i32* %15
br label %31
67: ; preds = %31
br label %68
68: ; preds = %67
%69 = load i32, i32* %14
%70 = add nsw i32 %69, 1
store i32 %70, i32* %14
br label %22
71: ; preds = %22
br label %72
72: ; preds = %71
%73 = load i32, i32* %13
%74 = add nsw i32 %73, 1
store i32 %74, i32* %13
br label %17
75: ; preds = %17
ret void
}

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