#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 */
typedef int /*<<< orphan*/ m;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_matrix(float **m, int nrl, int nrh, int ncl, int nch) {
  int i;
  for (i = nrl; i <= nrh; ++i) {
    free((void *)((m[i]) + ncl));
  }
  free((void *)(m + nrl));
}


x86 assembly (clang, -O0):
<free_matrix>:
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    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1165 <free_matrix+0x55>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <free_matrix+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_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
cmp    %edx,%esi
jle    1127 <free_matrix+0x17>
movslq %esi,%r15
jmp    1155 <free_matrix+0x45>
mov    %edx,%ebx
movslq %ecx,%r12
movslq %esi,%r15
lea    (%r14,%r15,8),%r13
sub    %esi,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
shl    $0x2,%r12
xchg   %ax,%ax
mov    0x0(%r13,%rbp,8),%rdi
add    %r12,%rdi
call   1030 <free@plt>
add    $0x1,%rbp
cmp    %ebp,%ebx
jne    1140 <free_matrix+0x30>
lea    (%r14,%r15,8),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

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