// File: /workspace/github_cpp_makefile_star2_O1/dsharlet[P]array/test/matrix.cpp
// Function: nda::test_matrix_transpose_body()
TEST(matrix_transpose) {
  matrix<int> m({5, 8});
  fill_pattern(m);
  auto mt = transpose<1, 0>(m);
  for_all_indices(m.shape(), [&](int i, int j) { ASSERT_EQ(m(i, j), mt(j, i)); });
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
xorl %r12d, %r12d
leaq 0xc8(%rsp), %r14
movq %r12, (%r14)
movl $0x8, %ebx
movq %rbx, 0x8(%r14)
movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000
movq %r13, 0x10(%r14)
movl $0x1, %edi
movq %r14, %rsi
callq 0xd09f
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %r15
movups %xmm0, 0x8(%r15)
movups %xmm0, 0x18(%r15)
movq %rbx, 0x28(%r15)
movq %r12, 0x38(%r15)
movq $0x5, 0x40(%r15)
movq %r13, 0x48(%r15)
movq %r15, %rdi
callq 0x1ce12
movq %r15, %rdi
callq 0x1cecc
movq 0x18(%r15), %rax
movq %rax, (%r14)
addq %r14, %rbx
movups 0x20(%r15), %xmm0
movups %xmm0, 0x8(%r14)
movups 0x30(%r15), %xmm0
movups %xmm0, 0x18(%r14)
movups 0x40(%r15), %xmm0
movups %xmm0, 0x28(%r14)
leaq 0x10(%rsp), %rax
movl $0x0, (%rax)
leaq 0x90(%rsp), %rsi
movq %rax, (%rsi)
movq %r14, 0x8(%rsi)
movq %rbx, %rdi
callq 0x79a10
leaq 0x90(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x790d5
movq 0x80(%rsp), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x7838f
movq 0x78(%rsp), %rcx
movq %rcx, (%rsp)
addq %rcx, 0x30(%rsp)
leaq 0x10(%rsp), %r12
movq 0x68(%rsp), %r13
testq %r13, %r13
je 0x78379
movq 0x60(%rsp), %rbp
movslq (%rsp), %rax
movq %rax, 0x8(%rsp)
shlq $0x20, %rbp
movq 0x8(%rsp), %rsi
movq %rsi, %rax
subq 0x78(%rsp), %rax
imulq 0x88(%rsp), %rax
movq %rbp, %rbx
sarq $0x20, %rbx
movq %rbx, %rcx
subq 0x60(%rsp), %rcx
shlq $0x2, %rcx
addq 0x58(%rsp), %rcx
movq %rbx, %rdx
subq 0xb0(%rsp), %rdx
subq 0x98(%rsp), %rsi
imulq 0xa8(%rsp), %rsi
shlq $0x2, %rdx
addq 0x90(%rsp), %rdx
movl (%rcx,%rax,4), %r14d
movl (%rdx,%rsi,4), %r15d
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq $0x13, 0x38(%rsp)
movq %r12, %rdi
leaq 0x38(%rsp), %rsi
xorl %edx, %edx
callq 0x2310
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movups 0x405b6(%rip), %xmm0    # 0xb87ce
movups %xmm0, (%rax)
movl $0x2969202c, 0xf(%rax)  # imm = 0x2969202C
movq %rcx, 0x18(%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax,%rcx)
xorl %esi, %esi
cmpl %r15d, %r14d
sete %sil
leaq 0xc8(%rsp), %rdi
movq %r12, %r15
movq %r12, %rdx
movq %rdi, %r12
callq 0xbf0a
movq %r12, %rdi
leaq 0x293fb(%rip), %rsi     # 0xa1654
callq 0x18a16
movq %rax, %rdi
leaq 0x4057a(%rip), %rsi     # 0xb87e2
callq 0x18af6
movq %rax, %rdi
leaq 0x2d0b3(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x782bb
movq %rbx, %rax
subq 0x60(%rsp), %rax
shlq $0x2, %rax
addq 0x58(%rsp), %rax
movq 0x8(%rsp), %rcx
subq 0x78(%rsp), %rcx
imulq 0x88(%rsp), %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rax,%rcx,4), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x2938f(%rip), %rsi     # 0xa1654
callq 0x18a16
movq %rax, %rdi
leaq 0x40505(%rip), %rsi     # 0xb87d9
callq 0x19c24
movq %rax, %rdi
leaq 0x2d047(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x7832d
subq 0xb0(%rsp), %rbx
shlq $0x2, %rbx
addq 0x90(%rsp), %rbx
movq 0x8(%rsp), %rax
subq 0x98(%rsp), %rax
imulq 0xa8(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movl (%rbx,%rax,4), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x40032(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %r12, %rdi
callq 0xbf62
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x78360
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbp
decq %r13
movq %r15, %r12
jne 0x78182
movq (%rsp), %rcx
incq %rcx
movq %rcx, (%rsp)
cmpq 0x30(%rsp), %rcx
jne 0x78162
leaq 0x40(%rsp), %rdi
callq 0x1d2ce
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x783fb
jmp 0x783b1
jmp 0x783b1
movq %rax, %rbx
jmp 0x783e7
movq %rax, %rbx
jmp 0x783cb
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0xbf62
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x783e7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x40(%rsp), %rdi
callq 0x1d2ce
movq %rbx, %rdi
callq 0x2300
jmp 0x783fb
movq %rax, %rdi
callq 0xc036