#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*/ GetProcessHeap();
int /*<<< orphan*/ HeapFree(int /*<<< orphan*/, int /*<<< orphan*/, char **);
int /*<<< orphan*/ strfreeU(int /*<<< orphan*/);
void strarrayfreeU(char **strarray) {
  if (strarray) {
    char **p = strarray;
    while (*p)
      strfreeU(*p++);
    HeapFree(GetProcessHeap(), 0, strarray);
  }
}


x86 assembly (clang, -O0):
<strarrayfreeU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118f <strarrayfreeU+0x5f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     117b <strarrayfreeU+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <strfreeU@plt>
jmp    114f <strarrayfreeU+0x1f>
mov    $0x0,%al
call   1050 <GetProcessHeap@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <HeapFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strarrayfreeU>:
test   %rdi,%rdi
je     117b <strarrayfreeU+0x4b>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1161 <strarrayfreeU+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <strfreeU@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1150 <strarrayfreeU+0x20>
xor    %eax,%eax
call   1050 <GetProcessHeap@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <HeapFree@plt>
ret

LLVM IR (-O0):
define void @strarrayfreeU(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = icmp ne i8** %4, null
br i1 %5, label %6, label %22
6: ; preds = %1
%7 = load i8**, i8*** %2
store i8** %7, i8*** %3
br label %8
8: ; preds = %12, %6
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8**, i8*** %3
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %3
%15 = load i8*, i8** %13
%16 = ptrtoint i8* %15 to i32
%17 = call i32 @strfreeU(i32 %16)
br label %8
18: ; preds = %8
%19 = call i32 (...) @GetProcessHeap()
%20 = load i8**, i8*** %2
%21 = call i32 @HeapFree(i32 %19, i32 0, i8** %20)
br label %22
22: ; preds = %18, %1
ret void
}

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