// File: /workspace/github_c_makefile_star2_O3/OhYee[P]computer_application_programming_experiment/utils/bplus_tree/test/test_bplus_tree.c
// Function: main
int main() {
    mp_init(1 << 20, mp_exit);
    a = mp_new(sizeof(int));
    bplus_tree *bpt = bpt_init(3, compare);
    bpt_add(bpt, num(1), sizeof(int));
    bpt_add(bpt, num(1), sizeof(int));
    bpt_add(bpt, num(2), sizeof(int));
    bpt_add(bpt, num(3), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(4), sizeof(int));
    bpt_add(bpt, num(4), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(5), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(6), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(7), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(8), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(9), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(10), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(11), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(18), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(19), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(12), sizeof(int));
    bpt_print(bpt);

    bpt_add(bpt, num(13), sizeof(int));
    bpt_print(bpt);

    boolean pass = T;
    int     testcases[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 18, 19};
    for (int i = 0; i < sizeof(testcases) / 8; ++i) {
        int n = testcases[i];
        if (bpt_exist(bpt, num(n)) == T) {
            print_ok("Search %d passed.\n", n);
        } else {
            print_err("Search %d has error!\n", n);
            pass = F;
        }
    }
    if (bpt_exist(bpt, num(0)) == F) {
        print_ok("Search %d passed.\n", 0);
    } else {
        print_err("Search %d has error!\n", 0);
        pass = F;
    }
    if (bpt_exist(bpt, num(23)) == F) {
        print_ok("Search %d passed.\n", 23);
    } else {
        print_err("Search %d has error!\n", 23);
        pass = F;
    }

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

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq -0xaa6(%rip), %rsi      # 0x128c
movl $0x100000, %edi         # imm = 0x100000
callq 0x1297
movl $0x4, %ebp
movl $0x4, %edi
callq 0x14d0
movq %rax, 0x3366(%rip)      # 0x50b8
leaq -0x5d(%rip), %rsi       # 0x1cfc
movl $0x3, %edi
callq 0x1574
movq %rax, %r15
movq 0x334b(%rip), %rax      # 0x50b8
movl $0x1, %r14d
movl %r14d, (%rax)
movq 0x333b(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq 0x3327(%rip), %rax      # 0x50b8
movl %r14d, (%rax)
movq 0x331d(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq 0x3309(%rip), %rax      # 0x50b8
movl $0x2, (%rax)
movq 0x32fc(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq 0x32e8(%rip), %rax      # 0x50b8
movl $0x3, (%rax)
movq 0x32db(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x32bf(%rip), %rax      # 0x50b8
movl %ebp, (%rax)
movq 0x32b6(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq 0x32a2(%rip), %rax      # 0x50b8
movl %ebp, (%rax)
movq 0x3299(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x327d(%rip), %rax      # 0x50b8
movl $0x5, (%rax)
movq 0x3270(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3254(%rip), %rax      # 0x50b8
movl $0x6, (%rax)
movq 0x3247(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x322b(%rip), %rax      # 0x50b8
movl $0x7, (%rax)
movq 0x321e(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3202(%rip), %rax      # 0x50b8
movl $0x8, (%rax)
movq 0x31f5(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x31d9(%rip), %rax      # 0x50b8
movl $0x9, (%rax)
movq 0x31cc(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x31b0(%rip), %rax      # 0x50b8
movl $0xa, (%rax)
movq 0x31a3(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3187(%rip), %rax      # 0x50b8
movl $0xb, (%rax)
movq 0x317a(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x315e(%rip), %rax      # 0x50b8
movl $0x12, (%rax)
movq 0x3151(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3135(%rip), %rax      # 0x50b8
movl $0x13, (%rax)
movq 0x3128(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x310c(%rip), %rax      # 0x50b8
movl $0xc, (%rax)
movq 0x30ff(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x30e3(%rip), %rax      # 0x50b8
movl $0xd, (%rax)
movq 0x30d6(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rbx
movq %r15, %rdi
callq 0x167c
leaq 0x116f(%rip), %rax      # 0x3170
movl (%rax), %r13d
leaq 0x1169(%rip), %rax      # 0x3174
movl (%rax), %r12d
leaq 0x116b(%rip), %r15      # 0x3180
xorl %r14d, %r14d
movl %r13d, 0x4(%rsp)
movl (%r14,%r15), %ebp
movq 0x3090(%rip), %rax      # 0x50b8
movl %ebp, (%rax)
movq 0x3087(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1691
cmpl %r13d, %eax
jne 0x2050
leaq 0x1177(%rip), %rdi      # 0x31bc
movl %ebp, %esi
xorl %eax, %eax
callq 0x1c39
jmp 0x2065
leaq 0x1178(%rip), %rdi      # 0x31cf
movl %ebp, %esi
xorl %eax, %eax
callq 0x10d0
movl %r12d, 0x4(%rsp)
addq $0x4, %r14
cmpq $0x1c, %r14
jne 0x201d
movq 0x3042(%rip), %rax      # 0x50b8
movl $0x0, (%rax)
movq 0x3035(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1691
cmpl %r12d, %eax
jne 0x20a6
leaq 0x1125(%rip), %rdi      # 0x31bc
xorl %esi, %esi
xorl %eax, %eax
callq 0x1c39
movl 0x4(%rsp), %ebp
jmp 0x20b9
leaq 0x1122(%rip), %rdi      # 0x31cf
xorl %esi, %esi
xorl %eax, %eax
callq 0x10d0
movl %r12d, %ebp
movq 0x2ff8(%rip), %rax      # 0x50b8
movl $0x17, (%rax)
movq 0x2feb(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1691
cmpl %r12d, %eax
jne 0x20ef
leaq 0x10db(%rip), %rdi      # 0x31bc
movl $0x17, %esi
xorl %eax, %eax
callq 0x1c39
jmp 0x2105
leaq 0x10d9(%rip), %rdi      # 0x31cf
movl $0x17, %esi
xorl %eax, %eax
callq 0x10d0
movl %r12d, %ebp
testl %ebp, %ebp
je 0x2119
leaq 0x10d5(%rip), %rdi      # 0x31e5
xorl %eax, %eax
callq 0x1c39
jmp 0x2127
leaq 0x10dc(%rip), %rdi      # 0x31fc
xorl %eax, %eax
callq 0x10d0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq