// File: /workspace/github_cpp_makefile_star2_O1/CoderUper[P]BTree/BTree.cpp
// Function: BTree::bfs_print()
void BTree::bfs_print()
{
    if(!root) return;
    //初始化队列
    std::cout<<"init\n";
    int flag=0;
    Node* queue[num];
    memset(queue,0,sizeof(queue));
    int front=0,rear=0;
    queue[rear++]=root;
    while(front<rear)
    {
        Node *p=queue[front++];
        /*
        if(node_ptr.count(p))
        {
            std::cout<<"重复出现指针"<<p<<std::endl;
            flag=1;    
        }*/
        std::cout<<"[";
        for(int i=0;i<p->key_num;i++)
        {
            std::cout<<p->key[i]<<" ";
        }
        std::cout<<"]  ";
        //if(flag) break;
        node_ptr.insert(p);
        std::cout<<"key num in root is"<<p->key_num<<std::endl;
        for(int i=0;i<p->child_num;i++)
        {
            if(!p->is_leaf)
            {
                queue[rear++]=p->child[i];                   
                std::cout<<p->child[i]<<" ";
            }
        }
        std::cout<<"\n----------------\n";
    }
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x22c2
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
movq 0x2ebf(%rip), %rbx      # 0x4fd8
leaq 0xfcd(%rip), %rsi       # 0x30ed
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1170
movq %rsp, -0x38(%rbp)
movl 0x8(%r15), %edx
movq %rsp, %r12
leaq 0xf(,%rdx,8), %r13
andq $-0x10, %r13
movq %r12, %r14
subq %r13, %r14
movq %r14, %rsp
negq %r13
shlq $0x3, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10a0
movq (%r15), %rax
xorl %r15d, %r15d
movq %rax, (%r12,%r13)
movl $0x1, %r13d
leaq 0xf82(%rip), %r12       # 0x30f7
movq %r15, -0x40(%rbp)
movq (%r14,%r15,8), %rax
movq %rax, -0x30(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0xf63(%rip), %rsi       # 0x30f3
callq 0x1170
movq -0x30(%rbp), %rax
cmpl $0x0, 0x68(%rax)
jle 0x21ce
xorl %r15d, %r15d
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x1110
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1170
incq %r15
movq -0x30(%rbp), %rax
movslq 0x68(%rax), %rcx
cmpq %rcx, %r15
jl 0x21a2
movl $0x3, %edx
movq %rbx, %rdi
leaq 0xf18(%rip), %rsi       # 0x30f5
callq 0x1170
leaq 0x2f3f(%rip), %rdi      # 0x5128
leaq -0x30(%rbp), %rsi
callq 0x23e8
movl $0x12, %edx
movq %rbx, %rdi
leaq 0xef8(%rip), %rsi       # 0x30f9
callq 0x1170
movq -0x30(%rbp), %rax
movl 0x68(%rax), %esi
movq %rbx, %rdi
callq 0x11a0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x1130
movsbl %al, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
movq -0x30(%rbp), %rax
cmpl $0x0, 0x6c(%rax)
jle 0x2289
xorl %r15d, %r15d
cmpb $0x0, 0x78(%rax)
jne 0x2279
movq 0x30(%rax,%r15,8), %rsi
movslq %r13d, %rax
incl %r13d
movq %rsi, (%r14,%rax,8)
movq %rbx, %rdi
callq 0x10d0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1170
incq %r15
movq -0x30(%rbp), %rax
movslq 0x6c(%rax), %rcx
cmpq %rcx, %r15
jl 0x224c
movq -0x40(%rbp), %r15
incq %r15
movl $0x12, %edx
movq %rbx, %rdi
leaq 0xe6d(%rip), %rsi       # 0x310c
callq 0x1170
movslq %r13d, %rax
cmpq %rax, %r15
jl 0x2175
movq -0x38(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop