// File: /workspace/github_cpp_makefile_star2_O1/toxaart[P]hierarchical_block_sparse_lib/source/HierarchicalBlockSparseMatrix.h
// Function: hbsm::HierarchicalBlockSparseMatrix<double>::get_upper_triangle(hbsm::HierarchicalBlockSparseMatrix<double>&) const
void HierarchicalBlockSparseMatrix<Treal>::get_upper_triangle(HierarchicalBlockSparseMatrix<Treal> & A) const {

			if(get_n_rows() != get_n_cols()) throw std::runtime_error("Error in HierarchicalBlockSparseMatrix::get_upper_triangle(): call for non-square matrix!");

			if(!A.empty())A.clear();

			A.set_params(get_params());
			A.resize(nRows_orig,nCols_orig);

			if(lowest_level()){

				int blocksize = A.nRows;
				int M = A.nRows;
				if(A.on_bottom_boundary()) M = A.get_n_rows() % A.blocksize; // fill only necessary elements

				for (int col = 0; col < M; col++){
					for (int row = 0; row <= col; row++) {
						 A.submatrix[col * nRows + row] = submatrix[col * nRows + row];
					}
			   }

			   return;
			}

			// children 0 and 3 are recursive, child 2 is just a copy
			if(children[0] != NULL){
				A.children[0] = std::make_shared<HierarchicalBlockSparseMatrix<Treal> >();
				A.children[0]->parent = &A;
				children[0]->get_upper_triangle(*A.children[0]);
			}

			// child2
			if(children[2] != NULL){
				A.children[2] = children[2];
				A.children[2]->parent = &A;
			}

			if(children[3] != NULL){
				A.children[3] = std::make_shared<HierarchicalBlockSparseMatrix<Treal> >();
				A.children[3]->parent = &A;
				children[3]->get_upper_triangle(*A.children[3]);
			}

			return;
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x68(%rdi), %rax
movq %rdi, %rcx
testq %rax, %rax
je 0x1fa96
movq %r14, %rdx
movq %rdx, %rcx
movq 0x68(%rdx), %rdx
testq %rdx, %rdx
jne 0x1fa8a
movl 0x8(%rcx), %ecx
movq %r14, %rdx
testq %rax, %rax
je 0x1fab0
movq %r14, %rax
movq %rax, %rdx
movq 0x68(%rax), %rax
testq %rax, %rax
jne 0x1faa4
cmpl 0xc(%rdx), %ecx
jne 0x1fca1
movq %rbx, %rdi
callq 0x1ad92
testb %al, %al
jne 0x1facd
movq %rbx, %rdi
callq 0x1adc6
movl 0x10(%r14), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x9974
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x99da
movq %r14, %rdi
callq 0x1aed4
testb %al, %al
je 0x1fb7c
movl (%rbx), %ebp
movq %rbx, %rdi
callq 0x1b0e6
testb %al, %al
je 0x1fb2e
cmpq $0x0, 0x68(%rbx)
movq %rbx, %rax
je 0x1fb25
movq %rbx, %rcx
movq %rcx, %rax
movq 0x68(%rcx), %rcx
testq %rcx, %rcx
jne 0x1fb19
movl 0x8(%rax), %eax
cltd
idivl 0x10(%rbx)
movl %edx, %ebp
testl %ebp, %ebp
jle 0x1fc96
movslq (%r14), %rax
movq 0x70(%r14), %rcx
movq 0x70(%rbx), %rdx
movl %ebp, %esi
shlq $0x3, %rax
movl $0x1, %edi
xorl %r8d, %r8d
xorl %r9d, %r9d
movsd (%rcx,%r9,8), %xmm0
movsd %xmm0, (%rdx,%r9,8)
incq %r9
cmpq %r9, %rdi
jne 0x1fb52
incq %r8
incq %rdi
addq %rax, %rcx
addq %rax, %rdx
cmpq %rsi, %r8
jne 0x1fb4f
jmp 0x1fc96
cmpq $0x0, 0x28(%r14)
movabsq $0x100000001, %r15      # imm = 0x100000001
je 0x1fbfd
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0xb13e(%rip), %rcx      # 0x2ace0
movq %rcx, (%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, 0x28(%rbx)
movq 0x30(%rbx), %rdi
movq %rax, 0x30(%rbx)
testq %rdi, %rdi
je 0x1fbec
callq 0x1af0e
movq 0x28(%rbx), %rsi
movq %rbx, 0x68(%rsi)
movq 0x28(%r14), %rdi
callq 0x1fa6e
movq 0x48(%r14), %rax
testq %rax, %rax
je 0x1fc1f
movq %rax, 0x48(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x50(%r14), %rsi
callq 0x1c38c
movq 0x48(%rbx), %rax
movq %rbx, 0x68(%rax)
cmpq $0x0, 0x58(%r14)
je 0x1fc96
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0xb0a5(%rip), %rcx      # 0x2ace0
movq %rcx, (%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, 0x58(%rbx)
movq 0x60(%rbx), %rdi
movq %rax, 0x60(%rbx)
testq %rdi, %rdi
je 0x1fc85
callq 0x1af0e
movq 0x58(%rbx), %rsi
movq %rbx, 0x68(%rsi)
movq 0x58(%r14), %rdi
callq 0x1fa6e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x4c80(%rip), %rsi      # 0x24935
movq %rax, %rdi
callq 0x20a0
movq 0xb32c(%rip), %rsi      # 0x2aff0
movq 0xb2f5(%rip), %rdx      # 0x2afc0
movq %rbx, %rdi
callq 0x2290
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x22b0