#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 */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ nrerror(char *);
void free_f3tensor(float ***t, long nrl, long nrh, long ncl, long nch, long ndl,
                   long ndh) {
  if ((nch < 0) | (nrh < 0) | (ndh < 0))
    nrerror("free_cmatrix: nch must be >=0");
  free((char *)(t[nrl][ncl] + ndl - 1));
  free((char *)(t[nrl] + ncl - 1));
  free((char *)(t + nrl - 1));
}


x86 assembly (clang, -O0):
<free_f3tensor>:
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)
cmpq   $0x0,-0x28(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpq   $0x0,-0x18(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmpq   $0x0,0x10(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     1186 <free_f3tensor+0x66>
lea    0xe7f(%rip),%rdi
call   1040 <nrerror@plt>
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    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%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_f3tensor>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r9,%r12
mov    %rcx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
or     %r8,%rdx
or     0x30(%rsp),%rdx
jns    114a <free_f3tensor+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <nrerror@plt>
mov    (%rbx,%r14,8),%rax
mov    (%rax,%r15,8),%rax
lea    (%rax,%r12,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    (%rbx,%r14,8),%rax
lea    (%rax,%r15,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"free_cmatrix: nch must be >=0\00"
define void @free_f3tensor(float*** %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca float***
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store float*** %0, float**** %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 i64, i64* %12
%16 = icmp slt i64 %15, 0
%17 = zext i1 %16 to i32
%18 = load i64, i64* %10
%19 = icmp slt i64 %18, 0
%20 = zext i1 %19 to i32
%21 = or i32 %17, %20
%22 = load i64, i64* %14
%23 = icmp slt i64 %22, 0
%24 = zext i1 %23 to i32
%25 = or i32 %21, %24
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %7
%28 = call i32 @nrerror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %29
29: ; preds = %27, %7
%30 = load float***, float**** %8
%31 = load i64, i64* %9
%32 = getelementptr inbounds float**, float*** %30, i64 %31
%33 = load float**, float*** %32
%34 = load i64, i64* %11
%35 = getelementptr inbounds float*, float** %33, i64 %34
%36 = load float*, float** %35
%37 = load i64, i64* %13
%38 = getelementptr inbounds float, float* %36, i64 %37
%39 = getelementptr inbounds float, float* %38, i64 -1
%40 = bitcast float* %39 to i8*
%41 = call i32 @free(i8* %40)
%42 = load float***, float**** %8
%43 = load i64, i64* %9
%44 = getelementptr inbounds float**, float*** %42, i64 %43
%45 = load float**, float*** %44
%46 = load i64, i64* %11
%47 = getelementptr inbounds float*, float** %45, i64 %46
%48 = getelementptr inbounds float*, float** %47, i64 -1
%49 = bitcast float** %48 to i8*
%50 = call i32 @free(i8* %49)
%51 = load float***, float**** %8
%52 = load i64, i64* %9
%53 = getelementptr inbounds float**, float*** %51, i64 %52
%54 = getelementptr inbounds float**, float*** %53, i64 -1
%55 = bitcast float*** %54 to i8*
%56 = call i32 @free(i8* %55)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"free_cmatrix: nch must be >=0\00"
define void @free_f3tensor(float*** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = or i64 %4, %2
%9 = or i64 %8, %6
%10 = icmp sgt i64 %9, -1
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i32 @nrerror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
%14 = getelementptr inbounds float**, float*** %0, i64 %1
%15 = load float**, float*** %14
%16 = getelementptr inbounds float*, float** %15, i64 %3
%17 = load float*, float** %16
%18 = getelementptr inbounds float, float* %17, i64 %5
%19 = getelementptr inbounds float, float* %18, i64 -1
%20 = bitcast float* %19 to i8*
%21 = tail call i32 @free(i8* %20)
%22 = load float**, float*** %14
%23 = getelementptr inbounds float*, float** %22, i64 %3
%24 = getelementptr inbounds float*, float** %23, i64 -1
%25 = bitcast float** %24 to i8*
%26 = tail call i32 @free(i8* %25)
%27 = getelementptr inbounds float**, float*** %14, i64 -1
%28 = bitcast float*** %27 to i8*
%29 = tail call i32 @free(i8* %28)
ret void
}