// File: /workspace/github_cpp_makefile_star2_O1/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 $0x258, %rsp            # imm = 0x258
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
leaq 0x58(%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 0x58ef2
movq %rbx, %rdi
callq 0x58f92
movq 0x18(%rbx), %rax
leaq 0xd0(%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 0xa0(%rsp), %rax
movl $0x0, (%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
leaq 0xc8(%rsp), %rax
movq %rax, 0x8(%rsi)
callq 0x591a4
leaq 0x10(%rsp), %rdi
movq $0x0, 0x30(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movq %r14, 0x40(%rdi)
callq 0x59220
leaq 0x10(%rsp), %rdi
callq 0x592c0
movq 0x70(%rsp), %rbx
movq 0x78(%rsp), %rcx
movq 0x88(%rsp), %rdx
movq 0x98(%rsp), %r14
movq 0x28(%rsp), %r15
movq 0x30(%rsp), %rbp
movq 0x40(%rsp), %r13
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %r12
testq %r12, %r12
je 0x50543
cmpq %rcx, %r13
je 0x5054c
leaq 0x5e380(%rip), %rdi     # 0xae8b0
leaq 0x5e398(%rip), %rsi     # 0xae8cf
leaq 0x5e632(%rip), %rcx     # 0xaeb70
jmp 0x50884
cmpq %rcx, %r13
jne 0x5088e
movq %rcx, 0x8(%rsp)
movq %rdx, 0xc0(%rsp)
cmpq %rdx, %rbp
jne 0x5086f
leaq 0xc8(%rsp), %rdi
movq %rbp, (%rdi)
movq %r13, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %r12, 0x20(%rdi)
callq 0x57054
movq 0xc8(%rsp), %rcx
movq 0xd8(%rsp), %rdx
leaq 0xb(%rcx), %rax
movq %rdx, %rsi
subq %r13, %rsi
imulq %r12, %rsi
leaq (,%rcx,4), %rdi
leaq (%rdi,%rsi,4), %rsi
shlq $0x2, %rbp
subq %rbp, %rsi
addq %rsi, %r15
shlq $0x2, %r12
movq %rcx, %rsi
subq 0xc0(%rsp), %rsi
imulq %r14, %rsi
shlq $0x2, %rdx
leaq (%rdx,%rsi,4), %rdx
movq 0x8(%rsp), %rsi
shlq $0x2, %rsi
subq %rsi, %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 0x505e5
leaq 0x1(%rcx), %rdx
addq $0x4, %r15
addq %r14, %rbx
cmpq %rax, %rcx
movq %rdx, %rcx
jne 0x505e0
movq 0x40(%rsp), %rbp
leaq 0x13(%rbp), %rax
movq %rax, 0x8(%rsp)
leaq 0xa0(%rsp), %r12
movl $0xc, %r15d
movq 0x30(%rsp), %r13
movq %rbp, %rax
subq 0x40(%rsp), %rax
imulq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
subq 0x30(%rsp), %rax
addq %r13, %rax
movl (%rcx,%rax,4), %r14d
movq %r13, %rax
subq 0x88(%rsp), %rax
movq 0x70(%rsp), %rcx
imulq 0x98(%rsp), %rax
addq %rbp, %rax
subq 0x78(%rsp), %rax
movl (%rcx,%rax,4), %ebx
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %r12, %rdi
leaq 0x5d8a0(%rip), %rsi     # 0xadf27
leaq 0x5d8ac(%rip), %rdx     # 0xadf3a
callq 0xd0b8
xorl %esi, %esi
cmpl %ebx, %r14d
sete %sil
leaq 0xc8(%rsp), %rdi
movq %r12, %rbx
movq %r12, %rdx
movq %rdi, %r12
callq 0xbf0a
movq %r12, %rdi
leaq 0x50f98(%rip), %rsi     # 0xa1654
callq 0x18a16
movq %rax, %rdi
leaq 0x5d870(%rip), %rsi     # 0xadf3b
callq 0x19c24
movq %rax, %rdi
leaq 0x54c50(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x50715
movq 0x28(%rsp), %rax
movq %rbp, %rcx
subq 0x40(%rsp), %rcx
imulq 0x50(%rsp), %rcx
subq 0x30(%rsp), %rcx
addq %r13, %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rax,%rcx,4), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x50f35(%rip), %rsi     # 0xa1654
callq 0x18a16
movq %rax, %rdi
leaq 0x5d805(%rip), %rsi     # 0xadf33
callq 0x18af6
movq %rax, %rdi
leaq 0x54bed(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5077e
movq %r13, %rax
subq 0x88(%rsp), %rax
imulq 0x98(%rsp), %rax
addq %rbp, %rax
subq 0x78(%rsp), %rax
movq 0x70(%rsp), %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rcx,%rax,4), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x67be1(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %r12, %rdi
callq 0xbf62
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x507ba
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %r13
decq %r15
movq %rbx, %r12
jne 0x5062a
leaq 0x1(%rbp), %rax
cmpq 0x8(%rsp), %rbp
movq %rax, %rbp
jne 0x5061f
cmpq $0x0, 0x28(%rsp)
je 0x50819
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
xorl %ebx, %ebx
movq %rbx, 0x40(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq %rbx, 0x18(%rsp)
cmpq $0x0, 0x70(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
je 0x5085d
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rsp)
xorl %ebx, %ebx
movq %rbx, 0x88(%rsp)
movq %rax, 0x98(%rsp)
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq %rbx, 0x60(%rsp)
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5e03a(%rip), %rdi     # 0xae8b0
leaq 0x5e052(%rip), %rsi     # 0xae8cf
leaq 0x5e36c(%rip), %rcx     # 0xaebf0
movl $0xf2, %edx
callq 0x2100
leaq 0x5e0d8(%rip), %rdi     # 0xae96d
leaq 0x5e033(%rip), %rsi     # 0xae8cf
leaq 0x5e2cd(%rip), %rcx     # 0xaeb70
movl $0xf7, %edx
callq 0x2100
jmp 0x508cc
movq %rax, %rbx
movq %r14, %rax
jmp 0x50954
movq %rax, %rbx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
jmp 0x50954
movq %rax, %rbx
jmp 0x5090b
movq %rax, %rbx
jmp 0x508e6
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0xbf62
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x5090b
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x21f0
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq $0x0, 0x28(%rsp)
je 0x50954
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
xorl %r14d, %r14d
movq %r14, 0x40(%rsp)
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %r14, 0x18(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0x5098f
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rsp)
xorl %r14d, %r14d
movq %r14, 0x88(%rsp)
movq %rax, 0x98(%rsp)
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq %r14, 0x60(%rsp)
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc036