#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 patricia_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ptree_remove_entry_r(struct patricia_node *,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *, void *, size_t,
                                        size_t, struct patricia_node **);
void ptree_del_entry(void *str, size_t sstr, struct patricia_node **root) {
  if (!(*root))
    return;
  ptree_remove_entry_r(*root, NULL, NULL, str, sstr, sstr * 8, root);
}


x86 assembly (clang, -O0):
<ptree_del_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1137 <ptree_del_entry+0x27>
jmp    1160 <ptree_del_entry+0x50>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x10(%rbp),%r9
shl    $0x3,%r9
mov    -0x18(%rbp),%rax
xor    %edx,%edx
mov    %rdx,%rsi
mov    %rax,(%rsp)
call   1030 <ptree_remove_entry_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptree_del_entry>:
push   %rax
mov    %rdi,%rcx
mov    (%rdx),%rdi
test   %rdi,%rdi
je     1134 <ptree_del_entry+0x24>
mov    %rsi,%r8
lea    0x0(,%rsi,8),%r9
mov    %rdx,(%rsp)
xor    %esi,%esi
xor    %edx,%edx
call   1030 <ptree_remove_entry_r@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.patricia_node = type { i32 }
define void @ptree_del_entry(i8* %0, i64 %1, %struct.patricia_node** %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %struct.patricia_node**
store i8* %0, i8** %4
store i64 %1, i64* %5
store %struct.patricia_node** %2, %struct.patricia_node*** %6
%7 = load %struct.patricia_node**, %struct.patricia_node*** %6
%8 = load %struct.patricia_node*, %struct.patricia_node** %7
%9 = icmp ne %struct.patricia_node* %8, null
br i1 %9, label %11, label %10
10: ; preds = %3
br label %20
11: ; preds = %3
%12 = load %struct.patricia_node**, %struct.patricia_node*** %6
%13 = load %struct.patricia_node*, %struct.patricia_node** %12
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = load i64, i64* %5
%17 = mul i64 %16, 8
%18 = load %struct.patricia_node**, %struct.patricia_node*** %6
%19 = call i32 @ptree_remove_entry_r(%struct.patricia_node* %13, i32* null, i32* null, i8* %14, i64 %15, i64 %17, %struct.patricia_node** %18)
br label %20
20: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
%struct.patricia_node = type { i32 }
define void @ptree_del_entry(i8* %0, i64 %1, %struct.patricia_node** %2) {
%4 = load %struct.patricia_node*, %struct.patricia_node** %2
%5 = icmp eq %struct.patricia_node* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = shl i64 %1, 3
%8 = tail call i32 @ptree_remove_entry_r(%struct.patricia_node* %4, i32* null, i32* null, i8* %0, i64 %1, i64 %7, %struct.patricia_node** %2)
br label %9
9: ; preds = %3, %6
ret void
}