// File: /workspace/github_c_makefile_star2_O2/OhYee[P]computer_application_programming_experiment/utils/blanced_binary_tree/test/test_blanced_binary_tree.c
// Function: main
int main() {
    mp_init(1 << 16, mp_exit);
    avl_tree *at = at_init(compare);
    at_add(at, num_init(3), sizeof(int));
    at_add(at, num_init(2), sizeof(int));
    at_add(at, num_init(5), sizeof(int));
    at_add(at, num_init(7), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(4), sizeof(int));
    at_add(at, num_init(9), sizeof(int));
    at_add(at, num_init(6), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(8), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(2), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(1), sizeof(int));
    at_add(at, num_init(1), sizeof(int));

    at_print(at);

    boolean pass = T;

    if (at_search(at, (void *)num_init(10)) == T) {
        print_ok("search 10 ok\n");
    } else {
        print_err("search 10 error\n");
        pass = F;
    }
    if (at_search(at, (void *)num_init(100)) == F) {
        print_ok("search 100 ok\n");
    } else {
        print_err("search 100 error\n");
        pass = F;
    }
    if (at_search(at, (void *)num_init(1)) == T) {
        print_ok("search 1 ok\n");
    } else {
        print_err("search 1 error\n");
        pass = F;
    }

    if (pass) {
        print_ok("All testcases passed.\n");
    } else {
        print_err("Error!\n");
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq -0x7a0(%rip), %rsi      # 0x118c
movl $0x10000, %edi          # imm = 0x10000
callq 0x1195
leaq -0x41(%rip), %rdi       # 0x18fc
callq 0x1408
movq %rax, %rbx
pushq $0x3
popq %rdi
callq 0x190f
pushq $0x4
popq %rbp
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
pushq $0x2
popq %r15
movl %r15d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
pushq $0x5
popq %rdi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
pushq $0x7
popq %rdi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %ebp, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
pushq $0x9
popq %rdi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
pushq $0x6
popq %rdi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
pushq $0x8
popq %rdi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r15d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movl %r14d, %edi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x143a
movq %rbx, %rdi
callq 0x144f
leaq 0x672(%rip), %rax       # 0x2174
movl (%rax), %ebp
pushq $0xa
popq %rdi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x141e
cmpl %ebp, %eax
jne 0x1b38
leaq 0x65a(%rip), %rdi       # 0x217c
xorl %eax, %eax
callq 0x1844
leaq 0x648(%rip), %rax       # 0x2178
movl (%rax), %r14d
movl %ebp, %r15d
jmp 0x1b53
leaq 0x64b(%rip), %rdi       # 0x218a
xorl %eax, %eax
callq 0x178c
leaq 0x62b(%rip), %rax       # 0x2178
movl (%rax), %r14d
movl %r14d, %r15d
pushq $0x64
popq %rdi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x141e
cmpl %r14d, %eax
jne 0x1b7b
leaq 0x629(%rip), %rdi       # 0x219b
xorl %eax, %eax
callq 0x1844
jmp 0x1b8c
leaq 0x628(%rip), %rdi       # 0x21aa
xorl %eax, %eax
callq 0x178c
movl %r14d, %r15d
pushq $0x1
popq %rdi
callq 0x190f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x141e
cmpl %ebp, %eax
jne 0x1bb3
leaq 0x612(%rip), %rdi       # 0x21bc
xorl %eax, %eax
callq 0x1844
jmp 0x1bc4
leaq 0x60f(%rip), %rdi       # 0x21c9
xorl %eax, %eax
callq 0x178c
movl %r14d, %r15d
testl %r15d, %r15d
je 0x1bd9
leaq 0x609(%rip), %rdi       # 0x21d9
xorl %eax, %eax
callq 0x1844
jmp 0x1be7
leaq 0x610(%rip), %rdi       # 0x21f0
xorl %eax, %eax
callq 0x178c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq