// File: /workspace/github_cpp_makefile_star2_O1/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 $0x228, %rsp            # imm = 0x228
xorl %r14d, %r14d
leaq 0x98(%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 0xd09f
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 0x48(%rsp), %rbx
leaq 0x98(%rsp), %rsi
movq %rbx, %rdi
callq 0x79028
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x77c94
movq 0x80(%rsp), %rcx
addq %rcx, %rax
movq 0x60(%rsp), %rdx
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdi
movq 0x80(%rsp), %r8
movq 0x90(%rsp), %r9
movq %rsi, %r10
shlq $0x20, %r10
leal (%rcx,%rcx,4), %r11d
leal (%rsi,%r11,2), %r11d
movabsq $0x100000000, %rbx      # imm = 0x100000000
testq %rdi, %rdi
je 0x77c88
movslq %ecx, %r14
subq %r8, %r14
imulq %r9, %r14
leaq (%rdx,%r14,4), %r14
movl %r11d, %ebp
movq %r10, %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 %rbx, %r15
incl %ebp
decq %r12
jne 0x77c67
incq %rcx
addl $0xa, %r11d
cmpq %rax, %rcx
jne 0x77c4b
movq $0x0, 0x30(%rsp)
leaq 0x98(%rsp), %rbx
xorl %r14d, %r14d
movq 0x60(%rsp), %rbp
movq 0x68(%rsp), %r13
movq 0x80(%rsp), %r15
movq 0x90(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, %rax
subq %r13, %rax
testq %rbp, %rbp
leaq (%rbp,%rax,4), %r12
cmoveq %rbp, %r12
movq 0x70(%rsp), %rax
movq %r13, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
movq $0x1, 0xa8(%rsp)
xorl %edi, %edi
movq %rbx, %rsi
callq 0xd09f
movq %r14, %rax
subq 0x80(%rsp), %rax
imulq 0x90(%rsp), %rax
testq %rbp, %rbp
leaq (%rbp,%rax,4), %rax
cmoveq %rbp, %rax
shlq $0x2, %r13
subq %r13, %rax
movq %rax, 0x38(%rsp)
movq 0x8(%rsp), %rax
imulq %rax, %r15
shlq $0x2, %r15
subq %r15, %r12
shlq $0x2, %rax
movq %r14, 0x40(%rsp)
movl %r14d, %r15d
xorl %r13d, %r13d
leaq 0x10(%rsp), %rbp
movq %rax, %r14
movss (%r12), %xmm0
movss %xmm0, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
leaq 0x40624(%rip), %rsi     # 0xb839b
leaq 0x40631(%rip), %rdx     # 0xb83af
callq 0xd0b8
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
movss 0x8(%rsp), %xmm1
cmpeqss %xmm0, %xmm1
movd %xmm1, %esi
andl $0x1, %esi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0xbf0a
movq %rbx, %rdi
leaq 0x298a2(%rip), %rsi     # 0xa1654
callq 0x18a16
movq %rax, %rdi
leaq 0x405ef(%rip), %rsi     # 0xb83b0
callq 0x56a24
movq %rax, %rdi
leaq 0x2d55a(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x77df6
movq %rbp, %rdi
addq $0x10, %rdi
xorps %xmm0, %xmm0
cvtss2sd (%r12), %xmm0
callq 0x2280
movq %rbp, %rdi
leaq 0x29854(%rip), %rsi     # 0xa1654
callq 0x18a16
movq %rax, %rdi
leaq 0x40596(%rip), %rsi     # 0xb83a5
callq 0x18abe
movq %rax, %rdi
leaq 0x2d50c(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x77e3e
movq %rbp, %rdi
addq $0x10, %rdi
movl %r15d, %esi
callq 0x22f0
movq %rbp, %rdi
leaq 0x40521(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %rbx, %rdi
callq 0xbf62
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x77e71
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x38(%rsp), %rax
movss (%rax,%r13,4), %xmm0
movss %xmm0, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
leaq 0x4051c(%rip), %rsi     # 0xb83b7
leaq 0x40529(%rip), %rdx     # 0xb83cb
callq 0xd0b8
movq 0x30(%rsp), %rax
addl %r13d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss 0x8(%rsp), %xmm1
cmpeqss %xmm0, %xmm1
movd %xmm1, %esi
andl $0x1, %esi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0xbf0a
movq %rbx, %rdi
leaq 0x29777(%rip), %rsi     # 0xa1654
callq 0x18a16
movq %rax, %rdi
leaq 0x404e0(%rip), %rsi     # 0xb83cc
callq 0x56a24
movq %rax, %rdi
leaq 0x2d42f(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x77f26
movq %rbp, %rdi
addq $0x10, %rdi
movq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r13,4), %xmm0
callq 0x2280
movq %rbp, %rdi
leaq 0x29724(%rip), %rsi     # 0xa1654
callq 0x18a16
movq %rax, %rdi
leaq 0x40482(%rip), %rsi     # 0xb83c1
callq 0x18abe
movq %rax, %rdi
leaq 0x2d3dc(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x77f74
movq %rbp, %rdi
addq $0x10, %rdi
movq 0x30(%rsp), %rax
leal (%rax,%r13), %esi
callq 0x22f0
movq %rbp, %rdi
leaq 0x403eb(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %rbx, %rdi
callq 0xbf62
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x77fa7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %r13
addl $0xa, %r15d
addq %r14, %r12
cmpq $0xa, %r13
leaq 0x10(%rsp), %rbp
jne 0x77d57
movq 0x40(%rsp), %r14
incq %r14
addq $0xa, 0x30(%rsp)
cmpq $0xa, %r14
jne 0x77ca8
leaq 0x48(%rsp), %rdi
callq 0x79846
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7805c
jmp 0x77ffa
jmp 0x77ffa
movq %rax, %rbx
jmp 0x78048
jmp 0x7800a
jmp 0x7801c
jmp 0x78005
movq %rax, %rbx
jmp 0x7802c
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xbf62
jmp 0x7802c
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xbf62
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x78048
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x48(%rsp), %rdi
callq 0x79846
movq %rbx, %rdi
callq 0x2300
jmp 0x7805c
movq %rax, %rdi
callq 0xc036