// File: /workspace/github_c_makefile_star2_O3/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 -0x806(%rip), %rsi      # 0x125c
movl $0x10000, %edi          # imm = 0x10000
callq 0x1267
leaq -0x43(%rip), %rdi       # 0x1a30
callq 0x1544
movq %rax, %rbx
movl $0x4, %edi
callq 0x14a0
movl $0x3, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl $0x2, %r14d
movl %r14d, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl $0x5, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl $0x7, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl $0x1, %ebp
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl $0x4, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl $0x9, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl $0x6, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl $0x8, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %r14d, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movl $0x4, %edi
callq 0x14a0
movl %ebp, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x157b
movq %rbx, %rdi
callq 0x1590
leaq 0x491(%rip), %rax       # 0x2174
movl (%rax), %ebp
movl $0x4, %edi
callq 0x14a0
movl $0xa, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x155f
cmpl %ebp, %eax
jne 0x1d21
leaq 0x471(%rip), %rdi       # 0x217c
xorl %eax, %eax
callq 0x196d
leaq 0x45f(%rip), %rax       # 0x2178
movl (%rax), %r14d
movl %ebp, %r15d
jmp 0x1d3c
leaq 0x462(%rip), %rdi       # 0x218a
xorl %eax, %eax
callq 0x10a0
leaq 0x442(%rip), %rax       # 0x2178
movl (%rax), %r14d
movl %r14d, %r15d
movl $0x4, %edi
callq 0x14a0
movl $0x64, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x155f
cmpl %r14d, %eax
jne 0x1d6c
leaq 0x438(%rip), %rdi       # 0x219b
xorl %eax, %eax
callq 0x196d
jmp 0x1d7d
leaq 0x437(%rip), %rdi       # 0x21aa
xorl %eax, %eax
callq 0x10a0
movl %r14d, %r15d
movl $0x4, %edi
callq 0x14a0
movl $0x1, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x155f
cmpl %ebp, %eax
jne 0x1dac
leaq 0x419(%rip), %rdi       # 0x21bc
xorl %eax, %eax
callq 0x196d
jmp 0x1dbd
leaq 0x416(%rip), %rdi       # 0x21c9
xorl %eax, %eax
callq 0x10a0
movl %r14d, %r15d
testl %r15d, %r15d
je 0x1dd2
leaq 0x410(%rip), %rdi       # 0x21d9
xorl %eax, %eax
callq 0x196d
jmp 0x1de0
leaq 0x417(%rip), %rdi       # 0x21f0
xorl %eax, %eax
callq 0x10a0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq