#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 _DtCvFreeArray(void **array) {
  void **next;
  if (array == NULL)
    return -1;
  for (next = array; *next != NULL; next++)
    free(*next);
  free(array);
  return (0);
}


x86 assembly (clang, -O0):
<_DtCvFreeArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <_DtCvFreeArray+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <_DtCvFreeArray+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1166 <_DtCvFreeArray+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    113b <_DtCvFreeArray+0x2b>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtCvFreeArray>:
test   %rdi,%rdi
je     1153 <_DtCvFreeArray+0x43>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <_DtCvFreeArray+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <_DtCvFreeArray+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0xffffffff,%eax
ret

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

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