// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/array_ref.cpp
// Function: nda::test_reinterpret_const_body()
TEST(reinterpret_const) {
  array_of_rank<int, 1> a1({3}, 0);
  a1(0) = 5;
  a1(1) = 2;
  a1(2) = 6;

  const_array_ref_of_rank<int, 1> a1_cref = a1.cref();
  array_ref_of_rank<int, 1> a1_ref = reinterpret_const<int>(a1_cref);
  a1_ref(0) = 10;
  a1_ref(1) = 20;
  a1_ref(2) = 30;

  ASSERT_EQ(a1(0), 10);
  ASSERT_EQ(a1(1), 20);
  ASSERT_EQ(a1(2), 30);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1f0, %rsp            # imm = 0x1F0
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
leaq 0x60(%rsp), %rsi
movq $0x0, (%rsi)
movq $0x3, 0x8(%rsi)
movq %r15, 0x10(%rsi)
leaq 0x8(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x4ad1a
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rdx
movq 0x30(%rbx), %rcx
movl $0x1, %esi
subq %rdx, %rsi
movl $0x2, %edi
subq %rdx, %rdi
imulq %rcx, %rdx
shlq $0x2, %rdx
negq %rdx
movl $0x5, (%rax,%rdx)
movl $0x1, %edx
imulq %rcx, %rsi
movl $0x2, (%rax,%rsi,4)
movl $0x2, %esi
imulq %rcx, %rdi
movl $0x6, (%rax,%rdi,4)
movq 0x20(%rbx), %rdi
movq 0x30(%rbx), %r8
subq %rdi, %rdx
subq %rdi, %rsi
negq %rdi
imulq %r8, %rdx
imulq %r8, %rsi
imulq %rdi, %r8
movl $0xa, (%rax,%r8,4)
movl $0x14, (%rax,%rdx,4)
movl $0x1e, (%rax,%rsi,4)
imulq %rcx, %rdi
movl (%rax,%rdi,4), %ebp
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x658eb(%rip), %rsi     # 0xae1d7
leaq 0x658ef(%rip), %rdx     # 0xae1e2
leaq 0x8(%rsp), %rdi
callq 0xd14c
xorl %esi, %esi
cmpl $0xa, %ebp
sete %sil
leaq 0x60(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xbf80
leaq 0x5ad68(%rip), %rsi     # 0xa3684
leaq 0x60(%rsp), %rdi
callq 0x18fba
leaq 0x658b6(%rip), %rsi     # 0xae1e3
movq %rax, %rdi
callq 0x2d7d8
leaq 0x5e91a(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x48976
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
imulq 0x58(%rsp), %rcx
shlq $0x2, %rcx
negq %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rax,%rcx), %esi
callq 0x22f0
leaq 0x5ad07(%rip), %rsi     # 0xa3684
movq %r14, %rdi
callq 0x18fba
leaq 0x5c309(%rip), %rsi     # 0xa4c95
movq %rax, %rdi
callq 0x1917a
leaq 0x5e8bb(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x489c0
movq %r14, %rdi
addq $0x10, %rdi
movl $0xa, %esi
callq 0x22f0
leaq 0x718d2(%rip), %rsi     # 0xba299
movq %r14, %rdi
callq 0x18fba
leaq 0x60(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x489f0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
movl $0x1, %eax
subq 0x48(%rsp), %rax
imulq 0x58(%rsp), %rax
movq 0x40(%rsp), %rcx
movl (%rcx,%rax,4), %ebp
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x657d2(%rip), %rsi     # 0xae1e9
leaq 0x657d6(%rip), %rdx     # 0xae1f4
callq 0xd14c
xorl %esi, %esi
cmpl $0x14, %ebp
sete %sil
leaq 0x60(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xbf80
leaq 0x5ac42(%rip), %rsi     # 0xa3684
leaq 0x60(%rsp), %rdi
callq 0x18fba
leaq 0x657a2(%rip), %rsi     # 0xae1f5
movq %rax, %rdi
callq 0x2d7d8
leaq 0x5e7f4(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x48a9a
movl $0x1, %eax
subq 0x48(%rsp), %rax
imulq 0x58(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rcx,%rax,4), %esi
callq 0x22f0
leaq 0x5abe3(%rip), %rsi     # 0xa3684
movq %r14, %rdi
callq 0x18fba
leaq 0x5c7c3(%rip), %rsi     # 0xa5273
movq %rax, %rdi
callq 0x1917a
leaq 0x5e797(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x48ae4
movq %r14, %rdi
addq $0x10, %rdi
movl $0x14, %esi
callq 0x22f0
leaq 0x717ae(%rip), %rsi     # 0xba299
movq %r14, %rdi
callq 0x18fba
leaq 0x60(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x48b14
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
movl $0x2, %eax
subq 0x48(%rsp), %rax
imulq 0x58(%rsp), %rax
movq 0x40(%rsp), %rcx
movl (%rcx,%rax,4), %ebp
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x656c0(%rip), %rsi     # 0xae1fb
leaq 0x656c4(%rip), %rdx     # 0xae206
callq 0xd14c
xorl %esi, %esi
cmpl $0x1e, %ebp
sete %sil
leaq 0x60(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xbf80
leaq 0x5ab1e(%rip), %rsi     # 0xa3684
leaq 0x60(%rsp), %rdi
callq 0x18fba
leaq 0x65690(%rip), %rsi     # 0xae207
movq %rax, %rdi
callq 0x2d7d8
leaq 0x5e6d0(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x48bbe
movl $0x2, %eax
subq 0x48(%rsp), %rax
imulq 0x58(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rcx,%rax,4), %esi
callq 0x22f0
leaq 0x5aabf(%rip), %rsi     # 0xa3684
movq %r14, %rdi
callq 0x18fba
leaq 0x75ea1(%rip), %rsi     # 0xbea75
movq %rax, %rdi
callq 0x1917a
leaq 0x5e673(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x48c08
movq %r14, %rdi
addq $0x10, %rdi
movl $0x1e, %esi
callq 0x22f0
leaq 0x7168a(%rip), %rsi     # 0xba299
movq %r14, %rdi
callq 0x18fba
leaq 0x60(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x48c38
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
cmpq $0x0, 0x40(%rsp)
je 0x48c67
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movq $0x0, 0x28(%rbx)
movq %r15, 0x58(%rsp)
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x48c7b
jmp 0x48c7b
movq %rax, %r14
jmp 0x48cd1
jmp 0x48c8f
jmp 0x48c9e
jmp 0x48cad
jmp 0x48c8a
jmp 0x48c8a
movq %rax, %r14
jmp 0x48cba
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0xbfd8
jmp 0x48cba
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0xbfd8
jmp 0x48cba
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x48cd1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
cmpq $0x0, 0x40(%rsp)
je 0x48d00
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movq $0x0, 0x28(%rbx)
movq %r15, 0x58(%rsp)
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq %r14, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9