// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, (%rax)
jne 0x2d9f
jmp 0x2f89
movq 0x4232(%rip), %rdi      # 0x6fd8
leaq 0x1359(%rip), %rsi      # 0x4106
callq 0x1110
movq -0x58(%rbp), %rax
movl $0x0, -0xc(%rbp)
movl 0x8(%rax), %eax
movl %eax, %edx
movq %rsp, %rax
movq %rax, -0x18(%rbp)
leaq 0xf(,%rdx,8), %rax
andq $-0x10, %rax
movq %rsp, %rdi
subq %rax, %rdi
movq %rdi, -0x60(%rbp)
movq %rdi, %rsp
movq %rdx, -0x20(%rbp)
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x10a0
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %rax
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq (%rcx), %rdx
movl -0x28(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x28(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x2f82
movq -0x60(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq 0x418f(%rip), %rdi      # 0x6fd8
leaq 0x12bc(%rip), %rsi      # 0x410c
callq 0x1110
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x68(%rcx), %eax
jge 0x2e9a
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x415d(%rip), %rdi      # 0x6fd8
callq 0x11b0
movq %rax, %rdi
leaq 0x1286(%rip), %rsi      # 0x4110
callq 0x1110
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2e5c
movq 0x4137(%rip), %rdi      # 0x6fd8
leaq 0x1266(%rip), %rsi      # 0x410e
callq 0x1110
leaq 0x4274(%rip), %rdi      # 0x7128
leaq -0x30(%rbp), %rsi
callq 0x3300
movq %rax, -0x48(%rbp)
movb %dl, -0x40(%rbp)
movq 0x410d(%rip), %rdi      # 0x6fd8
leaq 0x1240(%rip), %rsi      # 0x4112
callq 0x1110
movq %rax, %rdi
movq -0x30(%rbp), %rax
movl 0x68(%rax), %esi
callq 0x1190
movq %rax, %rdi
movq 0x40d8(%rip), %rsi      # 0x6fc8
callq 0x1150
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jge 0x2f6a
movq -0x30(%rbp), %rax
testb $0x1, 0x78(%rax)
jne 0x2f5d
movq -0x60(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq -0x4c(%rbp), %rdx
movq 0x30(%rcx,%rdx,8), %rdx
movl -0x28(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x28(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq 0x30(%rax,%rcx,8), %rsi
movq 0x408f(%rip), %rdi      # 0x6fd8
callq 0x10c0
movq %rax, %rdi
leaq 0x11b8(%rip), %rsi      # 0x4110
callq 0x1110
jmp 0x2f5f
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x2efc
movq 0x4067(%rip), %rdi      # 0x6fd8
leaq 0x11ad(%rip), %rsi      # 0x4125
callq 0x1110
jmp 0x2e1c
movq -0x18(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nop