// File: jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::xpath_ast_node::eval_string_concat(pugi::impl::(anonymous namespace)::xpath_context const&, pugi::impl::(anonymous namespace)::xpath_stack const&)
xpath_string eval_string_concat(const xpath_context& c, const xpath_stack& stack)
		{
			assert(_type == ast_func_concat);

			xpath_allocator_capture ct(stack.temp);

			// count the string number
			size_t count = 1;
			for (xpath_ast_node* nc = _right; nc; nc = nc->_next) count++;

			// allocate a buffer for temporary string objects
			xpath_string* buffer = static_cast<xpath_string*>(stack.temp->allocate(count * sizeof(xpath_string)));
			if (!buffer) return xpath_string();

			// evaluate all strings to temporary stack
			xpath_stack swapped_stack = {stack.temp, stack.result};

			buffer[0] = _left->eval_string(c, swapped_stack);

			size_t pos = 1;
			for (xpath_ast_node* n = _right; n; n = n->_next, ++pos) buffer[pos] = n->eval_string(c, swapped_stack);
			assert(pos == count);

			// get total length
			size_t length = 0;
			for (size_t i = 0; i < count; ++i) length += buffer[i].length();

			// create final string
			char_t* result = static_cast<char_t*>(stack.result->allocate((length + 1) * sizeof(char_t)));
			if (!result) return xpath_string();

			char_t* ri = result;

			for (size_t j = 0; j < count; ++j)
				for (const char_t* bi = buffer[j].c_str(); *bi; ++bi)
					*ri++ = *bi;

			*ri = 0;

			return xpath_string::from_heap_preallocated(result, ri);
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0xf8(%rbp)
movq %rdi, -0xf0(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0x6158a
jmp 0x615a9
leaq 0xce5b(%rip), %rdi      # 0x6e3ec
leaq 0x9dbd(%rip), %rsi      # 0x6b355
movl $0x28cf, %edx           # imm = 0x28CF
leaq 0xce61(%rip), %rcx      # 0x6e405
callq 0x7180
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x38(%rbp), %rdi
callq 0x607e0
movq -0xe8(%rbp), %rax
movq $0x1, -0x40(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x615f2
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x615d1
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x40(%rbp), %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x5cde0
movq %rax, -0x100(%rbp)
jmp 0x61614
movq -0x100(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x6165a
movq -0xf8(%rbp), %rdi
callq 0x4e460
jmp 0x61634
movl $0x1, -0x60(%rbp)
jmp 0x61914
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x60890
jmp 0x6192d
movq -0xe8(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, -0x70(%rbp)
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, -0x68(%rbp)
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rdx
leaq -0x88(%rbp), %rdi
leaq -0x70(%rbp), %rcx
callq 0x4cd60
jmp 0x61692
movq -0xe8(%rbp), %rax
movq -0x50(%rbp), %rcx
movq -0x88(%rbp), %rdx
movq %rdx, (%rcx)
movq -0x80(%rbp), %rdx
movq %rdx, 0x8(%rcx)
movq -0x78(%rbp), %rdx
movq %rdx, 0x10(%rcx)
movq $0x1, -0x90(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0x61749
movq -0x98(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0xb0(%rbp), %rdi
leaq -0x70(%rbp), %rcx
callq 0x4cd60
jmp 0x616f4
movq -0x50(%rbp), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq -0xb0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xa8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xa0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x616cd
movq -0x90(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x61758
jmp 0x61777
leaq 0xcd25(%rip), %rdi      # 0x6e484
leaq 0x9bef(%rip), %rsi      # 0x6b355
movl $0x28e2, %edx           # imm = 0x28E2
leaq 0xcc93(%rip), %rcx      # 0x6e405
callq 0x7180
movq $0x0, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x617e4
movq -0x50(%rbp), %rax
movq -0xc0(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x4e200
movq %rax, -0x108(%rbp)
jmp 0x617bb
movq -0x108(%rbp), %rax
addq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0x6178d
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x5cde0
movq %rax, -0x110(%rbp)
jmp 0x61803
movq -0x110(%rbp), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xc8(%rbp)
jne 0x61835
movq -0xf8(%rbp), %rdi
callq 0x4e460
jmp 0x61829
movl $0x1, -0x60(%rbp)
jmp 0x61914
movq -0xc8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq $0x0, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x618e7
movq -0x50(%rbp), %rax
movq -0xd8(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x4e1e0
movq %rax, -0x118(%rbp)
jmp 0x61880
movq -0x118(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
cmpb $0x0, (%rax)
je 0x618ce
movq -0xe0(%rbp), %rax
movb (%rax), %cl
movq -0xd0(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0xd0(%rbp)
movb %cl, (%rax)
movq -0xe0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe0(%rbp)
jmp 0x6188e
jmp 0x618d0
movq -0xd8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xd8(%rbp)
jmp 0x6184e
movq -0xf8(%rbp), %rdi
movq -0xd0(%rbp), %rax
movb $0x0, (%rax)
movq -0xc8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
callq 0x61be0
jmp 0x6190d
movl $0x1, -0x60(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x60890
movq -0xf0(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x7600
nopw %cs:(%rax,%rax)