#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*/ V3DMPListDelete(void ***, int *, int);
int /*<<< orphan*/ free(void **);
void V3DMPListDeleteAll(void ***list, int *total) {
  int i;
  if ((list == NULL) || (total == NULL))
    return;
  for (i = 0; i < (*total); i++)
    V3DMPListDelete(list, total, i);
  free(*list);
  (*list) = NULL;
  (*total) = 0;
  return;
}


x86 assembly (clang, -O0):
<V3DMPListDeleteAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <V3DMPListDeleteAll+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    114b <V3DMPListDeleteAll+0x2b>
jmp    11a0 <V3DMPListDeleteAll+0x80>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    117f <V3DMPListDeleteAll+0x5f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <V3DMPListDelete@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <V3DMPListDeleteAll+0x32>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V3DMPListDeleteAll>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1169 <V3DMPListDeleteAll+0x49>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1169 <V3DMPListDeleteAll+0x49>
mov    %rdi,%r14
cmpl   $0x0,(%rbx)
jle    1154 <V3DMPListDeleteAll+0x34>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <V3DMPListDelete@plt>
add    $0x1,%ebp
cmp    (%rbx),%ebp
jl     1140 <V3DMPListDeleteAll+0x20>
mov    (%r14),%rdi
call   1030 <free@plt>
movq   $0x0,(%r14)
movl   $0x0,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @V3DMPListDeleteAll(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 eq i8*** %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %8, %2
br label %32
12: ; preds = %8
store i32 0, i32* %5
br label %13
13: ; preds = %23, %12
%14 = load i32, i32* %5
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %26
18: ; preds = %13
%19 = load i8***, i8**** %3
%20 = load i32*, i32** %4
%21 = load i32, i32* %5
%22 = call i32 @V3DMPListDelete(i8*** %19, i32* %20, i32 %21)
br label %23
23: ; preds = %18
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %13
26: ; preds = %13
%27 = load i8***, i8**** %3
%28 = load i8**, i8*** %27
%29 = call i32 @free(i8** %28)
%30 = load i8***, i8**** %3
store i8** null, i8*** %30
%31 = load i32*, i32** %4
store i32 0, i32* %31
br label %32
32: ; preds = %26, %11
ret void
}

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