// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
addq $0x7, %r15
andq $-0x8, %r15
addq $0x7, %r12
andq $-0x8, %r12
testq %rsi, %rsi
je 0x2da3f
leaq (%rbx,%r15), %rax
movq (%r14), %rcx
movq 0x8(%r14), %rdx
addq %rdx, %rcx
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x2daca
testq %rbx, %rbx
je 0x2da3f
movq (%r14), %rcx
movq 0x8(%r14), %rax
subq %r15, %rax
addq %r12, %rax
cmpq 0x8(%rcx), %rax
jbe 0x2dac4
testq %rbx, %rbx
sete %bpl
movq %r14, %rdi
movq %r12, %rsi
callq 0x2c52c
movq %rax, %r13
testq %rax, %rax
sete %al
orb %bpl, %al
jne 0x2daaf
cmpq %r15, %r12
jb 0x2dae9
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x6090
movq (%r14), %rax
leaq 0x10(%rax), %rcx
cmpq %r13, %rcx
jne 0x2db08
movq (%rax), %rdi
testq %rdi, %rdi
je 0x2db27
leaq 0x10(%rdi), %rax
cmpq %rbx, %rax
jne 0x2daaf
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x2daaf
callq *0x19da7(%rip)          # 0x47850
movq (%r14), %rax
movq %rbx, (%rax)
movq %r13, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, 0x8(%r14)
jmp 0x2dab2
leaq 0x7a35(%rip), %rdi      # 0x35506
leaq 0x541d(%rip), %rsi      # 0x32ef5
leaq 0x7a76(%rip), %rcx      # 0x35555
movl $0x1d7a, %edx           # imm = 0x1D7A
callq 0x6120
leaq 0x7ac2(%rip), %rdi      # 0x355b2
leaq 0x53fe(%rip), %rsi      # 0x32ef5
leaq 0x7a57(%rip), %rcx      # 0x35555
movl $0x1d8b, %edx           # imm = 0x1D8B
callq 0x6120
leaq 0x7ab8(%rip), %rdi      # 0x355c7
leaq 0x53df(%rip), %rsi      # 0x32ef5
leaq 0x7a38(%rip), %rcx      # 0x35555
movl $0x1d8f, %edx           # imm = 0x1D8F
callq 0x6120
leaq 0x7aaf(%rip), %rdi      # 0x355dd
leaq 0x53c0(%rip), %rsi      # 0x32ef5
leaq 0x7a19(%rip), %rcx      # 0x35555
movl $0x1d90, %edx           # imm = 0x1D90
callq 0x6120