void free_d3tensor(t, nrl, nrh, ncl, nch, ndl, ndh) double ***t;
long nch, ncl, ndh, ndl, nrh, nrl;
{
  free((char *)(t[nrl][ncl] + ndl - 1));
  free((char *)(t[nrl] + ncl - 1));
  free((char *)(t + nrl - 1));
}


x86 assembly (clang, -O0):
<free_d3tensor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x30(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_d3tensor>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
mov    (%rax,%rcx,8),%rax
lea    (%rax,%r9,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    (%rbx,%r15,8),%rax
lea    (%rax,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r15,8),%rdi
add    $0xfffffffffffffff8,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_d3tensor(double*** %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca double***
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store double*** %0, double**** %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%15 = load double***, double**** %8
%16 = load i64, i64* %9
%17 = getelementptr inbounds double**, double*** %15, i64 %16
%18 = load double**, double*** %17
%19 = load i64, i64* %11
%20 = getelementptr inbounds double*, double** %18, i64 %19
%21 = load double*, double** %20
%22 = load i64, i64* %13
%23 = getelementptr inbounds double, double* %21, i64 %22
%24 = getelementptr inbounds double, double* %23, i64 -1
%25 = bitcast double* %24 to i8*
%26 = load double***, double**** %8
%27 = load i64, i64* %9
%28 = getelementptr inbounds double**, double*** %26, i64 %27
%29 = load double**, double*** %28
%30 = load i64, i64* %11
%31 = getelementptr inbounds double*, double** %29, i64 %30
%32 = getelementptr inbounds double*, double** %31, i64 -1
%33 = bitcast double** %32 to i8*
%34 = load double***, double**** %8
%35 = load i64, i64* %9
%36 = getelementptr inbounds double**, double*** %34, i64 %35
%37 = getelementptr inbounds double**, double*** %36, i64 -1
%38 = bitcast double*** %37 to i8*
ret void
}

LLVM IR (-O2):
define void @free_d3tensor(double*** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = getelementptr inbounds double**, double*** %0, i64 %1
%9 = load double**, double*** %8
%10 = getelementptr inbounds double*, double** %9, i64 %3
%11 = load double*, double** %10
%12 = getelementptr inbounds double, double* %11, i64 %5
%13 = getelementptr inbounds double, double* %12, i64 -1
%14 = bitcast double* %13 to i8*
tail call void @free(i8* %14)
%15 = load double**, double*** %8
%16 = getelementptr inbounds double*, double** %15, i64 %3
%17 = getelementptr inbounds double*, double** %16, i64 -1
%18 = bitcast double** %17 to i8*
tail call void @free(i8* %18)
%19 = getelementptr inbounds double**, double*** %8, i64 -1
%20 = bitcast double*** %19 to i8*
tail call void @free(i8* %20)
ret void
}