#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 */
struct pumas_recorder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ deallocate(struct pumas_recorder *);
int /*<<< orphan*/ pumas_recorder_clear(struct pumas_recorder *);
void pumas_recorder_destroy(struct pumas_recorder **recorder) {
  if ((recorder == NULL) || (*recorder == NULL))
    return;
  pumas_recorder_clear(*recorder);
  deallocate(*recorder);
  *recorder = NULL;
}


x86 assembly (clang, -O0):
<pumas_recorder_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <pumas_recorder_destroy+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114a <pumas_recorder_destroy+0x2a>
jmp    116d <pumas_recorder_destroy+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <pumas_recorder_clear@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <deallocate@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pumas_recorder_destroy>:
push   %rbx
test   %rdi,%rdi
je     1145 <pumas_recorder_destroy+0x25>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1145 <pumas_recorder_destroy+0x25>
call   1040 <pumas_recorder_clear@plt>
mov    (%rbx),%rdi
call   1030 <deallocate@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.pumas_recorder = type { i32 }
define void @pumas_recorder_destroy(%struct.pumas_recorder** %0) {
%2 = alloca %struct.pumas_recorder**
store %struct.pumas_recorder** %0, %struct.pumas_recorder*** %2
%3 = load %struct.pumas_recorder**, %struct.pumas_recorder*** %2
%4 = icmp eq %struct.pumas_recorder** %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load %struct.pumas_recorder**, %struct.pumas_recorder*** %2
%7 = load %struct.pumas_recorder*, %struct.pumas_recorder** %6
%8 = icmp eq %struct.pumas_recorder* %7, null
br i1 %8, label %9, label %10
9: ; preds = %5, %1
br label %18
10: ; preds = %5
%11 = load %struct.pumas_recorder**, %struct.pumas_recorder*** %2
%12 = load %struct.pumas_recorder*, %struct.pumas_recorder** %11
%13 = call i32 @pumas_recorder_clear(%struct.pumas_recorder* %12)
%14 = load %struct.pumas_recorder**, %struct.pumas_recorder*** %2
%15 = load %struct.pumas_recorder*, %struct.pumas_recorder** %14
%16 = call i32 @deallocate(%struct.pumas_recorder* %15)
%17 = load %struct.pumas_recorder**, %struct.pumas_recorder*** %2
store %struct.pumas_recorder* null, %struct.pumas_recorder** %17
br label %18
18: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
%struct.pumas_recorder = type { i32 }
define void @pumas_recorder_destroy(%struct.pumas_recorder** %0) {
%2 = icmp eq %struct.pumas_recorder** %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load %struct.pumas_recorder*, %struct.pumas_recorder** %0
%5 = icmp eq %struct.pumas_recorder* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @pumas_recorder_clear(%struct.pumas_recorder* %4)
%8 = load %struct.pumas_recorder*, %struct.pumas_recorder** %0
%9 = tail call i32 @deallocate(%struct.pumas_recorder* %8)
store %struct.pumas_recorder* null, %struct.pumas_recorder** %0
br label %10
10: ; preds = %1, %3, %6
ret void
}