#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 */
typedef scalar_t__ mem;

/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ free(void *);
void __tfree(void *mem) {
  if (!mem)
    return;
  assert((((void **)(mem))[-1]));
  (((void **)(mem))[-1]) = NULL;
  __tfree((((void **)(mem))[-3]));
  __tfree((((void **)(mem))[-2]));
  free((void *)((void **)(mem)-3));
}


x86 assembly (clang, -O0):
<__tfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <__tfree+0x1c>
jmp    118c <__tfree+0x5c>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,-0x8(%rax)
mov    -0x8(%rbp),%rax
mov    -0x18(%rax),%rdi
call   1050 <__tfree@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rax),%rdi
call   1050 <__tfree@plt>
mov    -0x8(%rbp),%rdi
add    $0xffffffffffffffe8,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tfree>:
test   %rdi,%rdi
je     1172 <__tfree+0x42>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    -0x8(%rdi),%rdi
call   1040 <assert@plt>
movq   $0x0,-0x8(%rbx)
lea    -0x18(%rbx),%r14
mov    -0x18(%rbx),%rdi
call   1050 <__tfree@plt>
mov    -0x10(%rbx),%rdi
call   1050 <__tfree@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @__tfree(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 %6, label %5
5: ; preds = %1
br label %28
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i8**
%9 = getelementptr inbounds i8*, i8** %8, i64 -1
%10 = load i8*, i8** %9
%11 = call i32 @assert(i8* %10)
%12 = load i8*, i8** %2
%13 = bitcast i8* %12 to i8**
%14 = getelementptr inbounds i8*, i8** %13, i64 -1
store i8* null, i8** %14
%15 = load i8*, i8** %2
%16 = bitcast i8* %15 to i8**
%17 = getelementptr inbounds i8*, i8** %16, i64 -3
%18 = load i8*, i8** %17
%19 = load i8*, i8** %2
%20 = bitcast i8* %19 to i8**
%21 = getelementptr inbounds i8*, i8** %20, i64 -2
%22 = load i8*, i8** %21
%23 = load i8*, i8** %2
%24 = bitcast i8* %23 to i8**
%25 = getelementptr inbounds i8*, i8** %24, i64 -3
%26 = bitcast i8** %25 to i8*
%27 = call i32 @free(i8* %26)
br label %28
28: ; preds = %6, %5
ret void
}

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