// File: /workspace/github_cpp_makefile_star2_O1/dsharlet[P]array/test/array_ref.cpp
// Function: nda::test_array_ref_implicit_conversion_body()
TEST(array_ref_implicit_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});
  const array_of_rank<int, 3>& const_non_ref = non_ref;

  // array -> ref
  array_ref_of_rank<int, 3> ref(non_ref);
  array_ref_of_rank<const int, 3> const_ref(const_non_ref);
  ref = non_ref;
  const_ref = non_ref;
  const_ref = const_non_ref;

  // non-const -> const
  array_ref_of_rank<const int, 3> const_null_ref(null_ref);
  const_null_ref = null_ref;
  const_ref = non_ref;
  non_template_const(null_ref);
  non_template_const(non_ref);

  // arbitrary -> dense
  dense_array_ref<int, 3> dense_null_ref(null_ref);
  dense_null_ref = null_ref;
  non_template_dense(null_ref);
  // non_template_dense(non_ref);

  // dense -> general
  array_ref_of_rank<int, 3> null_ref2(dense_null_ref);
  null_ref = dense_null_ref;
  non_template(dense_null_ref);
  // non_template(dense_non_ref);

  // nullptr -> ref
  non_template(nullptr);
  non_template_const(nullptr);
  non_template_dense(nullptr);

  ASSERT_EQ(overload_shape(null_ref), general);
  ASSERT_EQ(overload_shape(dense_null_ref), dense);
  ASSERT_EQ(overload_shape_const(null_ref), general);
  ASSERT_EQ(overload_shape_const(dense_null_ref), dense);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000
leaq 0x28(%rsp), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%rcx)
movq $0x1e, 0x8(%rcx)
movq %r13, 0x10(%rcx)
leaq 0x40(%rsp), %rdx
xorl %r14d, %r14d
movq %r14, (%rdx)
movl $0x14, %ebp
movq %rbp, 0x8(%rdx)
movq %r13, 0x10(%rdx)
leaq 0x58(%rsp), %r15
movq %r14, (%r15)
movl $0xa, %ebx
movq %rbx, 0x8(%r15)
movq %r13, 0x10(%r15)
movq %rcx, %rdi
movq %r15, %rsi
callq 0x1a487
leaq 0x2a0(%rsp), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r12)
movups %xmm0, 0x8(%r12)
movq %rbp, 0x28(%r12)
movq %r13, 0x30(%r12)
movq %r14, 0x38(%r12)
movq %rbx, 0x40(%r12)
movq %r13, 0x48(%r12)
movq %r14, 0x50(%r12)
movl $0x5, %ebx
movq %rbx, 0x58(%r12)
movq %r13, 0x60(%r12)
movq %r12, %rdi
callq 0x1a362
movq %r12, %rdi
callq 0x1a43a
leaq 0xa0(%rsp), %rsi
movq %r14, (%rsi)
movq %rbx, 0x8(%rsi)
movq %r13, 0x10(%rsi)
xorl %edi, %edi
callq 0xd09f
leaq 0x238(%rsp), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movq $0x14, 0x28(%rdi)
movq %r13, 0x30(%rdi)
xorl %eax, %eax
movq %rax, 0x38(%rdi)
movq $0xa, 0x40(%rdi)
movq %r13, 0x48(%rdi)
movq %rax, 0x50(%rdi)
movq $0x5, 0x58(%rdi)
callq 0xc2a2
leaq 0x238(%rsp), %rdi
callq 0xc38a
movq 0x10(%r15), %rax
leaq 0xa0(%rsp), %rsi
movq %rax, 0x10(%rsi)
movups (%r15), %xmm0
movaps %xmm0, (%rsi)
xorl %edi, %edi
callq 0xd09f
leaq 0x28(%rsp), %rbx
movq 0x68(%rsp), %rax
movq %rax, %rcx
negq %rcx
jo 0x48b70
cmpq $0x1, %rax
jne 0x4913d
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movaps %xmm2, 0x90(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movq 0x20(%rsp), %r12
movq 0x10(%r15), %rax
leaq 0xa0(%rsp), %rsi
movq %rax, 0x10(%rsi)
movups (%r15), %xmm0
movaps %xmm0, (%rsi)
xorl %edi, %edi
callq 0xd09f
movq 0x58(%rsp), %rbp
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %rax
movq %rax, %rcx
negq %rcx
jo 0x48bd4
cmpq $0x1, %rax
jne 0x4913d
leaq 0x40(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x98(%rsp)
movups (%rcx), %xmm0
movups %xmm0, 0x88(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x80(%rsp)
movq 0x10(%r15), %rax
leaq 0xa0(%rsp), %rsi
movq %rax, 0x10(%rsi)
movups (%r15), %xmm0
movaps %xmm0, (%rsi)
xorl %edi, %edi
callq 0xd09f
movq 0x68(%rsp), %rax
movq %rax, %rcx
negq %rcx
jo 0x48c39
cmpq $0x1, %rax
jne 0x4913d
leaq 0x88(%rsp), %rax
movq %r12, 0x20(%rsp)
movq %rbp, 0x58(%rsp)
movq %r14, 0x60(%rsp)
movq $0x1, 0x68(%rsp)
movq 0x10(%rax), %rcx
leaq 0x40(%rsp), %rdx
movq %rcx, 0x10(%rdx)
movups (%rax), %xmm0
movups %xmm0, (%rdx)
movq -0x8(%rax), %rcx
movq %rcx, 0x10(%rbx)
movaps -0x18(%rax), %xmm0
movups %xmm0, (%rbx)
leaq 0xa8(%rsp), %rcx
leaq 0xc0(%rsp), %rdx
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
leaq 0xd8(%rsp), %rsi
movups %xmm0, (%rsi)
movaps %xmm0, -0x38(%rsi)
movq $0x0, -0x28(%rsi)
movq %r13, -0x20(%rsi)
movq %r13, -0x8(%rsi)
movq %r13, 0x10(%rsi)
movq %rcx, %rdi
callq 0x1a487
leaq 0xa8(%rsp), %rcx
leaq 0xc0(%rsp), %rdx
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
leaq 0xd8(%rsp), %rsi
movups %xmm0, (%rsi)
movaps %xmm0, -0x38(%rsi)
movq $0x0, -0x28(%rsi)
movq %r13, -0x20(%rsi)
movq %r13, -0x8(%rsi)
movq %r13, 0x10(%rsi)
movq %rcx, %rdi
callq 0x1a487
leaq 0xa8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
movups %xmm0, 0x18(%rsi)
movaps %xmm0, -0x20(%rsi)
movq $0x0, -0x10(%rsi)
movq %r13, -0x8(%rsi)
movq %r13, 0x10(%rsi)
movq %rdi, %rdx
callq 0xc4eb
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x63783(%rip), %rsi     # 0xac4c6
leaq 0x6379f(%rip), %rdx     # 0xac4e9
movq %rsp, %rdi
callq 0xd0b8
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf0a
leaq 0x588e6(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x63768(%rip), %rsi     # 0xac4ea
movq %rax, %rdi
callq 0x421ec
leaq 0x5c599(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x48db3
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x5889a(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x63719(%rip), %rsi     # 0xac4e2
movq %rax, %rdi
callq 0x18af6
leaq 0x5c552(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x48dfa
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x6f568(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x48e2c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x636ca(%rip), %rsi     # 0xac503
leaq 0x636ea(%rip), %rdx     # 0xac52a
callq 0xd0b8
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf0a
leaq 0x587f3(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x636b6(%rip), %rsi     # 0xac52b
movq %rax, %rdi
callq 0x3ebfa
leaq 0x5c4a6(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x48ea9
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x587a4(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x63666(%rip), %rsi     # 0xac525
movq %rax, %rdi
callq 0x2ce10
leaq 0x5c45c(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x48ef3
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x6f46f(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x48f25
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x63618(%rip), %rsi     # 0xac54a
leaq 0x6363a(%rip), %rdx     # 0xac573
callq 0xd0b8
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf0a
leaq 0x586fa(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x63606(%rip), %rsi     # 0xac574
movq %rax, %rdi
callq 0x3ebfa
leaq 0x5c3ad(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x48f9f
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x586ae(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x6352d(%rip), %rsi     # 0xac4e2
movq %rax, %rdi
callq 0x18af6
leaq 0x5c366(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x48fe6
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x6f37c(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x49018
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x6356e(%rip), %rsi     # 0xac593
leaq 0x63594(%rip), %rdx     # 0xac5c0
callq 0xd0b8
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf0a
leaq 0x58607(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x63560(%rip), %rsi     # 0xac5c1
movq %rax, %rdi
callq 0x3ec32
leaq 0x5c2ba(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49095
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x585b8(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x6347a(%rip), %rsi     # 0xac525
movq %rax, %rdi
callq 0x2ce10
leaq 0x5c270(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x490df
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x6f283(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x49111
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x238(%rsp), %rdi
callq 0xd16c
leaq 0x2a0(%rsp), %rdi
callq 0x1d3b4
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x63699(%rip), %rdi     # 0xac7dd
leaq 0x57fa2(%rip), %rsi     # 0xa10ed
leaq 0x636c0(%rip), %rcx     # 0xac812
movl $0x1da, %edx            # imm = 0x1DA
callq 0x2100
jmp 0x4921d
jmp 0x4921d
jmp 0x49189
jmp 0x49189
jmp 0x49189
jmp 0x49189
jmp 0x49189
jmp 0x49189
jmp 0x49189
jmp 0x49189
jmp 0x4919b
jmp 0x491ad
jmp 0x491bf
jmp 0x491d1
jmp 0x49184
jmp 0x49184
jmp 0x49184
movq %rax, %rbx
jmp 0x491e1
movq %rax, %rbx
jmp 0x491f7
jmp 0x4919b
jmp 0x491ad
jmp 0x491bf
jmp 0x491d1
movq %rax, %rbx
jmp 0x49204
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x491e1
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x491e1
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x491e1
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x491f7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x238(%rsp), %rdi
callq 0xd16c
leaq 0x2a0(%rsp), %rdi
callq 0x1d3b4
movq %rbx, %rdi
callq 0x2300
jmp 0x4921d
jmp 0x4921d
movq %rax, %rdi
callq 0xc036