// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/shape.cpp
// Function: nda::test_shape_2d_negative_stride_body()
TEST(shape_2d_negative_stride) {
  dense_dim<> x(0, 10);
  dim<> y(0, 5, -x.extent());
  shape<dense_dim<>, dim<>> s(x, y);
  index_t flat_min = s[s.min()];
  index_t flat_max = flat_min;
  for (int i : y) {
    for (int j : x) {
      ASSERT_EQ(s(j, i), i * -x.extent() + j);
      flat_min = std::min(s(j, i), flat_min);
      flat_max = std::max(s(j, i), flat_max);
    }
  }
  ASSERT_EQ(s.size(), 50);
  ASSERT_EQ(s.flat_extent(), 50);
  ASSERT_EQ(s.flat_min(), flat_min);
  ASSERT_EQ(s.flat_max(), flat_max);

  shape_of_rank<3> s2(10, 5, {0, 3, -1});
  s2.resolve();
  ASSERT_EQ(s2.x().stride(), 3);
  ASSERT_EQ(s2.y().stride(), 30);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
leaq 0x88(%rsp), %rbp
movq $0x0, (%rbp)
movq $0xa, 0x8(%rbp)
movq $0x1, 0x10(%rbp)
movq $0x0, 0x78(%rsp)
xorl %edi, %edi
movq %rbp, %rsi
callq 0xd133
leaq 0x8(%rsp), %r12
xorl %r14d, %r14d
movq $0x0, 0x50(%rsp)
xorl %eax, %eax
movq %rax, 0x80(%rsp)
xorl %r13d, %r13d
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r12, %rdi
leaq 0x3b29d(%rip), %rsi     # 0xbe9ad
leaq 0x3b2b4(%rip), %rdx     # 0xbe9cb
callq 0xd14c
movq %rbp, %rdi
movl $0x1, %esi
movq %r12, %r15
movq %r12, %rdx
callq 0xbf80
movq %rbp, %rdi
leaq 0x1ff4b(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x3b244(%rip), %rsi     # 0xbe98c
callq 0x1909a
movq %rax, %rdi
leaq 0x23aff(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r12
movq %rbp, %rbx
movq 0x78(%rsp), %rax
leaq (%rax,%r13), %rbp
cmpb $0x1, 0x188(%r12)
jne 0x83785
movq %r12, %rdi
addq $0x10, %rdi
movq %rbp, %rsi
callq 0x21b0
movq %r12, %rdi
leaq 0x1fef5(%rip), %rsi     # 0xa3684
callq 0x18fba
movq %rax, %rdi
leaq 0x3b21a(%rip), %rsi     # 0xbe9b8
callq 0x1990c
movq %rax, %rdi
leaq 0x23aa9(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r12
cmpb $0x1, 0x188(%rax)
jne 0x837cd
movq %r12, %rdi
addq $0x10, %rdi
movq %rbp, %rsi
callq 0x21b0
movq %r12, %rdi
leaq 0x36ac2(%rip), %rsi     # 0xba299
callq 0x18fba
movq %rbx, %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x83800
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
cmpq %rbp, %r14
cmovgeq %rbp, %r14
movq 0x50(%rsp), %rax
cmpq %rax, %rbp
cmovgq %rbp, %rax
movq %rax, 0x50(%rsp)
incq %r13
cmpq $0xa, %r13
movq %r15, %r12
movq %rbx, %rbp
jne 0x836fc
movq 0x80(%rsp), %rax
incq %rax
addq $-0xa, 0x78(%rsp)
cmpq $0x5, %rax
jne 0x836f1
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x3b172(%rip), %rsi     # 0xbe9cc
leaq 0x3b179(%rip), %rdx     # 0xbe9da
callq 0xd14c
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x1fe00(%rip), %rsi     # 0xa3684
leaq 0x88(%rsp), %rdi
callq 0x18fba
leaq 0x3b078(%rip), %rsi     # 0xbe910
movq %rax, %rdi
callq 0x1a146
leaq 0x239af(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r15
cmpb $0x1, 0x188(%rax)
jne 0x838cc
movq %r15, %rdi
addq $0x10, %rdi
movl $0x32, %esi
callq 0x2110
leaq 0x1fdb1(%rip), %rsi     # 0xa3684
movq %r15, %rdi
callq 0x18fba
leaq 0x3b0f6(%rip), %rsi     # 0xbe9d8
movq %rax, %rdi
callq 0x1917a
leaq 0x23965(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r15
cmpb $0x1, 0x188(%rax)
jne 0x83916
movq %r15, %rdi
addq $0x10, %rdi
movl $0x32, %esi
callq 0x22f0
leaq 0x3697c(%rip), %rsi     # 0xba299
movq %r15, %rdi
callq 0x18fba
leaq 0x88(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8394e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x3b079(%rip), %rsi     # 0xbe9db
leaq 0x3b087(%rip), %rdx     # 0xbe9f0
callq 0xd14c
movq 0x50(%rsp), %rbx
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x1fcf3(%rip), %rsi     # 0xa3684
leaq 0x88(%rsp), %rdi
callq 0x18fba
leaq 0x3af4d(%rip), %rsi     # 0xbe8f2
movq %rax, %rdi
callq 0x4acaa
leaq 0x238a2(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r15
cmpb $0x1, 0x188(%rax)
jne 0x839d9
movq %r15, %rdi
addq $0x10, %rdi
movl $0x32, %esi
callq 0x2110
leaq 0x1fca4(%rip), %rsi     # 0xa3684
movq %r15, %rdi
callq 0x18fba
leaq 0x3afe9(%rip), %rsi     # 0xbe9d8
movq %rax, %rdi
callq 0x1917a
leaq 0x23858(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r15
cmpb $0x1, 0x188(%rax)
jne 0x83a23
movq %r15, %rdi
addq $0x10, %rdi
movl $0x32, %esi
callq 0x22f0
leaq 0x3686f(%rip), %rsi     # 0xba299
movq %r15, %rdi
callq 0x18fba
leaq 0x88(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x83a5b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x3af82(%rip), %rsi     # 0xbe9f1
leaq 0x3af93(%rip), %rdx     # 0xbea09
callq 0xd14c
xorl %esi, %esi
cmpq $-0x28, %r14
sete %sil
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xbf80
leaq 0x1fbe6(%rip), %rsi     # 0xa3684
leaq 0x88(%rsp), %rdi
callq 0x18fba
leaq 0x3af58(%rip), %rsi     # 0xbea0a
movq %rax, %rdi
callq 0x190d2
leaq 0x23795(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r15
cmpb $0x1, 0x188(%rax)
jne 0x83ae8
movq %r15, %rdi
addq $0x10, %rdi
movq $-0x28, %rsi
callq 0x21b0
leaq 0x1fb95(%rip), %rsi     # 0xa3684
movq %r15, %rdi
callq 0x18fba
leaq 0x3af03(%rip), %rsi     # 0xbea01
movq %rax, %rdi
callq 0x1a146
leaq 0x23749(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r15
cmpb $0x1, 0x188(%rax)
jne 0x83b30
movq %r15, %rdi
addq $0x10, %rdi
movq %r14, %rsi
callq 0x21b0
leaq 0x36762(%rip), %rsi     # 0xba299
movq %r15, %rdi
callq 0x18fba
leaq 0x88(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x83b68
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x3ae9b(%rip), %rsi     # 0xbea17
leaq 0x3aeac(%rip), %rdx     # 0xbea2f
callq 0xd14c
xorl %esi, %esi
cmpq $0x9, %rbx
sete %sil
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xbf80
leaq 0x1fad9(%rip), %rsi     # 0xa3684
leaq 0x88(%rsp), %rdi
callq 0x18fba
leaq 0x3ae71(%rip), %rsi     # 0xbea30
movq %rax, %rdi
callq 0x190d2
leaq 0x23688(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x83bf3
movq %r14, %rdi
addq $0x10, %rdi
movl $0x9, %esi
callq 0x21b0
leaq 0x1fa8a(%rip), %rsi     # 0xa3684
movq %r14, %rdi
callq 0x18fba
leaq 0x3ae1e(%rip), %rsi     # 0xbea27
movq %rax, %rdi
callq 0x1a146
leaq 0x2363e(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x83c3b
movq %r14, %rdi
addq $0x10, %rdi
movq %rbx, %rsi
callq 0x21b0
leaq 0x36657(%rip), %rsi     # 0xba299
movq %r14, %rdi
callq 0x18fba
leaq 0x88(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x83c73
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
xorl %eax, %eax
leaq 0x20(%rsp), %rdx
movq %rax, -0x18(%rdx)
movq $0x3, -0x10(%rdx)
movq $-0x1, -0x8(%rdx)
movq %rax, (%rdx)
movq $0x5, 0x8(%rdx)
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movq %rcx, 0x10(%rdx)
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
movq $0xa, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rbx, %rcx
callq 0x1a9f3
movq 0x40(%rbx), %rbx
leaq 0x68(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x3ad5e(%rip), %rsi     # 0xbea3d
leaq 0x3ad6b(%rip), %rdx     # 0xbea51
leaq 0x58(%rsp), %rdi
callq 0xd14c
xorl %esi, %esi
cmpq $0x3, %rbx
sete %sil
leaq 0x88(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0xbf80
leaq 0x1f971(%rip), %rsi     # 0xa3684
leaq 0x88(%rsp), %rdi
callq 0x18fba
leaq 0x3ad2b(%rip), %rsi     # 0xbea52
movq %rax, %rdi
callq 0x4acaa
leaq 0x23520(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x83d5b
movq 0x48(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x1f922(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x29be8(%rip), %rsi     # 0xad959
movq %rax, %rdi
callq 0x18fba
leaq 0x234d6(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x83da5
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x3, %esi
callq 0x22f0
leaq 0x364ed(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0x88(%rsp), %rdi
callq 0xbfd8
movq 0x58(%rsp), %rdi
cmpq %r14, %rdi
je 0x83dd8
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x30(%rsp), %rbx
leaq 0x58(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x3ac76(%rip), %rsi     # 0xbea62
leaq 0x3ac84(%rip), %rdx     # 0xbea77
callq 0xd14c
xorl %esi, %esi
cmpq $0x1e, %rbx
sete %sil
leaq 0x88(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0xbf80
leaq 0x1f869(%rip), %rsi     # 0xa3684
leaq 0x88(%rsp), %rdi
callq 0x18fba
leaq 0x3ac49(%rip), %rsi     # 0xbea78
movq %rax, %rdi
callq 0x4acaa
leaq 0x23418(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x83e63
movq 0x30(%rsp), %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x21b0
leaq 0x1f81a(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x3abfc(%rip), %rsi     # 0xbea75
movq %rax, %rdi
callq 0x1917a
leaq 0x233ce(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x83ead
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x1e, %esi
callq 0x22f0
leaq 0x363e5(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0x88(%rsp), %rdi
callq 0xbfd8
movq 0x58(%rsp), %rdi
cmpq %r14, %rdi
je 0x83ee0
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21f0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x83fbe
jmp 0x83fbe
jmp 0x83fbe
jmp 0x83fbe
jmp 0x83fbe
jmp 0x83fbe
jmp 0x83f3f
jmp 0x83f51
jmp 0x83f76
jmp 0x83f88
jmp 0x83f1a
movq %rax, %rbx
jmp 0x83f61
jmp 0x83fc5
jmp 0x83fc5
jmp 0x83fc5
jmp 0x83fc5
jmp 0x83f3f
jmp 0x83f51
jmp 0x83f9a
jmp 0x83fac
jmp 0x83f76
jmp 0x83f88
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbfd8
jmp 0x83f61
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbfd8
movq 0x58(%rsp), %rdi
cmpq %r14, %rdi
je 0x83ff8
movq 0x68(%rsp), %rsi
jmp 0x83ff0
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbfd8
jmp 0x83fdc
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbfd8
jmp 0x83fdc
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbfd8
jmp 0x83fdc
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbfd8
jmp 0x83fdc
movq %rax, %rbx
jmp 0x83ff8
jmp 0x83fcc
movq %rax, %rbx
jmp 0x83fdc
jmp 0x83fcc
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x83ff8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9