// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x580, %rsp            # imm = 0x580
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
movq $-0x1, %r12
leaq 0xd0(%rsp), %rbx
movq %r12, (%rbx)
movl $0xa, %r13d
movq %r13, 0x8(%rbx)
movq $0x1, 0x10(%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0xd133
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %r14
movups %xmm0, 0x8(%r14)
movq $0x0, 0x18(%r14)
movq $0x2, 0x20(%r14)
movq $0x5, 0x28(%r14)
movq $0x64, 0x30(%r14)
movq %r12, 0x38(%r14)
movq %r13, 0x40(%r14)
movq %r14, %rdi
callq 0x1c6ce
movq %r14, %rdi
callq 0x1c796
movups 0x38(%r14), %xmm0
movaps %xmm0, 0xc0(%rsp)
movq 0x20(%r14), %r12
movq 0x28(%r14), %r14
movq %r12, (%rbx)
movq %r14, 0x8(%rbx)
movq %r15, 0x10(%rbx)
leaq 0xd0(%rsp), %rsi
movl $0x1, %edi
callq 0xd133
leaq 0x20(%rsp), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq $0x0, 0x18(%rdi)
movq %r12, 0x20(%rdi)
movq %r14, 0x28(%rdi)
movaps 0xc0(%rsp), %xmm0
movups %xmm0, 0x38(%rdi)
movq %r15, 0x48(%rdi)
callq 0x1d2aa
leaq 0x20(%rsp), %rdi
callq 0x1d372
movq 0xa8(%rsp), %rbx
movq 0x58(%rsp), %r15
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x94380(%rip), %rsi     # 0xa4cf3
leaq 0x943a1(%rip), %rdx     # 0xa4d1b
movq %rsp, %rdi
callq 0xd14c
xorl %esi, %esi
cmpq %r15, %rbx
sete %sil
leaq 0xd0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf80
leaq 0x92ce2(%rip), %rsi     # 0xa3684
leaq 0xd0(%rsp), %rdi
callq 0x18fba
leaq 0x94366(%rip), %rsi     # 0xa4d1c
movq %rax, %rdi
callq 0x191ea
leaq 0x96891(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x109ed
movq 0xa8(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x92c90(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x94306(%rip), %rsi     # 0xa4d09
movq %rax, %rdi
callq 0x191ea
leaq 0x96844(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x10a37
movq 0x58(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0xa985b(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xd0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x10a69
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0xb0(%rsp), %rbx
movq 0x60(%rsp), %r15
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x942ac(%rip), %rsi     # 0xa4d2f
leaq 0x942d3(%rip), %rdx     # 0xa4d5d
callq 0xd14c
xorl %esi, %esi
cmpq %r15, %rbx
sete %sil
leaq 0xd0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf80
leaq 0x92bd5(%rip), %rsi     # 0xa3684
leaq 0xd0(%rsp), %rdi
callq 0x18fba
leaq 0x9429b(%rip), %rsi     # 0xa4d5e
movq %rax, %rdi
callq 0x19222
leaq 0x96784(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x10afa
movq 0xb0(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x92b83(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x94238(%rip), %rsi     # 0xa4d48
movq %rax, %rdi
callq 0x19222
leaq 0x96737(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x10b44
movq 0x60(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0xa974e(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xd0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x10b76
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x90(%rsp), %rbx
movq 0x40(%rsp), %r15
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x941e4(%rip), %rsi     # 0xa4d74
leaq 0x94205(%rip), %rdx     # 0xa4d9c
callq 0xd14c
xorl %esi, %esi
cmpq %r15, %rbx
sete %sil
leaq 0xd0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf80
leaq 0x92ac8(%rip), %rsi     # 0xa3684
leaq 0xd0(%rsp), %rdi
callq 0x18fba
leaq 0x941cd(%rip), %rsi     # 0xa4d9d
movq %rax, %rdi
callq 0x191ea
leaq 0x96677(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x10c07
movq 0x90(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x92a76(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x9416d(%rip), %rsi     # 0xa4d8a
movq %rax, %rdi
callq 0x191ea
leaq 0x9662a(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x10c51
movq 0x40(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0xa9641(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xd0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x10c83
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x98(%rsp), %rbx
movq 0x48(%rsp), %r15
movq %rsp, %rdi
movq %r14, (%rdi)
leaq 0x94113(%rip), %rsi     # 0xa4db0
leaq 0x9413a(%rip), %rdx     # 0xa4dde
callq 0xd14c
xorl %esi, %esi
cmpq %r15, %rbx
sete %sil
leaq 0xd0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf80
leaq 0x929bb(%rip), %rsi     # 0xa3684
leaq 0xd0(%rsp), %rdi
callq 0x18fba
leaq 0x94102(%rip), %rsi     # 0xa4ddf
movq %rax, %rdi
callq 0x19222
leaq 0x9656a(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x10d14
movq 0x98(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x92969(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x9409f(%rip), %rsi     # 0xa4dc9
movq %rax, %rdi
callq 0x19222
leaq 0x9651d(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x10d5e
movq 0x48(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0xa9534(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xd0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x10d90
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0xb0(%rsp), %r15
movq 0x98(%rsp), %rbx
movq 0xa0(%rsp), %r12
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x9403a(%rip), %rsi     # 0xa4df5
leaq 0x94044(%rip), %rdx     # 0xa4e06
leaq 0xd0(%rsp), %rdi
callq 0xd14c
movq %r12, %rax
negq %rax
cmovsq %r12, %rax
leaq -0x1(%rbx), %rcx
imulq %rax, %rcx
leaq (%r15,%rcx), %rax
decq %rax
testq %rax, %rax
movq $-0x1, %rcx
cmovnsq %rax, %rcx
incq %rcx
imulq %r15, %rbx
xorl %eax, %eax
testq %rbx, %rbx
cmovgq %rbx, %rax
xorl %esi, %esi
cmpq %rax, %rcx
seta %sil
leaq 0x3f0(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
callq 0xbf80
leaq 0x3f0(%rsp), %rdi
callq 0xbfd8
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x10e4e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x48(%rsp), %rbx
movq 0x60(%rsp), %r15
movq 0x68(%rsp), %r12
leaq 0xd0(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x93f98(%rip), %rsi     # 0xa4e07
leaq 0x93fa1(%rip), %rdx     # 0xa4e17
callq 0xd14c
movq %r12, %rax
negq %rax
cmovsq %r12, %rax
leaq -0x1(%r15), %rcx
imulq %rax, %rcx
leaq (%rbx,%rcx), %rax
decq %rax
testq %rax, %rax
movq $-0x1, %rcx
cmovnsq %rax, %rcx
incq %rcx
imulq %r15, %rbx
xorl %eax, %eax
testq %rbx, %rbx
cmovgq %rbx, %rax
xorl %esi, %esi
cmpq %rax, %rcx
setbe %sil
leaq 0x260(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
callq 0xbf80
leaq 0x260(%rsp), %rdi
callq 0xbfd8
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x10efa
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
callq 0x1d762
leaq 0x70(%rsp), %rdi
callq 0x1d1c4
addq $0x580, %rsp            # imm = 0x580
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x10ff3
jmp 0x10ff3
jmp 0x10f33
jmp 0x10f33
jmp 0x10f33
jmp 0x10f33
jmp 0x10f33
movq %rax, %rbx
jmp 0x10fd3
jmp 0x10f77
jmp 0x10f89
jmp 0x10f9b
jmp 0x10fad
jmp 0x10f45
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x10fd3
movq 0xe0(%rsp), %rsi
jmp 0x10fcb
jmp 0x10f65
jmp 0x10f65
jmp 0x10f65
movq %rax, %rbx
jmp 0x10fbd
jmp 0x10f77
jmp 0x10f89
jmp 0x10f9b
jmp 0x10fad
movq %rax, %rbx
jmp 0x10fdd
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xbfd8
jmp 0x10fbd
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xbfd8
jmp 0x10fbd
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xbfd8
jmp 0x10fbd
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x10fd3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
callq 0x1d762
leaq 0x70(%rsp), %rdi
callq 0x1d1c4
movq %rbx, %rdi
callq 0x2300
jmp 0x10ff3
jmp 0x10ff3
movq %rax, %rdi
callq 0xc0a9