// File: dsharlet[P]array/test/shape.cpp
// Function: nda::test_shape_1d_body()
TEST(shape_1d) {
  for (int stride : {1, 2, 10}) {
    dim<> x(0, 10, stride);
    shape<dim<>> s(x);
    for (int i : x) {
      ASSERT_EQ(s(i), i * stride);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movl $0x1, -0x44(%rbp)
movl $0x2, -0x40(%rbp)
movl $0xa, -0x3c(%rbp)
leaq -0x44(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x3, -0x30(%rbp)
leaq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x11250
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
callq 0x11270
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
je 0x1798d9
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
movslq -0x5c(%rbp), %rcx
leaq -0x78(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x10c60
leaq -0x90(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x367c0
leaq -0x78(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0x366c0
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
callq 0x366f0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq -0xa8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
je 0x1798c6
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %esi
leaq -0x90(%rbp), %rdi
callq 0x9fef0
movl -0xac(%rbp), %ecx
movl -0x5c(%rbp), %edx
imull %edx, %ecx
movslq %ecx, %rcx
subq %rcx, %rax
sete %al
movb %al, -0x291(%rbp)
leaq -0x261(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x33b0
movq -0x290(%rbp), %rdx
leaq 0x81bdf(%rip), %rsi     # 0x1fb29e
leaq -0x260(%rbp), %rdi
callq 0x10a90
jmp 0x1796cd
movb -0x291(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rdx
callq 0x10f80
jmp 0x1796ee
leaq 0x630f0(%rip), %rsi     # 0x1dc7e5
leaq -0x240(%rbp), %rdi
callq 0x34320
movq %rax, -0x2a0(%rbp)
jmp 0x17970a
movq -0x2a0(%rbp), %rdi
leaq 0x6e3e0(%rip), %rsi     # 0x1e7af8
callq 0x34360
movq %rax, -0x2a8(%rbp)
jmp 0x179726
movq -0x2a8(%rbp), %rdi
leaq 0x67078(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x2b0(%rbp)
jmp 0x179742
movl -0xac(%rbp), %esi
leaq -0x90(%rbp), %rdi
callq 0x9fef0
movq %rax, -0x2b8(%rbp)
jmp 0x17975d
movq -0x2b0(%rbp), %rdi
movq -0x2b8(%rbp), %rax
movq %rax, -0x280(%rbp)
leaq -0x280(%rbp), %rsi
callq 0x34510
movq %rax, -0x2c0(%rbp)
jmp 0x179787
movq -0x2c0(%rbp), %rdi
leaq 0x63050(%rip), %rsi     # 0x1dc7e5
callq 0x34320
movq %rax, -0x2c8(%rbp)
jmp 0x1797a3
movq -0x2c8(%rbp), %rdi
leaq 0x81af5(%rip), %rsi     # 0x1fb2a6
callq 0x34570
movq %rax, -0x2d0(%rbp)
jmp 0x1797bf
movq -0x2d0(%rbp), %rdi
leaq 0x66fdf(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x2d8(%rbp)
jmp 0x1797db
movq -0x2d8(%rbp), %rdi
movl -0xac(%rbp), %eax
movl -0x5c(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x284(%rbp)
leaq -0x284(%rbp), %rsi
callq 0x343a0
movq %rax, -0x2e0(%rbp)
jmp 0x179809
movq -0x2e0(%rbp), %rdi
leaq 0x7cc64(%rip), %rsi     # 0x1f647b
callq 0x34320
jmp 0x17981e
leaq -0x240(%rbp), %rdi
callq 0x10ff0
jmp 0x17982c
leaq -0x260(%rbp), %rdi
callq 0x3100
leaq -0x261(%rbp), %rdi
callq 0x3290
leaq -0xa0(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x179630
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x1798b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x1798ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x10ff0
jmp 0x1798aa
jmp 0x1798ac
leaq -0x260(%rbp), %rdi
callq 0x3100
leaq -0x261(%rbp), %rdi
callq 0x3290
jmp 0x1798e2
jmp 0x1798c8
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
jmp 0x1795c2
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
movq -0x270(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw %cs:(%rax,%rax)