// File: toxaart[P]hierarchical_block_sparse_lib/source/HierarchicalBlockSparseMatrix.h
// Function: hbsm::HierarchicalBlockSparseMatrix<double>::get_single_value(int, int) const
Treal HierarchicalBlockSparseMatrix<Treal>::get_single_value(int row, int col) const {


			if ( empty() )
			  throw std::runtime_error("Error in HierarchicalBlockSparseMatrix<Treal>::get_single_value: empty matrix occured.");


			if(!(0 <= row && row < nRows_orig && 0 <= col && col < nCols_orig ))
			  throw std::runtime_error("Error in HierarchicalBlockSparseMatrix<Treal>::get_single_value: bad index at highest level.");




			if(!(0 <= row && row < nRows && 0 <= col && col < nCols ) ){
				throw std::runtime_error("Error in HierarchicalBlockSparseMatrix<Treal>::get_single_value: bad index.");
			}

			if(lowest_level()){
				return submatrix[col*nRows + row];
			}


			int offset = nRows/2;

			// this part goes to child0
			if(row < offset && col < offset){
				if(children[0] == NULL) return 0.0;
				else return children[0]->get_single_value(row,col);
			}

			// this part goes to child1
			if(offset <= row && row < nRows && col < offset){
				if(children[1] == NULL) return 0.0;
				else return children[1]->get_single_value(row-offset,col);
			}

			// this part goes to child2
			if(row < offset && offset <= col && col < nCols){
				if(children[2] == NULL) return 0.0;
				else return children[2]->get_single_value(row,col-offset);
			}

			// this part goes to child3
			if(offset <= row && row < nRows && offset <= col && col < nCols){
				if(children[3] == NULL) return 0.0;
				else return children[3]->get_single_value(row-offset,col-offset);
			}

			throw std::runtime_error("Error in HierarchicalBlockSparseMatrix<Treal>::get_single_value: reached impossible point.");
			return 0.0;

		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x4970
testb $0x1, %al
jne 0xd1e5
jmp 0xd238
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x493a(%rip), %rsi      # 0x11b3a
callq 0x2070
jmp 0xd207
movq -0x38(%rbp), %rdi
movq 0xadde(%rip), %rsi      # 0x17ff0
movq 0xada7(%rip), %rdx      # 0x17fc0
callq 0x22c0
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x2130
jmp 0xd57e
xorl %eax, %eax
cmpl -0x14(%rbp), %eax
jg 0xd25e
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0xd25e
xorl %eax, %eax
cmpl -0x18(%rbp), %eax
jg 0xd25e
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0xc(%rcx), %eax
jl 0xd2b1
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x4918(%rip), %rsi      # 0x11b91
callq 0x2070
jmp 0xd280
movq -0x40(%rbp), %rdi
movq 0xad65(%rip), %rsi      # 0x17ff0
movq 0xad2e(%rip), %rdx      # 0x17fc0
callq 0x22c0
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x2130
jmp 0xd57e
xorl %eax, %eax
cmpl -0x14(%rbp), %eax
jg 0xd2d6
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl (%rcx), %eax
jge 0xd2d6
xorl %eax, %eax
cmpl -0x18(%rbp), %eax
jg 0xd2d6
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x4(%rcx), %eax
jl 0xd329
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
leaq 0x48fd(%rip), %rsi      # 0x11bee
callq 0x2070
jmp 0xd2f8
movq -0x48(%rbp), %rdi
movq 0xaced(%rip), %rsi      # 0x17ff0
movq 0xacb6(%rip), %rdx      # 0x17fc0
callq 0x22c0
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x2130
jmp 0xd57e
movq -0x30(%rbp), %rdi
callq 0x97b0
testb $0x1, %al
jne 0xd338
jmp 0xd362
movq -0x30(%rbp), %rcx
movq %rcx, %rdi
addq $0x70, %rdi
movl -0x18(%rbp), %eax
imull (%rcx), %eax
addl -0x14(%rbp), %eax
movslq %eax, %rsi
callq 0x9c20
movsd (%rax), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xd573
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x28(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xd3cc
movl -0x18(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xd3cc
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xd590
testb $0x1, %al
jne 0xd39a
jmp 0xd3a7
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xd573
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
callq 0x9830
movq %rax, %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0xd1c0
movsd %xmm0, -0x8(%rbp)
jmp 0xd573
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0xd43b
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl (%rcx), %eax
jge 0xd43b
movl -0x18(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xd43b
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xd590
testb $0x1, %al
jne 0xd402
jmp 0xd40f
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xd573
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
addq $0x10, %rdi
callq 0x9830
movq %rax, %rdi
movl -0x14(%rbp), %esi
subl -0x28(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0xd1c0
movsd %xmm0, -0x8(%rbp)
jmp 0xd573
movl -0x14(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xd4ab
movl -0x28(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0xd4ab
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0xd4ab
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xd590
testb $0x1, %al
jne 0xd472
jmp 0xd47f
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xd573
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
addq $0x20, %rdi
callq 0x9830
movq %rax, %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
subl -0x28(%rbp), %edx
callq 0xd1c0
movsd %xmm0, -0x8(%rbp)
jmp 0xd573
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0xd523
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl (%rcx), %eax
jge 0xd523
movl -0x28(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0xd523
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0xd523
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xd590
testb $0x1, %al
jne 0xd4ed
jmp 0xd4f7
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xd573
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
addq $0x30, %rdi
callq 0x9830
movq %rax, %rdi
movl -0x14(%rbp), %esi
subl -0x28(%rbp), %esi
movl -0x18(%rbp), %edx
subl -0x28(%rbp), %edx
callq 0xd1c0
movsd %xmm0, -0x8(%rbp)
jmp 0xd573
movl $0x10, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
leaq 0x46fc(%rip), %rsi      # 0x11c3a
callq 0x2070
jmp 0xd545
movq -0x50(%rbp), %rdi
movq 0xaaa0(%rip), %rsi      # 0x17ff0
movq 0xaa69(%rip), %rdx      # 0x17fc0
callq 0x22c0
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x2130
jmp 0xd57e
movsd -0x8(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x22e0
nopw (%rax,%rax)