// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
leaq 0x28(%rsp), %rbx
movups %xmm0, 0x8(%rbx)
movq $0x0, 0x18(%rbx)
movq $-0x1, 0x20(%rbx)
movq $0x9, 0x28(%rbx)
movq %r15, 0x30(%rbx)
movq %rbx, %rdi
callq 0x1f92c
movq %rbx, %rdi
callq 0x1f9da
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x1714f
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rdx
movq 0x58(%rsp), %rsi
shlq $0x2, %rsi
movl %edx, (%rcx)
addq %rsi, %rcx
incl %edx
decq %rax
jne 0x17143
leaq 0x88(%rsp), %rsi
movq $-0x3, (%rsi)
movq $0xc, 0x8(%rsi)
movq %r15, 0x10(%rsi)
leaq 0x28(%rsp), %rdi
callq 0x19c94
movq 0x58(%rsp), %rax
movq 0x40(%rsp), %rcx
movq 0x48(%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)
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
xorl %eax, %eax
testb %al, %al
jne 0x1720a
movl $0x9, %r12d
negq %r12
movq $-0x1, %r13
leaq 0x8(%rsp), %rbx
leaq 0x60(%rsp), %r14
movq %r13, 0x60(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1fd10
leaq (%r12,%r13), %rax
incq %rax
incq %r13
cmpq $-0x1, %rax
jne 0x171ea
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %r12
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x8bf2d(%rip), %rsi     # 0xa3151
leaq 0x8bf43(%rip), %rdx     # 0xa316e
leaq 0x8(%rsp), %rdi
callq 0xd0b8
movq %r12, %rax
negq %rax
cmovsq %r12, %rax
decq %rbx
imulq %rax, %rbx
xorl %esi, %esi
cmpq $0xb, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xbf0a
leaq 0x8a3eb(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x8bef2(%rip), %rsi     # 0xa316f
movq %rax, %rdi
callq 0x19e42
leaq 0x8e09e(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x172d8
movq 0x50(%rsp), %rax
movq 0x58(%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 0x8a375(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x8be7e(%rip), %rsi     # 0xa316c
movq %rax, %rdi
callq 0x18bd6
leaq 0x8e02d(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x17322
movq %rbx, %rdi
addq $0x10, %rdi
movl $0xc, %esi
callq 0x22f0
leaq 0xa1040(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x17355
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x70(%rsp), %rsi
movq $0x0, (%rsi)
movq $0x5, 0x8(%rsi)
movq %r15, 0x10(%rsi)
leaq 0x28(%rsp), %rdi
callq 0x19c94
leaq 0xa0(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x19e79
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %r15
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x8bdde(%rip), %rsi     # 0xa3187
leaq 0x8bdf3(%rip), %rdx     # 0xa31a3
callq 0xd0b8
movq %r15, %rax
negq %rax
cmovsq %r15, %rax
decq %rbx
imulq %rax, %rbx
xorl %esi, %esi
cmpq $0x4, %rbx
sete %sil
leaq 0xa0(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xbf0a
leaq 0x8a26b(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x8bd72(%rip), %rsi     # 0xa316f
movq %rax, %rdi
callq 0x19e42
leaq 0x8df1e(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x17458
movq 0x50(%rsp), %rax
movq 0x58(%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 0x8a1f5(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x8bd92(%rip), %rsi     # 0xa3200
movq %rax, %rdi
callq 0x18a16
leaq 0x8dead(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x174a2
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x5, %esi
callq 0x22f0
leaq 0xa0ec0(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x174d5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x28(%rsp), %rdi
callq 0x1fb50
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1755d
jmp 0x17548
jmp 0x17548
jmp 0x17548
jmp 0x17548
jmp 0x17548
jmp 0x1750b
jmp 0x1751d
jmp 0x17502
movq %rax, %rbx
jmp 0x1752d
jmp 0x1750b
jmp 0x1751d
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x1752d
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1754b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x1754b
jmp 0x1755d
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x1fb50
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc036