// File: dsharlet[P]array/test/array.cpp
// Function: nda::test_array_dense_copy_body()
TEST(array_dense_copy) {
  array_of_rank<int, 3> source({dim<>(-3, 4, 2), 5, 6});
  fill_pattern(source);
  ASSERT(!source.is_compact());

  dense_array<int, 3> dense_copy = make_compact_copy(source);
  ASSERT(dense_copy.is_compact());
  check_pattern(dense_copy);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x530, %rsp            # imm = 0x530
leaq -0xc8(%rbp), %rdi
movq $-0x3, %rsi
movl $0x4, %edx
movl $0x2, %ecx
callq 0x10c60
movq -0xb8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0xc8(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
movl $0x5, %esi
movl $0x6, %edx
callq 0x35aa0
movq -0x4e0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x4d8(%rbp)
callq 0x34f10
movq -0x4d8(%rbp), %rdi
xorl %esi, %esi
callq 0x34fb0
jmp 0x276e4
leaq -0x68(%rbp), %rdi
callq 0x36470
movb %al, -0x4e1(%rbp)
jmp 0x276f5
movb -0x4e1(%rbp), %al
xorb $0x1, %al
movb %al, -0x4f1(%rbp)
leaq -0x289(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0x33b0
movq -0x4f0(%rbp), %rdx
leaq 0x1b6e61(%rip), %rsi    # 0x1de585
leaq -0x288(%rbp), %rdi
callq 0x10a90
jmp 0x27732
movb -0x4f1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x268(%rbp), %rdi
leaq -0x288(%rbp), %rdx
callq 0x10f80
jmp 0x27753
leaq -0x268(%rbp), %rdi
callq 0x10ff0
jmp 0x27761
leaq -0x288(%rbp), %rdi
callq 0x3100
leaq -0x289(%rbp), %rdi
callq 0x3290
leaq -0x2f9(%rbp), %rdi
movq %rdi, -0x500(%rbp)
callq 0x10e30
movq -0x500(%rbp), %rdx
leaq -0x2f8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x364a0
jmp 0x277a5
leaq -0x2f9(%rbp), %rdi
callq 0x10e50
leaq -0x2f8(%rbp), %rdi
callq 0x364f0
movb %al, -0x501(%rbp)
jmp 0x277c5
leaq -0x4b1(%rbp), %rdi
movq %rdi, -0x510(%rbp)
callq 0x33b0
movq -0x510(%rbp), %rdx
leaq 0x1b6db4(%rip), %rsi    # 0x1de59a
leaq -0x4b0(%rbp), %rdi
callq 0x10a90
jmp 0x277f4
movb -0x501(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x490(%rbp), %rdi
leaq -0x4b0(%rbp), %rdx
callq 0x10f80
jmp 0x27815
leaq -0x490(%rbp), %rdi
callq 0x10ff0
jmp 0x27823
leaq -0x4b0(%rbp), %rdi
callq 0x3100
leaq -0x4b1(%rbp), %rdi
callq 0x3290
leaq -0x4d0(%rbp), %rdi
movq %rdi, -0x518(%rbp)
callq 0x35c10
movq -0x518(%rbp), %rsi
leaq -0x2f8(%rbp), %rdi
callq 0x35be0
jmp 0x27863
leaq -0x2f8(%rbp), %rdi
callq 0x11110
leaq -0x68(%rbp), %rdi
callq 0x35160
addq $0x530, %rsp            # imm = 0x530
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x27956
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x278ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x3100
leaq -0x289(%rbp), %rdi
callq 0x3290
jmp 0x27956
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x2f9(%rbp), %rdi
callq 0x10e50
jmp 0x27956
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x2794a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x2793e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x4b0(%rbp), %rdi
callq 0x3100
leaq -0x4b1(%rbp), %rdi
callq 0x3290
leaq -0x2f8(%rbp), %rdi
callq 0x11110
leaq -0x68(%rbp), %rdi
callq 0x35160
movq -0xd0(%rbp), %rdi
callq 0x33a0
nopl (%rax,%rax)