#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 size_t uint16_t;
typedef int /*<<< orphan*/ ****_sg_t10_vpd83_dp;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(int /*<<< orphan*/ ******);
void _sg_t10_vpd83_dp_array_free(struct _sg_t10_vpd83_dp **dps,
                                 uint16_t dp_count) {
  uint16_t i = 0;
  assert(dps != NULL);
  for (; i < dp_count; ++i) {
    free(dps[i]);
  }
  free(dps);
}


x86 assembly (clang, -O0):
<_sg_t10_vpd83_dp_array_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117a <_sg_t10_vpd83_dp_array_free+0x5a>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114a <_sg_t10_vpd83_dp_array_free+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sg_t10_vpd83_dp_array_free>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1040 <assert@plt>
test   %r14,%r14
je     1152 <_sg_t10_vpd83_dp_array_free+0x32>
xor    %ebx,%ebx
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <_sg_t10_vpd83_dp_array_free+0x20>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

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