// File: toxaart[P]hierarchical_block_sparse_lib/source/HierarchicalBlockSparseMatrix.h
// Function: hbsm::HierarchicalBlockSparseMatrix<double>::get_all_values(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, std::vector<double, std::allocator<double>>&) const
void HierarchicalBlockSparseMatrix<Treal>::get_all_values(std::vector<int> & rows,
						  std::vector<int> & cols,
						  std::vector<Treal> & values) const  {


			if(!rows.empty()) rows.clear();
			if(!cols.empty()) cols.clear();
			if(!values.empty()) values.clear();

      rows.reserve(nRows * nCols);
      cols.reserve(nRows * nCols);
      values.reserve(nRows * nCols);

			if(empty()){;
				return;
			}

			if(lowest_level()){
				for(int i = 0; i < submatrix.size(); ++i){

					if(fabs(submatrix[i]) > 0.0){

						int col = i / nRows;
						int row = i % nRows;
						rows.push_back(row);
						cols.push_back(col);
						values.push_back(submatrix[i]);

					}
				}

				return;
			}

			// here we have to merge vectors obtained from children, takin into account offset of indices
			int offset = nRows/2;

			std::vector<int> rows0,rows1,rows2,rows3;
			std::vector<int> cols0,cols1,cols2,cols3;
			std::vector<Treal> vals0,vals1,vals2,vals3;


			if(children[0] != NULL){
				children[0]->get_all_values(rows0,cols0,vals0);
				assert(rows0.size() == cols0.size() && rows0.size() == vals0.size());
				// child0 - no offset applied
				for(int i = 0; i < rows0.size(); ++i){
					rows.push_back(rows0[i]);
					cols.push_back(cols0[i]);
					values.push_back(vals0[i]);
				}
			}

			if(children[1] != NULL){
				children[1]->get_all_values(rows1,cols1,vals1);
				assert(rows1.size() == cols1.size() && rows1.size() == vals1.size());
				// child1 - offset applied to row number
				for(int i = 0; i < rows1.size(); ++i){
					rows.push_back(rows1[i]+offset);
					cols.push_back(cols1[i]);
					values.push_back(vals1[i]);
				}
			}

			if(children[2] != NULL){
				children[2]->get_all_values(rows2,cols2,vals2);
				assert(rows2.size() == cols2.size() && rows2.size() == vals2.size());
				// child2 - offset applied to col number
				for(int i = 0; i < rows2.size(); ++i){
					rows.push_back(rows2[i]);
					cols.push_back(cols2[i]+offset);
					values.push_back(vals2[i]);
				}
			}


			if(children[3] != NULL){
				children[3]->get_all_values(rows3,cols3,vals3);
				assert(rows3.size() == cols3.size() && rows3.size() == vals3.size());
				// child3 - offset applied to both col and row number
				for(int i = 0; i < rows3.size(); ++i){
					rows.push_back(rows3[i]+offset);
					cols.push_back(cols3[i]+offset);
					values.push_back(vals3[i]);
				}
			}

		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd5c0
testb $0x1, %al
jne 0x55ec
movq -0x10(%rbp), %rdi
callq 0x8aa0
movq -0x18(%rbp), %rdi
callq 0xd5c0
testb $0x1, %al
jne 0x5602
movq -0x18(%rbp), %rdi
callq 0x8aa0
movq -0x20(%rbp), %rdi
callq 0x8b50
testb $0x1, %al
jne 0x5618
movq -0x20(%rbp), %rdi
callq 0x8ac0
movq -0x188(%rbp), %rcx
movq -0x10(%rbp), %rdi
movl (%rcx), %eax
imull 0x4(%rcx), %eax
movslq %eax, %rsi
callq 0xb990
movq -0x188(%rbp), %rcx
movq -0x18(%rbp), %rdi
movl (%rcx), %eax
imull 0x4(%rcx), %eax
movslq %eax, %rsi
callq 0xb990
movq -0x188(%rbp), %rcx
movq -0x20(%rbp), %rdi
movl (%rcx), %eax
imull 0x4(%rcx), %eax
movslq %eax, %rsi
callq 0xba90
movq -0x188(%rbp), %rdi
callq 0x4970
testb $0x1, %al
jne 0x5675
jmp 0x567a
jmp 0x604c
movq -0x188(%rbp), %rdi
callq 0x97b0
testb $0x1, %al
jne 0x568f
jmp 0x5766
movl $0x0, -0x24(%rbp)
movq -0x188(%rbp), %rdi
movslq -0x24(%rbp), %rax
movq %rax, -0x190(%rbp)
addq $0x70, %rdi
callq 0x8cf0
movq %rax, %rcx
movq -0x190(%rbp), %rax
cmpq %rcx, %rax
jae 0x5761
movq -0x188(%rbp), %rdi
addq $0x70, %rdi
movslq -0x24(%rbp), %rsi
callq 0x9c20
movsd (%rax), %xmm0
movaps 0xb93d(%rip), %xmm1     # 0x11020
pand %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5751
movq -0x188(%rbp), %rcx
movl -0x24(%rbp), %eax
cltd
idivl (%rcx)
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
cltd
idivl (%rcx)
movl %edx, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x7e70
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x7e70
movq -0x188(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x198(%rbp)
addq $0x70, %rdi
movslq -0x24(%rbp), %rsi
callq 0x9c20
movq -0x198(%rbp), %rdi
movq %rax, %rsi
callq 0xbb90
jmp 0x5753
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5696
jmp 0x604c
movq -0x188(%rbp), %rax
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x30(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x53c0
leaq -0x60(%rbp), %rdi
callq 0x53c0
leaq -0x78(%rbp), %rdi
callq 0x53c0
leaq -0x90(%rbp), %rdi
callq 0x53c0
leaq -0xa8(%rbp), %rdi
callq 0x53c0
leaq -0xc0(%rbp), %rdi
callq 0x53c0
leaq -0xd8(%rbp), %rdi
callq 0x53c0
leaq -0xf0(%rbp), %rdi
callq 0x53c0
leaq -0x108(%rbp), %rdi
callq 0x53e0
leaq -0x120(%rbp), %rdi
callq 0x53e0
leaq -0x138(%rbp), %rdi
callq 0x53e0
leaq -0x150(%rbp), %rdi
callq 0x53e0
movq -0x188(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9800
testb $0x1, %al
jne 0x581e
jmp 0x5a53
movq -0x188(%rbp), %rdi
addq $0x28, %rdi
callq 0x9830
movq %rax, %rdi
leaq -0x48(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
leaq -0x108(%rbp), %rcx
callq 0x55b0
jmp 0x584a
leaq -0x48(%rbp), %rdi
callq 0x6070
movq %rax, -0x1a8(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x6070
movq -0x1a8(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x199(%rbp)
jne 0x58af
leaq -0x48(%rbp), %rdi
callq 0x6070
movq %rax, -0x1b0(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x8cf0
movq %rax, %rcx
movq -0x1b0(%rbp), %rax
cmpq %rcx, %rax
sete %al
movb %al, -0x199(%rbp)
movb -0x199(%rbp), %al
testb $0x1, %al
jne 0x58bb
jmp 0x58c0
jmp 0x597d
leaq 0xc3ce(%rip), %rdi      # 0x11c95
leaq 0xbc67(%rip), %rsi      # 0x11535
movl $0x436, %edx            # imm = 0x436
leaq 0xc3f8(%rip), %rcx      # 0x11cd2
callq 0x2100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x5300
leaq -0x138(%rbp), %rdi
callq 0x5300
leaq -0x120(%rbp), %rdi
callq 0x5300
leaq -0x108(%rbp), %rdi
callq 0x5300
leaq -0xf0(%rbp), %rdi
callq 0x5360
leaq -0xd8(%rbp), %rdi
callq 0x5360
leaq -0xc0(%rbp), %rdi
callq 0x5360
leaq -0xa8(%rbp), %rdi
callq 0x5360
leaq -0x90(%rbp), %rdi
callq 0x5360
leaq -0x78(%rbp), %rdi
callq 0x5360
leaq -0x60(%rbp), %rdi
callq 0x5360
leaq -0x48(%rbp), %rdi
callq 0x5360
jmp 0x6055
movl $0x0, -0x160(%rbp)
movslq -0x160(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x6070
movq %rax, %rcx
movq -0x1b8(%rbp), %rax
cmpq %rcx, %rax
jae 0x5a51
movq -0x10(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movslq -0x160(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x5050
movq -0x1c0(%rbp), %rdi
movq %rax, %rsi
callq 0x7e70
jmp 0x59dd
movq -0x18(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movslq -0x160(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x5050
movq -0x1c8(%rbp), %rdi
movq %rax, %rsi
callq 0x7e70
jmp 0x5a0c
movq -0x20(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movslq -0x160(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x5070
movq -0x1d0(%rbp), %rdi
movq %rax, %rsi
callq 0xbb90
jmp 0x5a3b
jmp 0x5a3d
movl -0x160(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x160(%rbp)
jmp 0x5987
jmp 0x5a53
movq -0x188(%rbp), %rdi
addq $0x28, %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9800
testb $0x1, %al
jne 0x5a74
jmp 0x5c19
movq -0x188(%rbp), %rdi
addq $0x38, %rdi
callq 0x9830
movq %rax, %rdi
leaq -0x60(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
leaq -0x120(%rbp), %rcx
callq 0x55b0
jmp 0x5aa0
leaq -0x60(%rbp), %rdi
callq 0x6070
movq %rax, -0x1e0(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x6070
movq -0x1e0(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x1d1(%rbp)
jne 0x5b05
leaq -0x60(%rbp), %rdi
callq 0x6070
movq %rax, -0x1e8(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x8cf0
movq %rax, %rcx
movq -0x1e8(%rbp), %rax
cmpq %rcx, %rax
sete %al
movb %al, -0x1d1(%rbp)
movb -0x1d1(%rbp), %al
testb $0x1, %al
jne 0x5b11
jmp 0x5b13
jmp 0x5b32
leaq 0xc24e(%rip), %rdi      # 0x11d68
leaq 0xba14(%rip), %rsi      # 0x11535
movl $0x441, %edx            # imm = 0x441
leaq 0xc1a5(%rip), %rcx      # 0x11cd2
callq 0x2100
movl $0x0, -0x164(%rbp)
movslq -0x164(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x6070
movq %rax, %rcx
movq -0x1f0(%rbp), %rax
cmpq %rcx, %rax
jae 0x5c17
movq -0x10(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movslq -0x164(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x5050
movq -0x1f8(%rbp), %rdi
movl (%rax), %eax
movl -0x30(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x168(%rbp)
leaq -0x168(%rbp), %rsi
callq 0x7c10
jmp 0x5ba3
movq -0x18(%rbp), %rax
movq %rax, -0x200(%rbp)
movslq -0x164(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x5050
movq -0x200(%rbp), %rdi
movq %rax, %rsi
callq 0x7e70
jmp 0x5bd2
movq -0x20(%rbp), %rax
movq %rax, -0x208(%rbp)
movslq -0x164(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x5070
movq -0x208(%rbp), %rdi
movq %rax, %rsi
callq 0xbb90
jmp 0x5c01
jmp 0x5c03
movl -0x164(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x164(%rbp)
jmp 0x5b3c
jmp 0x5c19
movq -0x188(%rbp), %rdi
addq $0x28, %rdi
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9800
testb $0x1, %al
jne 0x5c3a
jmp 0x5ddf
movq -0x188(%rbp), %rdi
addq $0x48, %rdi
callq 0x9830
movq %rax, %rdi
leaq -0x78(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
leaq -0x138(%rbp), %rcx
callq 0x55b0
jmp 0x5c66
leaq -0x78(%rbp), %rdi
callq 0x6070
movq %rax, -0x218(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x6070
movq -0x218(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x209(%rbp)
jne 0x5ccb
leaq -0x78(%rbp), %rdi
callq 0x6070
movq %rax, -0x220(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x8cf0
movq %rax, %rcx
movq -0x220(%rbp), %rax
cmpq %rcx, %rax
sete %al
movb %al, -0x209(%rbp)
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x5cd7
jmp 0x5cd9
jmp 0x5cf8
leaq 0xc0c5(%rip), %rdi      # 0x11da5
leaq 0xb84e(%rip), %rsi      # 0x11535
movl $0x44c, %edx            # imm = 0x44C
leaq 0xbfdf(%rip), %rcx      # 0x11cd2
callq 0x2100
movl $0x0, -0x16c(%rbp)
movslq -0x16c(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x6070
movq %rax, %rcx
movq -0x228(%rbp), %rax
cmpq %rcx, %rax
jae 0x5ddd
movq -0x10(%rbp), %rax
movq %rax, -0x230(%rbp)
movslq -0x16c(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x5050
movq -0x230(%rbp), %rdi
movq %rax, %rsi
callq 0x7e70
jmp 0x5d58
movq -0x18(%rbp), %rax
movq %rax, -0x238(%rbp)
movslq -0x16c(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x5050
movq -0x238(%rbp), %rdi
movl (%rax), %eax
movl -0x30(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x170(%rbp)
leaq -0x170(%rbp), %rsi
callq 0x7c10
jmp 0x5d98
movq -0x20(%rbp), %rax
movq %rax, -0x240(%rbp)
movslq -0x16c(%rbp), %rsi
leaq -0x138(%rbp), %rdi
callq 0x5070
movq -0x240(%rbp), %rdi
movq %rax, %rsi
callq 0xbb90
jmp 0x5dc7
jmp 0x5dc9
movl -0x16c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x16c(%rbp)
jmp 0x5d02
jmp 0x5ddf
movq -0x188(%rbp), %rdi
addq $0x28, %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9800
testb $0x1, %al
jne 0x5e00
jmp 0x5fc5
movq -0x188(%rbp), %rdi
addq $0x58, %rdi
callq 0x9830
movq %rax, %rdi
leaq -0x90(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
leaq -0x150(%rbp), %rcx
callq 0x55b0
jmp 0x5e2f
leaq -0x90(%rbp), %rdi
callq 0x6070
movq %rax, -0x250(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x6070
movq -0x250(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x241(%rbp)
jne 0x5e9a
leaq -0x90(%rbp), %rdi
callq 0x6070
movq %rax, -0x258(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x8cf0
movq %rax, %rcx
movq -0x258(%rbp), %rax
cmpq %rcx, %rax
sete %al
movb %al, -0x241(%rbp)
movb -0x241(%rbp), %al
testb $0x1, %al
jne 0x5ea6
jmp 0x5ea8
jmp 0x5ec7
leaq 0xbf33(%rip), %rdi      # 0x11de2
leaq 0xb67f(%rip), %rsi      # 0x11535
movl $0x458, %edx            # imm = 0x458
leaq 0xbe10(%rip), %rcx      # 0x11cd2
callq 0x2100
movl $0x0, -0x174(%rbp)
movslq -0x174(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x6070
movq %rax, %rcx
movq -0x260(%rbp), %rax
cmpq %rcx, %rax
jae 0x5fc3
movq -0x10(%rbp), %rax
movq %rax, -0x268(%rbp)
movslq -0x174(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x5050
movq -0x268(%rbp), %rdi
movl (%rax), %eax
movl -0x30(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x178(%rbp)
leaq -0x178(%rbp), %rsi
callq 0x7c10
jmp 0x5f3e
movq -0x18(%rbp), %rax
movq %rax, -0x270(%rbp)
movslq -0x174(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x5050
movq -0x270(%rbp), %rdi
movl (%rax), %eax
movl -0x30(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x17c(%rbp)
leaq -0x17c(%rbp), %rsi
callq 0x7c10
jmp 0x5f7e
movq -0x20(%rbp), %rax
movq %rax, -0x278(%rbp)
movslq -0x174(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x5070
movq -0x278(%rbp), %rdi
movq %rax, %rsi
callq 0xbb90
jmp 0x5fad
jmp 0x5faf
movl -0x174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x174(%rbp)
jmp 0x5ed1
jmp 0x5fc5
leaq -0x150(%rbp), %rdi
callq 0x5300
leaq -0x138(%rbp), %rdi
callq 0x5300
leaq -0x120(%rbp), %rdi
callq 0x5300
leaq -0x108(%rbp), %rdi
callq 0x5300
leaq -0xf0(%rbp), %rdi
callq 0x5360
leaq -0xd8(%rbp), %rdi
callq 0x5360
leaq -0xc0(%rbp), %rdi
callq 0x5360
leaq -0xa8(%rbp), %rdi
callq 0x5360
leaq -0x90(%rbp), %rdi
callq 0x5360
leaq -0x78(%rbp), %rdi
callq 0x5360
leaq -0x60(%rbp), %rdi
callq 0x5360
leaq -0x48(%rbp), %rdi
callq 0x5360
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
movq -0x158(%rbp), %rdi
callq 0x22e0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)