// File: /workspace/github_cpp_makefile_star2_O2/adamiaonr[P]rid-analytics/src/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);

			// adjust root size so that we have not allocated the object at all
			bool only_object = (_root_size == old_size);

			if (ptr) _root_size -= old_size;

			// allocate a new version (this will obviously reuse the memory if possible)
			void* result = allocate(new_size);
			assert(result);

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

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

					xpath_memory_block* next = _root->next->next;

					if (next)
					{
						// deallocate the whole page, unless it was the first one
						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, %r14
movq %rsi, %r15
movq %rdi, %rbx
addq $0x7, %r14
andq $-0x8, %r14
testq %rsi, %rsi
je 0x14733
leaq (%r15,%r14), %rax
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
addq %rdx, %rcx
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x147ba
movq %rdx, (%rsp)
movq %rdx, %rax
subq %r14, %rax
movq %rax, 0x8(%rbx)
jmp 0x1473b
movq 0x8(%rbx), %rax
movq %rax, (%rsp)
addq $0x7, %r12
andq $-0x8, %r12
testq %r15, %r15
sete %bpl
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14836
movq %rax, %r13
cmpq %r15, %rax
sete %al
orb %bpl, %al
jne 0x147a8
cmpq %r14, %r12
jb 0x147d9
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4340
cmpq %r14, (%rsp)
jne 0x147a8
movq (%rbx), %rax
leaq 0x10(%rax), %rcx
cmpq %r13, %rcx
jne 0x147f8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x14817
movq (%rdi), %r14
testq %r14, %r14
je 0x147a8
callq *0x26c4e(%rip)          # 0x3b3f0
movq (%rbx), %rax
movq %r14, (%rax)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x143ff(%rip), %rdi     # 0x28bc0
leaq 0x1202d(%rip), %rsi     # 0x267f5
leaq 0x14440(%rip), %rcx     # 0x28c0f
movl $0x1d2d, %edx           # imm = 0x1D2D
callq 0x42a0
leaq 0x1448c(%rip), %rdi     # 0x28c6c
leaq 0x1200e(%rip), %rsi     # 0x267f5
leaq 0x14421(%rip), %rcx     # 0x28c0f
movl $0x1d3c, %edx           # imm = 0x1D3C
callq 0x42a0
leaq 0x14482(%rip), %rdi     # 0x28c81
leaq 0x11fef(%rip), %rsi     # 0x267f5
leaq 0x14402(%rip), %rcx     # 0x28c0f
movl $0x1d42, %edx           # imm = 0x1D42
callq 0x42a0
leaq 0x14479(%rip), %rdi     # 0x28c97
leaq 0x11fd0(%rip), %rsi     # 0x267f5
leaq 0x143e3(%rip), %rcx     # 0x28c0f
movl $0x1d43, %edx           # imm = 0x1D43
callq 0x42a0