#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(double ***);
int /*<<< orphan*/ free_dmatrix(double **, int, int, int, int);
void FreeXi(double ***xi, int T, int N) {
  int t;
  for (t = 1; t <= T; t++)
    free_dmatrix(xi[t], 1, N, 1, N);
  xi++;
  free(xi);
}


x86 assembly (clang, -O0):
<FreeXi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1172 <FreeXi+0x52>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%r8d
mov    $0x1,%ecx
mov    %ecx,%esi
call   1040 <free_dmatrix@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <FreeXi+0x19>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeXi>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1161 <FreeXi+0x41>
mov    %edx,%ebp
mov    %esi,%r15d
add    $0x1,%r15d
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
mov    %ebp,%r8d
call   1040 <free_dmatrix@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <FreeXi+0x20>
add    $0x8,%r14
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeXi(double*** nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 1
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = add nuw i32 %1, 1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 1, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds double**, double*** %0, i64 %9
%11 = load double**, double*** %10
%12 = tail call i32 @free_dmatrix(double** %11, i32 1, i32 %2, i32 1, i32 %2)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %3
%16 = getelementptr inbounds double**, double*** %0, i64 1
%17 = tail call i32 @free(double*** %16)
ret void
}