// File: /workspace/github_cpp_makefile_star2_O3/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
cmpq $0x0, 0x68(%rdi)
je 0x200c1
movq %r14, %rax
movq %rax, %rcx
movq 0x68(%rax), %rax
testq %rax, %rax
jne 0x200a1
movl 0x8(%rcx), %eax
movq %r14, %rdx
movq %rdx, %rcx
movq 0x68(%rdx), %rdx
testq %rdx, %rdx
jne 0x200b3
jmp 0x200c8
movl 0x8(%r14), %eax
movq %r14, %rcx
cmpl 0xc(%rcx), %eax
jne 0x202b9
movq %rbx, %rdi
callq 0x1b2de
testb %al, %al
jne 0x200e5
movq %rbx, %rdi
callq 0x1b326
movl 0x10(%r14), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x9920
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x9986
movq %r14, %rdi
callq 0x1b448
testb %al, %al
je 0x20194
movl (%rbx), %ebp
movq %rbx, %rdi
callq 0x1b660
testb %al, %al
je 0x20146
cmpq $0x0, 0x68(%rbx)
movq %rbx, %rax
je 0x2013d
movq %rbx, %rcx
movq %rcx, %rax
movq 0x68(%rcx), %rcx
testq %rcx, %rcx
jne 0x20131
movl 0x8(%rax), %eax
cltd
idivl 0x10(%rbx)
movl %edx, %ebp
testl %ebp, %ebp
jle 0x202ae
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 0x2016a
incq %r8
incq %rdi
addq %rax, %rcx
addq %rax, %rdx
cmpq %rsi, %r8
jne 0x20167
jmp 0x202ae
cmpq $0x0, 0x28(%r14)
movabsq $0x100000001, %r15      # imm = 0x100000001
je 0x20215
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0xbb5e(%rip), %rcx      # 0x2bd18
movq %rcx, (%rax)
leaq 0x10(%rax), %rsi
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 %rsi, 0x28(%rbx)
movq 0x30(%rbx), %rdi
movq %rax, 0x30(%rbx)
testq %rdi, %rdi
je 0x20208
callq 0x1b482
movq 0x28(%rbx), %rsi
movq %rbx, 0x68(%rsi)
movq 0x28(%r14), %rdi
callq 0x2008a
movq 0x48(%r14), %rax
testq %rax, %rax
je 0x20237
movq %rax, 0x48(%rbx)
leaq 0x50(%rbx), %rdi
leaq 0x50(%r14), %rsi
callq 0x1c8e8
movq 0x48(%rbx), %rax
movq %rbx, 0x68(%rax)
cmpq $0x0, 0x58(%r14)
je 0x202ae
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0xbac5(%rip), %rcx      # 0x2bd18
movq %rcx, (%rax)
leaq 0x10(%rax), %rsi
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 %rsi, 0x58(%rbx)
movq 0x60(%rbx), %rdi
movq %rax, 0x60(%rbx)
testq %rdi, %rdi
je 0x202a1
callq 0x1b482
movq 0x58(%rbx), %rsi
movq %rbx, 0x68(%rsi)
movq 0x58(%r14), %rdi
callq 0x2008a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x56c8(%rip), %rsi      # 0x25995
movq %rax, %rdi
callq 0x20a0
movq 0xbd14(%rip), %rsi      # 0x2bff0
movq 0xbcdd(%rip), %rdx      # 0x2bfc0
movq %rbx, %rdi
callq 0x2290
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x22b0