// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
leaq 0x58(%rsp), %rsi
movq $0x0, (%rsi)
movq $0x3, 0x8(%rsi)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x10(%rsi)
movq %rsp, %rdx
movl $0x0, (%rdx)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x4a248
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), %ebx
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x644e8(%rip), %rsi     # 0xac39f
leaq 0x644ec(%rip), %rdx     # 0xac3aa
movq %rsp, %rdi
callq 0xd0b8
xorl %esi, %esi
cmpl $0xa, %ebx
sete %sil
leaq 0x58(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf0a
leaq 0x59771(%rip), %rsi     # 0xa1654
leaq 0x58(%rsp), %rdi
callq 0x18a16
leaq 0x644b7(%rip), %rsi     # 0xac3ab
movq %rax, %rdi
callq 0x2ce10
leaq 0x5d427(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x47f3d
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
imulq 0x50(%rsp), %rcx
shlq $0x2, %rcx
negq %rcx
movq %rbx, %rdi
addq $0x10, %rdi
movl (%rax,%rcx), %esi
callq 0x22f0
leaq 0x59710(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x5acfa(%rip), %rsi     # 0xa2c4d
movq %rax, %rdi
callq 0x18bd6
leaq 0x5d3c8(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x47f87
movq %rbx, %rdi
addq $0x10, %rdi
movl $0xa, %esi
callq 0x22f0
leaq 0x703db(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0x58(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x47fb6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movl $0x1, %eax
subq 0x40(%rsp), %rax
imulq 0x50(%rsp), %rax
movq 0x38(%rsp), %rcx
movl (%rcx,%rax,4), %ebx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x643d6(%rip), %rsi     # 0xac3b1
leaq 0x643da(%rip), %rdx     # 0xac3bc
callq 0xd0b8
xorl %esi, %esi
cmpl $0x14, %ebx
sete %sil
leaq 0x58(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf0a
leaq 0x59650(%rip), %rsi     # 0xa1654
leaq 0x58(%rsp), %rdi
callq 0x18a16
leaq 0x643a8(%rip), %rsi     # 0xac3bd
movq %rax, %rdi
callq 0x2ce10
leaq 0x5d306(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4805c
movl $0x1, %eax
subq 0x40(%rsp), %rax
imulq 0x50(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rbx, %rdi
addq $0x10, %rdi
movl (%rcx,%rax,4), %esi
callq 0x22f0
leaq 0x595f1(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x5b1b9(%rip), %rsi     # 0xa322b
movq %rax, %rdi
callq 0x18bd6
leaq 0x5d2a9(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x480a6
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x14, %esi
callq 0x22f0
leaq 0x702bc(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0x58(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x480d5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movl $0x2, %eax
subq 0x40(%rsp), %rax
imulq 0x50(%rsp), %rax
movq 0x38(%rsp), %rcx
movl (%rcx,%rax,4), %ebx
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x642c9(%rip), %rsi     # 0xac3c3
leaq 0x642cd(%rip), %rdx     # 0xac3ce
callq 0xd0b8
xorl %esi, %esi
cmpl $0x1e, %ebx
sete %sil
leaq 0x58(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf0a
leaq 0x59531(%rip), %rsi     # 0xa1654
leaq 0x58(%rsp), %rdi
callq 0x18a16
leaq 0x6429b(%rip), %rsi     # 0xac3cf
movq %rax, %rdi
callq 0x2ce10
leaq 0x5d1e7(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x4817b
movl $0x2, %eax
subq 0x40(%rsp), %rax
imulq 0x50(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rbx, %rdi
addq $0x10, %rdi
movl (%rcx,%rax,4), %esi
callq 0x22f0
leaq 0x594d2(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x74d84(%rip), %rsi     # 0xbcf15
movq %rax, %rdi
callq 0x18bd6
leaq 0x5d18a(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x481c5
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1e, %esi
callq 0x22f0
leaq 0x7019d(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0x58(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x481f4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
callq 0x1fb50
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
retq
jmp 0x48278
jmp 0x4820f
jmp 0x4820f
movq %rax, %rbx
jmp 0x48264
jmp 0x48223
jmp 0x48232
jmp 0x48241
jmp 0x4821e
jmp 0x4821e
movq %rax, %rbx
jmp 0x4824e
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xbf62
jmp 0x4824e
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xbf62
jmp 0x4824e
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x48264
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
callq 0x1fb50
movq %rbx, %rdi
callq 0x2300
jmp 0x48278
movq %rax, %rdi
callq 0xc036