// File: /workspace/github_c_makefile_star2_O1/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 0x7700
leaq 0x69da(%rip), %rdi      # 0xe0d8
jmp 0x7749
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x1bea
cmpl $0x1, %eax
jne 0x7718
leaq 0x699e(%rip), %rdi      # 0xe0b4
jmp 0x7749
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x21e7
testl %eax, %eax
je 0x772f
leaq 0x696c(%rip), %rdi      # 0xe099
jmp 0x7749
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x2458
cmpl $0x1, %eax
jne 0x7828
leaq 0x6938(%rip), %rdi      # 0xe081
callq 0x1040
callq 0x1050
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x36a3
testl %eax, %eax
je 0x776d
leaq 0x69e3(%rip), %rdi      # 0xe14e
jmp 0x77b6
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x3bff
cmpl $0x1, %eax
jne 0x7785
leaq 0x69a7(%rip), %rdi      # 0xe12a
jmp 0x77b6
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x41fc
testl %eax, %eax
je 0x779c
leaq 0x6975(%rip), %rdi      # 0xe10f
jmp 0x77b6
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x446d
cmpl $0x1, %eax
jne 0x7850
leaq 0x6941(%rip), %rdi      # 0xe0f7
callq 0x1040
callq 0x1050
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x56b8
testl %eax, %eax
je 0x77da
leaq 0x69ec(%rip), %rdi      # 0xe1c4
jmp 0x781f
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x5c14
cmpl $0x1, %eax
jne 0x77f2
leaq 0x69b0(%rip), %rdi      # 0xe1a0
jmp 0x781f
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x6211
testl %eax, %eax
je 0x7809
leaq 0x697e(%rip), %rdi      # 0xe185
jmp 0x781f
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x6487
cmpl $0x1, %eax
jne 0x787b
leaq 0x694e(%rip), %rdi      # 0xe16d
callq 0x1040
xorl %eax, %eax
popq %rbx
retq
callq 0x1050
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x67cb(%rip), %xmm0     # 0xe008
leaq 0x67d1(%rip), %rdi      # 0xe015
movb $0x1, %al
callq 0x1070
jmp 0x774e
callq 0x1050
subq %rbx, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x67a0(%rip), %xmm0     # 0xe008
leaq 0x67ca(%rip), %rdi      # 0xe039
movb $0x1, %al
callq 0x1070
jmp 0x77bb
callq 0x1050
subq %rbx, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x6775(%rip), %xmm0     # 0xe008
leaq 0x67c3(%rip), %rdi      # 0xe05d
movb $0x1, %al
callq 0x1070
jmp 0x7824
nop