// File: /workspace/github_cpp_makefile_star2_O3/jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::xpath_allocator::reallocate(void*, unsigned long, unsigned long)
void* reallocate(void* ptr, size_t old_size, size_t new_size)
		{
			// round size up to block alignment boundary
			old_size = (old_size + xpath_memory_block_alignment - 1) & ~(xpath_memory_block_alignment - 1);
			new_size = (new_size + xpath_memory_block_alignment - 1) & ~(xpath_memory_block_alignment - 1);

			// we can only reallocate the last object
			assert(ptr == 0 || static_cast<char*>(ptr) + old_size == &_root->data[0] + _root_size);

			// try to reallocate the object inplace
			if (ptr && _root_size - old_size + new_size <= _root->capacity)
			{
				_root_size = _root_size - old_size + new_size;
				return ptr;
			}

			// allocate a new block
			void* result = allocate(new_size);
			if (!result) return 0;

			// we have a new block
			if (ptr)
			{
				// copy old data (we only support growing)
				assert(new_size >= old_size);
				memcpy(result, ptr, old_size);

				// free the previous page if it had no other objects
				assert(_root->data == result);
				assert(_root->next);

				if (_root->next->data == ptr)
				{
					// deallocate the whole page, unless it was the first one
					xpath_memory_block* next = _root->next->next;

					if (next)
					{
						xml_memory::deallocate(_root->next);
						_root->next = next;
					}
				}
			}

			return result;
		}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r12
movq %rdi, %r14
addq $0x7, %r12
andq $-0x8, %r12
testq %rsi, %rsi
je 0x2d598
movq %rdx, %r15
movq %rsi, %rbx
addq $0x7, %r15
andq $-0x8, %r15
leaq (%rsi,%r15), %rdx
movq (%r14), %rcx
movq 0x8(%r14), %rax
leaq (%rcx,%rax), %rsi
addq $0x10, %rsi
cmpq %rsi, %rdx
jne 0x2d5c1
subq %r15, %rax
addq %r12, %rax
cmpq 0x8(%rcx), %rax
jbe 0x2d5ac
movq %r14, %rdi
movq %r12, %rsi
callq 0x2bfc0
testq %rax, %rax
je 0x2d5b2
cmpq %r15, %r12
jb 0x2d5e0
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x6090
movq (%r14), %rax
leaq 0x10(%rax), %rcx
cmpq %r13, %rcx
jne 0x2d5ff
movq (%rax), %rdi
testq %rdi, %rdi
je 0x2d61e
leaq 0x10(%rdi), %rax
cmpq %rbx, %rax
jne 0x2d593
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x2d593
callq *0x192c3(%rip)          # 0x46850
movq (%r14), %rax
movq %rbx, (%rax)
movq %r13, %rbx
jmp 0x2d5b4
movq %r14, %rdi
movq %r12, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2bfc0
movq %rax, 0x8(%r14)
jmp 0x2d5b4
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x6d94(%rip), %rdi      # 0x3435c
leaq 0x4956(%rip), %rsi      # 0x31f25
leaq 0x6dd5(%rip), %rcx      # 0x343ab
movl $0x1d7a, %edx           # imm = 0x1D7A
callq 0x6120
leaq 0x6e21(%rip), %rdi      # 0x34408
leaq 0x4937(%rip), %rsi      # 0x31f25
leaq 0x6db6(%rip), %rcx      # 0x343ab
movl $0x1d8b, %edx           # imm = 0x1D8B
callq 0x6120
leaq 0x6e17(%rip), %rdi      # 0x3441d
leaq 0x4918(%rip), %rsi      # 0x31f25
leaq 0x6d97(%rip), %rcx      # 0x343ab
movl $0x1d8f, %edx           # imm = 0x1D8F
callq 0x6120
leaq 0x6e0e(%rip), %rdi      # 0x34433
leaq 0x48f9(%rip), %rsi      # 0x31f25
leaq 0x6d78(%rip), %rcx      # 0x343ab
movl $0x1d90, %edx           # imm = 0x1D90
callq 0x6120