#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_variable_2nd_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[i]; 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_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    11fd <aml_array_int_4d_variable_2nd_save+0xed>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x20(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    11ea <aml_array_int_4d_variable_2nd_save+0xda>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11d7 <aml_array_int_4d_variable_2nd_save+0xc7>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    11c4 <aml_array_int_4d_variable_2nd_save+0xb4>
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
mov    (%rax,%rcx,4),%edx
lea    0xe4f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1177 <aml_array_int_4d_variable_2nd_save+0x67>
jmp    11c9 <aml_array_int_4d_variable_2nd_save+0xb9>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1164 <aml_array_int_4d_variable_2nd_save+0x54>
jmp    11dc <aml_array_int_4d_variable_2nd_save+0xcc>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1149 <aml_array_int_4d_variable_2nd_save+0x39>
jmp    11ef <aml_array_int_4d_variable_2nd_save+0xdf>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1136 <aml_array_int_4d_variable_2nd_save+0x26>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aml_array_int_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    120f <aml_array_int_4d_variable_2nd_save+0xff>
mov    %rdi,%r15
mov    %edx,%eax
mov    %rax,0x18(%rsp)
mov    0x8(%rsp),%eax
mov    %rax,0x20(%rsp)
mov    0xc(%rsp),%edx
xor    %r14d,%r14d
lea    0xeaa(%rip),%r13
mov    %rdx,0x30(%rsp)
mov    %rsi,0x28(%rsp)
jmp    117f <aml_array_int_4d_variable_2nd_save+0x6f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r14
cmp    0x18(%rsp),%r14
je     120f <aml_array_int_4d_variable_2nd_save+0xff>
mov    0x10(%rsp),%rax
mov    (%rax,%r14,4),%eax
test   %eax,%eax
jle    1170 <aml_array_int_4d_variable_2nd_save+0x60>
xor    %r12d,%r12d
jmp    11b5 <aml_array_int_4d_variable_2nd_save+0xa5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rax
mov    (%rax,%r14,4),%eax
add    $0x1,%r12
movslq %eax,%rcx
cmp    %rcx,%r12
jge    1170 <aml_array_int_4d_variable_2nd_save+0x60>
cmpl   $0x0,0x8(%rsp)
jle    11a9 <aml_array_int_4d_variable_2nd_save+0x99>
xor    %ebx,%ebx
jmp    11cb <aml_array_int_4d_variable_2nd_save+0xbb>
add    $0x1,%rbx
cmp    0x20(%rsp),%rbx
je     11a0 <aml_array_int_4d_variable_2nd_save+0x90>
cmpl   $0x0,0xc(%rsp)
jle    11c0 <aml_array_int_4d_variable_2nd_save+0xb0>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rsi,%r14,8),%rax
mov    (%rax,%r12,8),%rax
mov    (%rax,%rbx,8),%rax
mov    (%rax,%rbp,4),%edx
mov    %r15,%rdi
mov    %r13,%rsi
call   1030 <fprintf@plt>
mov    0x30(%rsp),%rdx
mov    0x28(%rsp),%rsi
add    $0x1,%rbp
cmp    %rbp,%rdx
jne    11e0 <aml_array_int_4d_variable_2nd_save+0xd0>
jmp    11c0 <aml_array_int_4d_variable_2nd_save+0xb0>
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_variable_2nd_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 = %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 i32****, i32***** %8
%43 = load i32, i32* %13
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32***, i32**** %42, i64 %44
%46 = load i32***, i32**** %45
%47 = load i32, i32* %14
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32**, i32*** %46, i64 %48
%50 = load i32**, i32*** %49
%51 = load i32, i32* %15
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32*, i32** %50, i64 %52
%54 = load i32*, i32** %53
%55 = load i32, i32* %16
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
%58 = load i32, i32* %57
%59 = call i32 @fprintf(i32* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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 = [4 x i8] c"%d \00"
define void @aml_array_int_4d_variable_2nd_save(i32* nocapture %0, i32**** 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 i32***, i32**** %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 i32***, i32**** %20
%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 = getelementptr inbounds i32, i32* %32, i64 %27
%34 = load i32, i32* %33
%35 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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
}