// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r14
movl $0x90, %edi
callq 0x42f0
movq %rax, %r13
movq %rax, %rdi
callq 0x4aa8
leaq 0x8(%r13), %rdi
movq %r12, %rsi
callq 0x41c0
testq %rbx, %rbx
jne 0x4f17
movl $0x90, %edi
callq 0x42f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x4aa8
movq %rbx, 0x8(%r14)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4b74
movq 0x18(%rbp), %rax
testq %rax, %rax
je 0x4f31
cmpq 0x20(%rbp), %rax
jne 0x4f7a
movq %rbp, %rdi
callq 0x4340
testq %rax, %rax
je 0x4f7a
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rdx
movq %rax, %rsi
callq 0x5480
movq %r13, %rdi
addq $0x28, %rdi
leaq 0x18(%rsp), %rsi
callq 0x41c0
leaq 0x18(%rsp), %rdi
callq 0x4160
movq 0x1d063(%rip), %rax     # 0x21fd8
movq %rbx, %rdi
callq *(%rax)
movq %r13, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0x18(%rbp), %r12
leaq 0x58(%rbp), %r14
leaq 0x18(%rsp), %r13
leaq 0x38(%rsp), %rbx
movq (%r14), %r14
testq %r14, %r14
je 0x500b
movq 0x10(%r14), %rsi
movq %rbp, %r15
movq %rbp, %rdi
callq 0x4470
testq %rax, %rax
je 0x5002
movq %rax, %rbp
movq 0x10(%r14), %rsi
movq %r13, %rdi
leaq 0x7(%rsp), %rdx
callq 0x5480
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x6(%rsp), %rdx
callq 0x5480
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x4b5a
movq %rbx, %rdi
callq 0x4160
movq %r13, %rdi
callq 0x4160
movq %rbp, %rdi
movq 0x1cfd8(%rip), %rax     # 0x21fd8
callq *(%rax)
addq $0x30, %r14
movq %r15, %rbp
jmp 0x4f96
leaq 0x18(%rsp), %rbx
leaq 0x38(%rsp), %r13
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r15
movq (%r12), %r12
testq %r12, %r12
je 0x505f
cmpl $0x1, 0x8(%r12)
jne 0x5059
movq 0x10(%r12), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x5480
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x4ebe
movq %rbx, %rdi
callq 0x4160
addq $0x30, %r12
jmp 0x501f
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x508a
jmp 0x5085
jmp 0x5085
jmp 0x508a
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x4160
jmp 0x508d
movq %rax, %rbx
jmp 0x5097
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4160
movq %rbx, %rdi
callq 0x45c0
nop