// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/ein_reduce.cpp
// Function: nda::test_make_ein_sum_matrix_vector_body()
TEST(make_ein_sum_matrix_vector) {
  constexpr index_t M = 50;
  constexpr index_t N = 64;
  matrix<int, M, N> B;
  vector<int, N> x;
  fill_pattern(B);
  fill_pattern(x);

  // Compute the matrix-vector product B*x.
  vector<int, M> Bx = make_ein_sum<int, i>(ein<i, j>(B) * ein<j>(x));

  ASSERT_EQ(Bx.rank(), 1);
  ASSERT_EQ(Bx.i().extent(), B.rows());
  for (index_t i : Bx.i()) {
    int Bx_i = 0;
    for (index_t j : x.i()) {
      Bx_i += B(i, j) * x(j);
    }
    ASSERT_EQ(Bx(i), Bx_i);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
leaq 0x58(%rsp), %rbx
movq $0x0, 0x30(%rbx)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x8(%rbx)
movdqu %xmm0, 0x18(%rbx)
movq %rax, 0x40(%rbx)
movq %rbx, %rdi
callq 0x5b312
movq %rbx, %rdi
callq 0x5b3ae
leaq 0xa0(%rsp), %rdi
pxor %xmm0, %xmm0
movdqu %xmm0, 0x18(%rdi)
movdqu %xmm0, 0x8(%rdi)
callq 0x57f74
leaq 0xa0(%rsp), %rdi
callq 0x57fba
movq 0x70(%rsp), %rax
leaq 0x110(%rsp), %rdi
movq %rax, -0x8(%rdi)
movups 0x78(%rsp), %xmm0
movups %xmm0, (%rdi)
movdqu 0x88(%rsp), %xmm0
movdqu %xmm0, 0x10(%rdi)
movq 0x98(%rsp), %rax
movq %rax, 0x20(%rdi)
leaq 0xf8(%rsp), %rax
movl $0x0, (%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x108(%rsp), %rax
movq %rax, 0x8(%rsi)
callq 0x5b5bc
leaq 0xb8(%rsp), %rax
movq (%rax), %r14
pshufd $0x0, 0x8(%rax), %xmm0  # xmm0 = mem[0,0,0,0]
paddd 0x59322(%rip), %xmm0    # 0xadf90
xorl %eax, %eax
movdqa 0x59328(%rip), %xmm1    # 0xadfa0
movdqu %xmm0, (%r14,%rax,4)
addq $0x4, %rax
paddd %xmm1, %xmm0
cmpq $0x40, %rax
jne 0x54c78
movq 0x70(%rsp), %r15
movq 0x78(%rsp), %r12
movq 0x88(%rsp), %rbp
movq 0x98(%rsp), %r13
movq 0xc0(%rsp), %rbx
movl $0x0, 0x3c(%rsp)
leaq 0x108(%rsp), %rsi
movq %rbp, (%rsi)
movq $0x32, 0x8(%rsi)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x10(%rsi)
xorl %edi, %edi
callq 0x5979c
leaq 0x108(%rsp), %rsi
movq %rbp, (%rsi)
movq $0x32, 0x8(%rsi)
movq $0x1, 0x10(%rsi)
xorl %edi, %edi
callq 0x597ad
leaq 0xf8(%rsp), %rsi
movq %rbp, (%rsi)
leaq 0x108(%rsp), %rdi
leaq 0x3c(%rsp), %rdx
leaq 0xf(%rsp), %rcx
callq 0x59844
cmpq %rbp, 0x128(%rsp)
jne 0x55292
cmpq %rbx, %r12
jne 0x552b1
leaq 0x120(%rsp), %rax
movq (%rax), %rbx
leaq 0x10(%rsp), %rdi
movq %r12, (%rdi)
movq %rbp, 0x10(%rdi)
callq 0x59b40
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rdx
leaq 0x3f(%rcx), %rax
leaq (,%rdx,4), %rsi
leaq (,%rbp,4), %rdi
subq %rdi, %rsi
addq %rsi, %rbx
subq %rbp, %rdx
imulq %r13, %rdx
leaq (,%rcx,4), %rsi
leaq (%rsi,%rdx,4), %rdx
leaq (,%r12,4), %rsi
subq %rsi, %rdx
addq %rdx, %r15
shlq $0x2, %r13
movq %rcx, %rdx
subq %r12, %rdx
movq %r15, %rsi
xorl %edi, %edi
movl (%r14,%rdx,4), %r8d
imull (%rsi), %r8d
addl %r8d, (%rbx,%rdi,4)
incq %rdi
addq %r13, %rsi
cmpq $0x32, %rdi
jne 0x54da9
leaq 0x1(%rcx), %rdx
addq $0x4, %r15
cmpq %rax, %rcx
movq %rdx, %rcx
jne 0x54d9e
movq 0x110(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x128(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5b357(%rip), %rsi     # 0xb016c
leaq 0x5b35e(%rip), %rdx     # 0xb017a
leaq 0x10(%rsp), %rdi
callq 0xd14c
leaq 0x108(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x4e840(%rip), %rsi     # 0xa3684
leaq 0x108(%rsp), %rdi
callq 0x18fba
leaq 0x5b323(%rip), %rsi     # 0xb017b
movq %rax, %rdi
callq 0x1902a
leaq 0x523ef(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x54e8c
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x2110
leaq 0x4e7f1(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x558ca(%rip), %rsi     # 0xaa76c
movq %rax, %rdi
callq 0x18fba
leaq 0x523a5(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x54ed6
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x653bc(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0x108(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x54f0e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5b263(%rip), %rsi     # 0xb0185
leaq 0x5b277(%rip), %rdx     # 0xb01a0
callq 0xd14c
leaq 0x108(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x4e738(%rip), %rsi     # 0xa3684
leaq 0x108(%rsp), %rdi
callq 0x18fba
leaq 0x5b241(%rip), %rsi     # 0xb01a1
movq %rax, %rdi
callq 0x4acaa
leaq 0x522e7(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x54f94
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x32, %esi
callq 0x21b0
leaq 0x4e6e9(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x5b1ee(%rip), %rsi     # 0xb0198
movq %rax, %rdi
callq 0x1a146
leaq 0x5229d(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x54fde
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x32, %esi
callq 0x21b0
leaq 0x652b4(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0x108(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x55016
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x50(%rsp), %r14
leaq 0x31(%r14), %rax
movq %rax, 0xd8(%rsp)
leaq 0x10(%rsp), %r15
movq %r14, %rax
subq 0x88(%rsp), %rax
imulq 0x98(%rsp), %rax
addq 0xc0(%rsp), %rax
movq 0xb8(%rsp), %rcx
subq 0x78(%rsp), %rax
shlq $0x2, %rax
addq 0x70(%rsp), %rax
pxor %xmm3, %xmm3
xorl %edx, %edx
movdqu (%rax,%rdx,4), %xmm0
movdqu (%rcx,%rdx,4), %xmm1
pshufd $0xf5, %xmm1, %xmm2     # xmm2 = xmm1[1,1,3,3]
pmuludq %xmm0, %xmm1
pshufd $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3]
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pmuludq %xmm0, %xmm2
pshufd $0xe8, %xmm2, %xmm0     # xmm0 = xmm2[0,2,2,3]
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
paddd %xmm1, %xmm3
addq $0x4, %rdx
cmpq $0x40, %rdx
jne 0x55064
movdqa %xmm3, 0xe0(%rsp)
movq %r14, %r13
subq 0x50(%rsp), %r13
movq 0x30(%rsp), %rax
movl (%rax,%r13,4), %ebx
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r15, %rdi
leaq 0x5b0e7(%rip), %rsi     # 0xb01b1
leaq 0x5b0ed(%rip), %rdx     # 0xb01be
callq 0xd14c
movdqa 0xe0(%rsp), %xmm1
pshufd $0xee, %xmm1, %xmm0     # xmm0 = xmm1[2,3,2,3]
paddd %xmm1, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
paddd %xmm0, %xmm1
movd %xmm1, %r12d
xorl %esi, %esi
cmpl %r12d, %ebx
sete %sil
leaq 0x108(%rsp), %rdi
movq %r15, %rbp
movq %r15, %rdx
movq %rdi, %r15
callq 0xbf80
movq %r15, %rdi
leaq 0x4e565(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x5b091(%rip), %rsi     # 0xb01bf
callq 0x2d7d8
movq %rax, %rdi
leaq 0x52119(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x55163
movq %rbx, %rdi
addq $0x10, %rdi
movq 0x30(%rsp), %rax
movl (%rax,%r13,4), %esi
callq 0x22f0
movq %rbx, %rdi
leaq 0x4e517(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x5b03e(%rip), %rsi     # 0xb01ba
callq 0x18ff2
movq %rax, %rdi
leaq 0x520cb(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x551ab
movq %rbx, %rdi
addq $0x10, %rdi
movl %r12d, %esi
callq 0x22f0
movq %rbx, %rdi
leaq 0x650e4(%rip), %rsi     # 0xba299
callq 0x18fba
movq %r15, %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x551de
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x1(%r14), %rax
cmpq 0xd8(%rsp), %r14
movq %rax, %r14
movq %rbp, %r15
jne 0x5502c
movq 0x48(%rsp), %rsi
shlq $0x2, %rsi
movq 0x40(%rsp), %rdi
callq 0x21f0
cmpq $0x0, 0xb8(%rsp)
je 0x5523d
pxor %xmm0, %xmm0
leaq 0xb8(%rsp), %rax
movdqu %xmm0, (%rax)
movq 0xa8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
cmpq $0x0, 0x70(%rsp)
je 0x55280
pxor %xmm0, %xmm0
movdqu %xmm0, 0x70(%rsp)
movq $0x0, 0x88(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x98(%rsp)
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5b547(%rip), %rdi     # 0xb07e0
leaq 0x5b55f(%rip), %rsi     # 0xb07ff
leaq 0x5cb62(%rip), %rcx     # 0xb1e09
movl $0xf2, %edx
callq 0x2100
leaq 0x5b5e5(%rip), %rdi     # 0xb089d
leaq 0x5b540(%rip), %rsi     # 0xb07ff
leaq 0x5b66e(%rip), %rcx     # 0xb0934
movl $0xf7, %edx
callq 0x2100
jmp 0x552d2
movq %rax, %r15
jmp 0x55365
leaq 0x120(%rsp), %rsi
movq %rax, %r15
cmpq $0x0, 0x120(%rsp)
je 0x553b8
leaq 0x108(%rsp), %rdi
callq 0x253a
jmp 0x553b8
jmp 0x5531f
jmp 0x55327
jmp 0x55339
jmp 0x5530e
movq %rax, %r15
jmp 0x55349
movq %rax, %r15
jmp 0x553e4
jmp 0x55327
jmp 0x55339
movq %rax, %r15
jmp 0x553b8
movq %rax, %r15
leaq 0x108(%rsp), %rdi
callq 0xbfd8
jmp 0x55349
movq %rax, %r15
leaq 0x108(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x55365
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
cmpq $0x0, 0x30(%rsp)
jne 0x553a5
jmp 0x553b8
movq %rax, %r15
jmp 0x553a5
movq %rax, %r15
jmp 0x55389
movq %rax, %r15
leaq 0x108(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x553a5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x48(%rsp), %rsi
shlq $0x2, %rsi
movq 0x40(%rsp), %rdi
callq 0x21f0
cmpq $0x0, 0xb8(%rsp)
je 0x553e4
leaq 0xb8(%rsp), %rax
pxor %xmm0, %xmm0
movdqu %xmm0, (%rax)
movq -0x10(%rax), %rdi
movq -0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x21f0
cmpq $0x0, 0x70(%rsp)
je 0x55427
pxor %xmm0, %xmm0
movdqu %xmm0, 0x70(%rsp)
movq $0x0, 0x88(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x98(%rsp)
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq %r15, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9