// File: jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::string_value(pugi::xpath_node const&, pugi::impl::(anonymous namespace)::xpath_allocator*)
PUGI__FN xpath_string string_value(const xpath_node& na, xpath_allocator* alloc)
	{
		if (na.attribute())
			return xpath_string::from_const(na.attribute().value());
		else
		{
			xml_node n = na.node();

			switch (n.type())
			{
			case node_pcdata:
			case node_cdata:
			case node_comment:
			case node_pi:
				return xpath_string::from_const(n.value());

			case node_document:
			case node_element:
			{
				xpath_string result;

				// element nodes can have value if parse_embed_pcdata was used
				if (n.value()[0])
					result.append(xpath_string::from_const(n.value()), alloc);

				xml_node cur = n.first_child();

				while (cur && cur != n)
				{
					if (cur.type() == node_pcdata || cur.type() == node_cdata)
						result.append(xpath_string::from_const(cur.value()), alloc);

					if (cur.first_child())
						cur = cur.first_child();
					else if (cur.next_sibling())
						cur = cur.next_sibling();
					else
					{
						while (!cur.next_sibling() && cur != n)
							cur = cur.parent();

						if (cur != n) cur = cur.next_sibling();
					}
				}

				return result;
			}

			default:
				return xpath_string();
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0xa8(%rbp)
movq %rdi, -0xa0(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x496d0
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x40990
cmpq $0x0, %rax
je 0x60af7
movq -0x8(%rbp), %rdi
callq 0x496d0
movq %rax, -0x20(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x41070
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x60df0
jmp 0x60d3e
movq -0x8(%rbp), %rdi
callq 0x49680
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x42160
movl %eax, %ecx
movl %ecx, %eax
decl %eax
movl %ecx, -0xac(%rbp)
subl $0x2, %eax
jb 0x60b51
jmp 0x60b20
movl -0xac(%rbp), %eax
addl $-0x3, %eax
subl $0x3, %eax
ja 0x60d32
jmp 0x60b34
leaq -0x28(%rbp), %rdi
callq 0x421a0
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x60df0
jmp 0x60d3e
movq -0xa8(%rbp), %rdi
callq 0x4e460
leaq -0x28(%rbp), %rdi
callq 0x421a0
cmpb $0x0, (%rax)
je 0x60b94
leaq -0x28(%rbp), %rdi
callq 0x421a0
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x60df0
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rsi
callq 0x60e20
leaq -0x28(%rbp), %rdi
callq 0x42a10
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x41c30
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0xad(%rbp)
je 0x60bce
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x42000
movb %al, -0xad(%rbp)
movb -0xad(%rbp), %al
testb $0x1, %al
jne 0x60bdd
jmp 0x60d30
leaq -0x48(%rbp), %rdi
callq 0x42160
cmpl $0x3, %eax
je 0x60bf9
leaq -0x48(%rbp), %rdi
callq 0x42160
cmpl $0x4, %eax
jne 0x60c22
leaq -0x48(%rbp), %rdi
callq 0x421a0
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x60df0
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq -0x60(%rbp), %rsi
callq 0x60e20
leaq -0x48(%rbp), %rdi
callq 0x42a10
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x41c30
cmpq $0x0, %rax
je 0x60c58
leaq -0x48(%rbp), %rdi
callq 0x42a10
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x60d2b
leaq -0x48(%rbp), %rdi
callq 0x423a0
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x41c30
cmpq $0x0, %rax
je 0x60c8e
leaq -0x48(%rbp), %rdi
callq 0x423a0
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x60d29
jmp 0x60c90
leaq -0x48(%rbp), %rdi
callq 0x423a0
movq %rax, -0x88(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x41c70
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xae(%rbp)
jne 0x60cbd
jmp 0x60cd0
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x42000
movb %al, -0xae(%rbp)
movb -0xae(%rbp), %al
testb $0x1, %al
jne 0x60cdc
jmp 0x60cf9
leaq -0x48(%rbp), %rdi
callq 0x426e0
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x60c90
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x42000
testb $0x1, %al
jne 0x60d0c
jmp 0x60d27
leaq -0x48(%rbp), %rdi
callq 0x423a0
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x60d29
jmp 0x60d2b
jmp 0x60ba1
jmp 0x60d3e
movq -0xa8(%rbp), %rdi
callq 0x4e460
movq -0xa0(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nop