// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1b2de
testb %al, %al
je 0x9d70
movl 0x10(%rbx), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0x9920
movl 0x8(%rbx), %edx
movl 0xc(%rbx), %esi
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9986
movq %rbx, %rdi
callq 0x1b448
testb %al, %al
je 0x9b8d
movslq 0x10(%rbx), %r12
movl (%rbx), %ebp
movl 0x4(%rbx), %r15d
movq %rbx, %rdi
callq 0x1b660
testb %al, %al
je 0x9b0e
cmpq $0x0, 0x68(%rbx)
movq %rbx, %rax
je 0x9b05
movq %rbx, %rcx
movq %rcx, %rax
movq 0x68(%rcx), %rcx
testq %rcx, %rcx
jne 0x9af9
movl 0x8(%rax), %eax
cltd
idivl 0x10(%rbx)
movl %edx, %ebp
movq %rbx, %rdi
callq 0x1b6b6
testb %al, %al
je 0x9b3d
cmpq $0x0, 0x68(%rbx)
movq %rbx, %rax
je 0x9b33
movq %rbx, %rcx
movq %rcx, %rax
movq 0x68(%rcx), %rcx
testq %rcx, %rcx
jne 0x9b27
movl 0xc(%rax), %eax
cltd
idivl 0x10(%rbx)
movl %edx, %r15d
testl %r15d, %r15d
jle 0x9d63
movq 0x70(%rbx), %rax
movq 0x70(%r14), %rcx
movl %r15d, %edx
movl %ebp, %esi
shlq $0x3, %r12
xorl %edi, %edi
testl %ebp, %ebp
jle 0x9b79
movq %rcx, %r8
xorl %r9d, %r9d
movsd (%rax,%r9,8), %xmm0
movsd %xmm0, (%r8)
incq %r9
addq %r12, %r8
cmpq %r9, %rsi
jne 0x9b63
incq %rdi
addq %r12, %rax
addq $0x8, %rcx
cmpq %rdx, %rdi
jne 0x9b59
jmp 0x9d63
cmpq $0x0, 0x28(%rbx)
movabsq $0x100000001, %r15      # imm = 0x100000001
je 0x9c0a
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0x22165(%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(%r14)
movq 0x30(%r14), %rdi
movq %rax, 0x30(%r14)
testq %rdi, %rdi
je 0x9c01
callq 0x1b482
movq 0x28(%r14), %rsi
movq 0x28(%rbx), %rdi
callq 0x9a82
cmpq $0x0, 0x38(%rbx)
je 0x9c7d
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0x220f2(%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, 0x48(%r14)
movq 0x50(%r14), %rdi
movq %rax, 0x50(%r14)
testq %rdi, %rdi
je 0x9c74
callq 0x1b482
movq 0x48(%r14), %rsi
movq 0x38(%rbx), %rdi
callq 0x9a82
cmpq $0x0, 0x48(%rbx)
je 0x9cf0
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0x2207f(%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, 0x38(%r14)
movq 0x40(%r14), %rdi
movq %rax, 0x40(%r14)
testq %rdi, %rdi
je 0x9ce7
callq 0x1b482
movq 0x38(%r14), %rsi
movq 0x48(%rbx), %rdi
callq 0x9a82
cmpq $0x0, 0x58(%rbx)
je 0x9d63
movl $0x98, %edi
callq 0x21c0
movq %r15, 0x8(%rax)
leaq 0x2200c(%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(%r14)
movq 0x60(%r14), %rdi
movq %rax, 0x60(%r14)
testq %rdi, %rdi
je 0x9d5a
callq 0x1b482
movq 0x58(%r14), %rsi
movq 0x58(%rbx), %rdi
callq 0x9a82
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x1ab5e(%rip), %rsi     # 0x248e2
movq %rax, %rdi
callq 0x20a0
movq 0x2225d(%rip), %rsi     # 0x2bff0
movq 0x22226(%rip), %rdx     # 0x2bfc0
movq %rbx, %rdi
callq 0x2290
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x22b0