// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
pxor %xmm0, %xmm0
leaq 0x8(%rsp), %rbx
movdqu %xmm0, 0x8(%rbx)
movq $0x0, 0x18(%rbx)
movq $-0x1, 0x20(%rbx)
movq $0x9, 0x28(%rbx)
movq %r15, 0x30(%rbx)
movq %rbx, %rdi
callq 0x203ce
movq %rbx, %rdi
callq 0x2048c
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x176b8
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq 0x38(%rsp), %rdx
leaq 0x1(%rdi), %rsi
andq $-0x2, %rsi
decq %rdi
movq %rdi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (,%rdx,8), %rdi
xorl %r8d, %r8d
movdqa 0x8b9f4(%rip), %xmm1    # 0xa3030
movdqa 0x8b9fc(%rip), %xmm2    # 0xa3040
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movq %r8, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm1, %xmm4
pxor %xmm2, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm0, %xmm5
pcmpeqd %xmm0, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %r9d
notl %r9d
testb $0x1, %r9b
je 0x17691
leaq (%rcx,%r8), %r9
movl %r9d, (%rax)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %r9d
testb $0x1, %r9b
je 0x176ac
leal (%rcx,%r8), %r9d
incl %r9d
movl %r9d, (%rax,%rdx,4)
addq $0x2, %r8
addq %rdi, %rax
cmpq %r8, %rsi
jne 0x1764c
leaq 0x20(%rsp), %r12
leaq 0x88(%rsp), %rsi
movq $-0x3, (%rsi)
movq $0xc, 0x8(%rsi)
movq %r15, 0x10(%rsi)
leaq 0x8(%rsp), %rdi
callq 0x1a1b6
movq 0x38(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
notq %rdx
imulq %rax, %rdx
testq %rcx, %rcx
leaq (%rcx,%rdx,4), %rdx
cmoveq %rcx, %rdx
leaq 0xa0(%rsp), %rcx
movq %rdx, (%rcx)
movq $-0x1, 0x8(%rcx)
movq $0x9, 0x10(%rcx)
movq %rax, 0x18(%rcx)
leaq 0x68(%rsp), %rax
movq $0x0, (%rax)
leaq 0x40(%rsp), %rbx
movq %rcx, (%rbx)
movq %rax, 0x8(%rbx)
movq $-0x1, %r13
leaq 0x60(%rsp), %r14
movq %r13, 0x60(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20726
incq %r13
cmpq $0x8, %r13
jne 0x17746
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r13
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x8da20(%rip), %rsi     # 0xa5199
leaq 0x8da36(%rip), %rdx     # 0xa51b6
leaq 0x40(%rsp), %rdi
callq 0xd14c
movq %r13, %rax
negq %rax
cmovsq %r13, %rax
decq %rbx
imulq %rax, %rbx
xorl %esi, %esi
cmpq $0xb, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xbf80
leaq 0x8bec6(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x8d9e5(%rip), %rsi     # 0xa51b7
movq %rax, %rdi
callq 0x1a3b8
leaq 0x8fa75(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x1782d
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, %rdx
negq %rdx
cmovsq %rcx, %rdx
decq %rax
imulq %rdx, %rax
testq %rax, %rax
movq $-0x1, %rsi
cmovnsq %rax, %rsi
incq %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x2110
leaq 0x8be50(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x8d971(%rip), %rsi     # 0xa51b4
movq %rax, %rdi
callq 0x1917a
leaq 0x8fa04(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x17877
movq %rbx, %rdi
addq $0x10, %rdi
movl $0xc, %esi
callq 0x22f0
leaq 0xa2a1b(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x178aa
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x70(%rsp), %rsi
movq $0x0, (%rsi)
movq $0x5, 0x8(%rsi)
movq %r15, 0x10(%rsi)
leaq 0x8(%rsp), %rdi
callq 0x1a1b6
leaq 0xa0(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x8(%rsp), %rdi
callq 0x1a3ef
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r13
leaq 0x40(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x8d8d1(%rip), %rsi     # 0xa51cf
leaq 0x8d8e6(%rip), %rdx     # 0xa51eb
callq 0xd14c
movq %r13, %rax
negq %rax
cmovsq %r13, %rax
decq %rbx
imulq %rax, %rbx
xorl %esi, %esi
cmpq $0x4, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xbf80
leaq 0x8bd46(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x8d865(%rip), %rsi     # 0xa51b7
movq %rax, %rdi
callq 0x1a3b8
leaq 0x8f8f5(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x179ad
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, %rdx
negq %rdx
cmovsq %rcx, %rdx
decq %rax
imulq %rdx, %rax
testq %rax, %rax
movq $-0x1, %rsi
cmovnsq %rax, %rsi
incq %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x2110
leaq 0x8bcd0(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x8d885(%rip), %rsi     # 0xa5248
movq %rax, %rdi
callq 0x18fba
leaq 0x8f884(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x179f7
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x5, %esi
callq 0x22f0
leaq 0xa289b(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x17a2a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21f0
cmpq $0x0, 0x20(%rsp)
je 0x17a5d
pxor %xmm0, %xmm0
movdqu %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movq %r15, 0x38(%rsp)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x17aca
jmp 0x17aca
jmp 0x17aca
jmp 0x17aca
jmp 0x17aca
jmp 0x17a87
jmp 0x17a99
jmp 0x17a7e
movq %rax, %rbx
jmp 0x17aa9
jmp 0x17a87
jmp 0x17a99
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
jmp 0x17aa9
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x17acd
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x17acd
movq %rax, %rdi
callq 0xc0a9
movq %rax, %rbx
cmpq $0x0, 0x20(%rsp)
je 0x17b00
pxor %xmm0, %xmm0
movdqu %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movq %r15, 0x38(%rsp)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300