// File: /workspace/github_cpp_makefile_star2_O2/dsharlet[P]array/test/ein_reduce.cpp
// Function: nda::test_ein_reduce_diag_body()
TEST(ein_reduce_diag) {
  constexpr index_t N = 64;
  matrix<int, N, N> A;
  fill_pattern(A);

  // Make diag(A), the diagonal of the matrix A.
  vector<int, N> a_diag;
  // This isn't a reduction!
  ein_reduce(ein<i>(a_diag) = ein<i, i>(A));

  for (index_t i : A.i()) {
    ASSERT_EQ(a_diag(i), A(i, i));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x46ac0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x46ae8
leaq 0x58(%rsp), %rdi
callq 0x46b3e
movq 0x28(%rsp), %rbx
movups 0x30(%rsp), %xmm0
leaq 0xc0(%rsp), %rdx
movups %xmm0, 0x8(%rdx)
movups 0x40(%rsp), %xmm0
movups %xmm0, 0x18(%rdx)
movq 0x50(%rsp), %rax
movq %rax, 0x28(%rdx)
movq 0x70(%rsp), %r14
movups 0x78(%rsp), %xmm0
movups %xmm0, -0x10(%rdx)
movq %r14, -0x18(%rdx)
movq %rbx, (%rdx)
leaq 0x88(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x46a60
movq 0x88(%rsp), %rax
movq 0xe8(%rsp), %rcx
movq 0xb0(%rsp), %rdx
movq 0xc8(%rsp), %rsi
leaq (,%rax,4), %rdi
shlq $0x2, %rdx
subq 0xd8(%rsp), %rax
imulq %rcx, %rax
leaq (%rdi,%rax,4), %rax
subq %rdx, %rdi
addq %rdi, %r14
shlq $0x2, %rsi
subq %rsi, %rax
addq %rax, %rbx
leaq 0x4(,%rcx,4), %rax
xorl %ecx, %ecx
cmpq $0x40, %rcx
je 0x4145f
movl (%rbx), %edx
movl %edx, (%r14,%rcx,4)
incq %rcx
addq %rax, %rbx
jmp 0x4144b
movq 0x40(%rsp), %r15
leaq 0x40(%r15), %rax
movq %rax, 0x8(%rsp)
leaq 0x88(%rsp), %r12
leaq 0xa8(%rsp), %r14
leaq 0x4c1c3(%rip), %rbp     # 0x8d647
cmpq 0x8(%rsp), %r15
je 0x415a6
movq %r15, %rax
subq 0x78(%rsp), %rax
movq 0x70(%rsp), %rcx
movl (%rcx,%rax,4), %r13d
movq 0x28(%rsp), %rax
movq %r15, %rcx
subq 0x40(%rsp), %rcx
imulq 0x50(%rsp), %rcx
addq %r15, %rcx
subq 0x30(%rsp), %rcx
movl (%rax,%rcx,4), %ebx
movq %r12, %rdi
leaq 0x58ed8(%rip), %rsi     # 0x9a3a0
leaq 0x7(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpl %ebx, %r13d
sete %sil
movq %r14, %rdi
movq %r12, %rdx
callq 0x6894
leaq 0x50105(%rip), %r12     # 0x915f2
movq %r14, %rdi
movq %rbp, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x58eb3(%rip), %rsi     # 0x9a3b5
callq 0x1079e
movq %rax, %rdi
movq %r12, %rsi
callq 0x106fe
movq %r15, %rsi
subq 0x78(%rsp), %rsi
shlq $0x2, %rsi
addq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
movq %rax, %rdi
movq %rbp, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x58e6d(%rip), %rsi     # 0x9a3ad
callq 0x107f4
movq %rax, %rdi
movq %r12, %rsi
callq 0x106fe
movq %r15, %rsi
subq 0x40(%rsp), %rsi
imulq 0x50(%rsp), %rsi
addq %r15, %rsi
subq 0x30(%rsp), %rsi
shlq $0x2, %rsi
addq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
movq %rax, %rdi
leaq 0x63d21(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r14, %rdi
callq 0x68d4
leaq 0x88(%rsp), %r12
movq %r12, %rdi
callq 0x2090
incq %r15
jmp 0x41484
leaq 0x58(%rsp), %rdi
callq 0x46b1e
leaq 0x10(%rsp), %rdi
callq 0x46b2e
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x415d5
jmp 0x415d0
movq %rax, %rbx
jmp 0x41606
movq %rax, %rbx
jmp 0x415fc
movq %rax, %rbx
jmp 0x415ef
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x68d4
leaq 0x88(%rsp), %rdi
callq 0x2090
leaq 0x58(%rsp), %rdi
callq 0x46b1e
leaq 0x10(%rsp), %rdi
callq 0x46b2e
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba