// File: /workspace/github_cpp_makefile_star2_O2/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 $0x288, %rsp            # imm = 0x288
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
callq 0x46ba6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x46bce
leaq 0x30(%rsp), %rdi
callq 0x46c04
movq 0x90(%rsp), %r15
movq 0x98(%rsp), %rbx
movq 0xa8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xb8(%rsp), %r12
movq 0x48(%rsp), %r13
movq 0x50(%rsp), %r14
movdqu 0x60(%rsp), %xmm0
movdqa %xmm0, 0x10(%rsp)
movq 0x70(%rsp), %rbp
leaq 0xf8(%rsp), %rdi
pushq $0x14
popq %rdx
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x47a2e
movq 0xf8(%rsp), %rax
movdqa 0x10(%rsp), %xmm0
movq %xmm0, %rcx
testq %rbp, %rbp
movq %rcx, 0x28(%rsp)
je 0x41c52
cmpq %rax, %rcx
je 0x41c5b
leaq 0x59261(%rip), %rdi     # 0x9aea0
leaq 0x59279(%rip), %rsi     # 0x9aebf
leaq 0x59513(%rip), %rcx     # 0x9b160
jmp 0x41f19
cmpq %rax, %rcx
jne 0x41f23
leaq 0xf8(%rsp), %rdi
pushq $0xc
popq %rdx
movq 0x8(%rsp), %rsi
xorl %ecx, %ecx
callq 0x47a86
cmpq 0xf8(%rsp), %r14
jne 0x41f04
leaq 0xd0(%rsp), %rsi
movdqa 0x10(%rsp), %xmm0
movdqa %xmm0, (%rsi)
movq %rbp, 0x10(%rsi)
leaq 0xc0(%rsp), %rdx
movq %r14, (%rdx)
leaq 0xf8(%rsp), %rdi
callq 0x478b4
movq 0xf8(%rsp), %rax
movq 0x108(%rsp), %rdx
leaq 0xc(%rax), %rcx
movq %rdx, %rsi
subq 0x28(%rsp), %rsi
imulq %rbp, %rsi
leaq (,%rax,4), %rdi
leaq (%rdi,%rsi,4), %rsi
shlq $0x2, %r14
subq %r14, %rsi
addq %rsi, %r13
shlq $0x2, %rbp
movq %rax, %rsi
subq 0x8(%rsp), %rsi
imulq %r12, %rsi
shlq $0x2, %rdx
leaq (%rdx,%rsi,4), %rdx
shlq $0x2, %rbx
subq %rbx, %rdx
addq %rdx, %r15
shlq $0x2, %r12
cmpq %rcx, %rax
je 0x41d34
xorl %edx, %edx
movq %r13, %rsi
cmpq $0x14, %rdx
je 0x41d28
movl (%r15,%rdx,4), %edi
movl %edi, (%rsi)
addq %rbp, %rsi
incq %rdx
jmp 0x41d14
incq %rax
addq $0x4, %r13
addq %r12, %r15
jmp 0x41d0a
movq 0x60(%rsp), %r13
leaq 0x14(%r13), %rax
movq %rax, 0x8(%rsp)
leaq 0xf8(%rsp), %r15
cmpq 0x8(%rsp), %r13
je 0x41ede
movq 0x50(%rsp), %rbp
pushq $0xc
popq %rcx
subq $0x1, %rcx
jb 0x41ed6
movq %rcx, 0x10(%rsp)
movq %r15, %r12
movq 0x48(%rsp), %rax
movq %r13, %rcx
subq 0x60(%rsp), %rcx
imulq 0x70(%rsp), %rcx
subq 0x50(%rsp), %rcx
addq %rbp, %rcx
movq %r13, %rdx
movl (%rax,%rcx,4), %r13d
movq 0x90(%rsp), %rax
movq %rbp, %rcx
subq 0xa8(%rsp), %rcx
imulq 0xb8(%rsp), %rcx
movq %rdx, %rbx
addq %rdx, %rcx
subq 0x98(%rsp), %rcx
movl (%rax,%rcx,4), %r15d
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
leaq 0x58656(%rip), %rsi     # 0x9a427
leaq 0xc0(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpl %r15d, %r13d
sete %sil
movq %r12, %r15
movq %r12, %rdi
movq %r14, %rdx
callq 0x6894
movq %rbx, %r13
leaq 0x4b848(%rip), %rbx     # 0x8d647
leaq 0x4f7ec(%rip), %r12     # 0x915f2
movq %r15, %rdi
movq %rbx, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x58620(%rip), %rsi     # 0x9a43b
callq 0x118ac
movq %rax, %rdi
movq %r12, %rsi
callq 0x106fe
movq %r13, %rsi
subq 0x60(%rsp), %rsi
imulq 0x70(%rsp), %rsi
subq 0x50(%rsp), %rsi
addq %rbp, %rsi
shlq $0x2, %rsi
addq 0x48(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
movq %rax, %rdi
movq %rbx, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x585cc(%rip), %rsi     # 0x9a433
callq 0x107f4
movq %rax, %rdi
movq %r12, %rsi
callq 0x106fe
movq %rbp, %rsi
subq 0xa8(%rsp), %rsi
imulq 0xb8(%rsp), %rsi
addq %r13, %rsi
subq 0x98(%rsp), %rsi
shlq $0x2, %rsi
addq 0x90(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
movq %rax, %rdi
leaq 0x633ee(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r15, %rdi
callq 0x68d4
movq %r14, %rdi
callq 0x2090
incq %rbp
movq 0x10(%rsp), %rcx
jmp 0x41d5d
incq %r13
jmp 0x41d4a
leaq 0x30(%rsp), %rdi
callq 0x46c2c
leaq 0x78(%rsp), %rdi
callq 0x46c3c
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x58f95(%rip), %rdi     # 0x9aea0
leaq 0x58fad(%rip), %rsi     # 0x9aebf
leaq 0x59311(%rip), %rcx     # 0x9b22a
movl $0xf2, %edx
callq 0x20e0
leaq 0x59033(%rip), %rdi     # 0x9af5d
leaq 0x58f8e(%rip), %rsi     # 0x9aebf
leaq 0x59228(%rip), %rcx     # 0x9b160
movl $0xf7, %edx
callq 0x20e0
jmp 0x41f44
movq %rax, %rbx
jmp 0x41f7c
jmp 0x41f4b
movq %rax, %rbx
jmp 0x41f72
movq %rax, %rbx
jmp 0x41f65
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x68d4
leaq 0xd0(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x46c2c
leaq 0x78(%rsp), %rdi
callq 0x46c3c
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba