// File: toxaart[P]hierarchical_block_sparse_lib/test_source/test_matrix_operations.cc
// Function: void test_symm_rk<hbsm::HierarchicalBlockSparseMatrix<double>>(hbsm::HierarchicalBlockSparseMatrix<double>::Params const&)
static void test_symm_rk(typename MatrixType::Params const & param) {
  MatrixType A;
  A.set_params(param);
  A.resize(2, 3);
  {
    SparseMatrix tmp;
    set_row(tmp, 0, 2, 3, 5);
    set_row(tmp, 1, 0, 1, 2);
    tmp.assign(A);
  }



  if (verbose)
    std::cout << "Test symm_rk C = A * A'" << std::endl;
  // A * A'
  MatrixType AxAt;
  MatrixType::symm_rk(A, false, AxAt);
  MatrixType AxAtref;
  AxAtref.set_params(param);
  AxAtref.resize(2, 2);
  {
    SparseMatrix tmp;
    set_row(tmp, 0,    38,    13);
    set_row(tmp, 1,     0,     5);
    tmp.assign(AxAtref);
  }

  verify_that_matrices_are_equal(AxAt, AxAtref);

  if (verbose)
    std::cout << "Test symm_rk C = A' * A" << std::endl;
  // A' * A
  MatrixType AtxA;
  MatrixType::symm_rk(A, true, AtxA);
  MatrixType AtxAref;
  AtxAref.set_params(param);
  AtxAref.resize(3, 3);
  {
    SparseMatrix tmp;
    set_row(tmp, 0,     4,     6,    10);
    set_row(tmp, 1,     0,    10,    17);
    set_row(tmp, 2,     0,     0,    29);
    tmp.assign(AtxAref);
  }

  verify_that_matrices_are_equal(AtxA, AtxAref);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3c0, %rsp            # imm = 0x3C0
movq %rdi, -0x8(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x84d0
movq -0x3a0(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x8570
jmp 0x7d04
xorl %eax, %eax
movl %eax, %ecx
leaq -0x90(%rbp), %rdi
movl $0x2, %esi
movl $0x3, %edx
callq 0x8600
jmp 0x7d20
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x3a8(%rbp)
callq 0x8750
movq -0x3a8(%rbp), %rdi
xorl %esi, %esi
movsd 0x2e2c4(%rip), %xmm0    # 0x36008
movsd 0x2e2c4(%rip), %xmm1    # 0x36010
movsd 0x2e2c4(%rip), %xmm2    # 0x36018
callq 0x34fd0
jmp 0x7d5b
leaq -0xe8(%rbp), %rdi
movl $0x1, %esi
xorps %xmm0, %xmm0
movsd 0x2e2ae(%rip), %xmm1    # 0x36020
movsd 0x2e28e(%rip), %xmm2    # 0x36008
callq 0x34fd0
jmp 0x7d81
leaq -0xe8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x8790
jmp 0x7d96
leaq -0xe8(%rbp), %rdi
callq 0x87d0
leaq -0x170(%rbp), %rdi
callq 0x84d0
jmp 0x7db0
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
leaq -0x170(%rbp), %rdx
callq 0x2d030
jmp 0x7dc7
leaq -0x1f8(%rbp), %rdi
callq 0x84d0
jmp 0x7dd5
movq -0x8(%rbp), %rsi
leaq -0x1f8(%rbp), %rdi
callq 0x8570
jmp 0x7de7
xorl %eax, %eax
movl %eax, %ecx
leaq -0x1f8(%rbp), %rdi
movl $0x2, %edx
movl %edx, %esi
callq 0x8600
jmp 0x7e00
leaq -0x240(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x8750
movq -0x3b0(%rbp), %rdi
xorl %esi, %esi
movsd 0x2e25c(%rip), %xmm0    # 0x36080
movsd 0x2e224(%rip), %xmm1    # 0x36050
callq 0x34e90
jmp 0x7e33
leaq -0x240(%rbp), %rdi
movl $0x1, %esi
xorps %xmm0, %xmm0
movsd 0x2e1ce(%rip), %xmm1    # 0x36018
callq 0x34e90
jmp 0x7e51
leaq -0x240(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x8790
jmp 0x7e66
leaq -0x240(%rbp), %rdi
callq 0x87d0
leaq -0x170(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x8bb0
jmp 0x7e87
leaq -0x2c8(%rbp), %rdi
callq 0x84d0
jmp 0x7e95
leaq -0x90(%rbp), %rdi
movl $0x1, %esi
leaq -0x2c8(%rbp), %rdx
callq 0x2d030
jmp 0x7eaf
leaq -0x350(%rbp), %rdi
callq 0x84d0
jmp 0x7ebd
movq -0x8(%rbp), %rsi
leaq -0x350(%rbp), %rdi
callq 0x8570
jmp 0x7ecf
xorl %eax, %eax
movl %eax, %ecx
leaq -0x350(%rbp), %rdi
movl $0x3, %edx
movl %edx, %esi
callq 0x8600
jmp 0x7ee8
leaq -0x398(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x8750
movq -0x3b8(%rbp), %rdi
xorl %esi, %esi
movsd 0x2e124(%rip), %xmm0    # 0x36030
movsd 0x2e114(%rip), %xmm1    # 0x36028
movsd 0x2e16c(%rip), %xmm2    # 0x36088
callq 0x34fd0
jmp 0x7f23
leaq -0x398(%rbp), %rdi
movl $0x1, %esi
xorps %xmm0, %xmm0
movsd 0x2e14e(%rip), %xmm1    # 0x36088
movsd 0x2e14e(%rip), %xmm2    # 0x36090
callq 0x34fd0
jmp 0x7f49
leaq -0x398(%rbp), %rdi
movl $0x2, %esi
xorps %xmm1, %xmm1
movsd 0x2e138(%rip), %xmm2    # 0x36098
movaps %xmm1, %xmm0
callq 0x34fd0
jmp 0x7f6a
leaq -0x398(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x8790
jmp 0x7f7f
leaq -0x398(%rbp), %rdi
callq 0x87d0
leaq -0x2c8(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x8bb0
jmp 0x7fa0
leaq -0x350(%rbp), %rdi
callq 0x11250
leaq -0x2c8(%rbp), %rdi
callq 0x11250
leaq -0x1f8(%rbp), %rdi
callq 0x11250
leaq -0x170(%rbp), %rdi
callq 0x11250
leaq -0x90(%rbp), %rdi
callq 0x11250
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x80e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x87d0
jmp 0x80e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x80d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x80c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x87d0
jmp 0x80c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x80bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x80b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x398(%rbp), %rdi
callq 0x87d0
leaq -0x350(%rbp), %rdi
callq 0x11250
leaq -0x2c8(%rbp), %rdi
callq 0x11250
leaq -0x1f8(%rbp), %rdi
callq 0x11250
leaq -0x170(%rbp), %rdi
callq 0x11250
leaq -0x90(%rbp), %rdi
callq 0x11250
movq -0x98(%rbp), %rdi
callq 0x2340
nopl (%rax,%rax)