#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_delete();
int /*<<< orphan*/ test_diameterOfBST();
int /*<<< orphan*/ test_find();
int /*<<< orphan*/ test_findMaxBST();
int /*<<< orphan*/ test_findMinBST();
int /*<<< orphan*/ test_initializeBST();
int /*<<< orphan*/ test_inorderTraversal();
int /*<<< orphan*/ test_insert();
int /*<<< orphan*/ test_levelOrder();
int /*<<< orphan*/ test_numFullNodes();
int /*<<< orphan*/ test_numLeaves();
int /*<<< orphan*/ test_numNodes();
int /*<<< orphan*/ test_perfectBST();
int /*<<< orphan*/ test_printRangeKeys();
int /*<<< orphan*/ test_randBST();
int /*<<< orphan*/ test_same();
int /*<<< orphan*/ test_similar();
int main() {
  printf("///////////////////////\n");
  printf("// BINARY SEARCH TREE TEST\n");
  printf("///////////////////////\n\n");
  test_initializeBST();
  test_find();
  printf("\n");
  test_findMinBST();
  printf("\n");
  test_findMaxBST();
  printf("\n");
  test_insert();
  test_delete();
  test_numNodes();
  printf("\n");
  test_numLeaves();
  printf("\n");
  test_numFullNodes();
  printf("\n");
  test_randBST();
  printf("\n");
  test_perfectBST();
  printf("\n");
  test_printRangeKeys();
  printf("\n\n");
  test_levelOrder();
  printf("\n\n");
  test_similar();
  printf("\n\n");
  test_same();
  printf("\n\n");
  test_inorderTraversal();
  printf("\n\n");
  test_diameterOfBST();
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xdca(%rip),%rdi
call   1070 <printf@plt>
lea    0xdd7(%rip),%rdi
call   1070 <printf@plt>
lea    0xde7(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1060 <test_initializeBST@plt>
mov    $0x0,%al
call   10f0 <test_find@plt>
lea    0xde5(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1080 <test_findMinBST@plt>
lea    0xdd2(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10a0 <test_findMaxBST@plt>
lea    0xdbf(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1140 <test_insert@plt>
mov    $0x0,%al
call   10c0 <test_delete@plt>
mov    $0x0,%al
call   1110 <test_numNodes@plt>
lea    0xd9e(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10d0 <test_numLeaves@plt>
lea    0xd8b(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1030 <test_numFullNodes@plt>
lea    0xd78(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1120 <test_randBST@plt>
lea    0xd65(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10e0 <test_perfectBST@plt>
lea    0xd52(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1090 <test_printRangeKeys@plt>
lea    0xd3e(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1100 <test_levelOrder@plt>
lea    0xd2b(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1130 <test_similar@plt>
lea    0xd18(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10b0 <test_same@plt>
lea    0xd05(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1050 <test_inorderTraversal@plt>
lea    0xcf2(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <test_diameterOfBST@plt>
lea    0xcdf(%rip),%rdi
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xdc8(%rip),%rdi
call   1050 <puts@plt>
lea    0xdd4(%rip),%rdi
call   1050 <puts@plt>
lea    0xde3(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1080 <test_initializeBST@plt>
xor    %eax,%eax
call   1100 <test_find@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1090 <test_findMinBST@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   10b0 <test_findMaxBST@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1150 <test_insert@plt>
xor    %eax,%eax
call   10d0 <test_delete@plt>
xor    %eax,%eax
call   1120 <test_numNodes@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   10e0 <test_numLeaves@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1030 <test_numFullNodes@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1130 <test_randBST@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   10f0 <test_perfectBST@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   10a0 <test_printRangeKeys@plt>
lea    0xd4a(%rip),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1110 <test_levelOrder@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1140 <test_similar@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   10c0 <test_same@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <test_inorderTraversal@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1060 <test_diameterOfBST@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"///////////////////////\0A\00"
@.str.1 = [28 x i8] c"// BINARY SEARCH TREE TEST\0A\00"
@.str.2 = [26 x i8] c"///////////////////////\0A\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @test_initializeBST()
%6 = call i32 (...) @test_find()
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (...) @test_findMinBST()
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (...) @test_findMaxBST()
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (...) @test_insert()
%13 = call i32 (...) @test_delete()
%14 = call i32 (...) @test_numNodes()
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (...) @test_numLeaves()
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (...) @test_numFullNodes()
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 (...) @test_randBST()
%21 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 (...) @test_perfectBST()
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%24 = call i32 (...) @test_printRangeKeys()
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 (...) @test_levelOrder()
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%28 = call i32 (...) @test_similar()
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 (...) @test_same()
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 (...) @test_inorderTraversal()
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%34 = call i32 (...) @test_diameterOfBST()
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"///////////////////////\00"
@str.5 = [27 x i8] c"// BINARY SEARCH TREE TEST\00"
@str.6 = [25 x i8] c"///////////////////////\0A\00"
@str.12 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 (...) @test_initializeBST()
%5 = tail call i32 (...) @test_find()
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 (...) @test_findMinBST()
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 (...) @test_findMaxBST()
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 (...) @test_insert()
%12 = tail call i32 (...) @test_delete()
%13 = tail call i32 (...) @test_numNodes()
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 (...) @test_numLeaves()
%16 = tail call i32 @putchar(i32 10)
%17 = tail call i32 (...) @test_numFullNodes()
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 (...) @test_randBST()
%20 = tail call i32 @putchar(i32 10)
%21 = tail call i32 (...) @test_perfectBST()
%22 = tail call i32 @putchar(i32 10)
%23 = tail call i32 (...) @test_printRangeKeys()
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.12, i64 0, i64 0))
%25 = tail call i32 (...) @test_levelOrder()
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.12, i64 0, i64 0))
%27 = tail call i32 (...) @test_similar()
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.12, i64 0, i64 0))
%29 = tail call i32 (...) @test_same()
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.12, i64 0, i64 0))
%31 = tail call i32 (...) @test_inorderTraversal()
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.12, i64 0, i64 0))
%33 = tail call i32 (...) @test_diameterOfBST()
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.12, i64 0, i64 0))
ret i32 0
}