#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 *);
void free_s3tensor(short ***t, long nrl, long nrh, long ncl, long nch, long ndl,
                   long ndh) {
  free((char *)(t[nrl][ncl] + ndl - 0));
  free((char *)(t[nrl] + ncl - 0));
  free((char *)(t + nrl - 0));
}


x86 assembly (clang, -O0):
<free_s3tensor>:
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    $0x1,%rax
add    %rax,%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
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @free_s3tensor(i16*** %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i16***
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i16*** %0, i16**** %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 i16***, i16**** %8
%16 = load i64, i64* %9
%17 = getelementptr inbounds i16**, i16*** %15, i64 %16
%18 = load i16**, i16*** %17
%19 = load i64, i64* %11
%20 = getelementptr inbounds i16*, i16** %18, i64 %19
%21 = load i16*, i16** %20
%22 = load i64, i64* %13
%23 = getelementptr inbounds i16, i16* %21, i64 %22
%24 = getelementptr inbounds i16, i16* %23, i64 0
%25 = bitcast i16* %24 to i8*
%26 = call i32 @free(i8* %25)
%27 = load i16***, i16**** %8
%28 = load i64, i64* %9
%29 = getelementptr inbounds i16**, i16*** %27, i64 %28
%30 = load i16**, i16*** %29
%31 = load i64, i64* %11
%32 = getelementptr inbounds i16*, i16** %30, i64 %31
%33 = getelementptr inbounds i16*, i16** %32, i64 0
%34 = bitcast i16** %33 to i8*
%35 = call i32 @free(i8* %34)
%36 = load i16***, i16**** %8
%37 = load i64, i64* %9
%38 = getelementptr inbounds i16**, i16*** %36, i64 %37
%39 = getelementptr inbounds i16**, i16*** %38, i64 0
%40 = bitcast i16*** %39 to i8*
%41 = call i32 @free(i8* %40)
ret void
}

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