// File: /workspace/github_cpp_makefile_star2_O1/jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::xml_node::first_element_by_path(char const*, char) const
PUGI__FN xml_node xml_node::first_element_by_path(const char_t* path_, char_t delimiter) const
	{
		xml_node found = *this; // Current search context.

		if (!_root || !path_[0]) return found;

		if (path_[0] == delimiter)
		{
			// Absolute path; e.g. '/foo/bar'
			found = found.root();
			++path_;
		}

		const char_t* path_segment = path_;

		while (*path_segment == delimiter) ++path_segment;

		const char_t* path_segment_end = path_segment;

		while (*path_segment_end && *path_segment_end != delimiter) ++path_segment_end;

		if (path_segment == path_segment_end) return found;

		const char_t* next_segment = path_segment_end;

		while (*next_segment == delimiter) ++next_segment;

		if (*path_segment == '.' && path_segment + 1 == path_segment_end)
			return found.first_element_by_path(next_segment, delimiter);
		else if (*path_segment == '.' && *(path_segment+1) == '.' && path_segment + 2 == path_segment_end)
			return found.parent().first_element_by_path(next_segment, delimiter);
		else
		{
			for (xml_node_struct* j = found._root->first_child; j; j = j->next_sibling)
			{
				if (j->name && impl::strequalrange(j->name, path_segment, static_cast<size_t>(path_segment_end - path_segment)))
				{
					xml_node subsearch = xml_node(j).first_element_by_path(next_segment, delimiter);

					if (subsearch) return subsearch;
				}
			}

			return xml_node();
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
je 0x215d0
movq %rsi, %rbx
movb (%rsi), %cl
testb %cl, %cl
je 0x215d0
cmpb %dl, %cl
jne 0x214cb
movq (%rsp), %rax
testq %rax, %rax
je 0x214c2
movq (%rax), %rcx
shrq $0x8, %rcx
negq %rcx
movq (%rax,%rcx), %rax
addq $-0x40, %rax
jmp 0x214c4
xorl %eax, %eax
movq %rax, (%rsp)
incq %rbx
addq $-0x3, %rbx
movb 0x3(%rbx), %al
incq %rbx
cmpb %dl, %al
je 0x214cf
xorl %r12d, %r12d
movb 0x2(%rbx,%r12), %cl
incq %r12
testb %cl, %cl
je 0x214ec
cmpb %dl, %cl
jne 0x214dc
cmpq $0x1, %r12
jne 0x214fb
movq (%rsp), %rax
jmp 0x215d0
leaq (%rbx,%r12), %r14
leaq -0x1(%r12), %r13
movq %r14, %rcx
incq %r14
cmpb %dl, 0x1(%rcx)
je 0x21504
cmpb $0x2e, %al
setne %cl
cmpq $0x2, %r12
setne %sil
orb %cl, %sil
jne 0x21534
movsbl %dl, %edx
movq %rsp, %rdi
movq %r14, %rsi
callq 0x21476
jmp 0x215d0
cmpb $0x2e, %al
jne 0x2155a
cmpq $0x3, %r12
jne 0x2155a
cmpb $0x2e, 0x3(%rbx)
jne 0x2155a
movq (%rsp), %rax
testq %rax, %rax
je 0x215df
movq 0x18(%rax), %rax
jmp 0x215e1
movq (%rsp), %rax
movq 0x20(%rax), %r15
testq %r15, %r15
je 0x215ce
leaq -0x2(%r12), %rbp
movsbl %dl, %eax
movl %eax, 0xc(%rsp)
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x215c5
movb (%rax), %cl
cmpb 0x2(%rbx), %cl
jne 0x215c5
xorl %ecx, %ecx
cmpq %rcx, %rbp
je 0x215a2
movb 0x1(%rax,%rcx), %sil
leaq 0x1(%rcx), %rdx
cmpb 0x3(%rbx,%rcx), %sil
movq %rdx, %rcx
je 0x21585
cmpq %r13, %rdx
jb 0x215c5
cmpb $0x0, -0x1(%rax,%r12)
jne 0x215c5
movq %r15, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movl 0xc(%rsp), %edx
callq 0x21476
testq %rax, %rax
jne 0x215d0
movq 0x30(%r15), %r15
testq %r15, %r15
jne 0x21573
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movsbl %dl, %edx
jmp 0x21527
nop