#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(char ***);
int /*<<< orphan*/ strv_free(char **);
char ***strv_free_free(char ***l) {
  char ***i;
  if (!l)
    return NULL;
  for (i = l; *i; i++)
    strv_free(*i);
  free(l);
  return NULL;
}


x86 assembly (clang, -O0):
<strv_free_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <strv_free_free+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1188 <strv_free_free+0x68>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1177 <strv_free_free+0x57>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1040 <strv_free@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    114c <strv_free_free+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strv_free_free>:
test   %rdi,%rdi
je     1160 <strv_free_free+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1151 <strv_free_free+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1040 <strv_free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <strv_free_free+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
xor    %eax,%eax
ret

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

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