// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/ein_reduce.cpp
// Function: nda::test_ein_reduce_transpose_body()
TEST(ein_reduce_transpose) {
  constexpr index_t M = 12;
  constexpr index_t N = 20;
  matrix<int, M, N> A;
  fill_pattern(A);

  // Transpose A using ein_reduce.
  matrix<int, N, M> AT;
  ein_reduce(ein<i, j>(AT) = ein<j, i>(A));

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
leaq 0x50(%rsp), %rbx
movq $0x0, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x18(%rbx)
movq %r14, 0x40(%rbx)
movq %rbx, %rdi
callq 0x5a3a6
movq %rbx, %rdi
callq 0x5a444
movq 0x18(%rbx), %rax
leaq 0xc0(%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)
leaq 0x98(%rsp), %rax
movl $0x0, (%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0xb8(%rsp), %rax
movq %rax, 0x8(%rsi)
callq 0x5a655
leaq 0x8(%rsp), %rdi
movq $0x0, 0x30(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movq %r14, 0x40(%rdi)
callq 0x5a6d0
leaq 0x8(%rsp), %rdi
callq 0x5a76e
movq 0x68(%rsp), %rbx
movq 0x70(%rsp), %r13
movq 0x80(%rsp), %rbp
movq 0x90(%rsp), %r14
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rax
movups 0x38(%rsp), %xmm0
movq 0x38(%rsp), %rcx
movq 0x48(%rsp), %r12
testq %r12, %r12
je 0x514f5
cmpq %r13, %rcx
je 0x514fe
leaq 0x5f2fe(%rip), %rdi     # 0xb07e0
leaq 0x5f316(%rip), %rsi     # 0xb07ff
leaq 0x5f5b0(%rip), %rcx     # 0xb0aa0
jmp 0x5181c
cmpq %r13, %rcx
jne 0x51826
movq %rcx, (%rsp)
cmpq %rbp, %rax
jne 0x51807
leaq 0xb8(%rsp), %rdi
movq %rbp, (%rdi)
movups %xmm0, 0x10(%rdi)
movq %r12, 0x20(%rdi)
callq 0x581b2
movq 0xb8(%rsp), %rcx
movq 0xc8(%rsp), %rdx
leaq 0xb(%rcx), %rax
movq %rdx, %rsi
subq (%rsp), %rsi
imulq %r12, %rsi
leaq (,%rcx,4), %rdi
leaq (%rdi,%rsi,4), %rsi
leaq (,%rbp,4), %rdi
subq %rdi, %rsi
addq %rsi, %r15
shlq $0x2, %r12
movq %rcx, %rsi
subq %rbp, %rsi
imulq %r14, %rsi
shlq $0x2, %rdx
leaq (%rdx,%rsi,4), %rdx
shlq $0x2, %r13
subq %r13, %rdx
addq %rdx, %rbx
shlq $0x2, %r14
movq %r15, %rdx
xorl %esi, %esi
movl (%rbx,%rsi,4), %edi
movl %edi, (%rdx)
incq %rsi
addq %r12, %rdx
cmpq $0x14, %rsi
jne 0x51585
leaq 0x1(%rcx), %rdx
addq $0x4, %r15
addq %r14, %rbx
cmpq %rax, %rcx
movq %rdx, %rcx
jne 0x51580
movq 0x38(%rsp), %rbp
leaq 0x13(%rbp), %rax
movq %rax, (%rsp)
leaq 0x98(%rsp), %r12
movl $0xc, %r15d
movq 0x28(%rsp), %r13
movq %rbp, %rax
subq 0x38(%rsp), %rax
imulq 0x48(%rsp), %rax
movq 0x20(%rsp), %rcx
subq 0x28(%rsp), %rax
addq %r13, %rax
movl (%rcx,%rax,4), %r14d
movq %r13, %rax
subq 0x80(%rsp), %rax
movq 0x68(%rsp), %rcx
imulq 0x90(%rsp), %rax
addq %rbp, %rax
subq 0x70(%rsp), %rax
movl (%rcx,%rax,4), %ebx
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq %r12, %rdi
leaq 0x5e831(%rip), %rsi     # 0xafe57
leaq 0x5e83d(%rip), %rdx     # 0xafe6a
callq 0xd14c
xorl %esi, %esi
cmpl %ebx, %r14d
sete %sil
leaq 0xb8(%rsp), %rdi
movq %r12, %rbx
movq %r12, %rdx
movq %rdi, %r12
callq 0xbf80
movq %r12, %rdi
leaq 0x52029(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x5e801(%rip), %rsi     # 0xafe6b
callq 0x1a146
movq %rax, %rdi
leaq 0x55bdd(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x516b4
movq 0x20(%rsp), %rax
movq %rbp, %rcx
subq 0x38(%rsp), %rcx
imulq 0x48(%rsp), %rcx
subq 0x28(%rsp), %rcx
addq %r13, %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rax,%rcx,4), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x51fc6(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x5e796(%rip), %rsi     # 0xafe63
callq 0x1909a
movq %rax, %rdi
leaq 0x55b7a(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5171d
movq %r13, %rax
subq 0x80(%rsp), %rax
imulq 0x90(%rsp), %rax
addq %rbp, %rax
subq 0x70(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rcx,%rax,4), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x68b72(%rip), %rsi     # 0xba299
callq 0x18fba
movq %r12, %rdi
callq 0xbfd8
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x51759
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %r13
decq %r15
movq %rbx, %r12
jne 0x515c9
leaq 0x1(%rbp), %rax
cmpq (%rsp), %rbp
movq %rax, %rbp
jne 0x515be
cmpq $0x0, 0x20(%rsp)
je 0x517b4
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rsp)
movq $0x0, 0x38(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x48(%rsp)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
cmpq $0x0, 0x68(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
je 0x517f5
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rsp)
movq $0x0, 0x80(%rsp)
movq %rax, 0x90(%rsp)
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5efd2(%rip), %rdi     # 0xb07e0
leaq 0x5efea(%rip), %rsi     # 0xb07ff
leaq 0x5f304(%rip), %rcx     # 0xb0b20
movl $0xf2, %edx
callq 0x2100
leaq 0x5f070(%rip), %rdi     # 0xb089d
leaq 0x5efcb(%rip), %rsi     # 0xb07ff
leaq 0x5f265(%rip), %rcx     # 0xb0aa0
movl $0xf7, %edx
callq 0x2100
jmp 0x51854
movq %rax, %rbx
jmp 0x518d8
movq %rax, %rbx
jmp 0x518ce
movq %rax, %rbx
jmp 0x51893
movq %rax, %rbx
jmp 0x5186e
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xbfd8
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x51893
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x21f0
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
cmpq $0x0, 0x20(%rsp)
je 0x518d8
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rsp)
movq $0x0, 0x38(%rsp)
movq %r14, 0x48(%rsp)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
cmpq $0x0, 0x68(%rsp)
je 0x5190f
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rsp)
movq $0x0, 0x80(%rsp)
movq %r14, 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