// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl $0x0, -0x4(%rbp)
movl $0x100000, %edi         # imm = 0x100000
leaq -0x111e(%rip), %rsi     # 0x11b0
callq 0x11c0
movl $0x4, %edi
callq 0x14d0
movq %rax, 0x2dcc(%rip)      # 0x50b0
movl $0x3, %edi
leaq -0xb0(%rip), %rsi       # 0x2240
callq 0x15a0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl $0x1, %edi
callq 0x2290
movq -0xe0(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl $0x1, %edi
callq 0x2290
movq -0xd8(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl $0x2, %edi
callq 0x2290
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl $0x3, %edi
callq 0x2290
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
movl $0x4, %edi
callq 0x2290
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl $0x4, %edi
callq 0x2290
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl $0x5, %edi
callq 0x2290
movq -0xb0(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x6, %edi
callq 0x2290
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl $0x7, %edi
callq 0x2290
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x8, %edi
callq 0x2290
movq -0x98(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x9, %edi
callq 0x2290
movq -0x90(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0xa, %edi
callq 0x2290
movq -0x88(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movl $0xb, %edi
callq 0x2290
movq -0x80(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movl $0x12, %edi
callq 0x2290
movq -0x78(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x13, %edi
callq 0x2290
movq -0x70(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0xc, %edi
callq 0x2290
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0xd, %edi
callq 0x2290
movq -0x60(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x15f0
movq -0x10(%rbp), %rdi
callq 0x1760
leaq 0xb64(%rip), %rax       # 0x3174
movl (%rax), %eax
movl %eax, -0x14(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xb60(%rip), %rsi       # 0x3180
movl $0x3c, %edx
callq 0x1060
movl $0x0, -0x54(%rbp)
movslq -0x54(%rbp), %rax
cmpq $0x7, %rax
jae 0x26b0
movslq -0x54(%rbp), %rax
movl -0x50(%rbp,%rax,4), %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe8(%rbp)
movl -0x58(%rbp), %edi
callq 0x2290
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x1790
leaq 0xb05(%rip), %rcx       # 0x3174
cmpl (%rcx), %eax
jne 0x2686
movl -0x58(%rbp), %esi
leaq 0xb3f(%rip), %rdi       # 0x31bc
movb $0x0, %al
callq 0x2180
jmp 0x26a3
movl -0x58(%rbp), %esi
leaq 0xb3f(%rip), %rdi       # 0x31cf
movb $0x0, %al
callq 0x20c0
leaq 0xada(%rip), %rax       # 0x3178
movl (%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x26a5
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2631
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
xorl %edi, %edi
callq 0x2290
movq -0xf0(%rbp), %rdi
movq %rax, %rsi
callq 0x1790
leaq 0xaa0(%rip), %rcx       # 0x3178
cmpl (%rcx), %eax
jne 0x26ee
leaq 0xad9(%rip), %rdi       # 0x31bc
xorl %esi, %esi
movb $0x0, %al
callq 0x2180
jmp 0x270a
leaq 0xada(%rip), %rdi       # 0x31cf
xorl %esi, %esi
movb $0x0, %al
callq 0x20c0
leaq 0xa73(%rip), %rax       # 0x3178
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
movl $0x17, %edi
callq 0x2290
movq -0xf8(%rbp), %rdi
movq %rax, %rsi
callq 0x1790
leaq 0xa43(%rip), %rcx       # 0x3178
cmpl (%rcx), %eax
jne 0x274e
leaq 0xa7c(%rip), %rdi       # 0x31bc
movl $0x17, %esi
movb $0x0, %al
callq 0x2180
jmp 0x276d
leaq 0xa7a(%rip), %rdi       # 0x31cf
movl $0x17, %esi
movb $0x0, %al
callq 0x20c0
leaq 0xa10(%rip), %rax       # 0x3178
movl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x2783
leaq 0xa6b(%rip), %rdi       # 0x31e5
movb $0x0, %al
callq 0x2180
jmp 0x2791
leaq 0xa72(%rip), %rdi       # 0x31fc
movb $0x0, %al
callq 0x20c0
xorl %eax, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq