// File: /workspace/github_cpp_makefile_star2_O3/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 0xd133
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 0x1d2aa
movq %r15, %rdi
callq 0x1d372
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 0x7b3af
leaq 0x90(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x7a971
movq 0x80(%rsp), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x79c2c
movq 0x78(%rsp), %rcx
movq %rcx, (%rsp)
addq %rcx, 0x30(%rsp)
leaq 0x10(%rsp), %r12
movq 0x68(%rsp), %r13
testq %r13, %r13
je 0x79c16
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 0x40c49(%rip), %xmm0    # 0xba6fe
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 0xbf80
movq %r12, %rdi
leaq 0x29b8e(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x40c0d(%rip), %rsi     # 0xba712
callq 0x1909a
movq %rax, %rdi
leaq 0x2d742(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x79b58
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 0x29b22(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x40b98(%rip), %rsi     # 0xba709
callq 0x1a146
movq %rax, %rdi
leaq 0x2d6d6(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x79bca
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 0x406c5(%rip), %rsi     # 0xba299
callq 0x18fba
movq %r12, %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x79bfd
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbp
decq %r13
movq %r15, %r12
jne 0x79a1f
movq (%rsp), %rcx
incq %rcx
movq %rcx, (%rsp)
cmpq 0x30(%rsp), %rcx
jne 0x799ff
leaq 0x40(%rsp), %rdi
callq 0x1d762
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x79c98
jmp 0x79c4e
jmp 0x79c4e
movq %rax, %rbx
jmp 0x79c84
movq %rax, %rbx
jmp 0x79c68
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x79c84
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x40(%rsp), %rdi
callq 0x1d762
movq %rbx, %rdi
callq 0x2300
jmp 0x79c98
movq %rax, %rdi
callq 0xc0a9