// File: /workspace/github_c_makefile_star2_O1/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 -0xa82(%rip), %rsi      # 0x128c
movl $0x100000, %edi         # imm = 0x100000
callq 0x1297
movl $0x4, %ebp
movl $0x4, %edi
callq 0x14cc
movq %rax, 0x338a(%rip)      # 0x50b8
leaq -0x5d(%rip), %rsi       # 0x1cd8
movl $0x3, %edi
callq 0x1574
movq %rax, %r15
movq 0x336f(%rip), %rax      # 0x50b8
movl $0x1, %r14d
movl %r14d, (%rax)
movq 0x335f(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq 0x334b(%rip), %rax      # 0x50b8
movl %r14d, (%rax)
movq 0x3341(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq 0x332d(%rip), %rax      # 0x50b8
movl $0x2, (%rax)
movq 0x3320(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq 0x330c(%rip), %rax      # 0x50b8
movl $0x3, (%rax)
movq 0x32ff(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x32e3(%rip), %rax      # 0x50b8
movl %ebp, (%rax)
movq 0x32da(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq 0x32c6(%rip), %rax      # 0x50b8
movl %ebp, (%rax)
movq 0x32bd(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x32a1(%rip), %rax      # 0x50b8
movl $0x5, (%rax)
movq 0x3294(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3278(%rip), %rax      # 0x50b8
movl $0x6, (%rax)
movq 0x326b(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x324f(%rip), %rax      # 0x50b8
movl $0x7, (%rax)
movq 0x3242(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3226(%rip), %rax      # 0x50b8
movl $0x8, (%rax)
movq 0x3219(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x31fd(%rip), %rax      # 0x50b8
movl $0x9, (%rax)
movq 0x31f0(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x31d4(%rip), %rax      # 0x50b8
movl $0xa, (%rax)
movq 0x31c7(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x31ab(%rip), %rax      # 0x50b8
movl $0xb, (%rax)
movq 0x319e(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3182(%rip), %rax      # 0x50b8
movl $0x12, (%rax)
movq 0x3175(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3159(%rip), %rax      # 0x50b8
movl $0x13, (%rax)
movq 0x314c(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3130(%rip), %rax      # 0x50b8
movl $0xc, (%rax)
movq 0x3123(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rdi
callq 0x167c
movq 0x3107(%rip), %rax      # 0x50b8
movl $0xd, (%rax)
movq 0x30fa(%rip), %rsi      # 0x50b8
movq %r15, %rdi
movl $0x4, %edx
callq 0x159b
movq %r15, %rbx
movq %r15, %rdi
callq 0x167c
leaq 0x1193(%rip), %rax      # 0x3170
movl (%rax), %r12d
leaq 0x118d(%rip), %rax      # 0x3174
movl (%rax), %r13d
leaq 0x118f(%rip), %r15      # 0x3180
xorl %r14d, %r14d
movl %r12d, 0x4(%rsp)
movl (%r14,%r15), %ebp
movq 0x30b4(%rip), %rax      # 0x50b8
movl %ebp, (%rax)
movq 0x30ab(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1691
cmpl %r12d, %eax
jne 0x202c
leaq 0x119b(%rip), %rdi      # 0x31bc
movl %ebp, %esi
xorl %eax, %eax
callq 0x1c15
jmp 0x2041
leaq 0x119c(%rip), %rdi      # 0x31cf
movl %ebp, %esi
xorl %eax, %eax
callq 0x10d0
movl %r13d, 0x4(%rsp)
addq $0x4, %r14
cmpq $0x1c, %r14
jne 0x1ff9
movq 0x3066(%rip), %rax      # 0x50b8
movl $0x0, (%rax)
movq 0x3059(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1691
leaq 0x1106(%rip), %rcx      # 0x3174
movl (%rcx), %ebp
cmpl %ebp, %eax
jne 0x208b
leaq 0x1141(%rip), %rdi      # 0x31bc
xorl %esi, %esi
xorl %eax, %eax
callq 0x1c15
movl 0x4(%rsp), %r14d
jmp 0x209e
leaq 0x113d(%rip), %rdi      # 0x31cf
xorl %esi, %esi
xorl %eax, %eax
callq 0x10d0
movl %ebp, %r14d
movq 0x3013(%rip), %rax      # 0x50b8
movl $0x17, (%rax)
movq 0x3006(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1691
cmpl %ebp, %eax
jne 0x20d3
leaq 0x10f7(%rip), %rdi      # 0x31bc
movl $0x17, %esi
xorl %eax, %eax
callq 0x1c15
jmp 0x20e9
leaq 0x10f5(%rip), %rdi      # 0x31cf
movl $0x17, %esi
xorl %eax, %eax
callq 0x10d0
movl %ebp, %r14d
testl %r14d, %r14d
je 0x20fe
leaq 0x10f0(%rip), %rdi      # 0x31e5
xorl %eax, %eax
callq 0x1c15
jmp 0x210c
leaq 0x10f7(%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