// File: fffrankkk[P]XmlCode/src/XMLTree.cpp
// Function: CXMLTree::ParseNode(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, CXMLNode*)
void CXMLTree::ParseNode(void* pvNode, const std::string& strName, CXMLNode* pCParent)
{
	xmlNodePtr pstNode = (xmlNodePtr)(pvNode);
	CXMLNode* pCNode = new CXMLNode;
	pCNode->SetName(strName);
	if (pCParent == NULL) {
		m_pCTree = new CXMLNode;
		m_pCTree->AddChild(pCNode);
	} else {
		pCParent->AddChild(pCNode);
	}

	//get name-value
	if ((pstNode->children != NULL && pstNode->children == pstNode->last) || pstNode->children == NULL) {
		char* pszCont = (char *) xmlNodeGetContent(pstNode);
		if (pszCont != NULL) {
			pCNode->SetValue(pszCont);
			xmlFree(pszCont);
		}
	}

	//get attribute
	xmlAttrPtr pstAttr = pstNode->properties;
	while (pstAttr != NULL) {
		char* pszCont = (char *)xmlGetProp(pstNode, pstAttr->name);
		if (pszCont != NULL) {
			pCNode->SetAttribute((char *)(pstAttr->name), pszCont);
			xmlFree(pszCont);
		}
		pstAttr = pstAttr->next;
	}

	//children
	xmlNodePtr pstChild = pstNode->children;
	while (pstChild != NULL) {
		if (pstChild->type == XML_ELEMENT_NODE) {
			ParseNode(pstChild, (char *)pstChild->name, pCNode);
		}
		pstChild = pstChild->next;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x90, %edi
callq 0x53e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x108(%rbp)
callq 0x6410
jmp 0x6c1c
movq -0x108(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6500
cmpq $0x0, -0x20(%rbp)
jne 0x6cc2
movl $0x90, %edi
callq 0x53e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x118(%rbp)
callq 0x6410
jmp 0x6c5d
movq -0x110(%rbp), %rax
movq -0x118(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x65a0
jmp 0x6ccf
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x90, %esi
callq 0x53f0
jmp 0x7045
movq -0x118(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x90, %esi
callq 0x53f0
jmp 0x7045
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x65a0
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x6cec
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
je 0x6cfb
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x6dbb
movq -0x28(%rbp), %rdi
callq 0x5480
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x6db9
movq -0x30(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x5750
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x7a40
jmp 0x6d52
movq -0x130(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x6530
jmp 0x6d64
leaq -0x68(%rbp), %rdi
callq 0x5240
leaq -0x69(%rbp), %rdi
callq 0x5460
movq 0x4425b(%rip), %rax     # 0x4afd8
movq (%rax), %rax
movq -0x48(%rbp), %rdi
callq *%rax
jmp 0x6db9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6dab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5240
leaq -0x69(%rbp), %rdi
callq 0x5460
jmp 0x7045
jmp 0x6dbb
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x6f41
movq -0x28(%rbp), %rdi
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x55c0
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0x6f30
movq -0x30(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x140(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x5750
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x7a40
jmp 0x6e3b
movq -0x80(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x5750
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
leaq -0xc8(%rbp), %rdi
callq 0x7a40
jmp 0x6e75
movq -0x148(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0x6560
jmp 0x6e91
leaq -0xc8(%rbp), %rdi
callq 0x5240
leaq -0xc9(%rbp), %rdi
callq 0x5460
leaq -0xa0(%rbp), %rdi
callq 0x5240
leaq -0xa1(%rbp), %rdi
callq 0x5460
movq 0x44110(%rip), %rax     # 0x4afd8
movq (%rax), %rax
movq -0x80(%rbp), %rdi
callq *%rax
jmp 0x6f30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6f1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6f07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x5240
leaq -0xc9(%rbp), %rdi
callq 0x5460
leaq -0xa0(%rbp), %rdi
callq 0x5240
leaq -0xa1(%rbp), %rdi
callq 0x5460
jmp 0x7045
movq -0x78(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x6dc7
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xd8(%rbp)
je 0x703c
movq -0xd8(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x7025
movq -0xd8(%rbp), %rax
movq %rax, -0x170(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x168(%rbp)
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x5750
movq -0x168(%rbp), %rsi
movq -0x160(%rbp), %rdx
leaq -0xf8(%rbp), %rdi
callq 0x7a40
jmp 0x6fb7
movq -0x170(%rbp), %rsi
movq -0x110(%rbp), %rdi
movq -0x30(%rbp), %rcx
leaq -0xf8(%rbp), %rdx
callq 0x6bd0
jmp 0x6fd7
leaq -0xf8(%rbp), %rdi
callq 0x5240
leaq -0xf9(%rbp), %rdi
callq 0x5460
jmp 0x7025
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x7017
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x5240
leaq -0xf9(%rbp), %rdi
callq 0x5460
jmp 0x7045
movq -0xd8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0xd8(%rbp)
jmp 0x6f50
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x5740
nop