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

/* Variables and functions */
struct node *delete (struct node *, int);
struct node *insert(struct node *, int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ search(struct node *, int);
int main(void) {
  struct node *root;
  root = insert(root, 5);
  root = insert(root, 6);
  root = insert(root, 7);
  root = insert(root, 8);
  root = insert(root, 9);
  root = insert(root, 10);
  root = delete (root, 9);
  if (search(root, 9)) {
    printf("%d Data Found\n", 9);
  }
  if (search(root, 10)) {
    printf("%d Data Found\n", 10);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1060 <delete@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1040 <search@plt>
cmp    $0x0,%rax
je     11f6 <main+0xb6>
lea    0xe14(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <search@plt>
cmp    $0x0,%rax
je     121f <main+0xdf>
lea    0xdeb(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%esi
call   1050 <insert@plt>
mov    %rax,%rdi
mov    $0x6,%esi
call   1050 <insert@plt>
mov    %rax,%rdi
mov    $0x7,%esi
call   1050 <insert@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   1050 <insert@plt>
mov    %rax,%rdi
mov    $0x9,%esi
call   1050 <insert@plt>
mov    %rax,%rdi
mov    $0xa,%esi
call   1050 <insert@plt>
mov    %rax,%rdi
mov    $0x9,%esi
call   1060 <delete@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x9,%esi
call   1040 <search@plt>
test   %rax,%rax
je     11bf <main+0x7f>
lea    0xe4b(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <search@plt>
test   %rax,%rax
je     11e2 <main+0xa2>
lea    0xe28(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [15 x i8] c"%d Data Found\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
%3 = load %struct.node*, %struct.node** %2
%4 = call %struct.node* @insert(%struct.node* %3, i32 5)
store %struct.node* %4, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call %struct.node* @insert(%struct.node* %5, i32 6)
store %struct.node* %6, %struct.node** %2
%7 = load %struct.node*, %struct.node** %2
%8 = call %struct.node* @insert(%struct.node* %7, i32 7)
store %struct.node* %8, %struct.node** %2
%9 = load %struct.node*, %struct.node** %2
%10 = call %struct.node* @insert(%struct.node* %9, i32 8)
store %struct.node* %10, %struct.node** %2
%11 = load %struct.node*, %struct.node** %2
%12 = call %struct.node* @insert(%struct.node* %11, i32 9)
store %struct.node* %12, %struct.node** %2
%13 = load %struct.node*, %struct.node** %2
%14 = call %struct.node* @insert(%struct.node* %13, i32 10)
store %struct.node* %14, %struct.node** %2
%15 = load %struct.node*, %struct.node** %2
%16 = call %struct.node* @delete(%struct.node* %15, i32 9)
store %struct.node* %16, %struct.node** %2
%17 = load %struct.node*, %struct.node** %2
%18 = call i64 @search(%struct.node* %17, i32 9)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 9)
br label %22
22: ; preds = %20, %0
%23 = load %struct.node*, %struct.node** %2
%24 = call i64 @search(%struct.node* %23, i32 10)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10)
br label %28
28: ; preds = %26, %22
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [15 x i8] c"%d Data Found\0A\00"
define i32 @main() {
%1 = tail call %struct.node* @insert(%struct.node* undef, i32 5)
%2 = tail call %struct.node* @insert(%struct.node* %1, i32 6)
%3 = tail call %struct.node* @insert(%struct.node* %2, i32 7)
%4 = tail call %struct.node* @insert(%struct.node* %3, i32 8)
%5 = tail call %struct.node* @insert(%struct.node* %4, i32 9)
%6 = tail call %struct.node* @insert(%struct.node* %5, i32 10)
%7 = tail call %struct.node* @delete(%struct.node* %6, i32 9)
%8 = tail call i64 @search(%struct.node* %7, i32 9)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %0
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 9)
br label %12
12: ; preds = %10, %0
%13 = tail call i64 @search(%struct.node* %7, i32 10)
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10)
br label %17
17: ; preds = %15, %12
ret i32 0
}