#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 *, int);
void aml_array_int_4d_save(FILE *file, int ****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; j++)
      for (k = 0; k < s3; k++)
        for (l = 0; l < s4; l++)
          fprintf(file, "%d ", arr[i][j][k][l]);
}


x86 assembly (clang, -O0):
<aml_array_int_4d_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)
mov    %r9d,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11f4 <aml_array_int_4d_save+0xe4>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11e1 <aml_array_int_4d_save+0xd1>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11ce <aml_array_int_4d_save+0xbe>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11bb <aml_array_int_4d_save+0xab>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe58(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    116e <aml_array_int_4d_save+0x5e>
jmp    11c0 <aml_array_int_4d_save+0xb0>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    115b <aml_array_int_4d_save+0x4b>
jmp    11d3 <aml_array_int_4d_save+0xc3>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1148 <aml_array_int_4d_save+0x38>
jmp    11e6 <aml_array_int_4d_save+0xd6>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1135 <aml_array_int_4d_save+0x25>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aml_array_int_4d_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    %ecx,0x4(%rsp)
test   %edx,%edx
jle    11ff <aml_array_int_4d_save+0xef>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %edx,%eax
mov    %rax,0x10(%rsp)
mov    0x4(%rsp),%eax
mov    %rax,0x18(%rsp)
mov    0x8(%rsp),%eax
mov    %rax,0x20(%rsp)
mov    0xc(%rsp),%eax
xor    %r15d,%r15d
lea    0xe9f(%rip),%r13
mov    %rax,0x28(%rsp)
jmp    117f <aml_array_int_4d_save+0x6f>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    0x10(%rsp),%r15
je     11ff <aml_array_int_4d_save+0xef>
cmpl   $0x0,0x4(%rsp)
jle    1170 <aml_array_int_4d_save+0x60>
xor    %edx,%edx
jmp    119b <aml_array_int_4d_save+0x8b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rdx
cmp    0x18(%rsp),%rdx
je     1170 <aml_array_int_4d_save+0x60>
cmpl   $0x0,0x8(%rsp)
jle    1190 <aml_array_int_4d_save+0x80>
xor    %r12d,%r12d
mov    %rdx,0x30(%rsp)
jmp    11bb <aml_array_int_4d_save+0xab>
nopl   0x0(%rax)
add    $0x1,%r12
cmp    0x20(%rsp),%r12
je     1190 <aml_array_int_4d_save+0x80>
cmpl   $0x0,0xc(%rsp)
jle    11b0 <aml_array_int_4d_save+0xa0>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx,%r15,8),%rax
mov    (%rax,%rdx,8),%rax
mov    (%rax,%r12,8),%rax
mov    (%rax,%rbp,4),%edx
mov    %r14,%rdi
mov    %r13,%rsi
call   1030 <fprintf@plt>
mov    0x30(%rsp),%rdx
mov    0x28(%rsp),%rax
add    $0x1,%rbp
cmp    %rbp,%rax
jne    11d0 <aml_array_int_4d_save+0xc0>
jmp    11b0 <aml_array_int_4d_save+0xa0>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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