// File: /workspace/github_cpp_makefile_star2_O2/dsharlet[P]array/test/ein_reduce.cpp
// Function: nda::test_ein_reduce_outer_body()
TEST(ein_reduce_outer) {
  constexpr index_t N = 64;
  constexpr index_t M = 40;
  vector<int, N> x;
  vector<int, M> y;
  fill_pattern(x);
  fill_pattern(y, 4);

  // Compute the outer product x^T*y.
  matrix<int, N, M> outer;
  ein_reduce(ein<i, j>(outer) = ein<i>(x) * ein<j>(y));

  for (index_t i : outer.i()) {
    for (index_t j : outer.j()) {
      ASSERT_EQ(outer(i, j), x(i) * y(j));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
leaq 0xa0(%rsp), %rdi
callq 0x46b3e
leaq 0x70(%rsp), %rdi
callq 0x46c78
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
callq 0x46b83
leaq 0x70(%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x46ca2
leaq 0x28(%rsp), %rdi
callq 0x46dfe
movq 0xb8(%rsp), %r15
movq 0xc0(%rsp), %rsi
movq 0x88(%rsp), %r12
movq 0x90(%rsp), %rbx
movq 0x40(%rsp), %r13
movq 0x48(%rsp), %r14
movdqu 0x58(%rsp), %xmm0
movdqa %xmm0, 0x10(%rsp)
movq 0x68(%rsp), %rbp
leaq 0x108(%rsp), %rdi
pushq $0x40
popq %rdx
movq %rsi, 0x8(%rsp)
xorl %ecx, %ecx
callq 0x476ca
movq 0x108(%rsp), %rax
movdqa 0x10(%rsp), %xmm0
movq %xmm0, %rcx
testq %rbp, %rbp
movq %rcx, 0x20(%rsp)
je 0x44249
cmpq %rax, %rcx
je 0x44252
leaq 0x56c6a(%rip), %rdi     # 0x9aea0
leaq 0x56c82(%rip), %rsi     # 0x9aebf
leaq 0x57dd9(%rip), %rcx     # 0x9c01d
jmp 0x44528
cmpq %rax, %rcx
jne 0x44532
leaq 0x108(%rsp), %rdi
pushq $0x28
popq %rdx
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x486fa
cmpq 0x108(%rsp), %r14
jne 0x44513
leaq 0xe0(%rsp), %rsi
movdqa 0x10(%rsp), %xmm0
movdqa %xmm0, (%rsi)
movq %rbp, 0x10(%rsi)
leaq 0xd0(%rsp), %rdx
movq %r14, (%rdx)
leaq 0x108(%rsp), %rdi
callq 0x493a8
movq 0x108(%rsp), %rax
movq 0x118(%rsp), %rdx
leaq 0x28(%rax), %rcx
movq %rdx, %rsi
subq 0x20(%rsp), %rsi
imulq %rbp, %rsi
leaq (,%rax,4), %rdi
leaq (%rdi,%rsi,4), %rsi
shlq $0x2, %r14
subq %r14, %rsi
addq %rsi, %r13
shlq $0x2, %rbp
shlq $0x2, %rdx
movq 0x8(%rsp), %rsi
shlq $0x2, %rsi
subq %rsi, %rdx
addq %rdx, %r15
cmpq %rcx, %rax
je 0x44323
movq %rax, %rdx
subq %rbx, %rdx
xorl %esi, %esi
movq %r13, %rdi
cmpq $0x40, %rsi
je 0x4431a
movl (%r12,%rdx,4), %r8d
imull (%r15,%rsi,4), %r8d
movl %r8d, (%rdi)
addq %rbp, %rdi
incq %rsi
jmp 0x44300
incq %rax
addq $0x4, %r13
jmp 0x442f0
movq 0x58(%rsp), %r15
leaq 0x40(%r15), %rax
movq %rax, 0x8(%rsp)
cmpq 0x8(%rsp), %r15
je 0x444e0
movq 0x48(%rsp), %rbp
pushq $0x28
popq %rcx
subq $0x1, %rcx
jb 0x444d8
movq %rcx, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq %r15, %rcx
subq 0x58(%rsp), %rcx
imulq 0x68(%rsp), %rcx
subq 0x48(%rsp), %rcx
addq %rbp, %rcx
movl (%rax,%rcx,4), %ebx
movq 0xb8(%rsp), %rax
movq %r15, %r12
movq %r15, %rcx
subq 0xc0(%rsp), %rcx
movl (%rax,%rcx,4), %r15d
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
shlq $0x2, %rcx
subq %rcx, %rax
movl (%rax,%rbp,4), %r13d
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
leaq 0x56331(%rip), %rsi     # 0x9a6e9
leaq 0x7(%rsp), %rdx
callq 0x66a0
imull %r15d, %r13d
xorl %esi, %esi
cmpl %r13d, %ebx
sete %sil
leaq 0x108(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x6894
movq %r12, %r15
leaq 0x4925b(%rip), %r12     # 0x8d647
leaq 0x4d1ff(%rip), %r13     # 0x915f2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x562fc(%rip), %rsi     # 0x9a704
callq 0x46c4c
movq %rax, %rdi
movq %r13, %rsi
callq 0x106fe
movq %r15, %rsi
subq 0x58(%rsp), %rsi
imulq 0x68(%rsp), %rsi
subq 0x48(%rsp), %rsi
addq %rbp, %rsi
shlq $0x2, %rsi
addq 0x40(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
movq %rax, %rdi
movq %r12, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x562a4(%rip), %rsi     # 0x9a6f8
callq 0x46c4c
movq %rax, %rdi
movq %r13, %rsi
callq 0x106fe
movq 0xb8(%rsp), %rcx
movq %r15, %rdx
subq 0xc0(%rsp), %rdx
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdi
shlq $0x2, %rdi
subq %rdi, %rsi
movl (%rsi,%rbp,4), %esi
imull (%rcx,%rdx,4), %esi
movl %esi, 0xd0(%rsp)
movq %rax, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x60dec(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %rbx, %rdi
callq 0x68d4
movq %r14, %rdi
callq 0x2090
incq %rbp
movq 0x10(%rsp), %rcx
jmp 0x44344
incq %r15
jmp 0x44331
leaq 0x28(%rsp), %rdi
callq 0x46e26
leaq 0x70(%rsp), %rdi
callq 0x46cc6
leaq 0xa0(%rsp), %rdi
callq 0x46b1e
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x56986(%rip), %rdi     # 0x9aea0
leaq 0x5699e(%rip), %rsi     # 0x9aebf
leaq 0x57b75(%rip), %rcx     # 0x9c09d
movl $0xf2, %edx
callq 0x20e0
leaq 0x56a24(%rip), %rdi     # 0x9af5d
leaq 0x5697f(%rip), %rsi     # 0x9aebf
leaq 0x57ad6(%rip), %rcx     # 0x9c01d
movl $0xf7, %edx
callq 0x20e0
jmp 0x44558
movq %rax, %rbx
jmp 0x4459c
movq %rax, %rbx
jmp 0x44592
jmp 0x4455f
movq %rax, %rbx
jmp 0x44588
jmp 0x4456b
movq %rax, %rbx
jmp 0x4457b
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x68d4
leaq 0xe0(%rsp), %rdi
callq 0x2090
leaq 0x28(%rsp), %rdi
callq 0x46e26
leaq 0x70(%rsp), %rdi
callq 0x46cc6
leaq 0xa0(%rsp), %rdi
callq 0x46b1e
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba