void delet5Darray_continuousMem(double *****tmp, int a1, int a2, int a3, int a4,
                                int a5) {
  free(tmp[0][0][0][0]);
  for (int i = 0; i < a1; i++) {
    for (int j = 0; j < a2; j++) {
      for (int k = 0; k < a3; k++) {
        free(tmp[i][j][k]);
      }
      free(tmp[i][j]);
    }
    free(tmp[i]);
  }
  free(tmp);
}


x86 assembly (clang, -O0):
<delet5Darray_continuousMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
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    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f0 <delet5Darray_continuousMem+0xe0>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d1 <delet5Darray_continuousMem+0xc1>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11aa <delet5Darray_continuousMem+0x9a>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    116f <delet5Darray_continuousMem+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115c <delet5Darray_continuousMem+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1149 <delet5Darray_continuousMem+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delet5Darray_continuousMem>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,0xc(%rsp)
mov    %edx,0x8(%rsp)
mov    %esi,%r15d
mov    %rdi,%rbp
mov    (%rdi),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
test   %r15d,%r15d
jle    11dd <delet5Darray_continuousMem+0xcd>
mov    %r15d,%eax
mov    %rax,0x10(%rsp)
mov    0x8(%rsp),%r13d
mov    0xc(%rsp),%ebx
xor    %r14d,%r14d
jmp    1175 <delet5Darray_continuousMem+0x65>
nopl   0x0(%rax)
mov    0x0(%rbp,%r14,8),%rdi
call   1030 <free@plt>
add    $0x1,%r14
cmp    0x10(%rsp),%r14
je     11dd <delet5Darray_continuousMem+0xcd>
cmpl   $0x0,0x8(%rsp)
jle    1160 <delet5Darray_continuousMem+0x50>
xor    %r15d,%r15d
jmp    11a7 <delet5Darray_continuousMem+0x97>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp,%r14,8),%rax
mov    (%rax,%r15,8),%rdi
call   1030 <free@plt>
add    $0x1,%r15
cmp    %r13,%r15
je     1160 <delet5Darray_continuousMem+0x50>
cmpl   $0x0,0xc(%rsp)
jle    1190 <delet5Darray_continuousMem+0x80>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp,%r14,8),%rax
mov    (%rax,%r15,8),%rax
mov    (%rax,%r12,8),%rdi
call   1030 <free@plt>
add    $0x1,%r12
cmp    %r12,%rbx
jne    11c0 <delet5Darray_continuousMem+0xb0>
jmp    1190 <delet5Darray_continuousMem+0x80>
mov    %rbp,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @delet5Darray_continuousMem(double***** %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca double*****
%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 double***** %0, double****** %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
%16 = load double*****, double****** %7
%17 = getelementptr inbounds double****, double***** %16, i64 0
%18 = load double****, double***** %17
%19 = getelementptr inbounds double***, double**** %18, i64 0
%20 = load double***, double**** %19
%21 = getelementptr inbounds double**, double*** %20, i64 0
%22 = load double**, double*** %21
%23 = getelementptr inbounds double*, double** %22, i64 0
%24 = load double*, double** %23
%25 = bitcast double* %24 to i8*
store i32 0, i32* %13
br label %26
26: ; preds = %79, %6
%27 = load i32, i32* %13
%28 = load i32, i32* %8
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %82
30: ; preds = %26
store i32 0, i32* %14
br label %31
31: ; preds = %69, %30
%32 = load i32, i32* %14
%33 = load i32, i32* %9
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %72
35: ; preds = %31
store i32 0, i32* %15
br label %36
36: ; preds = %55, %35
%37 = load i32, i32* %15
%38 = load i32, i32* %10
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %58
40: ; preds = %36
%41 = load double*****, double****** %7
%42 = load i32, i32* %13
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double****, double***** %41, i64 %43
%45 = load double****, double***** %44
%46 = load i32, i32* %14
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double***, double**** %45, i64 %47
%49 = load double***, double**** %48
%50 = load i32, i32* %15
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double**, double*** %49, i64 %51
%53 = load double**, double*** %52
%54 = bitcast double** %53 to i8*
br label %55
55: ; preds = %40
%56 = load i32, i32* %15
%57 = add nsw i32 %56, 1
store i32 %57, i32* %15
br label %36
58: ; preds = %36
%59 = load double*****, double****** %7
%60 = load i32, i32* %13
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double****, double***** %59, i64 %61
%63 = load double****, double***** %62
%64 = load i32, i32* %14
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double***, double**** %63, i64 %65
%67 = load double***, double**** %66
%68 = bitcast double*** %67 to i8*
br label %69
69: ; preds = %58
%70 = load i32, i32* %14
%71 = add nsw i32 %70, 1
store i32 %71, i32* %14
br label %31
72: ; preds = %31
%73 = load double*****, double****** %7
%74 = load i32, i32* %13
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double****, double***** %73, i64 %75
%77 = load double****, double***** %76
%78 = bitcast double**** %77 to i8*
br label %79
79: ; preds = %72
%80 = load i32, i32* %13
%81 = add nsw i32 %80, 1
store i32 %81, i32* %13
br label %26
82: ; preds = %26
%83 = load double*****, double****** %7
%84 = bitcast double***** %83 to i8*
ret void
}

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