#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_c3tensor(char ***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_c3tensor>:
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_c3tensor+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
add    -0x30(%rbp),%rdi
add    $0xffffffffffffffff,%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_c3tensor>:
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_c3tensor+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <nrerror@plt>
mov    (%rbx,%r14,8),%rax
mov    (%rax,%r15,8),%rax
lea    (%rax,%r12,1),%rdi
add    $0xffffffffffffffff,%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_c3tensor(i8*** %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i8***
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i8*** %0, i8**** %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 i8***, i8**** %8
%31 = load i64, i64* %9
%32 = getelementptr inbounds i8**, i8*** %30, i64 %31
%33 = load i8**, i8*** %32
%34 = load i64, i64* %11
%35 = getelementptr inbounds i8*, i8** %33, i64 %34
%36 = load i8*, i8** %35
%37 = load i64, i64* %13
%38 = getelementptr inbounds i8, i8* %36, i64 %37
%39 = getelementptr inbounds i8, i8* %38, i64 -1
%40 = call i32 @free(i8* %39)
%41 = load i8***, i8**** %8
%42 = load i64, i64* %9
%43 = getelementptr inbounds i8**, i8*** %41, i64 %42
%44 = load i8**, i8*** %43
%45 = load i64, i64* %11
%46 = getelementptr inbounds i8*, i8** %44, i64 %45
%47 = getelementptr inbounds i8*, i8** %46, i64 -1
%48 = bitcast i8** %47 to i8*
%49 = call i32 @free(i8* %48)
%50 = load i8***, i8**** %8
%51 = load i64, i64* %9
%52 = getelementptr inbounds i8**, i8*** %50, i64 %51
%53 = getelementptr inbounds i8**, i8*** %52, i64 -1
%54 = bitcast i8*** %53 to i8*
%55 = call i32 @free(i8* %54)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"free_cmatrix: nch must be >=0\00"
define void @free_c3tensor(i8*** 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 i8**, i8*** %0, i64 %1
%15 = load i8**, i8*** %14
%16 = getelementptr inbounds i8*, i8** %15, i64 %3
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8, i8* %17, i64 %5
%19 = getelementptr inbounds i8, i8* %18, i64 -1
%20 = tail call i32 @free(i8* %19)
%21 = load i8**, i8*** %14
%22 = getelementptr inbounds i8*, i8** %21, i64 %3
%23 = getelementptr inbounds i8*, i8** %22, i64 -1
%24 = bitcast i8** %23 to i8*
%25 = tail call i32 @free(i8* %24)
%26 = getelementptr inbounds i8**, i8*** %14, i64 -1
%27 = bitcast i8*** %26 to i8*
%28 = tail call i32 @free(i8* %27)
ret void
}