// File: /workspace/github_cpp_makefile_star2_O2/toxaart[P]hierarchical_block_sparse_lib/test_source/./test_utils.h
// Function: void verify_that_matrices_are_equal<hbsm::HierarchicalBlockSparseMatrix<double>>(hbsm::HierarchicalBlockSparseMatrix<double> const&, hbsm::HierarchicalBlockSparseMatrix<double> const&)
void verify_that_matrices_are_equal(const MatrixType & A,
				    const MatrixType & B) {
  if(A.get_n_rows() != B.get_n_rows() || A.get_n_cols() != B.get_n_cols())
    throw std::runtime_error("Error: matrices do not have same dimensions.");
  SparseMatrix spA;
  A.get_all_values(spA.rows, spA.cols, spA.values);
  std::vector<double> fullMatrixA;
  spA.to_full(fullMatrixA, A.get_n_rows(), A.get_n_cols());
  SparseMatrix spB;
  B.get_all_values(spB.rows, spB.cols, spB.values);
  std::vector<double> fullMatrixB;
  spB.to_full(fullMatrixB, B.get_n_rows(), B.get_n_cols());

  assert( fullMatrixA.size() == fullMatrixB.size() );
  for(unsigned int ind=0; ind<fullMatrixA.size(); ind++) {
    if (verbose)
      std::cout << std::setw(5) << ind << "  " 
		<< std::setw(14) << fullMatrixA[ind] << "  " 
		<< std::setw(14) << fullMatrixB[ind] 
		<< std::endl;
    if(fullMatrixA[ind] != fullMatrixB[ind])
      throw std::runtime_error("Error: matrices not equal.");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3a98
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3a98
cmpl %eax, %ebp
jne 0x4ff6
movq %r14, %rdi
callq 0x3ab4
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3ab4
cmpl %eax, %ebp
jne 0x4ff6
xorpd %xmm0, %xmm0
leaq 0xc0(%rsp), %rcx
movapd %xmm0, (%rcx)
movapd %xmm0, -0x10(%rcx)
movapd %xmm0, -0x20(%rcx)
movapd %xmm0, -0x30(%rcx)
andq $0x0, 0x10(%rcx)
leaq 0xa8(%rsp), %rdx
leaq 0x90(%rsp), %rsi
movq %r14, %rdi
callq 0x3eea
leaq 0x20(%rsp), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movq %r14, %rdi
callq 0x3a98
movl %eax, %ebp
movq %r14, %rdi
callq 0x3ab4
leaq 0x90(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %eax, %ecx
callq 0x7110
xorpd %xmm0, %xmm0
leaq 0x70(%rsp), %rcx
movapd %xmm0, (%rcx)
movapd %xmm0, -0x10(%rcx)
movapd %xmm0, -0x20(%rcx)
movapd %xmm0, -0x30(%rcx)
andq $0x0, 0x10(%rcx)
leaq 0x58(%rsp), %rdx
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x3eea
movq %rsp, %r14
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %rbx, %rdi
callq 0x3a98
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3ab4
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %eax, %ecx
callq 0x7110
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
subq %rdx, %rsi
cmpq %rsi, %rcx
jne 0x5026
sarq $0x3, %rcx
xorl %esi, %esi
movl %esi, %edi
cmpq %rdi, %rcx
jbe 0x4fbf
movsd (%rax,%rdi,8), %xmm0
leal 0x1(%rdi), %esi
ucomisd (%rdx,%rdi,8), %xmm0
jne 0x4f8f
jnp 0x4f77
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %r14
leaq 0x4162(%rip), %rsi      # 0x9103
movq %rax, %rdi
callq 0x2050
movq 0x8040(%rip), %rsi      # 0xcff0
movq 0x8009(%rip), %rdx      # 0xcfc0
movq %r14, %rdi
callq 0x21d0
movq %rsp, %rdi
callq 0x5c00
leaq 0x40(%rsp), %rdi
callq 0x7194
leaq 0x20(%rsp), %rdi
callq 0x5c00
leaq 0x90(%rsp), %rdi
callq 0x7194
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x20a0
movq %rax, %r14
leaq 0x400f(%rip), %rsi      # 0x9017
movq %rax, %rdi
callq 0x2050
movq 0x7fd9(%rip), %rsi      # 0xcff0
movq 0x7fa2(%rip), %rdx      # 0xcfc0
movq %r14, %rdi
callq 0x21d0
leaq 0x4017(%rip), %rdi      # 0x9044
leaq 0x4039(%rip), %rsi      # 0x906d
leaq 0x4041(%rip), %rcx      # 0x907c
pushq $0x40
popq %rdx
callq 0x20d0
jmp 0x5061
movq %rax, %rbx
jmp 0x5079
movq %rax, %rbx
jmp 0x5083
movq %rax, %rbx
jmp 0x508d
movq %rax, %rbx
movq %r14, %rdi
callq 0x2100
jmp 0x509a
movq %rax, %rbx
jmp 0x5071
movq %rax, %rbx
movq %r14, %rdi
callq 0x2100
movq %rsp, %rdi
callq 0x5c00
leaq 0x40(%rsp), %rdi
callq 0x7194
leaq 0x20(%rsp), %rdi
callq 0x5c00
leaq 0x90(%rsp), %rdi
callq 0x7194
movq %rbx, %rdi
callq 0x21f0