// File: /workspace/github_cpp_makefile_star2_O3/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 $0x318, %rsp            # imm = 0x318
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 %ebp, %ebp
movq %rbp, (%rdx)
movl $0x14, %r14d
movq %r14, 0x8(%rdx)
movq %r13, 0x10(%rdx)
leaq 0x58(%rsp), %r15
movq %rbp, (%r15)
movl $0xa, %ebx
movq %rbx, 0x8(%r15)
movq %r13, 0x10(%r15)
movq %rcx, %rdi
movq %r15, %rsi
callq 0x1a9f3
leaq 0x2b0(%rsp), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r12)
movups %xmm0, 0x8(%r12)
movq %r14, 0x28(%r12)
movq %r13, 0x30(%r12)
movq %rbp, 0x38(%r12)
movq %rbx, 0x40(%r12)
movq %r13, 0x48(%r12)
movq %rbp, 0x50(%r12)
movl $0x5, %ebx
movq %rbx, 0x58(%r12)
movq %r13, 0x60(%r12)
movq %r12, %rdi
callq 0x1a8cc
movq %r12, %rdi
callq 0x1a9a6
leaq 0xb0(%rsp), %rsi
movq %rbp, (%rsi)
movq %rbx, 0x8(%rsi)
movq %r13, 0x10(%rsi)
xorl %edi, %edi
callq 0xd133
leaq 0x248(%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 0xc30a
leaq 0x248(%rsp), %rdi
callq 0xc412
movq 0x10(%r15), %rax
leaq 0xb0(%rsp), %rsi
movq %rax, 0x10(%rsi)
movups (%r15), %xmm0
movaps %xmm0, (%rsi)
xorl %edi, %edi
callq 0xd133
leaq 0x28(%rsp), %rbx
leaq 0x40(%rsp), %r14
movq 0x68(%rsp), %rax
movq %rax, %rcx
negq %rcx
jo 0x49668
cmpq $0x1, %rax
jne 0x49c10
movq 0x20(%rsp), %r12
movq 0x10(%r15), %rax
leaq 0xb0(%rsp), %rsi
movq %rax, 0x10(%rsi)
movups (%r15), %xmm0
movaps %xmm0, (%rsi)
xorl %edi, %edi
callq 0xd133
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0x68(%rsp), %rax
movq %rax, %rcx
negq %rcx
jo 0x496ac
cmpq $0x1, %rax
jne 0x49c10
movq 0x10(%r14), %rax
movq %rax, 0xa8(%rsp)
movups (%r14), %xmm0
movups %xmm0, 0x98(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, 0x80(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x90(%rsp)
movq 0x10(%r15), %rax
leaq 0xb0(%rsp), %rsi
movq %rax, 0x10(%rsi)
movups (%r15), %xmm0
movaps %xmm0, (%rsi)
xorl %edi, %edi
callq 0xd133
movq 0x68(%rsp), %rax
movq %rax, %rcx
negq %rcx
jo 0x49710
cmpq $0x1, %rax
jne 0x49c10
leaq 0x98(%rsp), %rax
movq %r12, 0x20(%rsp)
movaps 0x70(%rsp), %xmm0
movups %xmm0, 0x58(%rsp)
movq $0x1, 0x68(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%r14)
movups (%rax), %xmm0
movups %xmm0, (%r14)
movq -0x8(%rax), %rcx
movq %rcx, 0x10(%rbx)
movaps -0x18(%rax), %xmm0
movups %xmm0, (%rbx)
leaq 0xb8(%rsp), %rcx
leaq 0xd0(%rsp), %rdx
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
leaq 0xe8(%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 0x1a9f3
leaq 0xb8(%rsp), %rcx
leaq 0xd0(%rsp), %rdx
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
leaq 0xe8(%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 0x1a9f3
leaq 0xb8(%rsp), %rdi
leaq 0xd0(%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 0xc573
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x64ae8(%rip), %rsi     # 0xae2fe
leaq 0x64b04(%rip), %rdx     # 0xae321
movq %rsp, %rdi
callq 0xd14c
leaq 0xb0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x59e43(%rip), %rsi     # 0xa3684
leaq 0xb0(%rsp), %rdi
callq 0x18fba
leaq 0x64acd(%rip), %rsi     # 0xae322
movq %rax, %rdi
callq 0x42c5e
leaq 0x5d9f2(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49886
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x59df7(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x64a7e(%rip), %rsi     # 0xae31a
movq %rax, %rdi
callq 0x1909a
leaq 0x5d9ab(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x498cd
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x709c5(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xb0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x498ff
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x64a2f(%rip), %rsi     # 0xae33b
leaq 0x64a4f(%rip), %rdx     # 0xae362
callq 0xd14c
leaq 0xb0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x59d50(%rip), %rsi     # 0xa3684
leaq 0xb0(%rsp), %rdi
callq 0x18fba
leaq 0x64a1b(%rip), %rsi     # 0xae363
movq %rax, %rdi
callq 0x3f5a4
leaq 0x5d8ff(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4997c
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x59d01(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x649cb(%rip), %rsi     # 0xae35d
movq %rax, %rdi
callq 0x2d7d8
leaq 0x5d8b5(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x499c6
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x708cc(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xb0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x499f8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x6497d(%rip), %rsi     # 0xae382
leaq 0x6499f(%rip), %rdx     # 0xae3ab
callq 0xd14c
leaq 0xb0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x59c57(%rip), %rsi     # 0xa3684
leaq 0xb0(%rsp), %rdi
callq 0x18fba
leaq 0x6496b(%rip), %rsi     # 0xae3ac
movq %rax, %rdi
callq 0x3f5a4
leaq 0x5d806(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49a72
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x59c0b(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x64892(%rip), %rsi     # 0xae31a
movq %rax, %rdi
callq 0x1909a
leaq 0x5d7bf(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49ab9
movq %rbx, %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x22f0
leaq 0x707d9(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xb0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x49aeb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x648d3(%rip), %rsi     # 0xae3cb
leaq 0x648f9(%rip), %rdx     # 0xae3f8
callq 0xd14c
leaq 0xb0(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x59b64(%rip), %rsi     # 0xa3684
leaq 0xb0(%rsp), %rdi
callq 0x18fba
leaq 0x648c5(%rip), %rsi     # 0xae3f9
movq %rax, %rdi
callq 0x3f5dc
leaq 0x5d713(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49b68
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x59b15(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x647df(%rip), %rsi     # 0xae35d
movq %rax, %rdi
callq 0x2d7d8
leaq 0x5d6c9(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x49bb2
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x22f0
leaq 0x706e0(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xb0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x49be4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x248(%rsp), %rdi
callq 0xd206
leaq 0x2b0(%rsp), %rdi
callq 0x1d848
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x649fe(%rip), %rdi     # 0xae615
leaq 0x594ff(%rip), %rsi     # 0xa311d
leaq 0x64a25(%rip), %rcx     # 0xae64a
movl $0x1da, %edx            # imm = 0x1DA
callq 0x2100
jmp 0x49cf0
jmp 0x49cf0
jmp 0x49c5c
jmp 0x49c5c
jmp 0x49c5c
jmp 0x49c5c
jmp 0x49c5c
jmp 0x49c5c
jmp 0x49c5c
jmp 0x49c5c
jmp 0x49c6e
jmp 0x49c80
jmp 0x49c92
jmp 0x49ca4
jmp 0x49c57
jmp 0x49c57
jmp 0x49c57
movq %rax, %rbx
jmp 0x49cb4
movq %rax, %rbx
jmp 0x49cca
jmp 0x49c6e
jmp 0x49c80
jmp 0x49c92
jmp 0x49ca4
movq %rax, %rbx
jmp 0x49cd7
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xbfd8
jmp 0x49cb4
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xbfd8
jmp 0x49cb4
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xbfd8
jmp 0x49cb4
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x49cca
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x248(%rsp), %rdi
callq 0xd206
leaq 0x2b0(%rsp), %rdi
callq 0x1d848
movq %rbx, %rdi
callq 0x2300
jmp 0x49cf0
jmp 0x49cf0
movq %rax, %rdi
callq 0xc0a9