// File: jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::document_order_comparator::operator()(pugi::xpath_node const&, pugi::xpath_node const&) const
bool operator()(const xpath_node& lhs, const xpath_node& rhs) const
		{
			// optimized document order based check
			const void* lo = document_buffer_order(lhs);
			const void* ro = document_buffer_order(rhs);

			if (lo && ro) return lo < ro;

			// slow comparison
			xml_node ln = lhs.node(), rn = rhs.node();

			// compare attributes
			if (lhs.attribute() && rhs.attribute())
			{
				// shared parent
				if (lhs.parent() == rhs.parent())
				{
					// determine sibling order
					for (xml_attribute a = lhs.attribute(); a; a = a.next_attribute())
						if (a == rhs.attribute())
							return true;

					return false;
				}

				// compare attribute parents
				ln = lhs.parent();
				rn = rhs.parent();
			}
			else if (lhs.attribute())
			{
				// attributes go after the parent element
				if (lhs.parent() == rhs.node()) return false;

				ln = lhs.parent();
			}
			else if (rhs.attribute())
			{
				// attributes go after the parent element
				if (rhs.parent() == lhs.node()) return true;

				rn = rhs.parent();
			}

			if (ln == rn) return false;

			if (!ln || !rn) return ln < rn;

			return node_is_before(ln.internal_object(), rn.internal_object());
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x59a10
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x59a10
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x59744
cmpq $0x0, -0x30(%rbp)
je 0x59744
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
setb %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x599fd
movq -0x18(%rbp), %rdi
callq 0x49680
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x49680
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x496d0
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x40990
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0xc9(%rbp)
je 0x597a8
movq -0x20(%rbp), %rdi
callq 0x496d0
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x40990
cmpq $0x0, %rax
setne %al
movb %al, -0xc9(%rbp)
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x597b7
jmp 0x59880
movq -0x18(%rbp), %rdi
callq 0x496f0
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
callq 0x496f0
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x41fd0
testb $0x1, %al
jne 0x597e4
jmp 0x5984b
movq -0x18(%rbp), %rdi
callq 0x496d0
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x40990
cmpq $0x0, %rax
je 0x59842
movq -0x20(%rbp), %rdi
callq 0x496d0
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x409f0
testb $0x1, %al
jne 0x59820
jmp 0x59829
movb $0x1, -0x1(%rbp)
jmp 0x599fd
jmp 0x5982b
leaq -0x68(%rbp), %rdi
callq 0x40b10
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x597f1
movb $0x0, -0x1(%rbp)
jmp 0x599fd
movq -0x18(%rbp), %rdi
callq 0x496f0
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x496f0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x59987
movq -0x18(%rbp), %rdi
callq 0x496d0
movq %rax, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x40990
cmpq $0x0, %rax
je 0x59904
movq -0x18(%rbp), %rdi
callq 0x496f0
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
callq 0x49680
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x41fd0
testb $0x1, %al
jne 0x598db
jmp 0x598e4
movb $0x0, -0x1(%rbp)
jmp 0x599fd
movq -0x18(%rbp), %rdi
callq 0x496f0
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x59985
movq -0x20(%rbp), %rdi
callq 0x496d0
movq %rax, -0xb0(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x40990
cmpq $0x0, %rax
je 0x59983
movq -0x20(%rbp), %rdi
callq 0x496f0
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x49680
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x41fd0
testb $0x1, %al
jne 0x5995f
jmp 0x59968
movb $0x1, -0x1(%rbp)
jmp 0x599fd
movq -0x20(%rbp), %rdi
callq 0x496f0
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x59985
jmp 0x59987
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x41fd0
testb $0x1, %al
jne 0x5999a
jmp 0x599a0
movb $0x0, -0x1(%rbp)
jmp 0x599fd
leaq -0x38(%rbp), %rdi
callq 0x41c70
testb $0x1, %al
jne 0x599bc
leaq -0x40(%rbp), %rdi
callq 0x41c70
testb $0x1, %al
jne 0x599bc
jmp 0x599d0
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42030
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x599fd
leaq -0x38(%rbp), %rdi
callq 0x459a0
movq %rax, -0xd8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x459a0
movq -0xd8(%rbp), %rdi
movq %rax, %rsi
callq 0x59b50
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)