// File: jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::xpath_node_set_raw pugi::impl::(anonymous namespace)::xpath_ast_node::step_do<pugi::impl::(anonymous namespace)::axis_to_type<(pugi::impl::(anonymous namespace)::axis_t)0>>(pugi::impl::(anonymous namespace)::xpath_context const&, pugi::impl::(anonymous namespace)::xpath_stack const&, pugi::impl::(anonymous namespace)::nodeset_eval_t, pugi::impl::(anonymous namespace)::axis_to_type<(pugi::impl::(anonymous namespace)::axis_t)0>)
xpath_node_set_raw step_do(const xpath_context& c, const xpath_stack& stack, nodeset_eval_t eval, T v)
		{
			const axis_t axis = T::axis;
			const bool axis_reverse = (axis == axis_ancestor || axis == axis_ancestor_or_self || axis == axis_preceding || axis == axis_preceding_sibling);
			const xpath_node_set::type_t axis_type = axis_reverse ? xpath_node_set::type_sorted_reverse : xpath_node_set::type_sorted;

			bool once =
				(axis == axis_attribute && _test == nodetest_name) ||
				(!_right && eval_once(axis_type, eval)) ||
				(_right && !_right->_next && _right->_test == predicate_constant_one);

			xpath_node_set_raw ns;
			ns.set_type(axis_type);

			if (_left)
			{
				xpath_node_set_raw s = _left->eval_node_set(c, stack, nodeset_eval_all);

				// self axis preserves the original order
				if (axis == axis_self) ns.set_type(s.type());

				for (const xpath_node* it = s.begin(); it != s.end(); ++it)
				{
					size_t size = ns.size();

					// in general, all axes generate elements in a particular order, but there is no order guarantee if axis is applied to two nodes
					if (axis != axis_self && size != 0) ns.set_type(xpath_node_set::type_unsorted);

					step_fill(ns, *it, stack.result, once, v);
					if (_right) apply_predicates(ns, size, stack, eval);
				}
			}
			else
			{
				step_fill(ns, c.n, stack.result, once, v);
				if (_right) apply_predicates(ns, 0, stack, eval);
			}

			// child, attribute and self axes always generate unique set of nodes
			// for other axis, if the set stayed sorted, it stayed unique because the traversal algorithms do not visit the same node twice
			if (axis != axis_child && axis != axis_attribute && axis != axis_self && ns.type() == xpath_node_set::type_unsorted)
				ns.remove_duplicates();

			return ns;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x88(%rbp)
movq %rdi, -0x80(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movl $0x0, -0x28(%rbp)
movb $0x1, -0x29(%rbp)
movl $0x2, -0x30(%rbp)
cmpq $0x0, 0x10(%rax)
jne 0x62a83
movl -0x24(%rbp), %esi
movl $0x2, %edi
callq 0x628a0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x89(%rbp)
jne 0x62ad1
movq -0x78(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x10(%rcx)
movb %al, -0x8a(%rbp)
je 0x62ac5
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rcx
xorl %eax, %eax
cmpq $0x0, 0x18(%rcx)
movb %al, -0x8a(%rbp)
jne 0x62ac5
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rax
movsbl 0x3(%rax), %eax
cmpl $0x3, %eax
sete %al
movb %al, -0x8a(%rbp)
movb -0x8a(%rbp), %al
movb %al, -0x89(%rbp)
movq -0x88(%rbp), %rdi
movb -0x89(%rbp), %al
andb $0x1, %al
movb %al, -0x31(%rbp)
callq 0x629f0
movq -0x88(%rbp), %rdi
movl $0x2, %esi
callq 0x626d0
movq -0x78(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x62bdd
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x58(%rbp), %rdi
xorl %r8d, %r8d
callq 0x4e6d0
leaq -0x58(%rbp), %rdi
callq 0x4ed40
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4ed60
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
je 0x62bdb
movq -0x88(%rbp), %rdi
callq 0x61380
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x62b7d
movq -0x88(%rbp), %rdi
xorl %esi, %esi
callq 0x626d0
movq -0x78(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movb -0x31(%rbp), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0x65030
movq -0x78(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x62bc8
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rdi
movq -0x68(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
callq 0x65190
jmp 0x62bca
movq -0x60(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x60(%rbp)
jmp 0x62b31
jmp 0x62c2a
movq -0x78(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movb -0x31(%rbp), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0x65030
movq -0x78(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x62c28
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rdi
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
xorl %eax, %eax
movl %eax, %edx
callq 0x65190
jmp 0x62c2a
movq -0x88(%rbp), %rdi
callq 0x4ed80
cmpl $0x0, %eax
jne 0x62c47
movq -0x88(%rbp), %rdi
callq 0x62810
movq -0x80(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)