#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*/ V3DMPDestroy(void *);
void *V3DMPListGetPtr(void **, int, int);
void V3DMPListDelete(void ***list, int *total, int i) {
  void *p;
  if ((list == NULL) || (total == NULL))
    return;
  p = V3DMPListGetPtr(*list, *total, i);
  if (p != NULL) {
    V3DMPDestroy(p);
    (*list)[i] = NULL;
  }
  return;
}


x86 assembly (clang, -O0):
<V3DMPListDelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <V3DMPListDelete+0x29>
cmpq   $0x0,-0x10(%rbp)
jne    114e <V3DMPListDelete+0x2e>
jmp    1193 <V3DMPListDelete+0x73>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x14(%rbp),%edx
call   1030 <V3DMPListGetPtr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118e <V3DMPListDelete+0x6e>
mov    -0x20(%rbp),%rdi
call   1040 <V3DMPDestroy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
jmp    1193 <V3DMPListDelete+0x73>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V3DMPListDelete>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1157 <V3DMPListDelete+0x37>
test   %rsi,%rsi
je     1157 <V3DMPListDelete+0x37>
mov    %edx,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    (%rsi),%esi
call   1030 <V3DMPListGetPtr@plt>
test   %rax,%rax
je     1157 <V3DMPListDelete+0x37>
mov    %rax,%rdi
call   1040 <V3DMPDestroy@plt>
mov    (%rbx),%rax
movslq %ebp,%rcx
movq   $0x0,(%rax,%rcx,8)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @V3DMPListDelete(i8*** %0, i32* %1, i32 %2) {
%4 = icmp eq i8*** %0, null
%5 = icmp eq i32* %1, null
%6 = or i1 %4, %5
br i1 %6, label %17, label %7
7: ; preds = %3
%8 = load i8**, i8*** %0
%9 = load i32, i32* %1
%10 = tail call i8* @V3DMPListGetPtr(i8** %8, i32 %9, i32 %2)
%11 = icmp eq i8* %10, null
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = tail call i32 @V3DMPDestroy(i8* %10)
%14 = load i8**, i8*** %0
%15 = sext i32 %2 to i64
%16 = getelementptr inbounds i8*, i8** %14, i64 %15
store i8* null, i8** %16
br label %17
17: ; preds = %7, %12, %3
ret void
}