// File: /workspace/github_c_makefile_star2_O3/CarlosLunaMota[P]BinaryTrees/main.c
// Function: main
int main () {

    // Test size:
    int max_size = 1001;//131063;// = 2^17 - 9, which is prime.

    // Timer:
    clock_t timer;

    // Init the random seed:
    srand(time(NULL));

    // BS_Testing:
    timer = clock();
    if      (bs_tree_sequential_test(max_size) == FAIL)      { printf("bs_tree_sequential_test FAILS\n\n"); }
    else if (bs_tree_fast_sequential_test(max_size) == FAIL) { printf("bs_tree_fast_sequential_test FAILS\n\n"); }
    else if (bs_tree_random_test(max_size) == FAIL)          { printf("bs_tree_random_test FAILS\n\n"); }
    else if (bs_tree_set_test(max_size) == FAIL)             { printf("bs_tree_set_test FAILS\n\n"); }
    else { printf("\nALL BS_TESTS PASSING in %.2f sec\n\n", ((double) (clock() - timer)) / CLOCKS_PER_SEC); }

    // RB_Testing:
    timer = clock();
    if      (rb_tree_sequential_test(max_size) == FAIL)      { printf("rb_tree_sequential_test FAILS\n\n"); }
    else if (rb_tree_fast_sequential_test(max_size) == FAIL) { printf("rb_tree_fast_sequential_test FAILS\n\n"); }
    else if (rb_tree_random_test(max_size) == FAIL)          { printf("rb_tree_random_test FAILS\n\n"); }
    else if (rb_tree_set_test(max_size) == FAIL)             { printf("rb_tree_set_test FAILS\n\n"); }
    else { printf("\nALL RB_TESTS PASSING in %.2f sec\n\n", ((double) (clock() - timer)) / CLOCKS_PER_SEC); }

    // SP_Testing:
    timer = clock();
    if      (sp_tree_sequential_test(max_size) == FAIL)      { printf("sp_tree_sequential_test FAILS\n\n"); }
    else if (sp_tree_fast_sequential_test(max_size) == FAIL) { printf("sp_tree_fast_sequential_test FAILS\n\n"); }
    else if (sp_tree_random_test(max_size) == FAIL)          { printf("sp_tree_random_test FAILS\n\n"); }
    else if (sp_tree_set_test(max_size) == FAIL)             { printf("sp_tree_set_test FAILS\n\n"); }
    else { printf("\nALL SP_TESTS PASSING in %.2f sec\n\n", ((double) (clock() - timer)) / CLOCKS_PER_SEC); }

    return 0;
}

// Assembly:
pushq %rbx
xorl %edi, %edi
callq 0x10c0
movl %eax, %edi
callq 0x10a0
callq 0x1050
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x168e
testl %eax, %eax
je 0x7814
leaq 0x68c6(%rip), %rdi      # 0xe0d8
jmp 0x785d
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x1c18
cmpl $0x1, %eax
jne 0x782c
leaq 0x688a(%rip), %rdi      # 0xe0b4
jmp 0x785d
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x2243
testl %eax, %eax
je 0x7843
leaq 0x6858(%rip), %rdi      # 0xe099
jmp 0x785d
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x24b4
cmpl $0x1, %eax
jne 0x793c
leaq 0x6824(%rip), %rdi      # 0xe081
callq 0x1040
callq 0x1050
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x36ff
testl %eax, %eax
je 0x7881
leaq 0x68cf(%rip), %rdi      # 0xe14e
jmp 0x78ca
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x3c89
cmpl $0x1, %eax
jne 0x7899
leaq 0x6893(%rip), %rdi      # 0xe12a
jmp 0x78ca
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x42b4
testl %eax, %eax
je 0x78b0
leaq 0x6861(%rip), %rdi      # 0xe10f
jmp 0x78ca
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x4525
cmpl $0x1, %eax
jne 0x7964
leaq 0x682d(%rip), %rdi      # 0xe0f7
callq 0x1040
callq 0x1050
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x5770
testl %eax, %eax
je 0x78ee
leaq 0x68d8(%rip), %rdi      # 0xe1c4
jmp 0x7933
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x5cfa
cmpl $0x1, %eax
jne 0x7906
leaq 0x689c(%rip), %rdi      # 0xe1a0
jmp 0x7933
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x6325
testl %eax, %eax
je 0x791d
leaq 0x686a(%rip), %rdi      # 0xe185
jmp 0x7933
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x659b
cmpl $0x1, %eax
jne 0x798f
leaq 0x683a(%rip), %rdi      # 0xe16d
callq 0x1040
xorl %eax, %eax
popq %rbx
retq
callq 0x1050
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x66b7(%rip), %xmm0     # 0xe008
leaq 0x66bd(%rip), %rdi      # 0xe015
movb $0x1, %al
callq 0x1070
jmp 0x7862
callq 0x1050
subq %rbx, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x668c(%rip), %xmm0     # 0xe008
leaq 0x66b6(%rip), %rdi      # 0xe039
movb $0x1, %al
callq 0x1070
jmp 0x78cf
callq 0x1050
subq %rbx, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x6661(%rip), %xmm0     # 0xe008
leaq 0x66af(%rip), %rdi      # 0xe05d
movb $0x1, %al
callq 0x1070
jmp 0x7938
nop