// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/matrix.cpp
// Function: nda::test_matrix_slice_body()
TEST(matrix_slice) {
  matrix<float> m({10, 10}, 0);
  for_all_indices(m.shape(), [&](int i, int j) { m(i, j) = i * 10 + j; });

  for (int i = 0; i < 10; i++) {
    auto row = m(_, i);
    auto col = m(i, _);

    for (int j = 0; j < 10; j++) {
      ASSERT_EQ(row(j), j * 10 + i);
      ASSERT_EQ(col(j), i * 10 + j);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
xorl %r14d, %r14d
leaq 0xa0(%rsp), %rbx
movq %r14, (%rbx)
movl $0xa, %r15d
movq %r15, 0x8(%rbx)
movabsq $-0x8000000000000000, %r12 # imm = 0x8000000000000000
movq %r12, 0x10(%rbx)
movl $0x1, %edi
movq %rbx, %rsi
callq 0xd133
movq %r14, (%rbx)
movq %r15, 0x8(%rbx)
movq %r14, 0x18(%rbx)
movq %r15, 0x20(%rbx)
movq %r12, 0x28(%rbx)
leaq 0x10(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x50(%rsp), %rbx
leaq 0xa0(%rsp), %rsi
movq %rbx, %rdi
callq 0x7a8c4
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x7952b
movq 0x88(%rsp), %rcx
addq %rcx, %rax
movq 0x68(%rsp), %rdx
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdi
movq 0x98(%rsp), %r8
movq %rsi, %r9
shlq $0x20, %r9
leal (%rcx,%rcx,4), %r10d
leal (%rsi,%r10,2), %r10d
movabsq $0x100000000, %r11      # imm = 0x100000000
movq %rcx, %rbx
testq %rdi, %rdi
je 0x7951f
movslq %ebx, %r14
subq %rcx, %r14
imulq %r8, %r14
leaq (%rdx,%r14,4), %r14
movl %r10d, %ebp
movq %r9, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movq %r15, %r13
sarq $0x20, %r13
subq %rsi, %r13
movss %xmm0, (%r14,%r13,4)
addq %r11, %r15
incl %ebp
decq %r12
jne 0x794fe
incq %rbx
addl $0xa, %r10d
cmpq %rax, %rbx
jne 0x794e2
movq $0x0, 0x30(%rsp)
xorl %ebp, %ebp
movq 0x68(%rsp), %r12
movq 0x70(%rsp), %r15
movq 0x88(%rsp), %r14
movq 0x98(%rsp), %rbx
movq %rbp, %rax
subq %r15, %rax
testq %r12, %r12
movups 0x70(%rsp), %xmm0
leaq (%r12,%rax,4), %r13
cmoveq %r12, %r13
movaps %xmm0, 0xa0(%rsp)
movq $0x1, 0xb0(%rsp)
xorl %edi, %edi
leaq 0xa0(%rsp), %rsi
callq 0xd133
movq %rbp, %rax
subq 0x88(%rsp), %rax
imulq 0x98(%rsp), %rax
testq %r12, %r12
leaq (%r12,%rax,4), %rax
cmoveq %r12, %rax
shlq $0x2, %r15
subq %r15, %rax
movq %rax, 0x38(%rsp)
imulq %rbx, %r14
shlq $0x2, %r14
subq %r14, %r13
shlq $0x2, %rbx
movq %rbp, 0x48(%rsp)
movl %ebp, %r15d
xorl %r14d, %r14d
leaq 0x10(%rsp), %r12
movq %r13, 0x40(%rsp)
movss (%r13), %xmm0
movss %xmm0, 0xc(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdi
leaq 0x40cd3(%rip), %rsi     # 0xba2cb
leaq 0x40ce0(%rip), %rdx     # 0xba2df
callq 0xd14c
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
movss 0xc(%rsp), %xmm1
cmpeqss %xmm0, %xmm1
movd %xmm1, %esi
andl $0x1, %esi
leaq 0xa0(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rdx
callq 0xbf80
movq %rbp, %rdi
leaq 0x2a049(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x40c96(%rip), %rsi     # 0xba2e0
callq 0x57b7a
movq %rax, %rdi
leaq 0x2dbfd(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x79682
movq %rbp, %rdi
addq $0x10, %rdi
movq 0x40(%rsp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
callq 0x2280
movq %rbp, %rdi
leaq 0x29ff8(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x40c3a(%rip), %rsi     # 0xba2d5
callq 0x19062
movq %rax, %rdi
leaq 0x2dbac(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r12
cmpb $0x1, 0x188(%rax)
jne 0x796ca
movq %r12, %rdi
addq $0x10, %rdi
movl %r15d, %esi
callq 0x22f0
movq %r12, %rdi
leaq 0x40bc5(%rip), %rsi     # 0xba299
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x79702
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x38(%rsp), %rax
movss (%rax,%r14,4), %xmm0
movss %xmm0, 0xc(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %r12
movq %r12, %rdi
leaq 0x40bbb(%rip), %rsi     # 0xba2e7
leaq 0x40bc8(%rip), %rdx     # 0xba2fb
callq 0xd14c
movq 0x30(%rsp), %rax
leaq (%rax,%r14), %rbp
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movss 0xc(%rsp), %xmm1
cmpeqss %xmm0, %xmm1
movd %xmm1, %esi
andl $0x1, %esi
leaq 0xa0(%rsp), %r13
movq %r13, %rdi
movq %r12, %rdx
callq 0xbf80
movq %r13, %rdi
leaq 0x29f0d(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x40b76(%rip), %rsi     # 0xba2fc
callq 0x57b7a
movq %rax, %rdi
leaq 0x2dac1(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r12
cmpb $0x1, 0x188(%rax)
jne 0x797c0
movq %r12, %rdi
addq $0x10, %rdi
movq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r14,4), %xmm0
callq 0x2280
movq %r12, %rdi
leaq 0x29eba(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x40b18(%rip), %rsi     # 0xba2f1
callq 0x19062
movq %rax, %rdi
leaq 0x2da6e(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r12
cmpb $0x1, 0x188(%rax)
jne 0x79807
movq %r12, %rdi
addq $0x10, %rdi
movl %ebp, %esi
callq 0x22f0
movq %r12, %rdi
leaq 0x40a88(%rip), %rsi     # 0xba299
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7983f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %r14
addl $0xa, %r15d
movq 0x40(%rsp), %r13
addq %rbx, %r13
cmpq $0xa, %r14
leaq 0x10(%rsp), %r12
jne 0x795d3
movq 0x48(%rsp), %rbp
incq %rbp
addq $0xa, 0x30(%rsp)
cmpq $0xa, %rbp
jne 0x79536
leaq 0x50(%rsp), %rdi
callq 0x7b0ea
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x798f9
jmp 0x79897
jmp 0x79897
movq %rax, %rbx
jmp 0x798e5
jmp 0x798a7
jmp 0x798b9
jmp 0x798a2
movq %rax, %rbx
jmp 0x798c9
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
jmp 0x798c9
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x798e5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x50(%rsp), %rdi
callq 0x7b0ea
movq %rbx, %rdi
callq 0x2300
jmp 0x798f9
movq %rax, %rdi
callq 0xc0a9