// File: /workspace/github_c_makefile_star2_O2/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 0x123c
testl %eax, %eax
je 0x7223
leaq 0x5eb7(%rip), %rdi      # 0xd0d8
jmp 0x726c
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x175f
cmpl $0x1, %eax
jne 0x723b
leaq 0x5e7b(%rip), %rdi      # 0xd0b4
jmp 0x726c
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x1d11
testl %eax, %eax
je 0x7252
leaq 0x5e49(%rip), %rdi      # 0xd099
jmp 0x726c
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x1f6b
cmpl $0x1, %eax
jne 0x734b
leaq 0x5e15(%rip), %rdi      # 0xd081
callq 0x1040
callq 0x1050
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x3222
testl %eax, %eax
je 0x7290
leaq 0x5ec0(%rip), %rdi      # 0xd14e
jmp 0x72d9
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x3745
cmpl $0x1, %eax
jne 0x72a8
leaq 0x5e84(%rip), %rdi      # 0xd12a
jmp 0x72d9
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x3cf7
testl %eax, %eax
je 0x72bf
leaq 0x5e52(%rip), %rdi      # 0xd10f
jmp 0x72d9
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x3f51
cmpl $0x1, %eax
jne 0x7373
leaq 0x5e1e(%rip), %rdi      # 0xd0f7
callq 0x1040
callq 0x1050
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x5208
testl %eax, %eax
je 0x72fd
leaq 0x5ec9(%rip), %rdi      # 0xd1c4
jmp 0x7342
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x572b
cmpl $0x1, %eax
jne 0x7315
leaq 0x5e8d(%rip), %rdi      # 0xd1a0
jmp 0x7342
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x5cdd
testl %eax, %eax
je 0x732c
leaq 0x5e5b(%rip), %rdi      # 0xd185
jmp 0x7342
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x5f3e
cmpl $0x1, %eax
jne 0x739b
leaq 0x5e2b(%rip), %rdi      # 0xd16d
callq 0x1040
xorl %eax, %eax
popq %rbx
retq
callq 0x1050
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x5ca8(%rip), %xmm0     # 0xd008
leaq 0x5cae(%rip), %rdi      # 0xd015
movb $0x1, %al
callq 0x1070
jmp 0x7271
callq 0x1050
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x5c80(%rip), %xmm0     # 0xd008
leaq 0x5caa(%rip), %rdi      # 0xd039
movb $0x1, %al
callq 0x1070
jmp 0x72de
callq 0x1050
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x5c58(%rip), %xmm0     # 0xd008
leaq 0x5ca6(%rip), %rdi      # 0xd05d
movb $0x1, %al
callq 0x1070
jmp 0x7347