// File: /workspace/github_cpp_makefile_star2_O1/muk343[P]pmml/GraphGenerator.cpp
// Function: GraphGenerator::getNodeDataFromThisNode(TiXmlElement*)
Node* GraphGenerator::getNodeDataFromThisNode(TiXmlElement* pElement) 
    {

        Node* node = new Node();
        //Just for doubleCheck
        string nodeTag = "Node";
        if(!pElement || nodeTag.compare(pElement->Value()) != 0) 
        {
            cout<<"Node sent is not an actual node";
            exit(-1);
        } 

        TiXmlAttribute* pAttribFirst=pElement->FirstAttribute();
        TiXmlAttribute* pAttribLast=pElement->LastAttribute();

        double score;
        double recordCount;

        if (pAttribFirst->QueryDoubleValue(&score)!=TIXML_SUCCESS) 
        {
         cout<<"Problem extracting the score value from the node";   
         exit(-1);
        } else
        {
            node->score = score;
        } 
        if (pAttribLast->QueryDoubleValue(&recordCount)!=TIXML_SUCCESS) 
        {
         cout<<"Problem extracting the score value from the node";   
         exit(-1);
        } else
        {
            node->node_record_count = recordCount;
        } 

        //Now let's add info about predicate
        TiXmlElement* pPredicate = pElement->FirstChild()->ToElement();
        populatePredicate(node, pPredicate);

        vector<double> scoreDistributions;
        scoreDistributions.resize(5, 0.0);
        string scoreDistributionTag = "ScoreDistribution";
        TiXmlNode* pChild;
        for ( pChild = pElement->FirstChild(); pChild != 0; pChild = pChild->NextSibling()) 
        {
            if (scoreDistributionTag.compare(pChild->Value()) == 0) {
                    pair<double, double> p1 = getScoreDistribution(pChild->ToElement());
                    double score = p1.first;
                    double value = p1.second;

                    int index = (int)score;
                    scoreDistributions[index] = value;
            }
            
        }

        node->score_distribution = scoreDistributions;

        return node;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rsi, %r14
movl $0x88, %edi
callq 0x4240
movq %rax, %rbx
movq %rax, %rdi
callq 0xb36c
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3d2d(%rip), %rsi      # 0xdd3b
leaq 0x3d2a(%rip), %rdx      # 0xdd3f
leaq 0x50(%rsp), %rdi
callq 0xa888
testq %r14, %r14
je 0xa1a8
movq 0x38(%r14), %rsi
addq $0x10, %rsi
leaq 0x50(%rsp), %rdi
callq 0x40d0
testl %eax, %eax
jne 0xa1a8
leaq 0x50(%r14), %rax
movq 0x88(%r14), %rdi
xorl %ecx, %ecx
cmpq %rax, %rdi
cmoveq %rcx, %rdi
movq 0x80(%r14), %r15
cmpq %rax, %r15
cmoveq %rcx, %r15
leaq 0x48(%rsp), %rsi
callq 0x56f4
testl %eax, %eax
jne 0xa1bd
movsd 0x48(%rsp), %xmm0
movsd %xmm0, (%rbx)
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x56f4
testl %eax, %eax
jne 0xa1d2
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x20(%rbx)
movq 0x28(%r14), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq %rbx, %rsi
movq %rax, %rdx
callq 0x9c00
xorpd %xmm0, %xmm0
movq %rsp, %rdi
movapd %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
leaq 0x20(%rsp), %rdx
movq %rax, (%rdx)
movl $0x5, %esi
callq 0xa72e
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x3c78(%rip), %rsi      # 0xdd60
leaq 0x3c82(%rip), %rdx      # 0xdd71
leaq 0x20(%rsp), %rdi
callq 0xa888
movq 0x28(%r14), %r14
testq %r14, %r14
je 0xa144
leaq 0x20(%rsp), %r15
movq 0x38(%r14), %rsi
addq $0x10, %rsi
movq %r15, %rdi
callq 0x40d0
testl %eax, %eax
jne 0xa13b
movq (%r14), %rax
movq %r14, %rdi
callq *0x58(%rax)
movq %rax, %rsi
callq 0x9f60
cvttsd2si %xmm0, %eax
cltq
movq (%rsp), %rcx
movsd %xmm1, (%rcx,%rax,8)
movq 0x48(%r14), %r14
testq %r14, %r14
jne 0xa107
movq %rbx, %rdi
addq $0x8, %rdi
movq %rsp, %rsi
callq 0xa762
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0xa16a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4250
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa180
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0xa197
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4250
movq %rbx, %rax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x9e19(%rip), %rdi      # 0x13fc8
leaq 0x3b8a(%rip), %rsi      # 0xdd40
callq 0x4220
jmp 0xa1e5
movq 0x9e04(%rip), %rdi      # 0x13fc8
leaq 0x3b3f(%rip), %rsi      # 0xdd0a
callq 0x4220
jmp 0xa1e5
movq 0x9def(%rip), %rdi      # 0x13fc8
leaq 0x3b2a(%rip), %rsi      # 0xdd0a
callq 0x4220
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x42c0
jmp 0xa213
jmp 0xa1f3
movq %rax, %r14
jmp 0xa22d
jmp 0xa20e
movq %rax, %r14
jmp 0xa25a
movq %rax, %r14
movl $0x88, %esi
movq %rbx, %rdi
jmp 0xa255
jmp 0xa20e
movq %rax, %r14
jmp 0xa243
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0xa22d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4250
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa243
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0xa25a
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4250
movq %r14, %rdi
callq 0x4410