void free_mem2Dpel(unsigned char **array2D) {
  if (array2D) {
    if (array2D[0])
      h264_free(array2D[0]);
    else {
      printf("free_mem2Dpel: trying to free unused memory", 100);
      exit(0);
    }
    h264_free(array2D);
  } else {
    printf("free_mem2Dpel: trying to free unused memory");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<free_mem2Dpel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1192 <free_mem2Dpel+0x62>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1168 <free_mem2Dpel+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1040 <h264_free@plt>
jmp    1182 <free_mem2Dpel+0x52>
lea    0xe91(%rip),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <h264_free@plt>
jmp    11a7 <free_mem2Dpel+0x77>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mem2Dpel>:
push   %rbx
test   %rdi,%rdi
je     1153 <free_mem2Dpel+0x23>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1168 <free_mem2Dpel+0x38>
xor    %eax,%eax
call   1040 <h264_free@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <h264_free@plt>
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xe91(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"free_mem2Dpel: trying to free unused memory\00"
define void @free_mem2Dpel(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %5, label %20
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8**, i8*** %2
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @h264_free to i32 (i8*, ...)*)(i8* %13)
br label %17
15: ; preds = %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 100)
unreachable
17: ; preds = %10
%18 = load i8**, i8*** %2
%19 = call i32 (i8**, ...) bitcast (i32 (...)* @h264_free to i32 (i8**, ...)*)(i8** %18)
br label %22
20: ; preds = %1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
unreachable
22: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"free_mem2Dpel: trying to free unused memory\00"
define void @free_mem2Dpel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @h264_free to i32 (i8*, ...)*)(i8* %4)
%8 = tail call i32 (i8**, ...) bitcast (i32 (...)* @h264_free to i32 (i8**, ...)*)(i8** %0)
ret void
9: ; preds = %3
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 100)
tail call void @exit(i32 0)
unreachable
11: ; preds = %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
}