// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a487
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 0x1a362
movq %rbx, %rdi
callq 0x1a43a
leaq 0xa0(%rsp), %rsi
movq %r15, (%rsi)
movq %r12, 0x8(%rsi)
movq %r14, 0x10(%rsi)
xorl %edi, %edi
callq 0xd09f
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 0xc2a2
leaq 0x298(%rsp), %rdi
callq 0xc38a
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x632ab(%rip), %rsi     # 0xac604
leaq 0x632c1(%rip), %rdx     # 0xac621
leaq 0x20(%rsp), %rdi
callq 0xd0b8
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movl $0x1, %esi
callq 0xbf0a
leaq 0x582cc(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x632b0(%rip), %rsi     # 0xac64c
movq %rax, %rdi
callq 0x421ec
leaq 0x5bf7f(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x493d0
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x4, %esi
callq 0x2110
leaq 0x5827d(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x5ccc6(%rip), %rsi     # 0xa60ac
movq %rax, %rdi
callq 0x18a16
leaq 0x5bf35(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4941a
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x4, %esi
callq 0x22f0
leaq 0x6ef48(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x4944d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x6320f(%rip), %rsi     # 0xac66b
leaq 0x63228(%rip), %rdx     # 0xac68b
callq 0xd0b8
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movl $0x1, %esi
callq 0xbf0a
leaq 0x581ce(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x631f8(%rip), %rsi     # 0xac692
movq %rax, %rdi
callq 0x3ec6a
leaq 0x5be81(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x494cb
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x21b0
leaq 0x58182(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x599f6(%rip), %rsi     # 0xa2ed7
movq %rax, %rdi
callq 0x18a16
leaq 0x5be3a(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49512
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x6ee50(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x49545
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x63160(%rip), %rsi     # 0xac6b4
leaq 0x6317c(%rip), %rdx     # 0xac6d7
callq 0xd0b8
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movl $0x1, %esi
callq 0xbf0a
leaq 0x580d6(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x6314c(%rip), %rsi     # 0xac6de
movq %rax, %rdi
callq 0x3ebfa
leaq 0x5bd89(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x495c6
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x21b0
leaq 0x58087(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x5f380(%rip), %rsi     # 0xa895c
movq %rax, %rdi
callq 0x18a16
leaq 0x5bd3f(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49610
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x6ed52(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
leaq 0x250(%rsp), %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x4964b
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 0x4b723
movq %r14, 0x20(%rsp)
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x62f93(%rip), %rsi     # 0xac622
leaq 0x62faf(%rip), %rdx     # 0xac645
movq %rsp, %rdi
callq 0xd0b8
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf0a
leaq 0x57f9a(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x62f78(%rip), %rsi     # 0xac646
movq %rax, %rdi
callq 0x3ebfa
leaq 0x5bc4d(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49702
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x5, %esi
callq 0x2110
leaq 0x57f4b(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x59ae8(%rip), %rsi     # 0xa3200
movq %rax, %rdi
callq 0x18a16
leaq 0x5bc03(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4974c
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x5, %esi
callq 0x22f0
leaq 0x6ec16(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4977e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x40(%rsp), %rbx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x62ed5(%rip), %rsi     # 0xac665
leaq 0x62ef4(%rip), %rdx     # 0xac68b
callq 0xd0b8
xorl %esi, %esi
testq %rbx, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf0a
leaq 0x57e98(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x62ebc(%rip), %rsi     # 0xac68c
movq %rax, %rdi
callq 0x4174e
leaq 0x5bb4b(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49804
movq 0x40(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x57e49(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x596bd(%rip), %rsi     # 0xa2ed7
movq %rax, %rdi
callq 0x18a16
leaq 0x5bb01(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4984b
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x6eb17(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4987d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x48(%rsp), %rbx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x62e1f(%rip), %rsi     # 0xac6ae
leaq 0x62e41(%rip), %rdx     # 0xac6d7
callq 0xd0b8
xorl %esi, %esi
cmpq $0x1, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf0a
leaq 0x57d98(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x62e08(%rip), %rsi     # 0xac6d8
movq %rax, %rdi
callq 0x3ec32
leaq 0x5ba4b(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49904
movq 0x48(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x57d49(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x5f042(%rip), %rsi     # 0xa895c
movq %rax, %rdi
callq 0x18a16
leaq 0x5ba01(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4994e
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x6ea14(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x49980
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x28(%rsp), %rbx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x62d6b(%rip), %rsi     # 0xac6fd
leaq 0x62d8f(%rip), %rdx     # 0xac728
callq 0xd0b8
xorl %esi, %esi
testq %rbx, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf0a
leaq 0x57c96(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x62d57(%rip), %rsi     # 0xac729
movq %rax, %rdi
callq 0x4a334
leaq 0x5b949(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49a06
movq 0x28(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x57c47(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x594bb(%rip), %rsi     # 0xa2ed7
movq %rax, %rdi
callq 0x18a16
leaq 0x5b8ff(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49a4d
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x6e915(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x49a7f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x30(%rsp), %rbx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x62cbf(%rip), %rsi     # 0xac750
leaq 0x62ce6(%rip), %rdx     # 0xac77e
callq 0xd0b8
xorl %esi, %esi
cmpq $0x1, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf0a
leaq 0x57b96(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x62cad(%rip), %rsi     # 0xac77f
movq %rax, %rdi
callq 0x4a36c
leaq 0x5b849(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49b06
movq 0x30(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x57b47(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x5ee40(%rip), %rsi     # 0xa895c
movq %rax, %rdi
callq 0x18a16
leaq 0x5b7ff(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49b50
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x6e812(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x49b82
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x298(%rsp), %rdi
callq 0xd16c
leaq 0x230(%rsp), %rdi
callq 0x1d3b4
addq $0x350, %rsp            # imm = 0x350
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x49d01
jmp 0x49d01
jmp 0x49bc7
jmp 0x49bc7
jmp 0x49bc7
jmp 0x49bc7
jmp 0x49bc7
jmp 0x49bc7
jmp 0x49bc7
jmp 0x49bc7
movq %rax, %rbx
jmp 0x49cdb
jmp 0x49c28
jmp 0x49c3a
jmp 0x49c4c
jmp 0x49c5e
jmp 0x49c70
jmp 0x49c90
jmp 0x49ca2
jmp 0x49cb4
jmp 0x49bf6
jmp 0x49bf6
jmp 0x49bf6
jmp 0x49bf6
movq %rax, %rbx
jmp 0x49c80
jmp 0x49c02
jmp 0x49c02
movq %rax, %rbx
jmp 0x49cc4
jmp 0x49c28
jmp 0x49c3a
jmp 0x49c4c
jmp 0x49c5e
jmp 0x49c70
jmp 0x49c90
jmp 0x49ca2
jmp 0x49cb4
movq %rax, %rbx
jmp 0x49ce8
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x49c80
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x49c80
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x49c80
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x49c80
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x49cdb
movq 0x10(%rsp), %rsi
jmp 0x49cd3
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x49cc4
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x49cc4
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x49cdb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x298(%rsp), %rdi
callq 0xd16c
leaq 0x230(%rsp), %rdi
callq 0x1d3b4
movq %rbx, %rdi
callq 0x2300
jmp 0x49d01
jmp 0x49d01
movq %rax, %rdi
callq 0xc036