#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*/ ighmm_mes_err(char *, int /*<<< orphan*/, char *);
int ighmm_cmatrix_stat_free(double ***matrix) {
  if (!(matrix)) {
    ighmm_mes_err("matrix", 0,
                  "("
                  "Mar 15 2022"
                  ":"
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/lukefrasera/fatigueBSN/"
                  "refs/heads/master/scripts/include/ghmm-0.9-rc3/ghmm/matrix.c"
                  ":"
                  "ighmm_cmatrix_stat_free"
                  ")");
    return (-1);
  };
  if (!*matrix)
    return (0);
  free(*matrix);
  return 0;
}


x86 assembly (clang, -O0):
<ighmm_cmatrix_stat_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <ighmm_cmatrix_stat_free+0x38>
lea    0xec2(%rip),%rdi
xor    %esi,%esi
lea    0xec0(%rip),%rdx
call   1040 <ighmm_mes_err@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <ighmm_cmatrix_stat_free+0x65>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1172 <ighmm_cmatrix_stat_free+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1185 <ighmm_cmatrix_stat_free+0x65>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ighmm_cmatrix_stat_free>:
push   %rbx
test   %rdi,%rdi
je     1137 <ighmm_cmatrix_stat_free+0x17>
mov    (%rdi),%rdi
xor    %ebx,%ebx
test   %rdi,%rdi
je     1151 <ighmm_cmatrix_stat_free+0x31>
call   1030 <free@plt>
jmp    1151 <ighmm_cmatrix_stat_free+0x31>
lea    0xec2(%rip),%rdi
lea    0xec2(%rip),%rdx
xor    %esi,%esi
call   1040 <ighmm_mes_err@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"matrix\00"
@.str.1 = [212 x i8] c"(Mar 15 2022:/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lukefrasera/fatigueBSN/refs/heads/master/scripts/include/ghmm-0.9-rc3/ghmm/matrix.c:ighmm_cmatrix_stat_free)\00"
define i32 @ighmm_cmatrix_stat_free(double*** %0) {
%2 = alloca i32
%3 = alloca double***
store double*** %0, double**** %3
%4 = load double***, double**** %3
%5 = icmp ne double*** %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @ighmm_mes_err(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([212 x i8], [212 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %17
8: ; preds = %1
%9 = load double***, double**** %3
%10 = load double**, double*** %9
%11 = icmp ne double** %10, null
br i1 %11, label %13, label %12
12: ; preds = %8
store i32 0, i32* %2
br label %17
13: ; preds = %8
%14 = load double***, double**** %3
%15 = load double**, double*** %14
%16 = call i32 @free(double** %15)
store i32 0, i32* %2
br label %17
17: ; preds = %13, %12, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [7 x i8] c"matrix\00"
@.str.1 = [212 x i8] c"(Mar 15 2022:/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lukefrasera/fatigueBSN/refs/heads/master/scripts/include/ghmm-0.9-rc3/ghmm/matrix.c:ighmm_cmatrix_stat_free)\00"
define i32 @ighmm_cmatrix_stat_free(double*** %0) {
%2 = icmp eq double*** %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @ighmm_mes_err(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([212 x i8], [212 x i8]* @.str.1, i64 0, i64 0))
br label %10
5: ; preds = %1
%6 = load double**, double*** %0
%7 = icmp eq double** %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @free(double** %6)
br label %10
10: ; preds = %5, %8, %3
%11 = phi i32 [ 0, %8 ], [ -1, %3 ], [ 0, %5 ]
ret i32 %11
}