#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 **);
void util_ptr_vec_free(void **ptr_vec, int count) {
  int i;
  if (!ptr_vec || count < 0)
    return;
  for (i = 0; i < count; i++)
    free(ptr_vec[i]);
  free(ptr_vec);
}


x86 assembly (clang, -O0):
<util_ptr_vec_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <util_ptr_vec_free+0x24>
cmpl   $0x0,-0xc(%rbp)
jge    1139 <util_ptr_vec_free+0x29>
jmp    1174 <util_ptr_vec_free+0x64>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116b <util_ptr_vec_free+0x5b>
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    1140 <util_ptr_vec_free+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_ptr_vec_free>:
test   %rdi,%rdi
je     114f <util_ptr_vec_free+0x3f>
test   %esi,%esi
js     114f <util_ptr_vec_free+0x3f>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
je     1142 <util_ptr_vec_free+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <util_ptr_vec_free+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
ret

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

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