#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_D3dmatrix(double ***m, int nrl, int nrh, int ncl, int nch, int nzl,
                    int nzh) {
  int i, j;
  for (i = nrh; i >= nrl; i--) {
    for (j = nch; j >= ncl; j--) {
      free((char *)(m[i][j] + nzl));
    }
  }
}


x86 assembly (clang, -O0):
<free_D3dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1199 <free_D3dmatrix+0x89>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1186 <free_D3dmatrix+0x76>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1148 <free_D3dmatrix+0x38>
jmp    118b <free_D3dmatrix+0x7b>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1136 <free_D3dmatrix+0x26>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_D3dmatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,0xc(%rsp)
mov    %ecx,0x8(%rsp)
cmp    %esi,%edx
jge    113a <free_D3dmatrix+0x2a>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rdi,%r13
movslq %r9d,%rbp
movslq 0xc(%rsp),%rax
movslq 0x8(%rsp),%rbx
movslq %edx,%r14
movslq %esi,%r12
add    $0x1,%rax
mov    %rax,0x10(%rsp)
shl    $0x3,%rbp
jmp    116c <free_D3dmatrix+0x5c>
nop
lea    -0x1(%r14),%rax
cmp    %r12,%r14
mov    %rax,%r14
jle    112b <free_D3dmatrix+0x1b>
mov    0x8(%rsp),%eax
cmp    %eax,0xc(%rsp)
jl     1160 <free_D3dmatrix+0x50>
mov    0x10(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13,%r14,8),%rax
mov    -0x8(%rax,%r15,8),%rdi
add    %rbp,%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%r15
cmp    %rbx,%r15
jg     1180 <free_D3dmatrix+0x70>
jmp    1160 <free_D3dmatrix+0x50>

LLVM IR (-O0):
define void @free_D3dmatrix(double*** %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca double***
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store double*** %0, double**** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%17 = load i32, i32* %10
store i32 %17, i32* %15
br label %18
18: ; preds = %47, %7
%19 = load i32, i32* %15
%20 = load i32, i32* %9
%21 = icmp sge i32 %19, %20
br i1 %21, label %22, label %50
22: ; preds = %18
%23 = load i32, i32* %12
store i32 %23, i32* %16
br label %24
24: ; preds = %43, %22
%25 = load i32, i32* %16
%26 = load i32, i32* %11
%27 = icmp sge i32 %25, %26
br i1 %27, label %28, label %46
28: ; preds = %24
%29 = load double***, double**** %8
%30 = load i32, i32* %15
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double**, double*** %29, i64 %31
%33 = load double**, double*** %32
%34 = load i32, i32* %16
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double*, double** %33, i64 %35
%37 = load double*, double** %36
%38 = load i32, i32* %13
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
%41 = bitcast double* %40 to i8*
%42 = call i32 @free(i8* %41)
br label %43
43: ; preds = %28
%44 = load i32, i32* %16
%45 = add nsw i32 %44, -1
store i32 %45, i32* %16
br label %24
46: ; preds = %24
br label %47
47: ; preds = %46
%48 = load i32, i32* %15
%49 = add nsw i32 %48, -1
store i32 %49, i32* %15
br label %18
50: ; preds = %18
ret void
}

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