#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 ****aml_array_int_4d_variable_2nd_new(int, int *, int, int,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int ****aml_array_int_4d_variable_2nd_load(FILE *file, int s1, int *s2, int s3,
                                           int s4) {
  int ****arr = aml_array_int_4d_variable_2nd_new(s1, s2, s3, s4, 0);
  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++)
          fscanf(file, "%d ", &arr[i][j][k][l]);
  return arr;
}


x86 assembly (clang, -O0):
<aml_array_int_4d_variable_2nd_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
xor    %r8d,%r8d
call   1040 <aml_array_int_4d_variable_2nd_new@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1225 <aml_array_int_4d_variable_2nd_load+0x105>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x18(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1212 <aml_array_int_4d_variable_2nd_load+0xf2>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11ff <aml_array_int_4d_variable_2nd_load+0xdf>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11ec <aml_array_int_4d_variable_2nd_load+0xcc>
mov    -0x8(%rbp),%rdi
mov    -0x28(%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),%rdx
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe27(%rip),%rsi
call   1030 <fscanf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    119b <aml_array_int_4d_variable_2nd_load+0x7b>
jmp    11f1 <aml_array_int_4d_variable_2nd_load+0xd1>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1188 <aml_array_int_4d_variable_2nd_load+0x68>
jmp    1204 <aml_array_int_4d_variable_2nd_load+0xe4>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    116d <aml_array_int_4d_variable_2nd_load+0x4d>
jmp    1217 <aml_array_int_4d_variable_2nd_load+0xf7>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    115a <aml_array_int_4d_variable_2nd_load+0x3a>
mov    -0x28(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aml_array_int_4d_variable_2nd_load>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %esi,%r13d
mov    %rdi,%rbp
mov    %esi,%edi
mov    %rdx,0x8(%rsp)
mov    %rdx,%rsi
mov    %ecx,(%rsp)
mov    %ecx,%edx
mov    %r8d,0x4(%rsp)
mov    %r8d,%ecx
xor    %r8d,%r8d
call   1040 <aml_array_int_4d_variable_2nd_new@plt>
mov    %rax,%rdx
test   %r13d,%r13d
jle    1242 <aml_array_int_4d_variable_2nd_load+0x122>
mov    %r13d,%eax
mov    %rax,0x10(%rsp)
mov    (%rsp),%eax
mov    %rax,0x18(%rsp)
mov    0x4(%rsp),%r12d
shl    $0x2,%r12
xor    %ebx,%ebx
lea    0xe7f(%rip),%rsi
mov    %rbp,0x20(%rsp)
mov    %rdx,0x28(%rsp)
mov    0x20(%rsp),%r15
jmp    11af <aml_array_int_4d_variable_2nd_load+0x8f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    0x10(%rsp),%rbx
je     1242 <aml_array_int_4d_variable_2nd_load+0x122>
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,4),%eax
test   %eax,%eax
jle    11a0 <aml_array_int_4d_variable_2nd_load+0x80>
xor    %r13d,%r13d
mov    %rbx,0x30(%rsp)
jmp    11e4 <aml_array_int_4d_variable_2nd_load+0xc4>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,4),%eax
add    $0x1,%r13
movslq %eax,%rcx
cmp    %rcx,%r13
jge    11a0 <aml_array_int_4d_variable_2nd_load+0x80>
cmpl   $0x0,(%rsp)
jle    11d8 <aml_array_int_4d_variable_2nd_load+0xb8>
xor    %r14d,%r14d
jmp    11fb <aml_array_int_4d_variable_2nd_load+0xdb>
nop
add    $0x1,%r14
cmp    0x18(%rsp),%r14
je     11d0 <aml_array_int_4d_variable_2nd_load+0xb0>
cmpl   $0x0,0x4(%rsp)
jle    11f0 <aml_array_int_4d_variable_2nd_load+0xd0>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rdx,%rbx,8),%rax
mov    (%rax,%r13,8),%rax
mov    (%rax,%r14,8),%rdx
add    %rbp,%rdx
mov    %r15,%rdi
mov    %rsi,%rbx
call   1030 <fscanf@plt>
mov    %rbx,%rsi
mov    0x30(%rsp),%rbx
mov    0x28(%rsp),%rdx
add    $0x4,%rbp
cmp    %rbp,%r12
jne    1210 <aml_array_int_4d_variable_2nd_load+0xf0>
jmp    11f0 <aml_array_int_4d_variable_2nd_load+0xd0>
mov    %rdx,%rax
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 i32**** @aml_array_int_4d_variable_2nd_load(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%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
%15 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%16 = load i32, i32* %7
%17 = load i32*, i32** %8
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = call i32**** @aml_array_int_4d_variable_2nd_new(i32 %16, i32* %17, i32 %18, i32 %19, i32 0)
store i32**** %20, i32***** %11
store i32 0, i32* %12
br label %21
21: ; preds = %75, %5
%22 = load i32, i32* %12
%23 = load i32, i32* %7
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %78
25: ; preds = %21
store i32 0, i32* %13
br label %26
26: ; preds = %71, %25
%27 = load i32, i32* %13
%28 = load i32*, i32** %8
%29 = load i32, i32* %12
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = icmp slt i32 %27, %32
br i1 %33, label %34, label %74
34: ; preds = %26
store i32 0, i32* %14
br label %35
35: ; preds = %67, %34
%36 = load i32, i32* %14
%37 = load i32, i32* %9
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %70
39: ; preds = %35
store i32 0, i32* %15
br label %40
40: ; preds = %63, %39
%41 = load i32, i32* %15
%42 = load i32, i32* %10
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %66
44: ; preds = %40
%45 = load i32*, i32** %6
%46 = load i32****, i32***** %11
%47 = load i32, i32* %12
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32***, i32**** %46, i64 %48
%50 = load i32***, i32**** %49
%51 = load i32, i32* %13
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32**, i32*** %50, i64 %52
%54 = load i32**, i32*** %53
%55 = load i32, i32* %14
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32*, i32** %54, i64 %56
%58 = load i32*, i32** %57
%59 = load i32, i32* %15
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %58, i64 %60
%62 = call i32 @fscanf(i32* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %61)
br label %63
63: ; preds = %44
%64 = load i32, i32* %15
%65 = add nsw i32 %64, 1
store i32 %65, i32* %15
br label %40
66: ; preds = %40
br label %67
67: ; preds = %66
%68 = load i32, i32* %14
%69 = add nsw i32 %68, 1
store i32 %69, i32* %14
br label %35
70: ; preds = %35
br label %71
71: ; preds = %70
%72 = load i32, i32* %13
%73 = add nsw i32 %72, 1
store i32 %73, i32* %13
br label %26
74: ; preds = %26
br label %75
75: ; preds = %74
%76 = load i32, i32* %12
%77 = add nsw i32 %76, 1
store i32 %77, i32* %12
br label %21
78: ; preds = %21
%79 = load i32****, i32***** %11
ret i32**** %79
}

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