// File: /workspace/github_cpp_makefile_star2_O3/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 0xb410
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x3f0e(%rip), %rsi      # 0xdd50
leaq 0x3f0b(%rip), %rdx      # 0xdd54
leaq 0x50(%rsp), %rdi
callq 0xa6dc
testq %r14, %r14
je 0x9fdc
movq 0x38(%r14), %rsi
addq $0x10, %rsi
leaq 0x50(%rsp), %rdi
callq 0x40d0
testl %eax, %eax
jne 0x9fdc
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 0x5688
testl %eax, %eax
jne 0x9ff1
movsd 0x48(%rsp), %xmm0
movsd %xmm0, (%rbx)
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x5688
testl %eax, %eax
jne 0xa006
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 0x9a34
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 0xa56c
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x3e59(%rip), %rsi      # 0xdd75
leaq 0x3e63(%rip), %rdx      # 0xdd86
leaq 0x20(%rsp), %rdi
callq 0xa6dc
movq 0x28(%r14), %r14
testq %r14, %r14
je 0x9f78
leaq 0x20(%rsp), %r15
movq 0x38(%r14), %rsi
addq $0x10, %rsi
movq %r15, %rdi
callq 0x40d0
testl %eax, %eax
jne 0x9f6f
movq (%r14), %rax
movq %r14, %rdi
callq *0x58(%rax)
movq %rax, %rsi
callq 0x9d94
cvttsd2si %xmm0, %eax
cltq
movq (%rsp), %rcx
movsd %xmm1, (%rcx,%rax,8)
movq 0x48(%r14), %r14
testq %r14, %r14
jne 0x9f3b
movq %rbx, %rdi
addq $0x8, %rdi
movq %rsp, %rsi
callq 0xa5a0
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x9f9e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4250
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x9fb4
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x9fcb
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 0x9fe5(%rip), %rdi      # 0x13fc8
leaq 0x3d6b(%rip), %rsi      # 0xdd55
callq 0x4220
jmp 0xa019
movq 0x9fd0(%rip), %rdi      # 0x13fc8
leaq 0x3d20(%rip), %rsi      # 0xdd1f
callq 0x4220
jmp 0xa019
movq 0x9fbb(%rip), %rdi      # 0x13fc8
leaq 0x3d0b(%rip), %rsi      # 0xdd1f
callq 0x4220
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x42c0
jmp 0xa047
jmp 0xa027
movq %rax, %r14
jmp 0xa061
jmp 0xa042
movq %rax, %r14
jmp 0xa08e
movq %rax, %r14
movl $0x88, %esi
movq %rbx, %rdi
jmp 0xa089
jmp 0xa042
movq %rax, %r14
jmp 0xa077
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0xa061
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4250
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa077
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0xa08e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4250
movq %r14, %rdi
callq 0x4410