#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*/ ****vit_s;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ ******);
void FreeViterbiMatrix(struct vit_s **mx, int L) {
  int i;
  for (i = 0; i < L + 2; i++)
    free(mx[i]);
  free(mx);
}


x86 assembly (clang, -O0):
<FreeViterbiMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1156 <FreeViterbiMatrix+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <FreeViterbiMatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeViterbiMatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
cmp    $0xffffffff,%esi
jl     1142 <FreeViterbiMatrix+0x32>
mov    %esi,%r15d
add    $0x2,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <FreeViterbiMatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

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