#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_dmatrix(double **Matrix, int LoRows, int HiRows, int LoCols,
                  int HiCols) {
  int silly;
  silly = HiCols - HiRows;
  free((char *)(Matrix[LoRows] + LoCols - 1));
  free((char *)(Matrix + LoRows - 1));
}


x86 assembly (clang, -O0):
<free_dmatrix>:
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    -0x18(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
mov    (%rdi,%rbx,8),%rax
movslq %ecx,%rcx
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%r14,%rbx,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dmatrix(double** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store double** %0, double*** %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* %10
%13 = load i32, i32* %8
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %11
%15 = load double**, double*** %6
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double*, double** %15, i64 %17
%19 = load double*, double** %18
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = getelementptr inbounds double, double* %22, i64 -1
%24 = bitcast double* %23 to i8*
%25 = call i32 @free(i8* %24)
%26 = load double**, double*** %6
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double*, double** %26, i64 %28
%30 = getelementptr inbounds double*, double** %29, i64 -1
%31 = bitcast double** %30 to i8*
%32 = call i32 @free(i8* %31)
ret void
}

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