// File: dsharlet[P]array/test/shape.cpp
// Function: nda::test_shape_is_in_range_2d_body()
TEST(shape_is_in_range_2d) {
  dim<> x(2, 5);
  dim<> y(-3, 6);
  shape<dim<>, dim<>> s(x, y);

  for (int i = -3; i < 3; i++) {
    for (int j = 2; j < 7; j++) {
      ASSERT(s.is_in_range(j, i));
    }
  }
  ASSERT(!s.is_in_range(1, 0));
  ASSERT(!s.is_in_range(2, -4));

  ASSERT(!s.is_in_range(8, 0));
  ASSERT(!s.is_in_range(2, 4));

  ASSERT(s.is_in_range(x, y));
  ASSERT(!s.is_in_range(1, y));
  ASSERT(!s.is_in_range(x, -4));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf60, %rsp            # imm = 0xF60
leaq -0x18(%rbp), %rdi
movl $0x2, %esi
movl $0x5, %edx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
callq 0x10c60
leaq -0x30(%rbp), %rdi
movq $-0x3, %rsi
movl $0x6, %edx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
callq 0x10c60
leaq -0x60(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x11310
movl $0xfffffffd, -0x64(%rbp) # imm = 0xFFFFFFFD
cmpl $0x3, -0x64(%rbp)
jge 0x182926
movl $0x2, -0x68(%rbp)
cmpl $0x7, -0x68(%rbp)
jge 0x182916
movl -0x68(%rbp), %esi
movl -0x64(%rbp), %edx
leaq -0x60(%rbp), %rdi
callq 0x18b020
movb %al, -0xeb1(%rbp)
leaq -0x219(%rbp), %rdi
movq %rdi, -0xeb0(%rbp)
callq 0x33b0
movq -0xeb0(%rbp), %rdx
leaq 0x7920f(%rip), %rsi     # 0x1fba7f
leaq -0x218(%rbp), %rdi
callq 0x10a90
jmp 0x18287e
movb -0xeb1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x1f8(%rbp), %rdi
leaq -0x218(%rbp), %rdx
callq 0x10f80
jmp 0x18289f
leaq -0x1f8(%rbp), %rdi
callq 0x10ff0
jmp 0x1828ad
leaq -0x218(%rbp), %rdi
callq 0x3100
leaq -0x219(%rbp), %rdi
callq 0x3290
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x182830
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x182905
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x3100
leaq -0x219(%rbp), %rdi
callq 0x3290
jmp 0x182f8a
jmp 0x182918
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x18281f
leaq -0x60(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x18b020
xorb $0x1, %al
movb %al, -0xec1(%rbp)
leaq -0x3e1(%rbp), %rdi
movq %rdi, -0xec0(%rbp)
callq 0x33b0
movq -0xec0(%rbp), %rdx
leaq 0x79134(%rip), %rsi     # 0x1fba93
leaq -0x3e0(%rbp), %rdi
callq 0x10a90
jmp 0x18296d
movb -0xec1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x3c0(%rbp), %rdi
leaq -0x3e0(%rbp), %rdx
callq 0x10f80
jmp 0x18298e
leaq -0x3c0(%rbp), %rdi
callq 0x10ff0
jmp 0x18299c
leaq -0x3e0(%rbp), %rdi
callq 0x3100
leaq -0x3e1(%rbp), %rdi
callq 0x3290
leaq -0x60(%rbp), %rdi
movl $0x2, %esi
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
callq 0x18b020
xorb $0x1, %al
movb %al, -0xed1(%rbp)
leaq -0x599(%rbp), %rdi
movq %rdi, -0xed0(%rbp)
callq 0x33b0
movq -0xed0(%rbp), %rdx
leaq 0x790b8(%rip), %rsi     # 0x1fbaa8
leaq -0x598(%rbp), %rdi
callq 0x10a90
jmp 0x1829fe
movb -0xed1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x578(%rbp), %rdi
leaq -0x598(%rbp), %rdx
callq 0x10f80
jmp 0x182a1f
leaq -0x578(%rbp), %rdi
callq 0x10ff0
jmp 0x182a2d
leaq -0x598(%rbp), %rdi
callq 0x3100
leaq -0x599(%rbp), %rdi
callq 0x3290
leaq -0x60(%rbp), %rdi
movl $0x8, %esi
xorl %edx, %edx
callq 0x18b020
xorb $0x1, %al
movb %al, -0xee1(%rbp)
leaq -0x751(%rbp), %rdi
movq %rdi, -0xee0(%rbp)
callq 0x33b0
movq -0xee0(%rbp), %rdx
leaq 0x79040(%rip), %rsi     # 0x1fbabe
leaq -0x750(%rbp), %rdi
callq 0x10a90
jmp 0x182a8c
movb -0xee1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x730(%rbp), %rdi
leaq -0x750(%rbp), %rdx
callq 0x10f80
jmp 0x182aad
leaq -0x730(%rbp), %rdi
callq 0x10ff0
jmp 0x182abb
leaq -0x750(%rbp), %rdi
callq 0x3100
leaq -0x751(%rbp), %rdi
callq 0x3290
leaq -0x60(%rbp), %rdi
movl $0x2, %esi
movl $0x4, %edx
callq 0x18b020
xorb $0x1, %al
movb %al, -0xef1(%rbp)
leaq -0x909(%rbp), %rdi
movq %rdi, -0xef0(%rbp)
callq 0x33b0
movq -0xef0(%rbp), %rdx
leaq 0x78fc4(%rip), %rsi     # 0x1fbad3
leaq -0x908(%rbp), %rdi
callq 0x10a90
jmp 0x182b1d
movb -0xef1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x8e8(%rbp), %rdi
leaq -0x908(%rbp), %rdx
callq 0x10f80
jmp 0x182b3e
leaq -0x8e8(%rbp), %rdi
callq 0x10ff0
jmp 0x182b4c
leaq -0x908(%rbp), %rdi
callq 0x3100
leaq -0x909(%rbp), %rdi
callq 0x3290
movq -0x8(%rbp), %rax
movq %rax, -0xab0(%rbp)
movups -0x18(%rbp), %xmm0
movaps %xmm0, -0xac0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xad0(%rbp)
movups -0x30(%rbp), %xmm0
movaps %xmm0, -0xae0(%rbp)
movq -0xad0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x28(%rax)
movaps -0xae0(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0xab0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movaps -0xac0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x60(%rbp), %rdi
callq 0x18b060
movb %al, -0xf01(%rbp)
leaq -0xb01(%rbp), %rdi
movq %rdi, -0xf00(%rbp)
callq 0x33b0
movq -0xf00(%rbp), %rdx
leaq 0x78efa(%rip), %rsi     # 0x1fbae8
leaq -0xb00(%rbp), %rdi
callq 0x10a90
jmp 0x182bfc
movb -0xf01(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0xaa0(%rbp), %rdi
leaq -0xb00(%rbp), %rdx
callq 0x10f80
jmp 0x182c1d
leaq -0xaa0(%rbp), %rdi
callq 0x10ff0
jmp 0x182c2b
leaq -0xb00(%rbp), %rdi
callq 0x3100
leaq -0xb01(%rbp), %rdi
callq 0x3290
movq -0x20(%rbp), %rax
movq %rax, -0xca0(%rbp)
movups -0x30(%rbp), %xmm0
movaps %xmm0, -0xcb0(%rbp)
movq -0xca0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0xcb0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x60(%rbp), %rdi
movl $0x1, %esi
callq 0x18b0a0
xorb $0x1, %al
movb %al, -0xf11(%rbp)
leaq -0xcd1(%rbp), %rdi
movq %rdi, -0xf10(%rbp)
callq 0x33b0
movq -0xf10(%rbp), %rdx
leaq 0x78e54(%rip), %rsi     # 0x1fbafc
leaq -0xcd0(%rbp), %rdi
callq 0x10a90
jmp 0x182cb6
movb -0xf11(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0xc98(%rbp), %rdi
leaq -0xcd0(%rbp), %rdx
callq 0x10f80
jmp 0x182cd7
leaq -0xc98(%rbp), %rdi
callq 0x10ff0
jmp 0x182ce5
leaq -0xcd0(%rbp), %rdi
callq 0x3100
leaq -0xcd1(%rbp), %rdi
callq 0x3290
movq -0x8(%rbp), %rax
movq %rax, -0xe70(%rbp)
movups -0x18(%rbp), %xmm0
movaps %xmm0, -0xe80(%rbp)
movq -0xe70(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0xe80(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x60(%rbp), %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x18b0e0
xorb $0x1, %al
movb %al, -0xf21(%rbp)
leaq -0xea1(%rbp), %rdi
movq %rdi, -0xf20(%rbp)
callq 0x33b0
movq -0xf20(%rbp), %rdx
leaq 0x78daf(%rip), %rsi     # 0x1fbb11
leaq -0xea0(%rbp), %rdi
callq 0x10a90
jmp 0x182d70
movb -0xf21(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0xe68(%rbp), %rdi
leaq -0xea0(%rbp), %rdx
callq 0x10f80
jmp 0x182d91
leaq -0xe68(%rbp), %rdi
callq 0x10ff0
jmp 0x182d9f
leaq -0xea0(%rbp), %rdi
callq 0x3100
leaq -0xea1(%rbp), %rdi
callq 0x3290
addq $0xf60, %rsp            # imm = 0xF60
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x182df2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x3e0(%rbp), %rdi
callq 0x3100
leaq -0x3e1(%rbp), %rdi
callq 0x3290
jmp 0x182f8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x182e35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x598(%rbp), %rdi
callq 0x3100
leaq -0x599(%rbp), %rdi
callq 0x3290
jmp 0x182f8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x182e78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x750(%rbp), %rdi
callq 0x3100
leaq -0x751(%rbp), %rdi
callq 0x3290
jmp 0x182f8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x182ebb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x908(%rbp), %rdi
callq 0x3100
leaq -0x909(%rbp), %rdi
callq 0x3290
jmp 0x182f8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x182efe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0xb00(%rbp), %rdi
callq 0x3100
leaq -0xb01(%rbp), %rdi
callq 0x3290
jmp 0x182f8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x182f3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0xcd0(%rbp), %rdi
callq 0x3100
leaq -0xcd1(%rbp), %rdi
callq 0x3290
jmp 0x182f8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x182f7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0xea0(%rbp), %rdi
callq 0x3100
leaq -0xea1(%rbp), %rdi
callq 0x3290
movq -0x228(%rbp), %rdi
callq 0x33a0
nopw %cs:(%rax,%rax)