// File: dsharlet[P]array/test/shape.cpp
// Function: nda::test_shape_2d_body()
TEST(shape_2d) {
  dense_dim<> x(0, 10);
  dim<> y(0, 5, x.extent());
  shape<dense_dim<>, dim<>> s(x, y);
  for (int i : y) {
    for (int j : x) {
      ASSERT_EQ(s(j, i), i * x.extent() + j);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
leaq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
movl $0x1, %ecx
callq 0x16d70
leaq -0x88(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
leaq -0xa0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x5, %edx
callq 0x10c60
leaq -0xd0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x349d0
leaq -0xa0(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x366c0
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x366f0
movq %rax, -0xe8(%rbp)
leaq -0xe0(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0xe8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x60(%rbp), %rcx
cmpq (%rcx), %rax
je 0x17a016
leaq -0xe0(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl %eax, -0xec(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x366c0
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x366f0
movq %rax, -0x108(%rbp)
leaq -0x100(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x108(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rax
movq (%rax), %rax
movq -0x70(%rbp), %rcx
cmpq (%rcx), %rax
je 0x179ff6
leaq -0x100(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x10c(%rbp)
movl -0x10c(%rbp), %esi
movl -0xec(%rbp), %edx
leaq -0xd0(%rbp), %rdi
callq 0x404d0
movslq -0xec(%rbp), %rcx
leaq -0x88(%rbp), %rdx
movq %rdx, -0x28(%rbp)
movq -0x28(%rbp), %rdx
addq $0x8, %rdx
movq %rdx, -0x10(%rbp)
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
imulq %rdx, %rcx
movslq -0x10c(%rbp), %rdx
addq %rdx, %rcx
subq %rcx, %rax
sete %al
movb %al, -0x2f1(%rbp)
leaq -0x2c1(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x33b0
movq -0x2f0(%rbp), %rdx
leaq 0x81525(%rip), %rsi     # 0x1fb2ca
leaq -0x2c0(%rbp), %rdi
callq 0x10a90
jmp 0x179db3
movb -0x2f1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x2a0(%rbp), %rdi
leaq -0x2c0(%rbp), %rdx
callq 0x10f80
jmp 0x179dd4
leaq 0x62a0a(%rip), %rsi     # 0x1dc7e5
leaq -0x2a0(%rbp), %rdi
callq 0x34320
movq %rax, -0x300(%rbp)
jmp 0x179df0
movq -0x300(%rbp), %rdi
leaq 0x814ea(%rip), %rsi     # 0x1fb2e8
callq 0x34600
movq %rax, -0x308(%rbp)
jmp 0x179e0c
movq -0x308(%rbp), %rdi
leaq 0x66992(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x310(%rbp)
jmp 0x179e28
movl -0x10c(%rbp), %esi
movl -0xec(%rbp), %edx
leaq -0xd0(%rbp), %rdi
callq 0x404d0
movq %rax, -0x318(%rbp)
jmp 0x179e49
movq -0x310(%rbp), %rdi
movq -0x318(%rbp), %rax
movq %rax, -0x2e0(%rbp)
leaq -0x2e0(%rbp), %rsi
callq 0x34510
movq %rax, -0x320(%rbp)
jmp 0x179e73
movq -0x320(%rbp), %rdi
leaq 0x62964(%rip), %rsi     # 0x1dc7e5
callq 0x34320
movq %rax, -0x328(%rbp)
jmp 0x179e8f
movq -0x328(%rbp), %rdi
leaq 0x81438(%rip), %rsi     # 0x1fb2d5
callq 0x34b60
movq %rax, -0x330(%rbp)
jmp 0x179eab
movq -0x330(%rbp), %rdi
leaq 0x668f3(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x338(%rbp)
jmp 0x179ec7
movslq -0xec(%rbp), %rax
movq %rax, -0x348(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x340(%rbp)
movq -0x338(%rbp), %rdi
movq -0x340(%rbp), %rcx
movq -0x348(%rbp), %rax
imulq %rcx, %rax
movslq -0x10c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2e8(%rbp)
leaq -0x2e8(%rbp), %rsi
callq 0x34510
movq %rax, -0x350(%rbp)
jmp 0x179f39
movq -0x350(%rbp), %rdi
leaq 0x7c534(%rip), %rsi     # 0x1f647b
callq 0x34320
jmp 0x179f4e
leaq -0x2a0(%rbp), %rdi
callq 0x10ff0
jmp 0x179f5c
leaq -0x2c0(%rbp), %rdi
callq 0x3100
leaq -0x2c1(%rbp), %rdi
callq 0x3290
leaq -0x100(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x179cec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2d0(%rbp)
movl %eax, -0x2d4(%rbp)
jmp 0x179fe8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2d0(%rbp)
movl %eax, -0x2d4(%rbp)
jmp 0x179fdc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2d0(%rbp)
movl %eax, -0x2d4(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x10ff0
jmp 0x179fda
jmp 0x179fdc
leaq -0x2c0(%rbp), %rdi
callq 0x3100
leaq -0x2c1(%rbp), %rdi
callq 0x3290
jmp 0x17a01f
jmp 0x179ff8
leaq -0xe0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x179c76
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
movq -0x2d0(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw %cs:(%rax,%rax)