// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x80, %rsp
movq %rsi, %r14
movl $0x88, %edi
callq 0x4220
movq %rax, %rbx
movq %rax, %rdi
callq 0x9ef8
leaq 0x3212(%rip), %rsi      # 0xbd71
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x90b6
testq %r14, %r14
je 0x8cc8
movq 0x38(%r14), %rsi
addq $0x10, %rsi
leaq 0x60(%rsp), %rdi
callq 0x40d0
testl %eax, %eax
jne 0x8cc8
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 0x18(%rsp), %rsi
callq 0x5184
testl %eax, %eax
jne 0x8cdd
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rbx)
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x5184
testl %eax, %eax
jne 0x8cf2
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x20(%rbx)
movq 0x28(%r14), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq %rbx, %rsi
movq %rax, %rdx
callq 0x88b0
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movapd %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x40(%rsp), %rdx
andq $0x0, (%rdx)
pushq $0x5
popq %rsi
callq 0x910a
leaq 0x3168(%rip), %rsi      # 0xbd96
leaq 0x40(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x90b6
addq $0x28, %r14
leaq 0x40(%rsp), %r15
movq (%r14), %r14
testq %r14, %r14
je 0x8c89
movq 0x38(%r14), %rsi
addq $0x10, %rsi
movq %r15, %rdi
callq 0x40d0
testl %eax, %eax
jne 0x8c83
movq (%r14), %rax
movq %r14, %rdi
callq *0x58(%rax)
movq %rax, %rsi
callq 0x8abe
cvttsd2si %xmm0, %eax
cltq
movq 0x20(%rsp), %rcx
movsd %xmm1, (%rcx,%rax,8)
addq $0x48, %r14
jmp 0x8c46
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x20(%rsp), %rsi
callq 0x913e
leaq 0x40(%rsp), %rdi
callq 0x4120
leaq 0x20(%rsp), %rdi
callq 0x93c6
leaq 0x60(%rsp), %rdi
callq 0x4120
movq %rbx, %rax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x92f1(%rip), %rdi      # 0x11fc0
leaq 0x30a0(%rip), %rsi      # 0xbd76
callq 0x4200
jmp 0x8d05
movq 0x92dc(%rip), %rdi      # 0x11fc0
leaq 0x3055(%rip), %rsi      # 0xbd40
callq 0x4200
jmp 0x8d05
movq 0x92c7(%rip), %rdi      # 0x11fc0
leaq 0x3040(%rip), %rsi      # 0xbd40
callq 0x4200
pushq $-0x1
popq %rdi
callq 0x4290
jmp 0x8d36
jmp 0x8d11
movq %rax, %r14
jmp 0x8d43
jmp 0x8d31
movq %rax, %r14
jmp 0x8d57
movq %rax, %r14
movl $0x88, %esi
movq %rbx, %rdi
callq 0x4230
jmp 0x8d57
jmp 0x8d31
movq %rax, %r14
jmp 0x8d4d
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x4120
leaq 0x20(%rsp), %rdi
callq 0x93c6
leaq 0x60(%rsp), %rdi
callq 0x4120
movq %r14, %rdi
callq 0x43e0
nop