// File: dsharlet[P]array/test/shape.cpp
// Function: nda::test_auto_strides_body()
TEST(auto_strides) {
  check_resolved_strides<1>({{3, 5, unresolved}}, {1});
  check_resolved_strides<2>({5, 10}, {1, 5});

  // Stride one dimensions mixed in with extent 1 dimensions.
  check_resolved_strides<3>({1, 1, {0, 2, 1}}, {2, 2, 1});
  check_resolved_strides<3>({1, {0, 2, 1}, 1}, {2, 1, 2});
  check_resolved_strides<3>({1, 10, {0, 2, 1}}, {2, 2, 1});
  check_resolved_strides<3>({5, {0, 2, 1}, 1}, {2, 1, 10});

  // Interleaved with row stride.
  check_resolved_strides<3>({5, {0, 4, 20}, {0, 3, 1}}, {3, 20, 1});

  // Interleaved with row stride dense.
  check_resolved_strides<3>({5, {0, 4, 15}, {0, 3, 1}}, {3, 15, 1});

  // Interleaved with row stride oops.
  check_resolved_strides<3>({5, {0, 4, 14}, {0, 3, 1}}, {56, 14, 1});

  test_auto_strides<1>();
  test_auto_strides<2>();
  test_auto_strides<3>();
  test_auto_strides<4>();
  test_auto_strides<5>();
  test_auto_strides<6>();
  test_auto_strides<7>();
  test_auto_strides<8>();
  test_auto_strides<9>();
  test_auto_strides<10>();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x840, %rsp            # imm = 0x840
leaq -0x30(%rbp), %rdi
movq %rdi, -0x718(%rbp)
movl $0x3, %esi
movl $0x5, %edx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
callq 0x10c60
movq -0x718(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x367c0
movq $0x1, -0x60(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x1, -0x50(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x710(%rbp)
callq 0x18a530
movq -0x710(%rbp), %rcx
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x18a550
jmp 0x17cc21
leaq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x18a230
jmp 0x17cc30
leaq -0x48(%rbp), %rdi
callq 0x18a5d0
leaq -0x61(%rbp), %rdi
callq 0x18a630
leaq -0xa8(%rbp), %rdi
movl $0x5, %esi
movl $0xa, %edx
callq 0x11150
movq $0x1, -0xe0(%rbp)
movq $0x5, -0xd8(%rbp)
leaq -0xe0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq $0x2, -0xc8(%rbp)
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x720(%rbp)
callq 0x18a530
movq -0x720(%rbp), %rcx
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x18a550
jmp 0x17ccbd
leaq -0xa8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x18a650
jmp 0x17ccd2
leaq -0xc0(%rbp), %rdi
callq 0x18a5d0
leaq -0xe1(%rbp), %rdi
callq 0x18a630
leaq -0x148(%rbp), %rdi
movq %rdi, -0x740(%rbp)
movl $0x1, %esi
movq %rsi, -0x748(%rbp)
callq 0x10c20
movq -0x748(%rbp), %rsi
leaq -0x160(%rbp), %rdi
movq %rdi, -0x738(%rbp)
callq 0x10c20
movq -0x748(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x178(%rbp), %rdi
movq %rdi, -0x730(%rbp)
movl $0x2, %edx
callq 0x10c60
movq -0x740(%rbp), %rsi
movq -0x738(%rbp), %rdx
movq -0x730(%rbp), %rcx
leaq -0x130(%rbp), %rdi
callq 0x36640
movups 0x80032(%rip), %xmm0    # 0x1fcda0
movaps %xmm0, -0x1c0(%rbp)
movq $0x1, -0x1b0(%rbp)
leaq -0x1c0(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq $0x3, -0x198(%rbp)
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x728(%rbp)
callq 0x18a530
movq -0x728(%rbp), %rcx
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdx
leaq -0x190(%rbp), %rdi
callq 0x18a550
jmp 0x17cdcf
leaq -0x130(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x18a950
jmp 0x17cde4
leaq -0x190(%rbp), %rdi
callq 0x18a5d0
leaq -0x1c1(%rbp), %rdi
callq 0x18a630
leaq -0x228(%rbp), %rdi
movq %rdi, -0x768(%rbp)
movl $0x1, %esi
movq %rsi, -0x770(%rbp)
callq 0x10c20
movq -0x770(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x240(%rbp), %rdi
movq %rdi, -0x760(%rbp)
movl $0x2, %edx
callq 0x10c60
movq -0x770(%rbp), %rsi
leaq -0x258(%rbp), %rdi
movq %rdi, -0x758(%rbp)
callq 0x10c20
movq -0x768(%rbp), %rsi
movq -0x760(%rbp), %rdx
movq -0x758(%rbp), %rcx
leaq -0x210(%rbp), %rdi
callq 0x36640
movups 0x7ff38(%rip), %xmm0    # 0x1fcdb8
movaps %xmm0, -0x2a0(%rbp)
movq $0x2, -0x290(%rbp)
leaq -0x2a0(%rbp), %rax
movq %rax, -0x280(%rbp)
movq $0x3, -0x278(%rbp)
leaq -0x2a1(%rbp), %rdi
movq %rdi, -0x750(%rbp)
callq 0x18a530
movq -0x750(%rbp), %rcx
movq -0x280(%rbp), %rsi
movq -0x278(%rbp), %rdx
leaq -0x270(%rbp), %rdi
callq 0x18a550
jmp 0x17cee1
leaq -0x210(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x18a950
jmp 0x17cef6
leaq -0x270(%rbp), %rdi
callq 0x18a5d0
leaq -0x2a1(%rbp), %rdi
callq 0x18a630
leaq -0x308(%rbp), %rdi
movq %rdi, -0x790(%rbp)
movl $0x1, %esi
movq %rsi, -0x798(%rbp)
callq 0x10c20
leaq -0x320(%rbp), %rdi
movq %rdi, -0x788(%rbp)
movl $0xa, %esi
callq 0x10c20
movq -0x798(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x338(%rbp), %rdi
movq %rdi, -0x780(%rbp)
movl $0x2, %edx
callq 0x10c60
movq -0x790(%rbp), %rsi
movq -0x788(%rbp), %rdx
movq -0x780(%rbp), %rcx
leaq -0x2f0(%rbp), %rdi
callq 0x36640
movups 0x7fe40(%rip), %xmm0    # 0x1fcdd0
movaps %xmm0, -0x380(%rbp)
movq $0x1, -0x370(%rbp)
leaq -0x380(%rbp), %rax
movq %rax, -0x360(%rbp)
movq $0x3, -0x358(%rbp)
leaq -0x381(%rbp), %rdi
movq %rdi, -0x778(%rbp)
callq 0x18a530
movq -0x778(%rbp), %rcx
movq -0x360(%rbp), %rsi
movq -0x358(%rbp), %rdx
leaq -0x350(%rbp), %rdi
callq 0x18a550
jmp 0x17cff1
leaq -0x2f0(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x18a950
jmp 0x17d006
leaq -0x350(%rbp), %rdi
callq 0x18a5d0
leaq -0x381(%rbp), %rdi
callq 0x18a630
leaq -0x3e8(%rbp), %rdi
movq %rdi, -0x7b8(%rbp)
movl $0x5, %esi
callq 0x10c20
xorl %eax, %eax
movl %eax, %esi
leaq -0x400(%rbp), %rdi
movq %rdi, -0x7b0(%rbp)
movl $0x2, %edx
movl $0x1, %ecx
movq %rcx, -0x7c0(%rbp)
callq 0x10c60
movq -0x7c0(%rbp), %rsi
leaq -0x418(%rbp), %rdi
movq %rdi, -0x7a8(%rbp)
callq 0x10c20
movq -0x7b8(%rbp), %rsi
movq -0x7b0(%rbp), %rdx
movq -0x7a8(%rbp), %rcx
leaq -0x3d0(%rbp), %rdi
callq 0x36640
movups 0x7fd48(%rip), %xmm0    # 0x1fcde8
movaps %xmm0, -0x460(%rbp)
movq $0xa, -0x450(%rbp)
leaq -0x460(%rbp), %rax
movq %rax, -0x440(%rbp)
movq $0x3, -0x438(%rbp)
leaq -0x461(%rbp), %rdi
movq %rdi, -0x7a0(%rbp)
callq 0x18a530
movq -0x7a0(%rbp), %rcx
movq -0x440(%rbp), %rsi
movq -0x438(%rbp), %rdx
leaq -0x430(%rbp), %rdi
callq 0x18a550
jmp 0x17d101
leaq -0x3d0(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x18a950
jmp 0x17d116
leaq -0x430(%rbp), %rdi
callq 0x18a5d0
leaq -0x461(%rbp), %rdi
callq 0x18a630
leaq -0x4c8(%rbp), %rdi
movq %rdi, -0x7e0(%rbp)
movl $0x5, %esi
callq 0x10c20
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x7e8(%rbp)
leaq -0x4e0(%rbp), %rdi
movq %rdi, -0x7d8(%rbp)
movl $0x4, %edx
movl $0x14, %ecx
callq 0x10c60
movq -0x7e8(%rbp), %rsi
leaq -0x4f8(%rbp), %rdi
movq %rdi, -0x7d0(%rbp)
movl $0x3, %edx
movl $0x1, %ecx
callq 0x10c60
movq -0x7e0(%rbp), %rsi
movq -0x7d8(%rbp), %rdx
movq -0x7d0(%rbp), %rcx
leaq -0x4b0(%rbp), %rdi
callq 0x36640
movups 0x7fc46(%rip), %xmm0    # 0x1fce00
movaps %xmm0, -0x540(%rbp)
movq $0x1, -0x530(%rbp)
leaq -0x540(%rbp), %rax
movq %rax, -0x520(%rbp)
movq $0x3, -0x518(%rbp)
leaq -0x541(%rbp), %rdi
movq %rdi, -0x7c8(%rbp)
callq 0x18a530
movq -0x7c8(%rbp), %rcx
movq -0x520(%rbp), %rsi
movq -0x518(%rbp), %rdx
leaq -0x510(%rbp), %rdi
callq 0x18a550
jmp 0x17d21b
leaq -0x4b0(%rbp), %rdi
leaq -0x510(%rbp), %rsi
callq 0x18a950
jmp 0x17d230
leaq -0x510(%rbp), %rdi
callq 0x18a5d0
leaq -0x541(%rbp), %rdi
callq 0x18a630
leaq -0x5a8(%rbp), %rdi
movq %rdi, -0x808(%rbp)
movl $0x5, %esi
callq 0x10c20
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x810(%rbp)
leaq -0x5c0(%rbp), %rdi
movq %rdi, -0x800(%rbp)
movl $0x4, %edx
movl $0xf, %ecx
callq 0x10c60
movq -0x810(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
movq %rdi, -0x7f8(%rbp)
movl $0x3, %edx
movl $0x1, %ecx
callq 0x10c60
movq -0x808(%rbp), %rsi
movq -0x800(%rbp), %rdx
movq -0x7f8(%rbp), %rcx
leaq -0x590(%rbp), %rdi
callq 0x36640
movups 0x7fb44(%rip), %xmm0    # 0x1fce18
movaps %xmm0, -0x620(%rbp)
movq $0x1, -0x610(%rbp)
leaq -0x620(%rbp), %rax
movq %rax, -0x600(%rbp)
movq $0x3, -0x5f8(%rbp)
leaq -0x621(%rbp), %rdi
movq %rdi, -0x7f0(%rbp)
callq 0x18a530
movq -0x7f0(%rbp), %rcx
movq -0x600(%rbp), %rsi
movq -0x5f8(%rbp), %rdx
leaq -0x5f0(%rbp), %rdi
callq 0x18a550
jmp 0x17d335
leaq -0x590(%rbp), %rdi
leaq -0x5f0(%rbp), %rsi
callq 0x18a950
jmp 0x17d34a
leaq -0x5f0(%rbp), %rdi
callq 0x18a5d0
leaq -0x621(%rbp), %rdi
callq 0x18a630
leaq -0x688(%rbp), %rdi
movq %rdi, -0x830(%rbp)
movl $0x5, %esi
callq 0x10c20
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x838(%rbp)
leaq -0x6a0(%rbp), %rdi
movq %rdi, -0x828(%rbp)
movl $0x4, %edx
movl $0xe, %ecx
callq 0x10c60
movq -0x838(%rbp), %rsi
leaq -0x6b8(%rbp), %rdi
movq %rdi, -0x820(%rbp)
movl $0x3, %edx
movl $0x1, %ecx
callq 0x10c60
movq -0x830(%rbp), %rsi
movq -0x828(%rbp), %rdx
movq -0x820(%rbp), %rcx
leaq -0x670(%rbp), %rdi
callq 0x36640
movups 0x7fa42(%rip), %xmm0    # 0x1fce30
movaps %xmm0, -0x700(%rbp)
movq $0x1, -0x6f0(%rbp)
leaq -0x700(%rbp), %rax
movq %rax, -0x6e0(%rbp)
movq $0x3, -0x6d8(%rbp)
leaq -0x701(%rbp), %rdi
movq %rdi, -0x818(%rbp)
callq 0x18a530
movq -0x818(%rbp), %rcx
movq -0x6e0(%rbp), %rsi
movq -0x6d8(%rbp), %rdx
leaq -0x6d0(%rbp), %rdi
callq 0x18a550
jmp 0x17d44f
leaq -0x670(%rbp), %rdi
leaq -0x6d0(%rbp), %rsi
callq 0x18a950
jmp 0x17d464
leaq -0x6d0(%rbp), %rdi
callq 0x18a5d0
leaq -0x701(%rbp), %rdi
callq 0x18a630
callq 0x18ac50
callq 0x18ac60
callq 0x18ac70
callq 0x18ac80
callq 0x18ac90
callq 0x18aca0
callq 0x18acb0
callq 0x18acc0
callq 0x18acd0
callq 0x18ace0
addq $0x840, %rsp            # imm = 0x840
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x17d4da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x18a5d0
leaq -0x61(%rbp), %rdi
callq 0x18a630
jmp 0x17d695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x17d50e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x18a5d0
leaq -0xe1(%rbp), %rdi
callq 0x18a630
jmp 0x17d695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x17d545
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x18a5d0
leaq -0x1c1(%rbp), %rdi
callq 0x18a630
jmp 0x17d695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x17d57c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x18a5d0
leaq -0x2a1(%rbp), %rdi
callq 0x18a630
jmp 0x17d695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x17d5b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x18a5d0
leaq -0x381(%rbp), %rdi
callq 0x18a630
jmp 0x17d695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x17d5ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x18a5d0
leaq -0x461(%rbp), %rdi
callq 0x18a630
jmp 0x17d695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x17d621
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x510(%rbp), %rdi
callq 0x18a5d0
leaq -0x541(%rbp), %rdi
callq 0x18a630
jmp 0x17d695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x17d655
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x5f0(%rbp), %rdi
callq 0x18a5d0
leaq -0x621(%rbp), %rdi
callq 0x18a630
jmp 0x17d695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x17d689
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x6d0(%rbp), %rdi
callq 0x18a5d0
leaq -0x701(%rbp), %rdi
callq 0x18a630
movq -0x70(%rbp), %rdi
callq 0x33a0
nop