#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(void **);
int /*<<< orphan*/ FreeUnlessNil(void *);
void FreeVector(void **V, int First, int Last) {
  if (V) {
    while (First <= Last) {
      FreeUnlessNil(V[First]);
      First++;
    }
    Free(V);
  }
}


x86 assembly (clang, -O0):
<FreeVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1176 <FreeVector+0x56>
jmp    1142 <FreeVector+0x22>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     116d <FreeVector+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <FreeUnlessNil@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <FreeVector+0x22>
mov    -0x8(%rbp),%rdi
call   1040 <Free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeVector>:
test   %rdi,%rdi
je     1175 <FreeVector+0x55>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r12d
mov    %rdi,%r14
cmp    %edx,%esi
jg     1162 <FreeVector+0x42>
movslq %esi,%rax
lea    (%r14,%rax,8),%r15
sub    %esi,%r12d
add    $0x1,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <FreeUnlessNil@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1150 <FreeVector+0x30>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <Free@plt>
ret

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

LLVM IR (-O2):
define void @FreeVector(i8** %0, i32 %1, i32 %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %20, label %5
5: ; preds = %3
%6 = icmp sgt i32 %1, %2
br i1 %6, label %18, label %7
7: ; preds = %5
%8 = sext i32 %1 to i64
%9 = add i32 %2, 1
br label %10
10: ; preds = %7, %10
%11 = phi i64 [ %8, %7 ], [ %15, %10 ]
%12 = getelementptr inbounds i8*, i8** %0, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @FreeUnlessNil(i8* %13)
%15 = add nsw i64 %11, 1
%16 = trunc i64 %15 to i32
%17 = icmp eq i32 %9, %16
br i1 %17, label %18, label %10
18: ; preds = %10, %5
%19 = tail call i32 @Free(i8** %0)
br label %20
20: ; preds = %18, %3
ret void
}