// File: JainamS1996[P]Btree_DataStructure/final.cpp
// Function: splitNode(Node*)
void splitNode(Node *curNode) {
    if (curNode->isleaf) {
        Node *rNode = new Node();
        //curNode->next = rNode;
        rNode->prev = curNode;
        if (curNode->next == NULL) {
            curNode->next = rNode;
        }
        else {
            rNode->next = curNode->next;
            rNode->next->prev = rNode;
            curNode->next = rNode;
        }
        int x = order/2;
        //cout<< x << endl;
        //cout << curNode->record.size() << endl;
        for (int i = curNode->record.size()/2; i<curNode->record.size(); i++)
            rNode->record.push_back(curNode->record.at(i));
        rNode->nNodes = rNode->record.size();
        //cout << rNode->record.size() << endl;
        int z = curNode->record.size() - curNode->record.size()/2;
        curNode->record.erase(curNode->record.begin() + curNode->record.size()/2, curNode->record.end());
        curNode->nNodes = curNode->record.size();
        //cout << curNode->record.size() <<endl;    
        
        // sort(rNode->record.begin(),rNode->record.end());
        // cout << get<0>(rNode->record.at(0));
        if (curNode->parentNode == NULL) {
            Node *pNode = new Node(false);
            pNode->children.push_back(curNode);
            pNode->children.push_back(rNode);
            curNode->parentNode = pNode;
            rNode->parentNode = pNode;
            pNode->keys.push_back(get<0>(rNode->record.at(0)));
            curNode->parentNode->nNodes++;
            //cout<< pNode->keys.at(0)<<endl;
            rootNode = pNode;
            //cout<< rootNode->keys.at(0)<<endl;
            
        }
        else {
            //cout << "hello this is else";
            rNode->parentNode = curNode->parentNode;
           
            curNode->parentNode->keys.push_back(get<0>(rNode->record.at(0)));
            
            sort(curNode->parentNode->keys.begin(),curNode->parentNode->keys.end());
            // for (int i = 0; i< curNode->parentNode->keys.size(); i++)
            //         cout<<curNode->parentNode->keys.at(i)<<endl;
            
            // cout<< "Rnode pkeys :";
            // for (int x = 0; x < rNode->parentNode->keys.size(); x++)
            //         cout<<rNode->parentNode->keys.at(x)<<endl;
                
            curNode->parentNode->children.push_back(rNode);
            //cout<< "ye hua?"<<endl;
            // for (int i = 0; i<curNode->parentNode->children.size();i++)
            //  cout<<get<0>(curNode->parentNode->children.at(i)->record.at(0))<<endl;

            sort(curNode->parentNode->children.begin(),curNode->parentNode->children.end(),childSort);
            curNode->parentNode->nNodes++;
        

                

            if (curNode->parentNode->keys.size() > order-1) {
                
                //cout<<"aa bhi raha hai idhar?     "<<curNode->parentNode->keys.size()<<endl;
                curNode->parentNode->nNodes--;
                // for (int i = 0; i< curNode->parentNode->keys.size(); i++)
                //     cout<<curNode->parentNode->keys.at(i)<<endl;
                splitNode(curNode->parentNode);
             }
            // else {
            //     cout<< "Poora nahi hua" << curNode->parentNode->keys.size() <<endl;
            // }
            
        }
    
    }
    else {                  //INTERNAL NODES 
        Node *rNode = new Node(false);
        //cout << "hello this is the internalnode style"<<endl;
        int x = order/2;
        //cout<< x << endl;
        //cout << curNode->keys.size() << endl;
        for (int i = curNode->keys.size()/2; i<curNode->keys.size(); i++)
            rNode->keys.push_back(curNode->keys.at(i));
        
        //int z = curNode->keys.size() - curNode->keys.size()/2;
        curNode->keys.erase(curNode->keys.begin() + curNode->keys.size()/2, curNode->keys.end());
        // cout << curNode->keys.size() << endl;
        // cout << rNode->keys.size() << endl;
        rNode->nNodes = rNode->record.size();
        curNode->nNodes = curNode->record.size();

        // DISTRIBUTING THE CHILDREN TOO
        if (curNode->children.size()%2) {
            for (int i = curNode->children.size()/2+1; i<curNode->children.size();i++) {
                rNode->children.push_back(curNode->children.at(i));
                curNode->children.at(i)->parentNode = rNode;
            }
                curNode->children.erase(curNode->children.begin() + curNode->children.size()/2 + 1, curNode->children.end());
            // cout<< "BACCHO KA SIZE KE BAAER ME BHI TOH SOCHO" <<endl;
            // cout << curNode->children.size() << endl;
            // cout << rNode->children.size() << endl;
        }
        else {
            for (int i = curNode->children.size()/2; i<curNode->children.size();i++) {
                rNode->children.push_back(curNode->children.at(i));
                curNode->children.at(i)->parentNode = rNode;
            }
            curNode->children.erase(curNode->children.begin() + curNode->children.size()/2, curNode->children.end());
            // cout<< "BACCHO KA PAPA KE BAAER ME BHI TOH SOCHO" <<endl;
            // cout << curNode->children.size() << endl;
            // cout << rNode->children.size() << endl;
        }
        //CHILDREN HAVE BEEN DISTRIBUTED

        if (curNode->parentNode == NULL) {
            Node *pNode = new Node(false);
            pNode->children.push_back(curNode);
            pNode->children.push_back(rNode);
            curNode->parentNode = pNode;
            rNode->parentNode = pNode;
            pNode->keys.push_back(rNode->keys.at(0));
            rNode->keys.erase(rNode->keys.begin());
            rNode->nNodes--;
            curNode->parentNode->nNodes++;
            //cout<< pNode->keys.at(0)<<endl;
            rootNode = pNode;
        }
        else {
            rNode->parentNode = curNode->parentNode;
            curNode->parentNode->keys.push_back(rNode->keys.at(0));
            rNode->keys.erase(rNode->keys.begin());
            sort(curNode->parentNode->keys.begin(),curNode->parentNode->keys.end());
            curNode->parentNode->children.push_back(rNode);
            curNode->parentNode->nNodes++;

            sort(curNode->parentNode->children.begin(),curNode->parentNode->children.end(),keySort);

           
            if (curNode->parentNode->keys.size()>order-1) {
                curNode->parentNode->nNodes--;
                splitNode(curNode->parentNode);
            }
        }
        
    
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x88(%rax)
je 0x29fa
movl $0x90, %edi
callq 0x21c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x198(%rbp)
movl $0x1, %esi
callq 0x4da0
jmp 0x2603
movq -0x198(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x2650
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x267c
movq -0x198(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x21a0
jmp 0x31b2
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movl 0x10b36(%rip), %eax     # 0x131b8
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x4f20
shrq %rax
movl %eax, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x4f20
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
cmpq %rcx, %rax
jae 0x2701
movq -0x10(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x1a8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movslq -0x24(%rbp), %rsi
callq 0x4fc0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
callq 0x4f50
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x26a0
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x4f20
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x4f20
movq %rax, -0x1b8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x4f20
movq %rax, %rcx
movq -0x1b8(%rbp), %rax
shrq %rcx
subq %rcx, %rax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x1b0(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x5090
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x4f20
movq %rax, %rsi
shrq %rsi
leaq -0x40(%rbp), %rdi
callq 0x50c0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5100
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x5140
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x5100
movq -0x1b0(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x5000
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x4f20
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x28cd
movl $0x90, %edi
callq 0x21c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1c0(%rbp)
xorl %esi, %esi
callq 0x4da0
jmp 0x2813
movq -0x1c0(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
addq $0x70, %rdi
leaq -0x8(%rbp), %rsi
callq 0x5170
movq -0x60(%rbp), %rdi
addq $0x70, %rdi
leaq -0x10(%rbp), %rsi
callq 0x5170
movq -0x60(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x60(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x60(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x1c8(%rbp)
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4fc0
movq %rax, %rdi
callq 0x5250
movq -0x1c8(%rbp), %rdi
movq %rax, %rsi
callq 0x51e0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x60(%rbp), %rax
movq %rax, 0x1092d(%rip)     # 0x131d8
jmp 0x29f5
movq -0x1c0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x21a0
jmp 0x31b2
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
addq $0x58, %rax
movq %rax, -0x1d0(%rbp)
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4fc0
movq %rax, %rdi
callq 0x5250
movq -0x1d0(%rbp), %rdi
movq %rax, %rsi
callq 0x51e0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x58, %rdi
callq 0x52b0
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x58, %rdi
callq 0x52e0
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x5270
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x70, %rdi
leaq -0x10(%rbp), %rsi
callq 0x5170
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x70, %rdi
callq 0x5360
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x70, %rdi
callq 0x5390
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
leaq -0x4ad(%rip), %rdx      # 0x24f0
callq 0x5310
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x58, %rdi
callq 0x53c0
movl 0x107ee(%rip), %ecx     # 0x131b8
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x29f3
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x20(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x25c0
jmp 0x29f5
jmp 0x31a9
movl $0x90, %edi
callq 0x21c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1d8(%rbp)
xorl %esi, %esi
callq 0x4da0
jmp 0x2a1a
movq -0x1d8(%rbp), %rax
movq %rax, -0x88(%rbp)
movl 0x1078a(%rip), %eax     # 0x131b8
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x8c(%rbp)
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
callq 0x53c0
shrq %rax
movl %eax, -0x90(%rbp)
movslq -0x90(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
callq 0x53c0
movq %rax, %rcx
movq -0x1e0(%rbp), %rax
cmpq %rcx, %rax
jae 0x2adf
movq -0x88(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x1e8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
movslq -0x90(%rbp), %rsi
callq 0x53e0
movq -0x1e8(%rbp), %rdi
movq %rax, %rsi
callq 0x51e0
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x2a52
movq -0x1d8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x21a0
jmp 0x31b2
movq -0x8(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x1f0(%rbp)
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
callq 0x52b0
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
callq 0x53c0
movq %rax, %rsi
shrq %rsi
leaq -0xa8(%rbp), %rdi
callq 0x54b0
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x54f0
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
callq 0x52e0
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x54f0
movq -0x1f0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0xb0(%rbp), %rdx
callq 0x5420
movq %rax, -0xc0(%rbp)
movq -0x88(%rbp), %rdi
addq $0x40, %rdi
callq 0x4f20
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x4f20
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5530
andq $0x1, %rax
cmpq $0x0, %rax
je 0x2d4e
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5530
shrq %rax
addq $0x1, %rax
movl %eax, -0xc4(%rbp)
movslq -0xc4(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5530
movq %rax, %rcx
movq -0x1f8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2c8d
movq -0x88(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x208(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
movslq -0xc4(%rbp), %rsi
callq 0x5550
movq -0x208(%rbp), %rdi
movq %rax, %rsi
callq 0x5170
movq -0x88(%rbp), %rax
movq %rax, -0x200(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
movslq -0xc4(%rbp), %rsi
callq 0x5550
movq -0x200(%rbp), %rcx
movq (%rax), %rax
movq %rcx, 0x28(%rax)
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x2bea
movq -0x8(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x210(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5360
movq %rax, -0xe8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5530
movq %rax, %rsi
shrq %rsi
leaq -0xe8(%rbp), %rdi
callq 0x5620
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rdi
movl $0x1, %esi
callq 0x5620
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x5660
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5390
movq %rax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x5660
movq -0x210(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq -0xf0(%rbp), %rdx
callq 0x5590
movq %rax, -0x100(%rbp)
jmp 0x2eab
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5530
shrq %rax
movl %eax, -0x104(%rbp)
movslq -0x104(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5530
movq %rax, %rcx
movq -0x218(%rbp), %rax
cmpq %rcx, %rax
jae 0x2e07
movq -0x88(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x228(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
movslq -0x104(%rbp), %rsi
callq 0x5550
movq -0x228(%rbp), %rdi
movq %rax, %rsi
callq 0x5170
movq -0x88(%rbp), %rax
movq %rax, -0x220(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
movslq -0x104(%rbp), %rsi
callq 0x5550
movq -0x220(%rbp), %rcx
movq (%rax), %rax
movq %rcx, 0x28(%rax)
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x2d64
movq -0x8(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x230(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5360
movq %rax, -0x120(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5530
movq %rax, %rsi
shrq %rsi
leaq -0x120(%rbp), %rdi
callq 0x5620
movq %rax, -0x118(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x5660
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5390
movq %rax, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x5660
movq -0x230(%rbp), %rdi
movq -0x110(%rbp), %rsi
movq -0x128(%rbp), %rdx
callq 0x5590
movq %rax, -0x138(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x3010
movl $0x90, %edi
callq 0x21c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x238(%rbp)
xorl %esi, %esi
callq 0x4da0
jmp 0x2eda
movq -0x238(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
addq $0x70, %rdi
leaq -0x8(%rbp), %rsi
callq 0x5170
movq -0x140(%rbp), %rdi
addq $0x70, %rdi
leaq -0x88(%rbp), %rsi
callq 0x5170
movq -0x140(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x140(%rbp), %rcx
movq -0x88(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x140(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x248(%rbp)
movq -0x88(%rbp), %rdi
addq $0x58, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x53e0
movq -0x248(%rbp), %rdi
movq %rax, %rsi
callq 0x51e0
movq -0x88(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x240(%rbp)
movq -0x88(%rbp), %rdi
addq $0x58, %rdi
callq 0x52b0
movq %rax, -0x150(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x54f0
movq -0x240(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0x56a0
movq %rax, -0x158(%rbp)
movq -0x88(%rbp), %rax
movl 0x20(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x140(%rbp), %rax
movq %rax, 0x101ea(%rip)     # 0x131d8
jmp 0x31a7
movq -0x238(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x21a0
jmp 0x31b2
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x88(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
addq $0x58, %rax
movq %rax, -0x258(%rbp)
movq -0x88(%rbp), %rdi
addq $0x58, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x53e0
movq -0x258(%rbp), %rdi
movq %rax, %rsi
callq 0x51e0
movq -0x88(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x250(%rbp)
movq -0x88(%rbp), %rdi
addq $0x58, %rdi
callq 0x52b0
movq %rax, -0x168(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x54f0
movq -0x250(%rbp), %rdi
movq -0x160(%rbp), %rsi
callq 0x56a0
movq %rax, -0x170(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x58, %rdi
callq 0x52b0
movq %rax, -0x178(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x58, %rdi
callq 0x52e0
movq %rax, -0x180(%rbp)
movq -0x178(%rbp), %rdi
movq -0x180(%rbp), %rsi
callq 0x5270
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x70, %rdi
leaq -0x88(%rbp), %rsi
callq 0x5170
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x70, %rdi
callq 0x5360
movq %rax, -0x188(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x70, %rdi
callq 0x5390
movq %rax, -0x190(%rbp)
movq -0x188(%rbp), %rdi
movq -0x190(%rbp), %rsi
leaq -0xc00(%rip), %rdx      # 0x2560
callq 0x5310
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x58, %rdi
callq 0x53c0
movl 0x1003c(%rip), %ecx     # 0x131b8
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x31a5
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x20(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x25c0
jmp 0x31a7
jmp 0x31a9
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x2300
nopl (%rax,%rax)