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

			if(!C.empty()) throw std::runtime_error("Error in HierarchicalBlockSparseMatrix::transpose(): non-empty matrix to write result!");

			C.set_params(A.get_params());

			C.resize(A.nCols_orig,A.nRows_orig); // reverse order

			if(A.lowest_level()){
				int blocksize = A.blocksize;
				int M = A.nRows;
				int N = A.nCols;
				if(A.on_bottom_boundary()) M = A.get_n_rows() % A.blocksize; // fill only necessary elements
				if(A.on_right_boundary()) N = A.get_n_cols() % A.blocksize; // fill only necessary elements

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

				return;
			}

			if(A.children[0] != NULL) {
				C.children[0] = std::make_shared<HierarchicalBlockSparseMatrix<Treal> >();
				transpose(*A.children[0], *C.children[0]);
			}

			if(A.children[1] != NULL){
				C.children[2] = std::make_shared<HierarchicalBlockSparseMatrix<Treal> >();
				transpose(*A.children[1], *C.children[2]);
			}

			if(A.children[2] != NULL){
				C.children[1] = std::make_shared<HierarchicalBlockSparseMatrix<Treal> >();
				transpose(*A.children[2], *C.children[1]);
			}

			if(A.children[3] != NULL){
				C.children[3] = std::make_shared<HierarchicalBlockSparseMatrix<Treal> >();
				transpose(*A.children[3], *C.children[3]);
			}

			return;

		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1ad92
testb %al, %al
je 0x9dca
movl 0x10(%r14), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x9974
movl 0x8(%r14), %edx
movl 0xc(%r14), %esi
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x99da
movq %r14, %rdi
callq 0x1aed4
testb %al, %al
je 0x9be7
movslq 0x10(%r14), %r12
movl (%r14), %ebp
movl 0x4(%r14), %r15d
movq %r14, %rdi
callq 0x1b0e6
testb %al, %al
je 0x9b67
cmpq $0x0, 0x68(%r14)
movq %r14, %rax
je 0x9b5d
movq %r14, %rcx
movq %rcx, %rax
movq 0x68(%rcx), %rcx
testq %rcx, %rcx
jne 0x9b51
movl 0x8(%rax), %eax
cltd
idivl 0x10(%r14)
movl %edx, %ebp
movq %r14, %rdi
callq 0x1b13c
testb %al, %al
je 0x9b97
cmpq $0x0, 0x68(%r14)
movq %r14, %rax
je 0x9b8c
movq %r14, %rcx
movq %rcx, %rax
movq 0x68(%rcx), %rcx
testq %rcx, %rcx
jne 0x9b80
movl 0xc(%rax), %eax
cltd
idivl 0x10(%r14)
movl %edx, %r15d
testl %r15d, %r15d
jle 0x9dbd
movq 0x70(%r14), %rax
movq 0x70(%rbx), %rcx
movl %r15d, %edx
movl %ebp, %esi
shlq $0x3, %r12
xorl %edi, %edi
testl %ebp, %ebp
jle 0x9bd3
movq %rcx, %r8
xorl %r9d, %r9d
movsd (%rax,%r9,8), %xmm0
movsd %xmm0, (%r8)
incq %r9
addq %r12, %r8
cmpq %r9, %rsi
jne 0x9bbd
incq %rdi
addq %r12, %rax
addq $0x8, %rcx
cmpq %rdx, %rdi
jne 0x9bb3
jmp 0x9dbd
cmpq $0x0, 0x28(%r14)
movabsq $0x100000001, %r15      # imm = 0x100000001
je 0x9c64
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0x210d3(%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 0x9c57
callq 0x1af0e
movq 0x28(%r14), %rdi
movq 0x28(%rbx), %rsi
callq 0x9ad6
cmpq $0x0, 0x38(%r14)
je 0x9cd7
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0x21060(%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, 0x48(%rbx)
movq 0x50(%rbx), %rdi
movq %rax, 0x50(%rbx)
testq %rdi, %rdi
je 0x9cca
callq 0x1af0e
movq 0x38(%r14), %rdi
movq 0x48(%rbx), %rsi
callq 0x9ad6
cmpq $0x0, 0x48(%r14)
je 0x9d4a
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0x20fed(%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, 0x38(%rbx)
movq 0x40(%rbx), %rdi
movq %rax, 0x40(%rbx)
testq %rdi, %rdi
je 0x9d3d
callq 0x1af0e
movq 0x48(%r14), %rdi
movq 0x38(%rbx), %rsi
callq 0x9ad6
cmpq $0x0, 0x58(%r14)
je 0x9dbd
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0x20f7a(%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 0x9db0
callq 0x1af0e
movq 0x58(%r14), %rdi
movq 0x58(%rbx), %rsi
callq 0x9ad6
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x19aa4(%rip), %rsi     # 0x23882
movq %rax, %rdi
callq 0x20a0
movq 0x21203(%rip), %rsi     # 0x2aff0
movq 0x211cc(%rip), %rdx     # 0x2afc0
movq %rbx, %rdi
callq 0x2290
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x22b0