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

  // Compute the matrix-vector product B*x.
  vector<int, M> Bx = make_ein_sum<int, i>(cast<short>(ein<i, j>(B)) * cast<short>(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 += static_cast<short>(B(i, j)) * static_cast<short>(x(j));
    }
    ASSERT_EQ(Bx(i), Bx_i);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
leaq 0x50(%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 0x5b638
movq %rbx, %rdi
callq 0x5b6d4
leaq 0x98(%rsp), %rdi
pxor %xmm0, %xmm0
movdqu %xmm0, 0x18(%rdi)
movdqu %xmm0, 0x8(%rdi)
callq 0x5b72e
leaq 0x98(%rsp), %rdi
callq 0x5b774
movq 0x68(%rsp), %rax
leaq 0x100(%rsp), %rdi
movq %rax, -0x8(%rdi)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rdi)
movdqu 0x80(%rsp), %xmm0
movdqu %xmm0, 0x10(%rdi)
movq 0x90(%rsp), %rax
movq %rax, 0x20(%rdi)
leaq 0xe8(%rsp), %rax
movb $0x0, (%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0xf8(%rsp), %rax
movq %rax, 0x8(%rsi)
callq 0x5b7ea
leaq 0xb0(%rsp), %rcx
movq (%rcx), %rax
movd 0x8(%rcx), %xmm0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
paddb 0x5a7ea(%rip), %xmm0    # 0xafd10
xorl %ecx, %ecx
movdqa 0x5a7f0(%rip), %xmm1    # 0xafd20
movdqu %xmm0, (%rax,%rcx)
addq $0x10, %rcx
paddb %xmm1, %xmm0
cmpq $0x40, %rcx
jne 0x55530
movq 0x68(%rsp), %r14
movq 0x70(%rsp), %r15
movq 0x80(%rsp), %rbp
movq 0x90(%rsp), %r12
movq 0xb0(%rsp), %r13
movq 0xb8(%rsp), %rbx
movl $0x0, 0x34(%rsp)
leaq 0xf8(%rsp), %rsi
movq %rbp, (%rsi)
movq $0x32, 0x8(%rsi)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x10(%rsi)
xorl %edi, %edi
callq 0x5979c
leaq 0xf8(%rsp), %rsi
movq %rbp, (%rsi)
movq $0x32, 0x8(%rsi)
movq $0x1, 0x10(%rsi)
xorl %edi, %edi
callq 0x597ad
leaq 0xe8(%rsp), %rsi
movq %rbp, (%rsi)
leaq 0xf8(%rsp), %rdi
leaq 0x34(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x59844
cmpq %rbp, 0x118(%rsp)
jne 0x55b34
cmpq %rbx, %r15
jne 0x55b53
leaq 0x110(%rsp), %rax
movq (%rax), %rbx
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
movq %rbp, 0x10(%rdi)
callq 0x59b40
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rdx
leaq 0x3f(%rcx), %rax
leaq (,%rdx,4), %rsi
leaq (,%rbp,4), %rdi
subq %rdi, %rsi
addq %rsi, %rbx
subq %rbp, %rdx
imulq %r12, %rdx
addq %rcx, %rdx
subq %r15, %rdx
addq %rdx, %r14
movq %rcx, %rdx
subq %r15, %rdx
movq %r14, %rsi
xorl %edi, %edi
movsbl (%rsi), %r8d
movsbl (%r13,%rdx), %r9d
imull %r8d, %r9d
addl %r9d, (%rbx,%rdi,4)
incq %rdi
addq %r12, %rsi
cmpq $0x32, %rdi
jne 0x55653
leaq 0x1(%rcx), %rdx
incq %r14
cmpq %rax, %rcx
movq %rdx, %rcx
jne 0x55648
movq 0x100(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5aaa8(%rip), %rsi     # 0xb016c
leaq 0x5aaaf(%rip), %rdx     # 0xb017a
leaq 0x8(%rsp), %rdi
callq 0xd14c
leaq 0xf8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x4df91(%rip), %rsi     # 0xa3684
leaq 0xf8(%rsp), %rdi
callq 0x18fba
leaq 0x5aa74(%rip), %rsi     # 0xb017b
movq %rax, %rdi
callq 0x1902a
leaq 0x51b40(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x5573b
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x2110
leaq 0x4df42(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x5501b(%rip), %rsi     # 0xaa76c
movq %rax, %rdi
callq 0x18fba
leaq 0x51af6(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x55785
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x64b0d(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xf8(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x557bd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5a9b4(%rip), %rsi     # 0xb0185
leaq 0x5a9c8(%rip), %rdx     # 0xb01a0
callq 0xd14c
leaq 0xf8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x4de89(%rip), %rsi     # 0xa3684
leaq 0xf8(%rsp), %rdi
callq 0x18fba
leaq 0x5a992(%rip), %rsi     # 0xb01a1
movq %rax, %rdi
callq 0x4acaa
leaq 0x51a38(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x55843
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x32, %esi
callq 0x21b0
leaq 0x4de3a(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x5a93f(%rip), %rsi     # 0xb0198
movq %rax, %rdi
callq 0x1a146
leaq 0x519ee(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x5588d
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x32, %esi
callq 0x21b0
leaq 0x64a05(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xf8(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x558c5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x48(%rsp), %r14
leaq 0x31(%r14), %rax
movq %rax, 0xc8(%rsp)
leaq 0x8(%rsp), %r15
movq 0xb0(%rsp), %rax
movq %r14, %rcx
subq 0x80(%rsp), %rcx
imulq 0x90(%rsp), %rcx
addq 0xb8(%rsp), %rcx
subq 0x70(%rsp), %rcx
addq 0x68(%rsp), %rcx
pxor %xmm2, %xmm2
xorl %edx, %edx
movd (%rcx,%rdx), %xmm0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
movd (%rax,%rdx), %xmm1
punpcklbw %xmm1, %xmm1    # xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
psraw $0x8, %xmm0
psraw $0x8, %xmm1
pmullw %xmm0, %xmm1
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
psrad $0x10, %xmm0
paddd %xmm0, %xmm2
addq $0x4, %rdx
cmpq $0x40, %rdx
jne 0x5590f
movdqa %xmm2, 0xd0(%rsp)
movq %r14, %r13
subq 0x48(%rsp), %r13
movq 0x28(%rsp), %rax
movl (%rax,%r13,4), %ebx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
leaq 0x5a83d(%rip), %rsi     # 0xb01b1
leaq 0x5a843(%rip), %rdx     # 0xb01be
callq 0xd14c
movdqa 0xd0(%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 0xf8(%rsp), %rdi
movq %r15, %rbp
movq %r15, %rdx
movq %rdi, %r15
callq 0xbf80
movq %r15, %rdi
leaq 0x4dcbb(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x5a7e7(%rip), %rsi     # 0xb01bf
callq 0x2d7d8
movq %rax, %rdi
leaq 0x5186f(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x55a0d
movq %rbx, %rdi
addq $0x10, %rdi
movq 0x28(%rsp), %rax
movl (%rax,%r13,4), %esi
callq 0x22f0
movq %rbx, %rdi
leaq 0x4dc6d(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x5a794(%rip), %rsi     # 0xb01ba
callq 0x18ff2
movq %rax, %rdi
leaq 0x51821(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x55a55
movq %rbx, %rdi
addq $0x10, %rdi
movl %r12d, %esi
callq 0x22f0
movq %rbx, %rdi
leaq 0x6483a(%rip), %rsi     # 0xba299
callq 0x18fba
movq %r15, %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x55a88
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x1(%r14), %rax
cmpq 0xc8(%rsp), %r14
movq %rax, %r14
movq %rbp, %r15
jne 0x558db
movq 0x40(%rsp), %rsi
shlq $0x2, %rsi
movq 0x38(%rsp), %rdi
callq 0x21f0
cmpq $0x0, 0xb0(%rsp)
je 0x55ae3
pxor %xmm0, %xmm0
leaq 0xb0(%rsp), %rax
movdqu %xmm0, (%rax)
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x21f0
cmpq $0x0, 0x68(%rsp)
je 0x55b22
pxor %xmm0, %xmm0
movdqu %xmm0, 0x68(%rsp)
movq $0x0, 0x80(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x90(%rsp)
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x21f0
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5aca5(%rip), %rdi     # 0xb07e0
leaq 0x5acbd(%rip), %rsi     # 0xb07ff
leaq 0x5c2c0(%rip), %rcx     # 0xb1e09
movl $0xf2, %edx
callq 0x2100
leaq 0x5ad43(%rip), %rdi     # 0xb089d
leaq 0x5ac9e(%rip), %rsi     # 0xb07ff
leaq 0x5adcc(%rip), %rcx     # 0xb0934
movl $0xf7, %edx
callq 0x2100
jmp 0x55b74
movq %rax, %r15
jmp 0x55c07
leaq 0x110(%rsp), %rsi
movq %rax, %r15
cmpq $0x0, 0x110(%rsp)
je 0x55c5a
leaq 0xf8(%rsp), %rdi
callq 0x255a
jmp 0x55c5a
jmp 0x55bc1
jmp 0x55bc9
jmp 0x55bdb
jmp 0x55bb0
movq %rax, %r15
jmp 0x55beb
movq %rax, %r15
jmp 0x55c82
jmp 0x55bc9
jmp 0x55bdb
movq %rax, %r15
jmp 0x55c5a
movq %rax, %r15
leaq 0xf8(%rsp), %rdi
callq 0xbfd8
jmp 0x55beb
movq %rax, %r15
leaq 0xf8(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x55c07
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
cmpq $0x0, 0x28(%rsp)
jne 0x55c47
jmp 0x55c5a
movq %rax, %r15
jmp 0x55c47
movq %rax, %r15
jmp 0x55c2b
movq %rax, %r15
leaq 0xf8(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x55c47
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x40(%rsp), %rsi
shlq $0x2, %rsi
movq 0x38(%rsp), %rdi
callq 0x21f0
cmpq $0x0, 0xb0(%rsp)
je 0x55c82
leaq 0xb0(%rsp), %rax
pxor %xmm0, %xmm0
movdqu %xmm0, (%rax)
movq -0x10(%rax), %rdi
movq -0x8(%rax), %rsi
callq 0x21f0
cmpq $0x0, 0x68(%rsp)
je 0x55cc1
pxor %xmm0, %xmm0
movdqu %xmm0, 0x68(%rsp)
movq $0x0, 0x80(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x90(%rsp)
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x21f0
movq %r15, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9