#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 */

/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ get_mem5Dshort(short ******, int, int, int, int, int);
int /*<<< orphan*/ no_mem_exit(char *);
int get_mem6Dshort(short *******array6D, int list, int refs, int blocktype,
                   int rows, int columns, int component) {
  int j;
  if (((*array6D) = (short ******)calloc(list, sizeof(short *****))) == NULL)
    no_mem_exit("get_mem6Dshort: array6D");
  ;
  for (j = 0; j < list; j++)
    get_mem5Dshort((*array6D) + j, refs, blocktype, rows, columns, component);
  return list * refs * blocktype * rows * columns * component * sizeof(short);
}


x86 assembly (clang, -O0):
<get_mem6Dshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    117a <get_mem6Dshort+0x4a>
lea    0xe8b(%rip),%rdi
call   1040 <no_mem_exit@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c3 <get_mem6Dshort+0x93>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    0x10(%rbp),%r9d
call   1050 <get_mem5Dshort@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1181 <get_mem6Dshort+0x51>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
imul   0x10(%rbp),%eax
cltq
shl    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mem6Dshort>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,%ebp
mov    %r8d,%r13d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %esi,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rbx,%rcx
mov    %rax,(%rbx)
test   %rax,%rax
jne    1179 <get_mem6Dshort+0x49>
mov    %rcx,%rbx
lea    0xe8f(%rip),%rdi
call   1040 <no_mem_exit@plt>
mov    %rbx,%rcx
mov    0x50(%rsp),%r9d
mov    %r14d,0x8(%rsp)
test   %r14d,%r14d
mov    %r15d,%ebx
mov    %r12d,%r14d
jle    11e2 <get_mem6Dshort+0xb2>
mov    0x8(%rsp),%eax
shl    $0x3,%rax
mov    %rax,0x10(%rsp)
xor    %r15d,%r15d
mov    %r13d,0xc(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,%r12
mov    (%rcx),%rdi
add    %r15,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %ebp,%r8d
mov    %r9d,%r13d
call   1050 <get_mem5Dshort@plt>
mov    %r13d,%r9d
mov    0xc(%rsp),%r13d
mov    %r12,%rcx
add    $0x8,%r15
cmp    %r15,0x10(%rsp)
jne    11b0 <get_mem6Dshort+0x80>
mov    0x8(%rsp),%eax
imul   %r14d,%eax
imul   %ebx,%eax
imul   %r13d,%eax
imul   %ebp,%eax
imul   %r9d,%eax
add    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"get_mem6Dshort: array6D\00"
define i32 @get_mem6Dshort(i16******* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i16*******
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i16******* %0, i16******** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%16 = load i32, i32* %9
%17 = call i64 @calloc(i32 %16, i32 8)
%18 = inttoptr i64 %17 to i16******
%19 = load i16*******, i16******** %8
store i16****** %18, i16******* %19
%20 = icmp eq i16****** %18, null
br i1 %20, label %21, label %23
21: ; preds = %7
%22 = call i32 @no_mem_exit(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %7
store i32 0, i32* %15
br label %24
24: ; preds = %40, %23
%25 = load i32, i32* %15
%26 = load i32, i32* %9
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %43
28: ; preds = %24
%29 = load i16*******, i16******** %8
%30 = load i16******, i16******* %29
%31 = load i32, i32* %15
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i16*****, i16****** %30, i64 %32
%34 = load i32, i32* %10
%35 = load i32, i32* %11
%36 = load i32, i32* %12
%37 = load i32, i32* %13
%38 = load i32, i32* %14
%39 = call i32 @get_mem5Dshort(i16****** %33, i32 %34, i32 %35, i32 %36, i32 %37, i32 %38)
br label %40
40: ; preds = %28
%41 = load i32, i32* %15
%42 = add nsw i32 %41, 1
store i32 %42, i32* %15
br label %24
43: ; preds = %24
%44 = load i32, i32* %9
%45 = load i32, i32* %10
%46 = mul nsw i32 %44, %45
%47 = load i32, i32* %11
%48 = mul nsw i32 %46, %47
%49 = load i32, i32* %12
%50 = mul nsw i32 %48, %49
%51 = load i32, i32* %13
%52 = mul nsw i32 %50, %51
%53 = load i32, i32* %14
%54 = mul nsw i32 %52, %53
%55 = sext i32 %54 to i64
%56 = mul i64 %55, 2
%57 = trunc i64 %56 to i32
ret i32 %57
}

LLVM IR (-O2):
@.str = [24 x i8] c"get_mem6Dshort: array6D\00"
define i32 @get_mem6Dshort(i16******* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i64 @calloc(i32 %1, i32 8)
%9 = inttoptr i64 %8 to i16******
store i16****** %9, i16******* %0
%10 = icmp eq i64 %8, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = tail call i32 @no_mem_exit(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
%14 = icmp sgt i32 %1, 0
br i1 %14, label %15, label %24
15: ; preds = %13
%16 = zext i32 %1 to i64
br label %17
17: ; preds = %15, %17
%18 = phi i64 [ 0, %15 ], [ %22, %17 ]
%19 = load i16******, i16******* %0
%20 = getelementptr inbounds i16*****, i16****** %19, i64 %18
%21 = tail call i32 @get_mem5Dshort(i16****** %20, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
%22 = add nuw nsw i64 %18, 1
%23 = icmp eq i64 %22, %16
br i1 %23, label %24, label %17
24: ; preds = %17, %13
%25 = shl i32 %1, 1
%26 = mul i32 %25, %2
%27 = mul i32 %26, %3
%28 = mul i32 %27, %4
%29 = mul i32 %28, %5
%30 = mul i32 %29, %6
ret i32 %30
}