// File: /workspace/github_cpp_makefile_star2_O2/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 $0x278, %rsp            # imm = 0x278
leaq 0xe8(%rsp), %rbx
pushq $0xa
popq %rdx
movq %rbx, %rdi
movl %edx, %esi
callq 0x66cac
leaq 0x38(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x78(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x66cc0
movq 0x38(%r14), %rax
movq 0x40(%r14), %rcx
addq %rax, %rcx
movq 0x20(%r14), %rdx
movq 0x28(%r14), %rsi
movq %rdx, %rdi
shlq $0x20, %rdi
imull $0xa, %eax, %r8d
addl %edx, %r8d
movabsq $0x100000000, %r9       # imm = 0x100000000
cmpq %rcx, %rax
je 0x65dad
movslq %eax, %r10
subq 0xb0(%rsp), %r10
imulq 0xc0(%rsp), %r10
shlq $0x2, %r10
addq 0x90(%rsp), %r10
movq %rsi, %r11
movl %r8d, %ebx
movq %rdi, %r14
subq $0x1, %r11
jb 0x65da4
cvtsi2ss %ebx, %xmm0
movq %r14, %r15
sarq $0x20, %r15
subq %rdx, %r15
movss %xmm0, (%r10,%r15,4)
addq %r9, %r14
incl %ebx
jmp 0x65d83
incq %rax
addl $0xa, %r8d
jmp 0x65d55
movq $0x0, 0x28(%rsp)
leaq 0x78(%rsp), %r14
leaq 0xc8(%rsp), %r13
leaq 0x13(%rsp), %rbx
leaq 0xe8(%rsp), %rbp
xorl %r15d, %r15d
cmpq $0xa, %r15
je 0x66077
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x66d1c
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x66d48
movq %r15, 0x30(%rsp)
movl %r15d, 0x14(%rsp)
movq $0x0, 0x20(%rsp)
pushq $0xa
popq %r15
movq $0x0, 0x18(%rsp)
subq $0x1, %r15
jb 0x6605f
movq 0x18(%rsp), %rax
subq 0x40(%rsp), %rax
movq 0x38(%rsp), %rcx
imulq 0x50(%rsp), %rax
movss (%rcx,%rax,4), %xmm0
movss %xmm0, 0x8(%rsp)
movq %r13, %rdi
leaq 0x3f483(%rip), %rsi     # 0xa52d4
movq %rbx, %rdx
callq 0x66a0
movl 0x14(%rsp), %r14d
cvtsi2ss %r14d, %xmm0
movss 0x8(%rsp), %xmm1
cmpeqss %xmm0, %xmm1
movd %xmm1, %esi
andl $0x1, %esi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x6894
movq %rbp, %rdi
leaq 0x277bd(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x3f450(%rip), %rsi     # 0xa52e9
callq 0x46b68
movq %rax, %rdi
leaq 0x2b74a(%rip), %rsi     # 0x915f2
callq 0x106fe
movq 0x18(%rsp), %rsi
subq 0x40(%rsp), %rsi
imulq 0x50(%rsp), %rsi
shlq $0x2, %rsi
addq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0x3bfe2
movq %rax, %rdi
leaq 0x2776f(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x3f3f7(%rip), %rsi     # 0xa52de
callq 0x107d8
movq %rax, %rdi
leaq 0x2b6fc(%rip), %rsi     # 0x915f2
callq 0x106fe
movl %r14d, 0xc(%rsp)
movq %rax, %rdi
leaq 0xc(%rsp), %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x3f38b(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %rbp, %rdi
callq 0x68d4
movq %r13, %rdi
callq 0x2090
movq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
shlq $0x2, %rcx
subq %rcx, %rax
movq 0x20(%rsp), %rcx
movss (%rcx,%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movq %r13, %rdi
leaq 0x3f399(%rip), %rsi     # 0xa52f0
movq %rbx, %rdx
callq 0x66a0
movq %rbx, %r14
movq 0x28(%rsp), %rax
movq %r13, %rdx
movq 0x18(%rsp), %rcx
leaq (%rax,%rcx), %r13
cvtsi2ss %r13d, %xmm0
movss 0x8(%rsp), %xmm1
cmpeqss %xmm0, %xmm1
movd %xmm1, %esi
andl $0x1, %esi
movq %rbp, %rdi
movq %rdx, %rbx
callq 0x6894
movq %rbp, %r12
movq %rbp, %rdi
leaq 0x276a5(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x3f354(%rip), %rsi     # 0xa5305
callq 0x46b68
movq %rax, %rdi
leaq 0x2b632(%rip), %rsi     # 0x915f2
callq 0x106fe
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rcx
shlq $0x2, %rcx
subq %rcx, %rsi
addq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x3bfe2
movq %rax, %rdi
leaq 0x2765a(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x3f2fe(%rip), %rsi     # 0xa52fa
callq 0x107d8
movq %rax, %rdi
leaq 0x2b5e7(%rip), %rsi     # 0x915f2
callq 0x106fe
movl %r13d, 0xc(%rsp)
movq %rax, %rdi
leaq 0xc(%rsp), %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x3f276(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r12, %rdi
callq 0x68d4
movq %rbx, %r13
movq %rbx, %rdi
callq 0x2090
incq 0x18(%rsp)
addq $0x4, 0x20(%rsp)
addl $0xa, 0x14(%rsp)
movq %r14, %rbx
movq %r12, %rbp
jmp 0x65e1d
movq 0x30(%rsp), %r15
incq %r15
addq $0xa, 0x28(%rsp)
leaq 0x78(%rsp), %r14
jmp 0x65dd3
leaq 0x78(%rsp), %rdi
callq 0x66d74
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x66099
jmp 0x66099
jmp 0x66099
movq %rax, %rbx
jmp 0x660d8
jmp 0x660a4
jmp 0x660bb
jmp 0x660a9
movq %rax, %rbx
jmp 0x660cb
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x68d4
jmp 0x660cb
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x68d4
leaq 0xc8(%rsp), %rdi
callq 0x2090
leaq 0x78(%rsp), %rdi
callq 0x66d74
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba