#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 *insert(struct node *, int);
int /*<<< orphan*/ printPreOrder(struct node *);
int /*<<< orphan*/ printf(char *);
int main() {
  struct node *root = NULL;
  root = insert(root, 10);
  root = insert(root, 20);
  root = insert(root, 30);
  root = insert(root, 40);
  root = insert(root, 50);
  root = insert(root, 25);
  printf("Pre order traversal of the constructed AVL tree is \n");
  printPreOrder(root);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1e,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x28,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x32,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x19,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
lea    0xe46(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <printPreOrder@plt>
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
mov    $0xa,%esi
call   1060 <insert@plt>
mov    %rax,%rdi
mov    $0x14,%esi
call   1060 <insert@plt>
mov    %rax,%rdi
mov    $0x1e,%esi
call   1060 <insert@plt>
mov    %rax,%rdi
mov    $0x28,%esi
call   1060 <insert@plt>
mov    %rax,%rdi
mov    $0x32,%esi
call   1060 <insert@plt>
mov    %rax,%rdi
mov    $0x19,%esi
call   1060 <insert@plt>
mov    %rax,%rbx
lea    0xe68(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <printPreOrder@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [53 x i8] c"Pre order traversal of the constructed AVL tree is \0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = call %struct.node* @insert(%struct.node* %3, i32 10)
store %struct.node* %4, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call %struct.node* @insert(%struct.node* %5, i32 20)
store %struct.node* %6, %struct.node** %2
%7 = load %struct.node*, %struct.node** %2
%8 = call %struct.node* @insert(%struct.node* %7, i32 30)
store %struct.node* %8, %struct.node** %2
%9 = load %struct.node*, %struct.node** %2
%10 = call %struct.node* @insert(%struct.node* %9, i32 40)
store %struct.node* %10, %struct.node** %2
%11 = load %struct.node*, %struct.node** %2
%12 = call %struct.node* @insert(%struct.node* %11, i32 50)
store %struct.node* %12, %struct.node** %2
%13 = load %struct.node*, %struct.node** %2
%14 = call %struct.node* @insert(%struct.node* %13, i32 25)
store %struct.node* %14, %struct.node** %2
%15 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%16 = load %struct.node*, %struct.node** %2
%17 = call i32 @printPreOrder(%struct.node* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@str = [52 x i8] c"Pre order traversal of the constructed AVL tree is \00"
define i32 @main() {
%1 = tail call %struct.node* @insert(%struct.node* null, i32 10)
%2 = tail call %struct.node* @insert(%struct.node* %1, i32 20)
%3 = tail call %struct.node* @insert(%struct.node* %2, i32 30)
%4 = tail call %struct.node* @insert(%struct.node* %3, i32 40)
%5 = tail call %struct.node* @insert(%struct.node* %4, i32 50)
%6 = tail call %struct.node* @insert(%struct.node* %5, i32 25)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @printPreOrder(%struct.node* %6)
%9 = tail call i32 @putchar(i32 10)
ret i32 0
}