// File: dsharlet[P]array/test/array.cpp
// Function: nda::test_array_reshape_1d_body()
TEST(array_reshape_1d) {
  shape_of_rank<1> s({{-1, 9}});
  array_of_rank<int, 1> a(s);
  fill_pattern(a);

  a.reshape({{-3, 12}});
  check_pattern(a(s.x()));
  ASSERT_EQ(a.shape().flat_extent(), 12);

  a.reshape({5});
  check_pattern(a);
  ASSERT_EQ(a.shape().flat_extent(), 5);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5c0, %rsp            # imm = 0x5C0
leaq -0x30(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
movq $-0x1, %rsi
movl $0x9, %edx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
callq 0x10c60
movq -0x4b0(%rbp), %rsi
leaq -0x18(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x367c0
movq -0x4a8(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x36820
movq -0x4a0(%rbp), %rdi
xorl %esi, %esi
callq 0x368b0
jmp 0x28e3f
leaq -0xa8(%rbp), %rdi
movq $-0x3, %rsi
movl $0xc, %edx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
callq 0x10c60
jmp 0x28e63
leaq -0x90(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x367c0
jmp 0x28e78
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x368e0
jmp 0x28e8a
leaq -0x18(%rbp), %rdi
callq 0x36af0
movq %rax, -0x4b8(%rbp)
jmp 0x28e9c
movq -0x4b8(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0xd0(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0xe0(%rbp)
movq -0xd0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0xe0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0xc8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x36a90
jmp 0x28ee2
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x36b10
movq -0x4c0(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x36a50
jmp 0x28f0a
leaq -0x68(%rbp), %rdi
callq 0x36b40
movq %rax, -0x4c8(%rbp)
jmp 0x28f1c
movq -0x4c8(%rbp), %rdi
callq 0x36b60
movq %rax, -0x4d0(%rbp)
jmp 0x28f31
movq -0x4d0(%rbp), %rax
subq $0xc, %rax
sete %al
movb %al, -0x4d9(%rbp)
leaq -0x299(%rbp), %rdi
movq %rdi, -0x4d8(%rbp)
callq 0x33b0
movq -0x4d8(%rbp), %rdx
leaq 0x1b5748(%rip), %rsi    # 0x1de6ae
leaq -0x298(%rbp), %rdi
callq 0x10a90
jmp 0x28f74
movb -0x4d9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x278(%rbp), %rdi
leaq -0x298(%rbp), %rdx
callq 0x10f80
jmp 0x28f95
leaq 0x1b3849(%rip), %rsi    # 0x1dc7e5
leaq -0x278(%rbp), %rdi
callq 0x34320
movq %rax, -0x4e8(%rbp)
jmp 0x28fb1
movq -0x4e8(%rbp), %rdi
leaq 0x1b570d(%rip), %rsi    # 0x1de6cc
callq 0x36bc0
movq %rax, -0x4f0(%rbp)
jmp 0x28fcd
movq -0x4f0(%rbp), %rdi
leaq 0x1b77d1(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x4f8(%rbp)
jmp 0x28fe9
leaq -0x68(%rbp), %rdi
callq 0x36b40
movq %rax, -0x500(%rbp)
jmp 0x28ffb
movq -0x500(%rbp), %rdi
callq 0x36b60
movq %rax, -0x508(%rbp)
jmp 0x29010
movq -0x4f8(%rbp), %rdi
movq -0x508(%rbp), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x2a8(%rbp), %rsi
callq 0x355c0
movq %rax, -0x510(%rbp)
jmp 0x2903a
movq -0x510(%rbp), %rdi
leaq 0x1b379d(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x518(%rbp)
jmp 0x29056
movq -0x518(%rbp), %rdi
leaq 0x1b5665(%rip), %rsi    # 0x1de6c9
callq 0x34840
movq %rax, -0x520(%rbp)
jmp 0x29072
movq -0x520(%rbp), %rdi
leaq 0x1b772c(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x528(%rbp)
jmp 0x2908e
movq -0x528(%rbp), %rdi
movl $0xc, -0x2ac(%rbp)
leaq -0x2ac(%rbp), %rsi
callq 0x343a0
movq %rax, -0x530(%rbp)
jmp 0x290b4
movq -0x530(%rbp), %rdi
leaq 0x1cd3b9(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x290c9
leaq -0x278(%rbp), %rdi
callq 0x10ff0
jmp 0x290d7
leaq -0x298(%rbp), %rdi
callq 0x3100
leaq -0x299(%rbp), %rdi
callq 0x3290
leaq -0x2c8(%rbp), %rdi
movl $0x5, %esi
callq 0x36c00
jmp 0x29102
leaq -0x68(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x368e0
jmp 0x29114
leaq -0x2d0(%rbp), %rdi
movq %rdi, -0x538(%rbp)
callq 0x36b10
movq -0x538(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x36c40
jmp 0x29139
leaq -0x68(%rbp), %rdi
callq 0x36b40
movq %rax, -0x540(%rbp)
jmp 0x2914b
movq -0x540(%rbp), %rdi
callq 0x36b60
movq %rax, -0x548(%rbp)
jmp 0x29160
movq -0x548(%rbp), %rax
subq $0x5, %rax
sete %al
movb %al, -0x551(%rbp)
leaq -0x481(%rbp), %rdi
movq %rdi, -0x550(%rbp)
callq 0x33b0
movq -0x550(%rbp), %rdx
leaq 0x1b554f(%rip), %rsi    # 0x1de6e4
leaq -0x480(%rbp), %rdi
callq 0x10a90
jmp 0x291a3
movb -0x551(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x460(%rbp), %rdi
leaq -0x480(%rbp), %rdx
callq 0x10f80
jmp 0x291c4
leaq 0x1b361a(%rip), %rsi    # 0x1dc7e5
leaq -0x460(%rbp), %rdi
callq 0x34320
movq %rax, -0x560(%rbp)
jmp 0x291e0
movq -0x560(%rbp), %rdi
leaq 0x1b54de(%rip), %rsi    # 0x1de6cc
callq 0x36bc0
movq %rax, -0x568(%rbp)
jmp 0x291fc
movq -0x568(%rbp), %rdi
leaq 0x1b75a2(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x570(%rbp)
jmp 0x29218
leaq -0x68(%rbp), %rdi
callq 0x36b40
movq %rax, -0x578(%rbp)
jmp 0x2922a
movq -0x578(%rbp), %rdi
callq 0x36b60
movq %rax, -0x580(%rbp)
jmp 0x2923f
movq -0x570(%rbp), %rdi
movq -0x580(%rbp), %rax
movq %rax, -0x490(%rbp)
leaq -0x490(%rbp), %rsi
callq 0x355c0
movq %rax, -0x588(%rbp)
jmp 0x29269
movq -0x588(%rbp), %rdi
leaq 0x1b356e(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x590(%rbp)
jmp 0x29285
movq -0x590(%rbp), %rdi
leaq 0x1b54ca(%rip), %rsi    # 0x1de75d
callq 0x34320
movq %rax, -0x598(%rbp)
jmp 0x292a1
movq -0x598(%rbp), %rdi
leaq 0x1b74fd(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x5a0(%rbp)
jmp 0x292bd
movq -0x5a0(%rbp), %rdi
movl $0x5, -0x494(%rbp)
leaq -0x494(%rbp), %rsi
callq 0x343a0
movq %rax, -0x5a8(%rbp)
jmp 0x292e3
movq -0x5a8(%rbp), %rdi
leaq 0x1cd18a(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x292f8
leaq -0x460(%rbp), %rdi
callq 0x10ff0
jmp 0x29306
leaq -0x480(%rbp), %rdi
callq 0x3100
leaq -0x481(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
callq 0x36c70
addq $0x5c0, %rsp            # imm = 0x5C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x293e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x29385
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x29379
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x10ff0
jmp 0x29377
jmp 0x29379
leaq -0x298(%rbp), %rdi
callq 0x3100
leaq -0x299(%rbp), %rdi
callq 0x3290
jmp 0x293e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x293d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x293cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x460(%rbp), %rdi
callq 0x10ff0
jmp 0x293c9
jmp 0x293cb
leaq -0x480(%rbp), %rdi
callq 0x3100
leaq -0x481(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
callq 0x36c70
movq -0x70(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopl (%rax)