// File: /workspace/github_cpp_makefile_star2_O1/toxaart[P]hierarchical_block_sparse_lib/source/HierarchicalBlockSparseMatrix.h
// Function: hbsm::HierarchicalBlockSparseMatrix<double>::copy(hbsm::HierarchicalBlockSparseMatrix<double> const&, unsigned long*)
void HierarchicalBlockSparseMatrix<Treal>::copy(const HierarchicalBlockSparseMatrix<Treal> &other, size_t* no_of_resizes) {

			if(this == &other) return; // no need to copy itself to itself

			if(other.empty()){
				this->clear();
				return;
			}

			if(!empty()) clear();

			set_params(other.get_params());
			resize(other.nRows,other.nCols, no_of_resizes);
			nRows_orig = other.nRows_orig;
			nCols_orig = other.nCols_orig;


			if(other.lowest_level()){
				memcpy(&submatrix[0], &(other.submatrix[0]), sizeof(Treal) * other.submatrix.size());
				return;
			}

			frob_norm_squared_internal = other.frob_norm_squared_internal;
			n_block_multiplies = other.n_block_multiplies;

			for(int i = 0; i < 4; ++i){
				if(children[i] != NULL)
					throw std::runtime_error("Error in HierarchicalBlockSparseMatrix::copy(): non-null child exist!");

				if(other.children[i] != NULL){
					children[i] = std::make_shared<HierarchicalBlockSparseMatrix<Treal> >();
					children[i]->copy(*other.children[i], no_of_resizes);
					children[i]->parent = this;
				}


			}


		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rsi, %rdi
je 0x60c0
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x4338
testb %al, %al
je 0x5f97
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4422
movq %r14, %rdi
callq 0x4338
testb %al, %al
jne 0x5fab
movq %r14, %rdi
callq 0x4422
movl 0x10(%rbx), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0x42d2
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movq %r14, %rdi
movq %r15, %rcx
callq 0x436c
movl 0x8(%rbx), %eax
movl %eax, 0x8(%r14)
movl 0xc(%rbx), %eax
movl %eax, 0xc(%r14)
movq %rbx, %rdi
callq 0x6b36
testb %al, %al
je 0x6000
movq 0x70(%r14), %rdi
movq 0x70(%rbx), %rsi
movq 0x78(%rbx), %rdx
subq %rsi, %rdx
callq 0x2100
jmp 0x60c0
movsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x18(%r14)
movq 0x20(%rbx), %rax
movq %rax, 0x20(%r14)
movl $0x30, %r12d
movabsq $0x100000001, %r13      # imm = 0x100000001
leaq 0x7cb6(%rip), %rbp      # 0xdce0
cmpq $0x0, -0x8(%r14,%r12)
jne 0x60cf
cmpq $0x0, -0x8(%rbx,%r12)
je 0x60b2
movl $0x98, %edi
callq 0x2130
movq %r13, 0x8(%rax)
movq %rbp, (%rax)
leaq 0x10(%rax), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x38(%rax)
movups %xmm0, 0x48(%rax)
movups %xmm0, 0x58(%rax)
movups %xmm0, 0x68(%rax)
movups %xmm0, 0x78(%rax)
movups %xmm0, 0x88(%rax)
movq %rcx, -0x8(%r14,%r12)
movq (%r14,%r12), %rdi
movq %rax, (%r14,%r12)
testq %rdi, %rdi
je 0x6097
callq 0x6b64
movq -0x8(%r14,%r12), %rdi
movq -0x8(%rbx,%r12), %rsi
movq %r15, %rdx
callq 0x5f58
movq -0x8(%r14,%r12), %rax
movq %r14, 0x68(%rax)
addq $0x10, %r12
cmpq $0x70, %r12
jne 0x602a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x2070
movq %rax, %rbx
leaq 0x5023(%rip), %rsi      # 0xb106
movq %rax, %rdi
callq 0x2060
movq 0x7efe(%rip), %rsi      # 0xdff0
movq 0x7ec7(%rip), %rdx      # 0xdfc0
movq %rbx, %rdi
callq 0x21a0
movq %rax, %r14
movq %rbx, %rdi
callq 0x20e0
movq %r14, %rdi
callq 0x21c0