// File: /workspace/github_cpp_makefile_star2_O1/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 0x58bc8
movq %rbx, %rdi
callq 0x58c6a
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 0x58e77
leaq 0x20(%rsp), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
callq 0x56e24
leaq 0x20(%rsp), %rdi
callq 0x56e6a
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 0x56996
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 0x4fa20
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 0x5e408(%rip), %rsi     # 0xadea0
leaq 0x5e415(%rip), %rdx     # 0xadeb4
callq 0xd0b8
xorl %esi, %esi
cmpl %r13d, %r14d
sete %sil
movq %r12, %rdi
movq %rbx, %r13
movq %rbx, %rdx
callq 0xbf0a
leaq 0x51b92(%rip), %rbx     # 0xa1654
movq %r12, %rdi
movq %rbx, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x5e3de(%rip), %rsi     # 0xadeb5
callq 0x18a86
movq %rax, %rdi
leaq 0x55844(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x4fb17
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 0x18a16
movq %rax, %rdi
leaq 0x5e381(%rip), %rsi     # 0xadead
callq 0x18af6
movq %rax, %rdi
leaq 0x557ef(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x4fb7c
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 0x687e3(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %r12, %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4fbae
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %rbp
decq %r15
movq %r13, %rbx
jne 0x4fa4b
cmpq $0x0, 0x38(%rsp)
je 0x4fbec
xorps %xmm0, %xmm0
leaq 0x38(%rsp), %rax
movups %xmm0, (%rax)
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq $0x0, 0x28(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x4fc30
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rsp)
xorl %ebx, %ebx
movq %rbx, 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, 0x58(%rsp)
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4fc4b
jmp 0x4fc46
movq %rax, %rbx
jmp 0x4fcaf
movq %rax, %rbx
jmp 0x4fc80
movq %rax, %rbx
jmp 0x4fc65
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4fc80
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
cmpq $0x0, 0x38(%rsp)
je 0x4fcaf
xorps %xmm0, %xmm0
leaq 0x38(%rsp), %rax
movups %xmm0, (%rax)
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq $0x0, 0x28(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x4fcf4
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rsp)
xorl %r14d, %r14d
movq %r14, 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 %r14, 0x58(%rsp)
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc036