// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
leaq 0xb8(%rsp), %r14
pushq $0xa
popq %rbx
pushq $0x14
popq %rbp
pushq $0x1e
popq %rcx
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x10b74
leaq 0x320(%rsp), %rax
andq $0x0, -0x8(%rax)
pushq $0x9
popq %rcx
movq %rax, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq 0x11e95
leaq 0xb8(%rsp), %r14
pushq $0x5
popq %r15
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
movl %ebp, %ecx
callq 0x10b74
leaq 0x248(%rsp), %rdi
movq %r14, %rsi
callq 0x10b92
leaq 0xb8(%rsp), %rdi
movl %r15d, %esi
movl %ebx, %edx
movl %ebp, %ecx
callq 0x10810
leaq 0x2b0(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x6750
leaq 0x5d517(%rip), %rsi     # 0x989ac
leaq 0x38(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x66a0
leaq 0xb8(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x38(%rsp), %rdx
callq 0x6894
leaq 0x52187(%rip), %rsi     # 0x8d647
leaq 0xb8(%rsp), %rdi
callq 0x106fe
leaq 0x5d520(%rip), %rsi     # 0x989f4
movq %rax, %rdi
callq 0x34cb0
leaq 0x5610f(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x18(%rsp), %rsi
movq $0x4, (%rsi)
movq %rax, %rdi
callq 0x11052
leaq 0x52141(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x56e5f(%rip), %rsi     # 0x92374
movq %rax, %rdi
callq 0x106fe
leaq 0x560ce(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x10(%rsp), %rsi
movl $0x4, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x69d5c(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x38(%rsp), %rdi
callq 0x2090
leaq 0x5d4a7(%rip), %rsi     # 0x98a13
leaq 0x38(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x66a0
leaq 0xb8(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x38(%rsp), %rdx
callq 0x6894
leaq 0x520b0(%rip), %rsi     # 0x8d647
leaq 0xb8(%rsp), %rdi
callq 0x106fe
leaq 0x5d48f(%rip), %rsi     # 0x98a3a
movq %rax, %rdi
callq 0x31698
leaq 0x56038(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x18(%rsp), %rsi
andq $0x0, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x5206d(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x53c07(%rip), %rsi     # 0x8f1f0
movq %rax, %rdi
callq 0x106fe
leaq 0x55ffa(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x10(%rsp), %rsi
andl $0x0, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x69c8b(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x38(%rsp), %rdi
callq 0x2090
leaq 0x5d41f(%rip), %rsi     # 0x98a5c
leaq 0x38(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x66a0
leaq 0xb8(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x38(%rsp), %rdx
callq 0x6894
leaq 0x51fdf(%rip), %rsi     # 0x8d647
leaq 0xb8(%rsp), %rdi
callq 0x106fe
leaq 0x5d40a(%rip), %rsi     # 0x98a86
movq %rax, %rdi
callq 0x3160a
leaq 0x55f67(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x18(%rsp), %rsi
movq $0x1, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x51f99(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x5963f(%rip), %rsi     # 0x94cfc
movq %rax, %rdi
callq 0x106fe
leaq 0x55f26(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x10(%rsp), %rsi
movl $0x1, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x69bb4(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x38(%rsp), %rdi
callq 0x2090
leaq 0x38(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x3c1a0
leaq 0x5d2a4(%rip), %rsi     # 0x989ca
leaq 0x18(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x66a0
leaq 0xb8(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x18(%rsp), %rdx
callq 0x6894
leaq 0x51ef6(%rip), %rsi     # 0x8d647
leaq 0xb8(%rsp), %rdi
callq 0x106fe
leaq 0x5d289(%rip), %rsi     # 0x989ee
movq %rax, %rdi
callq 0x3160a
leaq 0x55e7e(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x10(%rsp), %rsi
movq $0x5, (%rsi)
movq %rax, %rdi
callq 0x11052
leaq 0x51eb0(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x53d73(%rip), %rsi     # 0x8f519
movq %rax, %rdi
callq 0x106fe
leaq 0x55e3d(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0xc(%rsp), %rsi
movl $0x5, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x69acb(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x18(%rsp), %rdi
callq 0x2090
movq 0x58(%rsp), %rbx
leaq 0x5d20b(%rip), %rsi     # 0x98a0d
leaq 0x18(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
testq %rbx, %rbx
sete %sil
leaq 0xb8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x6894
leaq 0x51e14(%rip), %rsi     # 0x8d647
leaq 0xb8(%rsp), %rdi
callq 0x106fe
leaq 0x5d1ed(%rip), %rsi     # 0x98a34
movq %rax, %rdi
callq 0x34240
leaq 0x55d9c(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x58(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x51dcd(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x53967(%rip), %rsi     # 0x8f1f0
movq %rax, %rdi
callq 0x106fe
leaq 0x55d5a(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x699eb(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x18(%rsp), %rdi
callq 0x2090
movq 0x60(%rsp), %rbx
leaq 0x5d174(%rip), %rsi     # 0x98a56
leaq 0x18(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x1, %rbx
sete %sil
leaq 0xb8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x6894
leaq 0x51d33(%rip), %rsi     # 0x8d647
leaq 0xb8(%rsp), %rdi
callq 0x106fe
leaq 0x5d158(%rip), %rsi     # 0x98a80
movq %rax, %rdi
callq 0x3167c
leaq 0x55cbb(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x60(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x51cec(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x59392(%rip), %rsi     # 0x94cfc
movq %rax, %rdi
callq 0x106fe
leaq 0x55c79(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0xc(%rsp), %rsi
movl $0x1, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x69907(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x18(%rsp), %rdi
callq 0x2090
movq 0x40(%rsp), %rbx
leaq 0x5d0df(%rip), %rsi     # 0x98aa5
leaq 0x18(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
testq %rbx, %rbx
sete %sil
leaq 0xb8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x6894
leaq 0x51c50(%rip), %rsi     # 0x8d647
leaq 0xb8(%rsp), %rdi
callq 0x106fe
leaq 0x5d0c6(%rip), %rsi     # 0x98ad1
movq %rax, %rdi
callq 0x3c1d4
leaq 0x55bd8(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x40(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x51c09(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x537a3(%rip), %rsi     # 0x8f1f0
movq %rax, %rdi
callq 0x106fe
leaq 0x55b96(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x69827(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x18(%rsp), %rdi
callq 0x2090
movq 0x48(%rsp), %rbx
leaq 0x5d052(%rip), %rsi     # 0x98af8
leaq 0x18(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x1, %rbx
sete %sil
leaq 0xb8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x6894
leaq 0x51b6f(%rip), %rsi     # 0x8d647
leaq 0xb8(%rsp), %rdi
callq 0x106fe
leaq 0x5d03b(%rip), %rsi     # 0x98b27
movq %rax, %rdi
callq 0x3c1f0
leaq 0x55af7(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x48(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x51b28(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x591ce(%rip), %rsi     # 0x94cfc
movq %rax, %rdi
callq 0x106fe
leaq 0x55ab5(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0xc(%rsp), %rsi
movl $0x1, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x69743(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x18(%rsp), %rdi
callq 0x2090
leaq 0x2b0(%rsp), %rdi
callq 0x69c2
leaq 0x248(%rsp), %rdi
callq 0x10d02
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3bbb6
jmp 0x3bbb6
jmp 0x3bbb6
jmp 0x3bbb6
jmp 0x3bbb6
jmp 0x3bbb6
jmp 0x3bbb6
jmp 0x3bbb6
movq %rax, %rbx
jmp 0x3bcae
jmp 0x3bc11
jmp 0x3bbd3
jmp 0x3bc23
jmp 0x3bbd3
jmp 0x3bc35
jmp 0x3bbd3
jmp 0x3bc47
jmp 0x3bbd3
jmp 0x3bc59
movq %rax, %rbx
jmp 0x3bc69
jmp 0x3bc70
jmp 0x3bbee
jmp 0x3bc82
jmp 0x3bbee
jmp 0x3bc94
movq %rax, %rbx
jmp 0x3bca4
movq %rax, %rbx
jmp 0x3bcbb
jmp 0x3bc11
jmp 0x3bc23
jmp 0x3bc35
jmp 0x3bc47
jmp 0x3bc59
jmp 0x3bc70
jmp 0x3bc82
jmp 0x3bc94
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
jmp 0x3bc69
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
jmp 0x3bc69
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
jmp 0x3bc69
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
jmp 0x3bc69
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x18(%rsp), %rdi
jmp 0x3bca9
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
jmp 0x3bca4
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
jmp 0x3bca4
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x38(%rsp), %rdi
callq 0x2090
leaq 0x2b0(%rsp), %rdi
callq 0x69c2
leaq 0x248(%rsp), %rdi
callq 0x10d02
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba