// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq -0x10(%rbp), %rax
jne 0x79b7
jmp 0x7bff
movq -0x10(%rbp), %rdi
callq 0x4970
testb $0x1, %al
jne 0x79c6
jmp 0x79d4
movq -0x48(%rbp), %rdi
callq 0x4be0
jmp 0x7bff
movq -0x48(%rbp), %rdi
callq 0x4970
testb $0x1, %al
jne 0x79ea
movq -0x48(%rbp), %rdi
callq 0x4be0
movq -0x10(%rbp), %rdi
callq 0xbc70
movq -0x48(%rbp), %rdi
movl %eax, -0x1c(%rbp)
leaq -0x1c(%rbp), %rsi
callq 0x48e0
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x18(%rbp), %rcx
callq 0x49d0
movq -0x48(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x97b0
testb $0x1, %al
jne 0x7a44
jmp 0x7a94
movq -0x48(%rbp), %rdi
addq $0x70, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5070
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
addq $0x70, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9c20
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
addq $0x70, %rdi
callq 0x8cf0
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rax, %rdx
shlq $0x3, %rdx
callq 0x2160
jmp 0x7bff
movq -0x48(%rbp), %rax
movq -0x10(%rbp), %rcx
movsd 0x18(%rcx), %xmm0
movsd %xmm0, 0x18(%rax)
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq %rcx, 0x20(%rax)
movl $0x0, -0x20(%rbp)
cmpl $0x4, -0x20(%rbp)
jge 0x7bff
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9800
testb $0x1, %al
jne 0x7ae5
jmp 0x7b38
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x60(%rbp)
leaq 0xa5c6(%rip), %rsi      # 0x120c6
callq 0x2070
jmp 0x7b07
movq -0x60(%rbp), %rdi
movq 0x104de(%rip), %rsi     # 0x17ff0
movq 0x104a7(%rip), %rdx     # 0x17fc0
callq 0x22c0
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x2130
jmp 0x7c05
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movslq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9800
testb $0x1, %al
jne 0x7b5d
jmp 0x7bef
leaq -0x40(%rbp), %rdi
callq 0xbc00
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq -0x40(%rbp), %rsi
callq 0x9870
leaq -0x40(%rbp), %rdi
callq 0x98a0
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x9830
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movslq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0xe570
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x7990
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x9830
movq -0x48(%rbp), %rcx
movq %rcx, 0x68(%rax)
jmp 0x7bf1
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x7ab9
addq $0x70, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x22e0
nop