void delet3Darray_continuousMem(double ***tmp, int a1, int a2, int a3) {
  free(tmp[0][0]);
  for (int i = 0; i < a1; i++) {
    free(tmp[i]);
  }
  free(tmp);
}


x86 assembly (clang, -O0):
<delet3Darray_continuousMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1166 <delet3Darray_continuousMem+0x56>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113b <delet3Darray_continuousMem+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delet3Darray_continuousMem>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
test   %ebp,%ebp
jle    1142 <delet3Darray_continuousMem+0x32>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <delet3Darray_continuousMem+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @delet3Darray_continuousMem(double*** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double***
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store double*** %0, double**** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load double***, double**** %5
%11 = getelementptr inbounds double**, double*** %10, i64 0
%12 = load double**, double*** %11
%13 = getelementptr inbounds double*, double** %12, i64 0
%14 = load double*, double** %13
%15 = bitcast double* %14 to i8*
store i32 0, i32* %9
br label %16
16: ; preds = %27, %4
%17 = load i32, i32* %9
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load double***, double**** %5
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double**, double*** %21, i64 %23
%25 = load double**, double*** %24
%26 = bitcast double** %25 to i8*
br label %27
27: ; preds = %20
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
br label %16
30: ; preds = %16
%31 = load double***, double**** %5
%32 = bitcast double*** %31 to i8*
ret void
}

LLVM IR (-O2):
define void @delet3Darray_continuousMem(double*** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = bitcast double*** %0 to i8***
%6 = load i8**, i8*** %5
%7 = load i8*, i8** %6
tail call void @free(i8* %7)
%8 = icmp sgt i32 %1, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = zext i32 %1 to i64
br label %13
11: ; preds = %13, %4
%12 = bitcast double*** %0 to i8*
tail call void @free(i8* %12)
ret void
13: ; preds = %9, %13
%14 = phi i64 [ 0, %9 ], [ %18, %13 ]
%15 = getelementptr inbounds double**, double*** %0, i64 %14
%16 = bitcast double*** %15 to i8**
%17 = load i8*, i8** %16
tail call void @free(i8* %17)
%18 = add nuw nsw i64 %14, 1
%19 = icmp eq i64 %18, %10
br i1 %19, label %11, label %13
}