// File: dsharlet[P]array/test/array.cpp
// Function: nda::test_array_equality_body()
TEST(array_equality) {
  array_of_rank<int, 3> a({4, 5, 6});
  fill_pattern(a);
  array_of_rank<int, 3> b({4, 5, 6});
  fill_pattern(b);
  array_of_rank<int, 3> c({dim<>(0, 4, 2), 5, 6});
  fill_pattern(c);

  ASSERT(a == b);

  // Arrays with different strides are not equal by operator!=,
  // but equal ignores strides.
  ASSERT(a != c);
  ASSERT(equal(a, c));

  a(1, 2, 3) = 5;
  ASSERT(a != b);
  ASSERT(a != c);
  ASSERT(!equal(a, c));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd20, %rsp            # imm = 0xD20
leaq -0xb0(%rbp), %rdi
movq %rdi, -0xc98(%rbp)
movl $0x4, %esi
movl $0x5, %edx
movl $0x6, %ecx
callq 0x34ec0
movq -0xc98(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0xc90(%rbp)
callq 0x34f10
movq -0xc90(%rbp), %rdi
xorl %esi, %esi
callq 0x34fb0
jmp 0x25954
leaq -0x170(%rbp), %rdi
movl $0x4, %esi
movl $0x5, %edx
movl $0x6, %ecx
callq 0x34ec0
jmp 0x25971
leaq -0x128(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x34f10
jmp 0x25986
leaq -0x128(%rbp), %rdi
xorl %esi, %esi
callq 0x34fb0
jmp 0x25996
xorl %eax, %eax
movl %eax, %esi
leaq -0x238(%rbp), %rdi
movl $0x4, %edx
movl $0x2, %ecx
callq 0x10c60
jmp 0x259b2
movq -0x228(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x238(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x220(%rbp), %rdi
movl $0x5, %esi
movl $0x6, %edx
callq 0x35aa0
jmp 0x259e2
leaq -0x1d8(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x34f10
jmp 0x259f7
leaq -0x1d8(%rbp), %rdi
xorl %esi, %esi
callq 0x34fb0
jmp 0x25a07
leaq -0x68(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x34fe0
movb %al, -0xc99(%rbp)
jmp 0x25a1f
leaq -0x3e9(%rbp), %rdi
movq %rdi, -0xca8(%rbp)
callq 0x33b0
movq -0xca8(%rbp), %rdx
leaq 0x1b6657(%rip), %rsi    # 0x1dc097
leaq -0x3e8(%rbp), %rdi
callq 0x10a90
jmp 0x25a4e
movb -0xc99(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x3c8(%rbp), %rdi
leaq -0x3e8(%rbp), %rdx
callq 0x10f80
jmp 0x25a6f
leaq -0x3c8(%rbp), %rdi
callq 0x10ff0
jmp 0x25a7d
leaq -0x3e8(%rbp), %rdi
callq 0x3100
leaq -0x3e9(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x351a0
movb %al, -0xca9(%rbp)
jmp 0x25aad
leaq -0x5a1(%rbp), %rdi
movq %rdi, -0xcb8(%rbp)
callq 0x33b0
movq -0xcb8(%rbp), %rdx
leaq 0x1b88e0(%rip), %rsi    # 0x1de3ae
leaq -0x5a0(%rbp), %rdi
callq 0x10a90
jmp 0x25adc
movb -0xca9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x580(%rbp), %rdi
leaq -0x5a0(%rbp), %rdx
callq 0x10f80
jmp 0x25afd
leaq -0x580(%rbp), %rdi
callq 0x10ff0
jmp 0x25b0b
leaq -0x5a0(%rbp), %rdi
callq 0x3100
leaq -0x5a1(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x35af0
movb %al, -0xcb9(%rbp)
jmp 0x25b3b
leaq -0x759(%rbp), %rdi
movq %rdi, -0xcc8(%rbp)
callq 0x33b0
movq -0xcc8(%rbp), %rdx
leaq 0x1b89b4(%rip), %rsi    # 0x1de510
leaq -0x758(%rbp), %rdi
callq 0x10a90
jmp 0x25b6a
movb -0xcb9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x738(%rbp), %rdi
leaq -0x758(%rbp), %rdx
callq 0x10f80
jmp 0x25b8b
leaq -0x738(%rbp), %rdi
callq 0x10ff0
jmp 0x25b99
leaq -0x758(%rbp), %rdi
callq 0x3100
leaq -0x759(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
movl $0x3, %ecx
callq 0x35b40
movq %rax, -0xcd0(%rbp)
jmp 0x25bd2
movq -0xcd0(%rbp), %rax
movl $0x5, (%rax)
leaq -0x68(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x351a0
movb %al, -0xcd1(%rbp)
jmp 0x25bf7
leaq -0x911(%rbp), %rdi
movq %rdi, -0xce0(%rbp)
callq 0x33b0
movq -0xce0(%rbp), %rdx
leaq 0x1b88f0(%rip), %rsi    # 0x1de508
leaq -0x910(%rbp), %rdi
callq 0x10a90
jmp 0x25c26
movb -0xcd1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x8f0(%rbp), %rdi
leaq -0x910(%rbp), %rdx
callq 0x10f80
jmp 0x25c47
leaq -0x8f0(%rbp), %rdi
callq 0x10ff0
jmp 0x25c55
leaq -0x910(%rbp), %rdi
callq 0x3100
leaq -0x911(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x351a0
movb %al, -0xce1(%rbp)
jmp 0x25c85
leaq -0xac9(%rbp), %rdi
movq %rdi, -0xcf0(%rbp)
callq 0x33b0
movq -0xcf0(%rbp), %rdx
leaq 0x1b8708(%rip), %rsi    # 0x1de3ae
leaq -0xac8(%rbp), %rdi
callq 0x10a90
jmp 0x25cb4
movb -0xce1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0xaa8(%rbp), %rdi
leaq -0xac8(%rbp), %rdx
callq 0x10f80
jmp 0x25cd5
leaq -0xaa8(%rbp), %rdi
callq 0x10ff0
jmp 0x25ce3
leaq -0xac8(%rbp), %rdi
callq 0x3100
leaq -0xac9(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x35af0
movb %al, -0xcf1(%rbp)
jmp 0x25d13
movb -0xcf1(%rbp), %al
xorb $0x1, %al
movb %al, -0xd01(%rbp)
leaq -0xc81(%rbp), %rdi
movq %rdi, -0xd00(%rbp)
callq 0x33b0
movq -0xd00(%rbp), %rdx
leaq 0x1b87cd(%rip), %rsi    # 0x1de50f
leaq -0xc80(%rbp), %rdi
callq 0x10a90
jmp 0x25d50
movb -0xd01(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0xc60(%rbp), %rdi
leaq -0xc80(%rbp), %rdx
callq 0x10f80
jmp 0x25d71
leaq -0xc60(%rbp), %rdi
callq 0x10ff0
jmp 0x25d7f
leaq -0xc80(%rbp), %rdi
callq 0x3100
leaq -0xc81(%rbp), %rdi
callq 0x3290
leaq -0x1d8(%rbp), %rdi
callq 0x35160
leaq -0x128(%rbp), %rdi
callq 0x35160
leaq -0x68(%rbp), %rdi
callq 0x35160
addq $0xd20, %rsp            # imm = 0xD20
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x25fa5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x25f99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x25f8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x25e38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x3e8(%rbp), %rdi
callq 0x3100
leaq -0x3e9(%rbp), %rdi
callq 0x3290
jmp 0x25f8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x25e7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x5a0(%rbp), %rdi
callq 0x3100
leaq -0x5a1(%rbp), %rdi
callq 0x3290
jmp 0x25f8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x25ebe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x758(%rbp), %rdi
callq 0x3100
leaq -0x759(%rbp), %rdi
callq 0x3290
jmp 0x25f8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x25f01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x910(%rbp), %rdi
callq 0x3100
leaq -0x911(%rbp), %rdi
callq 0x3290
jmp 0x25f8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x25f41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xac8(%rbp), %rdi
callq 0x3100
leaq -0xac9(%rbp), %rdi
callq 0x3290
jmp 0x25f8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x25f81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xc80(%rbp), %rdi
callq 0x3100
leaq -0xc81(%rbp), %rdi
callq 0x3290
leaq -0x1d8(%rbp), %rdi
callq 0x35160
leaq -0x128(%rbp), %rdi
callq 0x35160
leaq -0x68(%rbp), %rdi
callq 0x35160
movq -0xb8(%rbp), %rdi
callq 0x33a0
nopw (%rax,%rax)