// File: /workspace/github_cpp_makefile_star2_O3/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 $0x228, %rsp            # imm = 0x228
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
leaq 0x50(%rsp), %rbx
movq $0x0, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x18(%rbx)
movq %rax, 0x40(%rbx)
movq %rbx, %rdi
callq 0x5a070
movq %rbx, %rdi
callq 0x5a112
movq 0x18(%rbx), %rax
leaq 0xa0(%rsp), %rdi
movq %rax, -0x8(%rdi)
movups 0x20(%rbx), %xmm0
movups %xmm0, (%rdi)
movups 0x30(%rbx), %xmm0
movups %xmm0, 0x10(%rdi)
movq 0x40(%rbx), %rax
movq %rax, 0x20(%rdi)
movq %rsp, %rax
movl $0x0, (%rax)
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x98(%rsp), %rax
movq %rax, 0x8(%rsi)
callq 0x5a32a
leaq 0x20(%rsp), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
callq 0x57f74
leaq 0x20(%rsp), %rdi
callq 0x57fba
leaq 0x80(%rsp), %rax
movq -0x18(%rax), %rbx
movups -0x10(%rax), %xmm0
leaq 0xb0(%rsp), %rdx
movups %xmm0, 0x8(%rdx)
movq 0x10(%rax), %rcx
movq %rcx, 0x28(%rdx)
movups (%rax), %xmm0
movups %xmm0, 0x18(%rdx)
leaq 0x38(%rsp), %rax
movq (%rax), %r14
movups 0x8(%rax), %xmm0
movups %xmm0, -0x10(%rdx)
movq %r14, -0x18(%rdx)
movq %rbx, (%rdx)
movq %rsp, %rdi
leaq 0x98(%rsp), %rsi
callq 0x57aef
movq (%rsp), %rax
movq 0xd8(%rsp), %rcx
movq 0xa0(%rsp), %rdx
movq 0xb8(%rsp), %rsi
leaq (,%rax,4), %rdi
shlq $0x2, %rdx
subq 0xc8(%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
movl (%rbx), %edx
movl %edx, (%r14,%rcx,4)
incq %rcx
addq %rax, %rbx
cmpq $0x40, %rcx
jne 0x50985
movq 0x80(%rsp), %rbp
movl $0x40, %r15d
movq %rsp, %rbx
leaq 0x98(%rsp), %r12
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
shlq $0x2, %rcx
subq %rcx, %rax
movl (%rax,%rbp,4), %r14d
movq %rbp, %rax
subq 0x80(%rsp), %rax
imulq 0x90(%rsp), %rax
subq 0x70(%rsp), %rax
movq 0x68(%rsp), %rcx
addq %rbp, %rax
movl (%rcx,%rax,4), %r13d
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
leaq 0x5f3d3(%rip), %rsi     # 0xafdd0
leaq 0x5f3e0(%rip), %rdx     # 0xafde4
callq 0xd14c
xorl %esi, %esi
cmpl %r13d, %r14d
sete %sil
movq %r12, %rdi
movq %rbx, %r13
movq %rbx, %rdx
callq 0xbf80
leaq 0x52c5d(%rip), %rbx     # 0xa3684
movq %r12, %rdi
movq %rbx, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x5f3a9(%rip), %rsi     # 0xafde5
callq 0x1902a
movq %rax, %rdi
leaq 0x5680b(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x50a7c
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
shlq $0x2, %rcx
subq %rcx, %rax
movq %r14, %rdi
addq $0x10, %rdi
movl (%rax,%rbp,4), %esi
callq 0x22f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x5f34c(%rip), %rsi     # 0xafddd
callq 0x1909a
movq %rax, %rdi
leaq 0x567b6(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x50ae1
movq 0x68(%rsp), %rax
movq %rbp, %rcx
subq 0x80(%rsp), %rcx
imulq 0x90(%rsp), %rcx
subq 0x70(%rsp), %rcx
addq %rbp, %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rax,%rcx,4), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x697ae(%rip), %rsi     # 0xba299
callq 0x18fba
movq %r12, %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x50b13
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %rbp
decq %r15
movq %r13, %rbx
jne 0x509b0
cmpq $0x0, 0x38(%rsp)
je 0x50b48
xorps %xmm0, %xmm0
leaq 0x38(%rsp), %rax
movups %xmm0, (%rax)
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
cmpq $0x0, 0x68(%rsp)
je 0x50b89
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rsp)
movq $0x0, 0x80(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x90(%rsp)
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x50ba4
jmp 0x50b9f
movq %rax, %rbx
jmp 0x50bff
movq %rax, %rbx
jmp 0x50bd9
movq %rax, %rbx
jmp 0x50bbe
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x50bd9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
cmpq $0x0, 0x38(%rsp)
je 0x50bff
xorps %xmm0, %xmm0
leaq 0x38(%rsp), %rax
movups %xmm0, (%rax)
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
cmpq $0x0, 0x68(%rsp)
je 0x50c40
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rsp)
movq $0x0, 0x80(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x90(%rsp)
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9