// File: /workspace/github_cpp_makefile_star2_O2/dsharlet[P]array/test/array_ref.cpp
// Function: nda::test_reinterpret_body()
TEST(reinterpret) {
  float eight = 8.0f;
  int eight_int;
  ASSERT_EQ(sizeof(eight), sizeof(eight_int));
  std::memcpy(&eight_int, &eight, sizeof(eight));

  dense_array<int, 3> int_array({4, 5, 6}, eight_int);
  dense_array_ref<float, 3> float_array = reinterpret<float>(int_array);
  ASSERT_EQ(float_array.width(), 4);
  ASSERT_EQ(float_array.height(), 5);
  ASSERT_EQ(float_array.channels(), 6);
  ASSERT_EQ(float_array.rows(), 4);
  ASSERT_EQ(float_array.columns(), 5);
  for_all_indices(int_array.shape(), [&](int x, int y, int z) {
    ASSERT_EQ(int_array(x, y, z), eight_int);
    ASSERT_EQ(float_array(x, y, z), eight);
  });

  array_of_rank<int, 0> scalar_int({}, eight_int);
  array_ref_of_rank<float, 0> scalar = reinterpret<float>(scalar_int);
  ASSERT_EQ(scalar_int(), eight_int);
  ASSERT_EQ(scalar(), eight);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movl $0x41000000, 0x1c(%rsp) # imm = 0x41000000
leaq 0x5eea3(%rip), %rsi     # 0x985e0
leaq 0xe0(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x66a0
leaq 0x148(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0xe0(%rsp), %rdx
callq 0x6894
leaq 0x53ed9(%rip), %rsi     # 0x8d647
leaq 0x148(%rsp), %rdi
callq 0x106fe
leaq 0x5ee81(%rip), %rsi     # 0x98603
movq %rax, %rdi
callq 0x1085e
leaq 0x57e61(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x90(%rsp), %rsi
movq $0x4, (%rsi)
movq %rax, %rdi
callq 0x11052
leaq 0x53e90(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x5ee2b(%rip), %rsi     # 0x985f1
movq %rax, %rdi
callq 0x118c8
leaq 0x57e1d(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x28(%rsp), %rsi
movq $0x4, (%rsi)
movq %rax, %rdi
callq 0x11052
leaq 0x6baaa(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0xe0(%rsp), %rdi
callq 0x2090
movl 0x1c(%rsp), %eax
leaq 0x18(%rsp), %rbx
movl %eax, (%rbx)
leaq 0x148(%rsp), %r14
pushq $0x4
popq %rsi
pushq $0x5
popq %rdx
pushq $0x6
popq %rcx
movq %r14, %rdi
callq 0x10810
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x10ac4
movq 0x18(%r15), %rdx
leaq 0x100(%rsp), %rsi
leaq 0x98(%rsp), %rax
pushq $0x9
popq %rcx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %rdx, -0x8(%rax)
movq 0x38(%rax), %rbx
leaq 0x5ed91(%rip), %rsi     # 0x98611
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x4, %rbx
sete %sil
leaq 0x148(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x6894
leaq 0x53d95(%rip), %rsi     # 0x8d647
leaq 0x148(%rsp), %rdi
callq 0x106fe
leaq 0x5ed64(%rip), %rsi     # 0x9862a
movq %rax, %rdi
callq 0x11036
leaq 0x57d1d(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0xd0(%rsp), %rcx
leaq 0x50(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x53d4b(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x58a69(%rip), %rsi     # 0x92374
movq %rax, %rdi
callq 0x106fe
leaq 0x57cd8(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x14(%rsp), %rsi
movl $0x4, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x6b966(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0x28(%rsp), %rdi
callq 0x2090
movq 0xb8(%rsp), %rbx
leaq 0x5ecd4(%rip), %rsi     # 0x9863e
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x5, %rbx
sete %sil
leaq 0x148(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x6894
leaq 0x53cab(%rip), %rsi     # 0x8d647
leaq 0x148(%rsp), %rdi
callq 0x106fe
leaq 0x5eca8(%rip), %rsi     # 0x98658
movq %rax, %rdi
callq 0x3bfc6
leaq 0x57c33(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0xb8(%rsp), %rcx
leaq 0x50(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x53c61(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x55b24(%rip), %rsi     # 0x8f519
movq %rax, %rdi
callq 0x106fe
leaq 0x57bee(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x14(%rsp), %rsi
movl $0x5, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x6b87c(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0x28(%rsp), %rdi
callq 0x2090
movq 0xa0(%rsp), %rbx
leaq 0x5ec19(%rip), %rsi     # 0x9866d
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x6, %rbx
sete %sil
leaq 0x148(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x6894
leaq 0x53bc1(%rip), %rsi     # 0x8d647
leaq 0x148(%rsp), %rdi
callq 0x106fe
leaq 0x5ebef(%rip), %rsi     # 0x98689
movq %rax, %rdi
callq 0x11256
leaq 0x57b49(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0xa0(%rsp), %rcx
leaq 0x50(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x53b77(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x5eba8(%rip), %rsi     # 0x98687
movq %rax, %rdi
callq 0x106fe
leaq 0x57b04(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x14(%rsp), %rsi
movl $0x6, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x6b792(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0x28(%rsp), %rdi
callq 0x2090
movq 0xd0(%rsp), %rbx
leaq 0x5eb62(%rip), %rsi     # 0x986a0
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x4, %rbx
sete %sil
leaq 0x148(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x6894
leaq 0x53ad7(%rip), %rsi     # 0x8d647
leaq 0x148(%rsp), %rdi
callq 0x106fe
leaq 0x5eb34(%rip), %rsi     # 0x986b8
movq %rax, %rdi
callq 0x109ce
leaq 0x57a5f(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0xd0(%rsp), %rcx
leaq 0x50(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x53a8d(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x587ab(%rip), %rsi     # 0x92374
movq %rax, %rdi
callq 0x106fe
leaq 0x57a1a(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x14(%rsp), %rsi
movl $0x4, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x6b6a8(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0x28(%rsp), %rdi
callq 0x2090
movq 0xb8(%rsp), %rbx
leaq 0x5eaa3(%rip), %rsi     # 0x986cb
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x5, %rbx
sete %sil
leaq 0x148(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x6894
leaq 0x539ed(%rip), %rsi     # 0x8d647
leaq 0x148(%rsp), %rdi
callq 0x106fe
leaq 0x5ea78(%rip), %rsi     # 0x986e6
movq %rax, %rdi
callq 0x109ea
leaq 0x57975(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0xb8(%rsp), %rcx
leaq 0x50(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x539a3(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x55866(%rip), %rsi     # 0x8f519
movq %rax, %rdi
callq 0x106fe
leaq 0x57930(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x14(%rsp), %rsi
movl $0x5, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x6b5be(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0x28(%rsp), %rbp
movq %rbp, %rdi
callq 0x2090
leaq 0xe0(%rsp), %r15
movq 0x20(%r15), %r13
movq 0x28(%r15), %rax
addq %r13, %rax
movq %rax, 0x78(%rsp)
leaq 0x148(%rsp), %r12
cmpq 0x78(%rsp), %r13
je 0x39fa2
movq 0x118(%rsp), %rbx
movq 0x120(%rsp), %rax
addq %rbx, %rax
movq %rax, 0x80(%rsp)
cmpq 0x80(%rsp), %rbx
je 0x39f9a
movl 0x130(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %rbx, 0x20(%rsp)
subq $0x1, 0x88(%rsp)
jb 0x39f92
movq %r15, %rdi
movl 0x10(%rsp), %esi
movl %ebx, %edx
movl %r13d, %ecx
callq 0x1084a
movq %r13, %rbx
movq %r15, %r13
movl (%rax), %r14d
movl 0x18(%rsp), %r15d
movq %rbp, %rdi
leaq 0x5f419(%rip), %rsi     # 0x991cb
leaq 0x50(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpl %r15d, %r14d
sete %sil
movq %r12, %rdi
movq %rbp, %rdx
callq 0x6894
movq %r13, %r15
movq %rbx, %r13
leaq 0x5386a(%rip), %rbx     # 0x8d647
movq %r12, %rdi
movq %rbx, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x5f3f9(%rip), %rsi     # 0x991eb
callq 0x109ce
movq %rax, %rdi
leaq 0x577f1(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %r14
movq %r15, %rdi
movl 0x10(%rsp), %esi
movq 0x20(%rsp), %rdx
movl %r13d, %ecx
callq 0x1084a
movq %r14, %rdi
movq %rax, %rsi
callq 0x10736
movq %rax, %rdi
movq %rbx, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x5e8cf(%rip), %rsi     # 0x9870c
callq 0x1079e
movq %rax, %rdi
leaq 0x577a6(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %rdi
leaq 0x18(%rsp), %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x6b43a(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r12, %rdi
callq 0x68d4
movq %rbp, %rdi
callq 0x2090
leaq 0x90(%rsp), %rdi
movl 0x10(%rsp), %esi
movq 0x20(%rsp), %rdx
movl %r13d, %ecx
callq 0x3da3e
movss (%rax), %xmm0
movss %xmm0, 0x74(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x70(%rsp)
movq %rbp, %rdi
leaq 0x5f348(%rip), %rsi     # 0x991fe
leaq 0x50(%rsp), %rdx
callq 0x66a0
movss 0x74(%rsp), %xmm0
cmpeqss 0x70(%rsp), %xmm0
movd %xmm0, %esi
andl $0x1, %esi
movq %r12, %rdi
movq %rbp, %rdx
callq 0x6894
movq %r12, %rdi
movq %rbx, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x5f328(%rip), %rsi     # 0x9921c
callq 0x3bfc6
movq %rax, %rdi
leaq 0x576ef(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %r14
leaq 0x90(%rsp), %rdi
movl 0x10(%rsp), %esi
movq 0x20(%rsp), %rdx
movl %r13d, %ecx
callq 0x3da3e
movq %r14, %rdi
movq %rax, %rsi
callq 0x3bfe2
movq %rax, %rdi
movq %rbx, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x5e7eb(%rip), %rsi     # 0x9872f
callq 0x223dc
movq %rax, %rdi
leaq 0x5769f(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %rdi
leaq 0x1c(%rsp), %rsi
callq 0x3bfe2
movq %rax, %rdi
leaq 0x6b333(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r12, %rdi
callq 0x68d4
movq %rbp, %rdi
callq 0x2090
incl 0x10(%rsp)
movq 0x20(%rsp), %rbx
jmp 0x39d7a
incq %rbx
jmp 0x39d4c
incq %r13
jmp 0x39d26
leaq 0x28(%rsp), %rdi
leaq 0x148(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x11126
movq 0x40(%rsp), %rbx
movl (%rbx), %ebp
movl 0x18(%rsp), %r14d
leaq 0x5e730(%rip), %rsi     # 0x986fc
leaq 0x50(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpl %r14d, %ebp
sete %sil
leaq 0x148(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x6894
leaq 0x5364a(%rip), %rsi     # 0x8d647
leaq 0x148(%rsp), %rdi
callq 0x106fe
leaq 0x5e705(%rip), %rsi     # 0x98716
movq %rax, %rdi
callq 0x1082e
leaq 0x575d2(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x40(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
leaq 0x5360b(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x5e6c1(%rip), %rsi     # 0x9870c
movq %rax, %rdi
callq 0x1079e
leaq 0x57598(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
leaq 0x6b22c(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0x50(%rsp), %rdi
callq 0x2090
movss (%rbx), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
leaq 0x5e671(%rip), %rsi     # 0x98723
leaq 0x50(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x66a0
movss 0x10(%rsp), %xmm0
cmpeqss 0x20(%rsp), %xmm0
movd %xmm0, %esi
andl $0x1, %esi
leaq 0x148(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x6894
leaq 0x53559(%rip), %rsi     # 0x8d647
leaq 0x148(%rsp), %rdi
callq 0x106fe
leaq 0x552d1(%rip), %rsi     # 0x8f3d3
movq %rax, %rdi
callq 0x118ac
leaq 0x574e1(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3bfe2
leaq 0x5351c(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x5e5f5(%rip), %rsi     # 0x9872f
movq %rax, %rdi
callq 0x223dc
leaq 0x574a9(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x1c(%rsp), %rsi
movq %rax, %rdi
callq 0x3bfe2
leaq 0x6b13d(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0x50(%rsp), %rdi
callq 0x2090
leaq 0x28(%rsp), %rdi
callq 0x6baa
leaq 0xe0(%rsp), %rdi
callq 0x69c2
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a1af
movq %rax, %rbx
jmp 0x3a2d7
jmp 0x3a2f0
jmp 0x3a2f0
jmp 0x3a2f0
jmp 0x3a2f0
jmp 0x3a2f0
jmp 0x3a2f0
movq %rax, %rbx
jmp 0x3a32e
jmp 0x3a1df
movq %rax, %rbx
jmp 0x3a2cd
jmp 0x3a220
jmp 0x3a2eb
jmp 0x3a235
jmp 0x3a2eb
jmp 0x3a24a
jmp 0x3a2eb
jmp 0x3a25f
jmp 0x3a2eb
jmp 0x3a274
jmp 0x3a2eb
jmp 0x3a289
movq %rax, %rbx
jmp 0x3a299
jmp 0x3a220
jmp 0x3a235
jmp 0x3a24a
jmp 0x3a25f
jmp 0x3a274
jmp 0x3a289
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
jmp 0x3a317
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
jmp 0x3a317
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
jmp 0x3a317
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
jmp 0x3a317
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
jmp 0x3a317
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0xe0(%rsp), %rdi
callq 0x2090
jmp 0x3a32e
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
jmp 0x3a2cd
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0x50(%rsp), %rdi
callq 0x2090
leaq 0x28(%rsp), %rdi
callq 0x6baa
jmp 0x3a321
jmp 0x3a336
jmp 0x3a2f0
jmp 0x3a2f0
jmp 0x3a2eb
movq %rax, %rbx
jmp 0x3a317
movq %rax, %rbx
jmp 0x3a321
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
jmp 0x3a317
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x68d4
leaq 0x28(%rsp), %rdi
callq 0x2090
leaq 0xe0(%rsp), %rdi
callq 0x69c2
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba