// File: muk343[P]pmml/GraphGenerator.cpp
// Function: GraphGenerator::dump_to_stdout(TiXmlNode*)
Node* GraphGenerator::dump_to_stdout( TiXmlNode* pParent)
    {
        if ( !pParent ) return NULL;

        TiXmlNode* pChild;
        TiXmlText* pText;
        int t = pParent->Type();
        //printf( "%s", getIndent(indent));
        int num;
    /*
        switch ( t )
        {
        case TiXmlNode::TINYXML_DOCUMENT:
            printf( "Document" );
            break;

        case TiXmlNode::TINYXML_ELEMENT:
            printf( "Element [%s]", pParent->Value() );
            num=dump_attribs_to_stdout(pParent->ToElement(), indent+1);
            switch(num)
            {
                case 0:  printf( " (No attributes)"); break;
                case 1:  printf( "%s1 attribute", getIndentAlt(indent)); break;
                default: printf( "%s%d attributes", getIndentAlt(indent), num); break;
            }
            break;

        case TiXmlNode::TINYXML_COMMENT:
            printf( "Comment: [%s]", pParent->Value());
            break;

        case TiXmlNode::TINYXML_UNKNOWN:
            printf( "Unknown" );
            break;

        case TiXmlNode::TINYXML_TEXT:
            pText = pParent->ToText();
            printf( "Text: [%s]", pText->Value() );
            break;

        case TiXmlNode::TINYXML_DECLARATION:
            printf( "Declaration" );
            break;
        default:
            break;
        }
        
        */
        
        string node = "Node";
        if(node.compare(pParent->Value()) == 0) 
        {
            //getNodeDataFromThisNode(pParent);
            Node* rootNode = getNodeDataFromThisNode(pParent->ToElement()); 
            //nodeToReturn = getNodeDataFromThisNode
            //Add to the vector here
            for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling()) 
            {
                
                if(node.compare(pChild->Value()) == 0) {
                    rootNode->addChildNode(subGenerateGraph(pChild));
                }
                
            }

            return rootNode;
        } else {

            Node* deepInsertedRootToReturn = NULL;
            for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling()) 
            {

                Node* tempReturnValue = dump_to_stdout(pChild);
                if (tempReturnValue != NULL)
                {
                    deepInsertedRootToReturn = tempReturnValue;
                }
                
            }

            return deepInsertedRootToReturn;    
        }

        
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xd922
movq $0x0, -0x8(%rbp)
jmp 0xdb5f
movq -0x18(%rbp), %rdi
callq 0x8c80
movl %eax, -0x2c(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x44b0
movq -0x98(%rbp), %rdx
leaq 0x94f4(%rip), %rsi      # 0x16e40
leaq -0x50(%rbp), %rdi
callq 0xdea0
jmp 0xd957
leaq -0x51(%rbp), %rdi
callq 0x42f0
movq -0x18(%rbp), %rdi
callq 0x8ca0
movq %rax, -0xa0(%rbp)
jmp 0xd972
movq -0xa0(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x40f0
cmpl $0x0, %eax
jne 0xdabe
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq 0x58(%rax), %rax
callq *%rax
movq %rax, -0xa8(%rbp)
jmp 0xd9a1
movq -0xa8(%rbp), %rsi
movq -0x90(%rbp), %rdi
callq 0xd2d0
movq %rax, -0xb0(%rbp)
jmp 0xd9bd
movq -0xb0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9370
movq %rax, -0xb8(%rbp)
jmp 0xd9da
movq -0xb8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xdaaa
movq -0x20(%rbp), %rdi
callq 0x8ca0
movq %rax, -0xc0(%rbp)
jmp 0xda02
movq -0xc0(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x40f0
cmpl $0x0, %eax
jne 0xda86
movq -0x90(%rbp), %rdi
movq -0x70(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x20(%rbp), %rsi
callq 0xd780
movq %rax, -0xc8(%rbp)
jmp 0xda3b
movq -0xc8(%rbp), %rsi
movq -0xd0(%rbp), %rdi
callq 0x12220
jmp 0xda50
jmp 0xda86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x42f0
jmp 0xdb6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x41c0
jmp 0xdb6c
jmp 0xda88
movq -0x20(%rbp), %rdi
callq 0x8e20
movq %rax, -0xd8(%rbp)
jmp 0xda9a
movq -0xd8(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xd9e5
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0xdb56
movq $0x0, -0x80(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9370
movq %rax, -0xe0(%rbp)
jmp 0xdad8
movq -0xe0(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xdb47
movq -0x90(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xd8f0
movq %rax, -0xe8(%rbp)
jmp 0xdb03
movq -0xe8(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0xdb26
movq -0x88(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0xdb28
movq -0x20(%rbp), %rdi
callq 0x8e20
movq %rax, -0xf0(%rbp)
jmp 0xdb3a
movq -0xf0(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xdae3
movq -0x80(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x74(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x41c0
movq -0x8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x44a0
nopw %cs:(%rax,%rax)