// File: jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::xpath_ast_node::eval_boolean(pugi::impl::(anonymous namespace)::xpath_context const&, pugi::impl::(anonymous namespace)::xpath_stack const&)
bool eval_boolean(const xpath_context& c, const xpath_stack& stack)
		{
			switch (_type)
			{
			case ast_op_or:
				return _left->eval_boolean(c, stack) || _right->eval_boolean(c, stack);

			case ast_op_and:
				return _left->eval_boolean(c, stack) && _right->eval_boolean(c, stack);

			case ast_op_equal:
				return compare_eq(_left, _right, c, stack, equal_to());

			case ast_op_not_equal:
				return compare_eq(_left, _right, c, stack, not_equal_to());

			case ast_op_less:
				return compare_rel(_left, _right, c, stack, less());

			case ast_op_greater:
				return compare_rel(_right, _left, c, stack, less());

			case ast_op_less_or_equal:
				return compare_rel(_left, _right, c, stack, less_equal());

			case ast_op_greater_or_equal:
				return compare_rel(_right, _left, c, stack, less_equal());

			case ast_func_starts_with:
			{
				xpath_allocator_capture cr(stack.result);

				xpath_string lr = _left->eval_string(c, stack);
				xpath_string rr = _right->eval_string(c, stack);

				return starts_with(lr.c_str(), rr.c_str());
			}

			case ast_func_contains:
			{
				xpath_allocator_capture cr(stack.result);

				xpath_string lr = _left->eval_string(c, stack);
				xpath_string rr = _right->eval_string(c, stack);

				return find_substring(lr.c_str(), rr.c_str()) != 0;
			}

			case ast_func_boolean:
				return _left->eval_boolean(c, stack);

			case ast_func_not:
				return !_left->eval_boolean(c, stack);

			case ast_func_true:
				return true;

			case ast_func_false:
				return false;

			case ast_func_lang:
			{
				if (c.n.attribute()) return false;

				xpath_allocator_capture cr(stack.result);

				xpath_string lang = _left->eval_string(c, stack);

				for (xml_node n = c.n.node(); n; n = n.parent())
				{
					xml_attribute a = n.attribute(PUGIXML_TEXT("xml:lang"));

					if (a)
					{
						const char_t* value = a.value();

						// strnicmp / strncasecmp is not portable
						for (const char_t* lit = lang.c_str(); *lit; ++lit)
						{
							if (tolower_ascii(*lit) != tolower_ascii(*value)) return false;
							++value;
						}

						return *value == 0 || *value == '-';
					}
				}

				return false;
			}

			case ast_opt_compare_attribute:
			{
				const char_t* value = (_right->_type == ast_string_constant) ? _right->_data.string : _right->_data.variable->get_string();

				xml_attribute attr = c.n.node().attribute(_left->_data.nodetest);

				return attr && strequal(attr.value(), value) && is_xpath_attribute(attr.name());
			}

			case ast_variable:
			{
				assert(_rettype == _data.variable->type());

				if (_rettype == xpath_type_boolean)
					return _data.variable->get_boolean();
			}

			// fallthrough
			default:
			{
				switch (_rettype)
				{
				case xpath_type_number:
					return convert_number_to_boolean(eval_number(c, stack));

				case xpath_type_string:
				{
					xpath_allocator_capture cr(stack.result);

					return !eval_string(c, stack).empty();
				}

				case xpath_type_node_set:
				{
					xpath_allocator_capture cr(stack.result);

					return !eval_node_set(c, stack, nodeset_eval_any).empty();
				}

				default:
					assert(false && "Wrong expression for return type boolean"); // unreachable
					return false;
				}
			}
			}
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movsbl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x1e0(%rbp)
subl $0x3a, %eax
ja 0x4be7e
movq -0x1e0(%rbp), %rax
leaq 0x1f16d(%rip), %rcx     # 0x6a874
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4b6c0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x1e9(%rbp)
jne 0x4b755
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4b6c0
movb %al, -0x1e9(%rbp)
movb -0x1e9(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4b6c0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x1ea(%rbp)
jne 0x4b78e
jmp 0x4b7ac
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4b6c0
movb %al, -0x1ea(%rbp)
movb -0x1ea(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x21(%rbp), %r8
callq 0x5e5c0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x22(%rbp), %r8
callq 0x5ee90
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x23(%rbp), %r8
callq 0x5f760
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x24(%rbp), %r8
callq 0x5f760
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x25(%rbp), %r8
callq 0x5ffa0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x26(%rbp), %r8
callq 0x5ffa0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x20(%rbp), %rax
movq (%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x607e0
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x60(%rbp), %rdi
callq 0x4cd60
jmp 0x4b8e6
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x88(%rbp), %rdi
callq 0x4cd60
jmp 0x4b907
leaq -0x60(%rbp), %rdi
callq 0x4e1e0
movq %rax, -0x1f8(%rbp)
jmp 0x4b919
leaq -0x88(%rbp), %rdi
callq 0x4e1e0
movq %rax, -0x200(%rbp)
jmp 0x4b92e
movq -0x200(%rbp), %rsi
movq -0x1f8(%rbp), %rdi
callq 0x60820
movb %al, -0x201(%rbp)
jmp 0x4b949
movb -0x201(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x60890
jmp 0x4c00b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x60890
jmp 0x4c019
movq -0x20(%rbp), %rax
movq (%rax), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x607e0
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0xc0(%rbp), %rdi
callq 0x4cd60
jmp 0x4b9b0
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0xd8(%rbp), %rdi
callq 0x4cd60
jmp 0x4b9d1
leaq -0xc0(%rbp), %rdi
callq 0x4e1e0
movq %rax, -0x210(%rbp)
jmp 0x4b9e6
leaq -0xd8(%rbp), %rdi
callq 0x4e1e0
movq %rax, -0x218(%rbp)
jmp 0x4b9fb
movq -0x218(%rbp), %rsi
movq -0x210(%rbp), %rdi
callq 0x608c0
movq %rax, -0x220(%rbp)
jmp 0x4ba17
movq -0x220(%rbp), %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x60890
jmp 0x4c00b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x60890
jmp 0x4c019
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4b6c0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4b6c0
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movb $0x1, -0x1(%rbp)
jmp 0x4c00b
movb $0x0, -0x1(%rbp)
jmp 0x4c00b
movq -0x18(%rbp), %rdi
callq 0x496d0
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x40990
cmpq $0x0, %rax
je 0x4badb
movb $0x0, -0x1(%rbp)
jmp 0x4c00b
movq -0x20(%rbp), %rax
movq (%rax), %rsi
leaq -0x100(%rbp), %rdi
callq 0x607e0
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x118(%rbp), %rdi
callq 0x4cd60
jmp 0x4bb0f
movq -0x18(%rbp), %rdi
callq 0x49680
movq %rax, -0x228(%rbp)
jmp 0x4bb21
movq -0x228(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x41c30
cmpq $0x0, %rax
je 0x4bcf0
leaq 0x221b9(%rip), %rsi     # 0x6dd05
leaq -0x120(%rbp), %rdi
callq 0x42260
movq %rax, -0x230(%rbp)
jmp 0x4bb61
movq -0x230(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x40990
cmpq $0x0, %rax
je 0x4bcb8
leaq -0x128(%rbp), %rdi
callq 0x41070
movq %rax, -0x130(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x4e1e0
movq %rax, -0x238(%rbp)
jmp 0x4bbad
movq -0x238(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rax
cmpb $0x0, (%rax)
je 0x4bc74
movq -0x138(%rbp), %rax
movsbl (%rax), %edi
callq 0x608f0
movb %al, -0x239(%rbp)
jmp 0x4bbe2
movb -0x239(%rbp), %al
movsbl %al, %eax
movl %eax, -0x240(%rbp)
movq -0x130(%rbp), %rax
movsbl (%rax), %edi
callq 0x608f0
movb %al, -0x23a(%rbp)
jmp 0x4bc08
movl -0x240(%rbp), %eax
movb -0x23a(%rbp), %cl
movsbl %cl, %ecx
cmpl %ecx, %eax
je 0x4bc4b
movb $0x0, -0x1(%rbp)
movl $0x1, -0x13c(%rbp)
jmp 0x4bcfe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x60890
jmp 0x4c019
movq -0x130(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x130(%rbp)
movq -0x138(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x138(%rbp)
jmp 0x4bbbb
movq -0x130(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x241(%rbp)
je 0x4bca1
movq -0x130(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
sete %al
movb %al, -0x241(%rbp)
movb -0x241(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0x13c(%rbp)
jmp 0x4bcfe
jmp 0x4bcba
leaq -0x120(%rbp), %rdi
callq 0x426e0
movq %rax, -0x250(%rbp)
jmp 0x4bccf
movq -0x250(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x120(%rbp)
jmp 0x4bb2f
movb $0x0, -0x1(%rbp)
movl $0x1, -0x13c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x60890
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rax
movsbl (%rax), %eax
cmpl $0x12, %eax
jne 0x4bd3a
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x258(%rbp)
jmp 0x4bd55
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rdi
callq 0x4a270
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x18(%rbp), %rdi
callq 0x49680
movq %rax, %rcx
movq -0x1e8(%rbp), %rax
movq %rcx, -0x160(%rbp)
movq 0x8(%rax), %rax
movq 0x20(%rax), %rsi
leaq -0x160(%rbp), %rdi
callq 0x42260
movq %rax, -0x158(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x40990
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x259(%rbp)
je 0x4bdfb
leaq -0x158(%rbp), %rdi
callq 0x41070
movq %rax, %rdi
movq -0x150(%rbp), %rsi
callq 0x421f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x259(%rbp)
jne 0x4bde1
jmp 0x4bdfb
leaq -0x158(%rbp), %rdi
callq 0x41020
movq %rax, %rdi
callq 0x60920
movb %al, -0x259(%rbp)
movb -0x259(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x1e8(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl %ecx, -0x260(%rbp)
movq 0x20(%rax), %rdi
callq 0x4a1d0
movl %eax, %ecx
movl -0x260(%rbp), %eax
cmpl %ecx, %eax
jne 0x4be33
jmp 0x4be52
leaq 0x21ed4(%rip), %rdi     # 0x6dd0e
leaq 0x1f514(%rip), %rsi     # 0x6b355
movl $0x2821, %edx           # imm = 0x2821
leaq 0x21ee4(%rip), %rcx     # 0x6dd31
callq 0x7180
movq -0x1e8(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x4, %eax
jne 0x4be7c
movq -0x1e8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4a1e0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
jmp 0x4be7e
movq -0x1e8(%rbp), %rax
movsbl 0x1(%rax), %eax
movl %eax, -0x264(%rbp)
subl $0x1, %eax
je 0x4bf63
jmp 0x4be9a
movl -0x264(%rbp), %eax
subl $0x2, %eax
je 0x4beb7
jmp 0x4bea7
movl -0x264(%rbp), %eax
subl $0x3, %eax
je 0x4beda
jmp 0x4bfec
movq -0x1e8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4c1a0
callq 0x60980
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4c00b
movq -0x20(%rbp), %rax
movq (%rax), %rsi
leaq -0x180(%rbp), %rdi
callq 0x607e0
movq -0x1e8(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x198(%rbp), %rdi
callq 0x4cd60
jmp 0x4bf0a
leaq -0x198(%rbp), %rdi
callq 0x609c0
movb %al, -0x265(%rbp)
jmp 0x4bf1e
movb -0x265(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0x13c(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x60890
jmp 0x4c00b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x60890
jmp 0x4c019
movq -0x20(%rbp), %rax
movq (%rax), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x607e0
movq -0x1e8(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x1d8(%rbp), %rdi
movl $0x1, %r8d
callq 0x4e6d0
jmp 0x4bf99
leaq -0x1d8(%rbp), %rdi
callq 0x609e0
movb %al, -0x266(%rbp)
jmp 0x4bfad
movb -0x266(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0x13c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x60890
jmp 0x4c00b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x60890
jmp 0x4c019
leaq 0x21daf(%rip), %rdi     # 0x6dda2
leaq 0x1f35b(%rip), %rsi     # 0x6b355
movl $0x283e, %edx           # imm = 0x283E
leaq 0x21d2b(%rip), %rcx     # 0x6dd31
callq 0x7180
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x7600
nopw %cs:(%rax,%rax)