// File: /workspace/github_cpp_makefile_star2_O2/dsharlet[P]array/test/array.cpp
// Function: nda::test_array_construct_from_bounds_body()
TEST(array_construct_from_bounds) {
  // Illustrate creating an array from incompatible compile-time
  // shapes using bounds().
  using SrcShape = shape<dense_dim<>, dim<>>;
  using DstShape = shape<dim<>, dense_dim<>>;  // dense_dim is swapped.

  SrcShape src_shape({-1, 10}, {2, 5, /*stride =*/100});
  auto src = array<int, SrcShape>(src_shape);
  auto dst = array<int, DstShape>(src.bounds());

  // min and extent are preserved.
  ASSERT_EQ(src.dim<0>().min(), dst.dim<0>().min());
  ASSERT_EQ(src.dim<0>().extent(), dst.dim<0>().extent());
  ASSERT_EQ(src.dim<1>().min(), dst.dim<1>().min());
  ASSERT_EQ(src.dim<1>().extent(), dst.dim<1>().extent());
  // Ensure that `dst` did not inherit the strides of its parent and is
  // created compact.
  ASSERT(!src.is_compact());
  ASSERT(dst.is_compact());
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x5d8, %rsp            # imm = 0x5D8
leaq 0xf8(%rsp), %rsi
orq $-0x1, (%rsi)
movq $0xa, 0x8(%rsi)
leaq 0x58(%rsp), %rdx
movq $0x2, (%rdx)
movq $0x5, 0x8(%rdx)
movq $0x64, 0x10(%rdx)
leaq 0x288(%rsp), %rbx
movq %rbx, %rdi
callq 0x1091e
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10768
movups 0x20(%r14), %xmm0
movups 0x38(%r14), %xmm1
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x10(%rsi)
movups %xmm1, 0x18(%rsi)
movq %rax, 0x28(%rsi)
leaq 0xf8(%rsp), %rdi
callq 0x10974
leaq 0xa8(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x10998
movq 0x90(%rsp), %rbx
movq 0xe0(%rsp), %r14
leaq 0x83f4c(%rip), %rsi     # 0x8efc4
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq %r14, %rbx
sete %sil
leaq 0xf8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x6894
leaq 0x8259e(%rip), %rsi     # 0x8d647
leaq 0xf8(%rsp), %rdi
callq 0x106fe
leaq 0x83f30(%rip), %rsi     # 0x8efed
movq %rax, %rdi
callq 0x109ce
leaq 0x86526(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x90(%rsp), %rcx
leaq 0x18(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x82554(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x83ed8(%rip), %rsi     # 0x8efda
movq %rax, %rdi
callq 0x109ce
leaq 0x864e1(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0xe0(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x9a16a(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xf8(%rsp), %rdi
callq 0x68d4
leaq 0x20(%rsp), %rdi
callq 0x2090
movq 0x98(%rsp), %rbx
movq 0xe8(%rsp), %r14
leaq 0x83e92(%rip), %rsi     # 0x8f000
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq %r14, %rbx
sete %sil
leaq 0xf8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x6894
leaq 0x824a8(%rip), %rsi     # 0x8d647
leaq 0xf8(%rsp), %rdi
callq 0x106fe
leaq 0x83e7c(%rip), %rsi     # 0x8f02f
movq %rax, %rdi
callq 0x109ea
leaq 0x86430(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x98(%rsp), %rcx
leaq 0x18(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x8245e(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x83e21(%rip), %rsi     # 0x8f019
movq %rax, %rdi
callq 0x109ea
leaq 0x863eb(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0xe8(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x9a074(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xf8(%rsp), %rdi
callq 0x68d4
leaq 0x20(%rsp), %rdi
callq 0x2090
movq 0x78(%rsp), %rbx
movq 0xc8(%rsp), %r14
leaq 0x83de4(%rip), %rsi     # 0x8f045
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq %r14, %rbx
sete %sil
leaq 0xf8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x6894
leaq 0x823b5(%rip), %rsi     # 0x8d647
leaq 0xf8(%rsp), %rdi
callq 0x106fe
leaq 0x83dc8(%rip), %rsi     # 0x8f06e
movq %rax, %rdi
callq 0x109ce
leaq 0x8633d(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x78(%rsp), %rcx
leaq 0x18(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x8236e(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x83d73(%rip), %rsi     # 0x8f05b
movq %rax, %rdi
callq 0x109ce
leaq 0x862fb(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0xc8(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x99f84(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xf8(%rsp), %rdi
callq 0x68d4
leaq 0x20(%rsp), %rdi
callq 0x2090
movq 0x80(%rsp), %rbx
movq 0xd0(%rsp), %r14
leaq 0x83d2d(%rip), %rsi     # 0x8f081
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq %r14, %rbx
sete %sil
leaq 0xf8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x6894
leaq 0x822c2(%rip), %rsi     # 0x8d647
leaq 0xf8(%rsp), %rdi
callq 0x106fe
leaq 0x83d17(%rip), %rsi     # 0x8f0b0
movq %rax, %rdi
callq 0x109ea
leaq 0x8624a(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x80(%rsp), %rcx
leaq 0x18(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x82278(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x83cbc(%rip), %rsi     # 0x8f09a
movq %rax, %rdi
callq 0x109ea
leaq 0x86205(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0xd0(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x99e8e(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xf8(%rsp), %rdi
callq 0x68d4
leaq 0x78(%rsp), %rbx
leaq 0x20(%rsp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x14c4a
movl %eax, %ebx
leaq 0x83c7d(%rip), %rsi     # 0x8f0c6
leaq 0xf8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x66a0
xorb $0x1, %bl
movzbl %bl, %esi
leaq 0x448(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0x6894
leaq 0x448(%rsp), %rdi
callq 0x68d4
leaq 0xc8(%rsp), %rbx
leaq 0xf8(%rsp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x14c6e
movl %eax, %ebx
leaq 0x83c2f(%rip), %rsi     # 0x8f0d8
leaq 0xf8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x66a0
movzbl %bl, %esi
leaq 0x2b8(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0x6894
leaq 0x2b8(%rsp), %rdi
callq 0x68d4
leaq 0xf8(%rsp), %rdi
callq 0x2090
leaq 0xa8(%rsp), %rdi
callq 0x10a06
leaq 0x58(%rsp), %rdi
callq 0x108fe
addq $0x5d8, %rsp            # imm = 0x5D8
popq %rbx
popq %r14
retq
jmp 0xb52a
jmp 0xb52a
jmp 0xb52a
jmp 0xb52a
jmp 0xb52a
jmp 0xb52a
jmp 0xb51d
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0xb59a
movq %rax, %rbx
jmp 0xb59f
jmp 0xb54f
jmp 0xb53d
jmp 0xb561
jmp 0xb53d
jmp 0xb573
jmp 0xb53d
jmp 0xb585
movq %rax, %rbx
jmp 0xb595
movq %rax, %rbx
jmp 0xb5ac
jmp 0xb54f
jmp 0xb561
jmp 0xb573
jmp 0xb585
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x68d4
jmp 0xb595
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x68d4
jmp 0xb595
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x68d4
jmp 0xb595
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x68d4
leaq 0x20(%rsp), %rdi
callq 0x2090
leaq 0xa8(%rsp), %rdi
callq 0x10a06
leaq 0x58(%rsp), %rdi
callq 0x108fe
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba