// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/array_ref.cpp
// Function: nda::test_array_ref_explicit_conversion_body()
TEST(array_ref_explicit_conversion) {
  array_ref_of_rank<int, 3> null_ref(nullptr, {10, 20, 30});
  array_of_rank<int, 3> non_ref({5, 10, 20});
  dense_array<int, 3> dense_non_ref({5, 10, 20});

  auto null_ref_embedded = convert_shape<shape_of_rank<4>>(null_ref);
  ASSERT_EQ(null_ref_embedded.rank(), 4);
  ASSERT_EQ(null_ref_embedded.w().min(), 0);
  ASSERT_EQ(null_ref_embedded.w().extent(), 1);

  auto dense_null_ref_embedded = convert_shape<dense_shape<5>>(non_ref);
  ASSERT_EQ(dense_null_ref_embedded.rank(), 5);
  ASSERT_EQ(dense_null_ref_embedded.w().min(), 0);
  ASSERT_EQ(dense_null_ref_embedded.w().extent(), 1);
  ASSERT_EQ(dense_null_ref_embedded.dim<4>().min(), 0);
  ASSERT_EQ(dense_null_ref_embedded.dim<4>().extent(), 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x350, %rsp            # imm = 0x350
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
leaq 0x308(%rsp), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%rcx)
movq $0x1e, 0x8(%rcx)
movq %r14, 0x10(%rcx)
leaq 0x320(%rsp), %rdx
xorl %r15d, %r15d
movq %r15, (%rdx)
movl $0x14, %r12d
movq %r12, 0x8(%rdx)
movq %r14, 0x10(%rdx)
leaq 0x338(%rsp), %rsi
movq %r15, (%rsi)
movl $0xa, %r13d
movq %r13, 0x8(%rsi)
movq %r14, 0x10(%rsi)
movq %rcx, %rdi
callq 0x1a9f3
leaq 0x230(%rsp), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x8(%rbx)
movq %r12, 0x28(%rbx)
movq %r14, 0x30(%rbx)
movq %r15, 0x38(%rbx)
movq %r13, 0x40(%rbx)
movq %r14, 0x48(%rbx)
movq %r15, 0x50(%rbx)
movl $0x5, %r12d
movq %r12, 0x58(%rbx)
movq %r14, 0x60(%rbx)
movq %rbx, %rdi
callq 0x1a8cc
movq %rbx, %rdi
callq 0x1a9a6
leaq 0xa0(%rsp), %rsi
movq %r15, (%rsi)
movq %r12, 0x8(%rsi)
movq %r14, 0x10(%rsi)
xorl %edi, %edi
callq 0xd133
leaq 0x298(%rsp), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movq $0x14, 0x28(%rdi)
movq %r14, 0x30(%rdi)
xorl %eax, %eax
movq %rax, 0x38(%rdi)
movq $0xa, 0x40(%rdi)
movq %r14, 0x48(%rdi)
movq %rax, 0x50(%rdi)
movq $0x5, 0x58(%rdi)
callq 0xc30a
leaq 0x298(%rsp), %rdi
callq 0xc412
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x64610(%rip), %rsi     # 0xae43c
leaq 0x64626(%rip), %rdx     # 0xae459
leaq 0x20(%rsp), %rdi
callq 0xd14c
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x59829(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x64615(%rip), %rsi     # 0xae484
movq %rax, %rdi
callq 0x42c5e
leaq 0x5d3d8(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49ea3
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x4, %esi
callq 0x2110
leaq 0x597da(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x5e003(%rip), %rsi     # 0xa7ebc
movq %rax, %rdi
callq 0x18fba
leaq 0x5d38e(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49eed
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x4, %esi
callq 0x22f0
leaq 0x703a5(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x49f20
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x64574(%rip), %rsi     # 0xae4a3
leaq 0x6458d(%rip), %rdx     # 0xae4c3
callq 0xd14c
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x5972b(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x6455d(%rip), %rsi     # 0xae4ca
movq %rax, %rdi
callq 0x3f614
leaq 0x5d2da(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49f9e
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x21b0
leaq 0x596df(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x5af6b(%rip), %rsi     # 0xa4f1f
movq %rax, %rdi
callq 0x18fba
leaq 0x5d293(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49fe5
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x702ad(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x4a018
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x644c5(%rip), %rsi     # 0xae4ec
leaq 0x644e1(%rip), %rdx     # 0xae50f
callq 0xd14c
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x59633(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x644b1(%rip), %rsi     # 0xae516
movq %rax, %rdi
callq 0x3f5a4
leaq 0x5d1e2(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a099
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x21b0
leaq 0x595e4(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x606bd(%rip), %rsi     # 0xaa76c
movq %rax, %rdi
callq 0x18fba
leaq 0x5d198(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a0e3
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x701af(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
leaq 0x250(%rsp), %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x4a11e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x248(%rsp), %r14
leaq 0xa8(%rsp), %rax
movq %r14, -0x8(%rax)
movl $0x9, %ecx
movq %rax, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x4c2be
movq %r14, 0x20(%rsp)
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x642f8(%rip), %rsi     # 0xae45a
leaq 0x64314(%rip), %rdx     # 0xae47d
movq %rsp, %rdi
callq 0xd14c
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x594f7(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x642dd(%rip), %rsi     # 0xae47e
movq %rax, %rdi
callq 0x3f5a4
leaq 0x5d0a6(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a1d5
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x5, %esi
callq 0x2110
leaq 0x594a8(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x5b05d(%rip), %rsi     # 0xa5248
movq %rax, %rdi
callq 0x18fba
leaq 0x5d05c(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a21f
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x5, %esi
callq 0x22f0
leaq 0x70073(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4a251
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x40(%rsp), %rbx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x6423a(%rip), %rsi     # 0xae49d
leaq 0x64259(%rip), %rdx     # 0xae4c3
callq 0xd14c
xorl %esi, %esi
testq %rbx, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf80
leaq 0x593f5(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x64221(%rip), %rsi     # 0xae4c4
movq %rax, %rdi
callq 0x421c0
leaq 0x5cfa4(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a2d7
movq 0x40(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x593a6(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x5ac32(%rip), %rsi     # 0xa4f1f
movq %rax, %rdi
callq 0x18fba
leaq 0x5cf5a(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a31e
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x6ff74(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4a350
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x48(%rsp), %rbx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x64184(%rip), %rsi     # 0xae4e6
leaq 0x641a6(%rip), %rdx     # 0xae50f
callq 0xd14c
xorl %esi, %esi
cmpq $0x1, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf80
leaq 0x592f5(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x6416d(%rip), %rsi     # 0xae510
movq %rax, %rdi
callq 0x3f5dc
leaq 0x5cea4(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a3d7
movq 0x48(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x592a6(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x6037f(%rip), %rsi     # 0xaa76c
movq %rax, %rdi
callq 0x18fba
leaq 0x5ce5a(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a421
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x6fe71(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4a453
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x28(%rsp), %rbx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x640d0(%rip), %rsi     # 0xae535
leaq 0x640f4(%rip), %rdx     # 0xae560
callq 0xd14c
xorl %esi, %esi
testq %rbx, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf80
leaq 0x591f3(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x640bc(%rip), %rsi     # 0xae561
movq %rax, %rdi
callq 0x4ae06
leaq 0x5cda2(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a4d9
movq 0x28(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x591a4(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x5aa30(%rip), %rsi     # 0xa4f1f
movq %rax, %rdi
callq 0x18fba
leaq 0x5cd58(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a520
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x6fd72(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4a552
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x30(%rsp), %rbx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x64024(%rip), %rsi     # 0xae588
leaq 0x6404b(%rip), %rdx     # 0xae5b6
callq 0xd14c
xorl %esi, %esi
cmpq $0x1, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf80
leaq 0x590f3(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x64012(%rip), %rsi     # 0xae5b7
movq %rax, %rdi
callq 0x4ae3e
leaq 0x5cca2(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a5d9
movq 0x30(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x590a4(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x6017d(%rip), %rsi     # 0xaa76c
movq %rax, %rdi
callq 0x18fba
leaq 0x5cc58(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4a623
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x6fc6f(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4a655
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x298(%rsp), %rdi
callq 0xd206
leaq 0x230(%rsp), %rdi
callq 0x1d848
addq $0x350, %rsp            # imm = 0x350
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x4a7d4
jmp 0x4a7d4
jmp 0x4a69a
jmp 0x4a69a
jmp 0x4a69a
jmp 0x4a69a
jmp 0x4a69a
jmp 0x4a69a
jmp 0x4a69a
jmp 0x4a69a
movq %rax, %rbx
jmp 0x4a7ae
jmp 0x4a6fb
jmp 0x4a70d
jmp 0x4a71f
jmp 0x4a731
jmp 0x4a743
jmp 0x4a763
jmp 0x4a775
jmp 0x4a787
jmp 0x4a6c9
jmp 0x4a6c9
jmp 0x4a6c9
jmp 0x4a6c9
movq %rax, %rbx
jmp 0x4a753
jmp 0x4a6d5
jmp 0x4a6d5
movq %rax, %rbx
jmp 0x4a797
jmp 0x4a6fb
jmp 0x4a70d
jmp 0x4a71f
jmp 0x4a731
jmp 0x4a743
jmp 0x4a763
jmp 0x4a775
jmp 0x4a787
movq %rax, %rbx
jmp 0x4a7bb
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
jmp 0x4a753
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
jmp 0x4a753
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
jmp 0x4a753
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
jmp 0x4a753
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4a7ae
movq 0x10(%rsp), %rsi
jmp 0x4a7a6
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
jmp 0x4a797
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
jmp 0x4a797
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x4a7ae
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x298(%rsp), %rdi
callq 0xd206
leaq 0x230(%rsp), %rdi
callq 0x1d848
movq %rbx, %rdi
callq 0x2300
jmp 0x4a7d4
jmp 0x4a7d4
movq %rax, %rdi
callq 0xc0a9