#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 *createTree(int);
scalar_t__ dfs(struct node *, int);
int /*<<< orphan*/ free(struct node *);
int /*<<< orphan*/ insert(struct node *, int);
int /*<<< orphan*/ printf(char *);
void main() {
  struct node *head = createTree(20);
  int a[100];
  insert(head, 10);
  insert(head, 5);
  insert(head, 30);
  insert(head, 15);
  insert(head, 35);
  insert(head, 7);
  insert(head, 25);
  insert(head, 6);
  insert(head, 18);
  insert(head, 17);
  insert(head, 16);
  if (dfs(head, 35))
    printf("ele found\n");
  else
    printf("ele not found\n");
  free(head);
  head = NULL;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    $0x14,%edi
call   1040 <createTree@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1e,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0xf,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x19,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x12,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x11,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
call   1060 <insert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1070 <dfs@plt>
cmp    $0x0,%rax
je     122c <main+0xdc>
lea    0xdde(%rip),%rdi
call   1050 <printf@plt>
jmp    1238 <main+0xe8>
lea    0xdd8(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
call   1040 <createTree@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x23,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x19,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <insert@plt>
mov    %rbx,%rdi
mov    $0x23,%esi
call   1070 <dfs@plt>
test   %rax,%rax
lea    0xdfc(%rip),%rax
lea    0xe03(%rip),%rdi
cmove  %rax,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [11 x i8] c"ele found\0A\00"
@.str.1 = [15 x i8] c"ele not found\0A\00"
define void @main() {
%1 = alloca %struct.node*
%2 = alloca [100 x i32]
%3 = call %struct.node* @createTree(i32 20)
store %struct.node* %3, %struct.node** %1
%4 = load %struct.node*, %struct.node** %1
%5 = call i32 @insert(%struct.node* %4, i32 10)
%6 = load %struct.node*, %struct.node** %1
%7 = call i32 @insert(%struct.node* %6, i32 5)
%8 = load %struct.node*, %struct.node** %1
%9 = call i32 @insert(%struct.node* %8, i32 30)
%10 = load %struct.node*, %struct.node** %1
%11 = call i32 @insert(%struct.node* %10, i32 15)
%12 = load %struct.node*, %struct.node** %1
%13 = call i32 @insert(%struct.node* %12, i32 35)
%14 = load %struct.node*, %struct.node** %1
%15 = call i32 @insert(%struct.node* %14, i32 7)
%16 = load %struct.node*, %struct.node** %1
%17 = call i32 @insert(%struct.node* %16, i32 25)
%18 = load %struct.node*, %struct.node** %1
%19 = call i32 @insert(%struct.node* %18, i32 6)
%20 = load %struct.node*, %struct.node** %1
%21 = call i32 @insert(%struct.node* %20, i32 18)
%22 = load %struct.node*, %struct.node** %1
%23 = call i32 @insert(%struct.node* %22, i32 17)
%24 = load %struct.node*, %struct.node** %1
%25 = call i32 @insert(%struct.node* %24, i32 16)
%26 = load %struct.node*, %struct.node** %1
%27 = call i64 @dfs(%struct.node* %26, i32 35)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %0
%30 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %33
31: ; preds = %0
%32 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
%34 = load %struct.node*, %struct.node** %1
%35 = call i32 @free(%struct.node* %34)
store %struct.node* null, %struct.node** %1
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
@str = [14 x i8] c"ele not found\00"
@str.2 = [10 x i8] c"ele found\00"
define void @main() {
%1 = tail call %struct.node* @createTree(i32 20)
%2 = tail call i32 @insert(%struct.node* %1, i32 10)
%3 = tail call i32 @insert(%struct.node* %1, i32 5)
%4 = tail call i32 @insert(%struct.node* %1, i32 30)
%5 = tail call i32 @insert(%struct.node* %1, i32 15)
%6 = tail call i32 @insert(%struct.node* %1, i32 35)
%7 = tail call i32 @insert(%struct.node* %1, i32 7)
%8 = tail call i32 @insert(%struct.node* %1, i32 25)
%9 = tail call i32 @insert(%struct.node* %1, i32 6)
%10 = tail call i32 @insert(%struct.node* %1, i32 18)
%11 = tail call i32 @insert(%struct.node* %1, i32 17)
%12 = tail call i32 @insert(%struct.node* %1, i32 16)
%13 = tail call i64 @dfs(%struct.node* %1, i32 35)
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0)
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
%17 = tail call i32 @free(%struct.node* %1)
ret void
}