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


x86 assembly (clang, -O0):
<free_cmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1161 <free_cmatrix+0x51>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <free_cmatrix+0x1f>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_cmatrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
cmp    %esi,%edx
jge    1124 <free_cmatrix+0x14>
movslq %esi,%r15
jmp    1156 <free_cmatrix+0x46>
movslq %ecx,%r12
movslq %edx,%rbx
movslq %esi,%r15
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x8(%r14,%rbx,8),%rdi
add    %r12,%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    %r15,%rbx
jg     1140 <free_cmatrix+0x30>
lea    (%r14,%r15,8),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

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