// File: /workspace/github_cpp_makefile_star2_O2/dsharlet[P]array/test/array.cpp
// Function: nda::test_array_copy_body()
TEST(array_copy) {
  array_of_rank<int, 3> a({4, 5, 6});
  fill_pattern(a);

  dense_array<int, 3> b({4, 5, 6});
  copy(a, b);
  check_pattern(b);

  array_of_rank<int, 3> c({dim<>(0, 4, 2), 5, 6});
  copy(b, c);
  check_pattern(c);

  array_of_rank<int, 3> d = make_copy(a, c.shape());
  ASSERT_EQ(c.shape(), d.shape());
  check_pattern(d);

  dense_array<int, 3> e = make_copy(a, b.shape());
  ASSERT_EQ(b.shape(), e.shape());
  check_pattern(e);

  dense_array<int, 3> g({{1, 2}, {1, 3}, {1, 4}});
  copy(a, g);
  check_pattern(g);

  array_of_rank<int, 3> h = make_copy(a);
  check_pattern(h);

  array_of_rank<int, 3, uninitialized_std_allocator<int>> h_uninitialized =
      make_copy(a, uninitialized_std_allocator<int>());
  check_pattern(h_uninitialized);

  array_of_rank<int, 3> i = make_copy(a.ref());
  check_pattern(i);

  array_of_rank<int, 3, uninitialized_std_allocator<int>> i_uninitialized =
      make_copy(a.ref(), uninitialized_std_allocator<int>());
  check_pattern(i_uninitialized);

  array_of_rank<int, 3> j = make_copy(a.cref());
  check_pattern(i);

  array_of_rank<int, 3, uninitialized_std_allocator<int>> j_uninitialized =
      make_copy(a.cref(), uninitialized_std_allocator<int>());
  check_pattern(j_uninitialized);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x688, %rsp            # imm = 0x688
leaq 0x440(%rsp), %rbx
pushq $0x4
popq %rsi
pushq $0x5
popq %rdx
pushq $0x6
popq %rcx
movq %rbx, %rdi
callq 0x10b74
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10b92
movq %r14, %rdi
xorl %esi, %esi
callq 0x10bbd
leaq 0x440(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x5
popq %rdx
pushq $0x6
popq %rcx
callq 0x10810
leaq 0x370(%rsp), %rdi
leaq 0x440(%rsp), %rsi
callq 0x6750
leaq 0x8(%rsp), %rdi
leaq 0x370(%rsp), %rsi
callq 0x112da
xorps %xmm0, %xmm0
leaq 0x440(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x370(%rsp), %rdi
callq 0x1132f
leaq 0x440(%rsp), %rsi
andq $0x0, (%rsi)
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
movq $0x6, 0x8(%rsi)
movq %r15, 0x10(%rsi)
andq $0x0, 0x18(%rsi)
movq $0x5, 0x20(%rsi)
movq %r15, 0x28(%rsi)
andq $0x0, 0x30(%rsi)
movq $0x4, 0x38(%rsi)
movq $0x2, 0x40(%rsi)
leaq 0x3d8(%rsp), %rdi
callq 0x10b92
leaq 0x370(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
callq 0x1135f
xorps %xmm0, %xmm0
leaq 0x440(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x3d8(%rsp), %rdi
callq 0x113b4
leaq 0x3f8(%rsp), %r14
leaq 0x620(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x440(%rsp), %rcx
movq %r14, %rdx
callq 0x113e4
leaq 0x640(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1520e
movl %eax, %ebp
leaq 0x817f6(%rip), %rsi     # 0x8f2e3
leaq 0xd8(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x66a0
movzbl %bpl, %esi
leaq 0x440(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
callq 0x6894
leaq 0x7fb28(%rip), %rsi     # 0x8d647
leaq 0x440(%rsp), %rdi
callq 0x106fe
leaq 0x817c7(%rip), %rsi     # 0x8f2fa
movq %rax, %rdi
callq 0x1079e
leaq 0x83ab0(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq %rax, %rdi
movq %r14, %rsi
callq 0x1141e
leaq 0x7faeb(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x81785(%rip), %rsi     # 0x8f2f0
movq %rax, %rdi
callq 0x1079e
leaq 0x83a78(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1141e
leaq 0x9770e(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x440(%rsp), %rdi
callq 0x68d4
leaq 0xd8(%rsp), %rdi
callq 0x2090
xorps %xmm0, %xmm0
leaq 0x440(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x620(%rsp), %rdi
callq 0x113b4
leaq 0x390(%rsp), %r14
leaq 0xd8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x440(%rsp), %rcx
movq %r14, %rdx
callq 0x11439
leaq 0xf8(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8360
movl %eax, %ebp
leaq 0x816ed(%rip), %rsi     # 0x8f304
leaq 0x70(%rsp), %rdi
leaq 0x290(%rsp), %rdx
callq 0x66a0
movzbl %bpl, %esi
leaq 0x440(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x6894
leaq 0x7fa01(%rip), %rsi     # 0x8d647
leaq 0x440(%rsp), %rdi
callq 0x106fe
leaq 0x816c1(%rip), %rsi     # 0x8f31b
movq %rax, %rdi
callq 0x1079e
leaq 0x83989(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq %rax, %rdi
movq %r14, %rsi
callq 0x11472
leaq 0x7f9c4(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x8167f(%rip), %rsi     # 0x8f311
movq %rax, %rdi
callq 0x1079e
leaq 0x83951(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq %rax, %rdi
movq %rbx, %rsi
callq 0x11472
leaq 0x975e7(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x440(%rsp), %rdi
callq 0x68d4
leaq 0x70(%rsp), %rdi
callq 0x2090
xorps %xmm0, %xmm0
leaq 0x440(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0xd8(%rsp), %rdi
callq 0x1132f
pushq $0x1
popq %rax
leaq 0x290(%rsp), %rsi
movq %rax, (%rsi)
movq $0x2, 0x8(%rsi)
leaq 0x220(%rsp), %rdx
movq %rax, (%rdx)
movq $0x3, 0x8(%rdx)
movq %r15, 0x10(%rdx)
leaq 0x1b0(%rsp), %rcx
movq %rax, (%rcx)
movq $0x4, 0x8(%rcx)
movq %r15, 0x10(%rcx)
leaq 0x70(%rsp), %rdi
callq 0x66f8
leaq 0x440(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x6750
leaq 0x8(%rsp), %rdi
leaq 0x440(%rsp), %rsi
callq 0x112da
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x440(%rsp), %rdi
callq 0x1132f
leaq 0x70(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x290(%rsp), %rdx
callq 0x1148d
xorps %xmm0, %xmm0
leaq 0x290(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x70(%rsp), %rdi
callq 0x113b4
leaq 0x290(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x220(%rsp), %rdx
callq 0x114c0
xorps %xmm0, %xmm0
leaq 0x220(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x290(%rsp), %rdi
callq 0x114f3
leaq 0x28(%rsp), %rbx
movq -0x8(%rbx), %rax
leaq 0x1b8(%rsp), %rdi
movq %rax, -0x8(%rdi)
pushq $0x9
popq %rcx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x220(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
leaq 0x300(%rsp), %rdx
callq 0x11523
xorps %xmm0, %xmm0
leaq 0x1b0(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x220(%rsp), %rdi
callq 0x113b4
movq 0x20(%rsp), %rax
leaq 0x308(%rsp), %rdi
movq %rax, -0x8(%rdi)
pushq $0x9
popq %rcx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x1b0(%rsp), %rdi
leaq 0x300(%rsp), %rsi
leaq 0x140(%rsp), %rdx
callq 0x11587
xorps %xmm0, %xmm0
leaq 0x300(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x1b0(%rsp), %rdi
callq 0x114f3
movq 0x20(%rsp), %rax
leaq 0x148(%rsp), %rdi
movq %rax, -0x8(%rdi)
pushq $0x9
popq %rcx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x300(%rsp), %rdi
leaq 0x140(%rsp), %rsi
leaq 0x5d0(%rsp), %rdx
callq 0x115eb
xorps %xmm0, %xmm0
leaq 0x140(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x220(%rsp), %rdi
callq 0x113b4
movq 0x20(%rsp), %rax
leaq 0x5d8(%rsp), %rdi
movq %rax, -0x8(%rdi)
pushq $0x9
popq %rcx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x140(%rsp), %rdi
leaq 0x5d0(%rsp), %rsi
leaq 0x7(%rsp), %rdx
callq 0x1164f
xorps %xmm0, %xmm0
leaq 0x5d0(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x140(%rsp), %rdi
callq 0x114f3
leaq 0x140(%rsp), %rdi
callq 0x116b4
leaq 0x300(%rsp), %rdi
callq 0x10d02
leaq 0x1b0(%rsp), %rdi
callq 0x116b4
leaq 0x220(%rsp), %rdi
callq 0x10d02
leaq 0x290(%rsp), %rdi
callq 0x116b4
leaq 0x70(%rsp), %rdi
callq 0x10d02
leaq 0x440(%rsp), %rdi
callq 0x69c2
leaq 0xd8(%rsp), %rdi
callq 0x69c2
leaq 0x620(%rsp), %rdi
callq 0x10d02
leaq 0x3d8(%rsp), %rdi
callq 0x10d02
leaq 0x370(%rsp), %rdi
callq 0x69c2
leaq 0x8(%rsp), %rdi
callq 0x10d02
addq $0x688, %rsp            # imm = 0x688
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x116b4
jmp 0xe00f
jmp 0xe00c
movq %rax, %rbx
leaq 0x300(%rsp), %rdi
callq 0x10d02
jmp 0xe023
jmp 0xe020
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
callq 0x116b4
jmp 0xe037
jmp 0xe034
movq %rax, %rbx
leaq 0x220(%rsp), %rdi
callq 0x10d02
jmp 0xe04b
jmp 0xe048
movq %rax, %rbx
leaq 0x290(%rsp), %rdi
callq 0x116b4
leaq 0x70(%rsp), %rdi
callq 0x10d02
jmp 0xe072
jmp 0xe066
movq %rax, %rbx
jmp 0xe058
jmp 0xe06f
jmp 0xe06f
movq %rax, %rbx
leaq 0x440(%rsp), %rdi
callq 0x69c2
jmp 0xe0d4
jmp 0xe0a6
jmp 0xe0a6
jmp 0xe0a6
jmp 0xe08d
jmp 0xe08d
jmp 0xe08d
movq %rax, %rbx
jmp 0xe100
jmp 0xe096
jmp 0xe096
movq %rax, %rbx
jmp 0xe10d
jmp 0xe09f
jmp 0xe09f
movq %rax, %rbx
jmp 0xe11a
jmp 0xe0b5
movq %rax, %rbx
jmp 0xe0d4
movq %rax, %rbx
jmp 0xe0ca
movq %rax, %rbx
jmp 0xe0f3
movq %rax, %rbx
jmp 0xe127
movq %rax, %rbx
leaq 0x440(%rsp), %rdi
callq 0x68d4
leaq 0x70(%rsp), %rdi
callq 0x2090
leaq 0xd8(%rsp), %rdi
callq 0x69c2
jmp 0xe100
movq %rax, %rbx
leaq 0x440(%rsp), %rdi
callq 0x68d4
leaq 0xd8(%rsp), %rdi
callq 0x2090
leaq 0x620(%rsp), %rdi
callq 0x10d02
leaq 0x3d8(%rsp), %rdi
callq 0x10d02
leaq 0x370(%rsp), %rdi
callq 0x69c2
leaq 0x8(%rsp), %rdi
callq 0x10d02
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba