// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/include/array/array.h
// Function: nda::array<int, nda::shape<nda::dim<-9l, -9l, -9l>>, std::allocator<int>>::reshape(nda::shape<nda::dim<-9l, -9l, -9l>>)
void reshape(Shape new_shape) {
    new_shape.resolve();
    if (shape_ == new_shape) { return; }

    // Allocate an array with the new shape.
    array new_array(new_shape);

    // Move the common elements to the new array.
    Shape intersection =
        internal::clamp(new_shape.dims(), shape_.dims(), typename Shape::dim_indices());
    pointer intersection_base =
        internal::pointer_add(new_array.base_, new_shape[intersection.min()]);
    copy_shape_traits_type::for_each_value(
        shape_, base_, intersection, intersection_base, internal::move_assign<T, T>);

    *this = std::move(new_array);
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %rax
movq %rax, %rcx
negq %rcx
jno 0x1a1e3
movq 0x8(%r14), %rdi
movq %r14, %rsi
callq 0x204cd
movq %rax, 0x10(%r14)
movq 0x20(%rbx), %rcx
cmpq (%r14), %rcx
jne 0x1a200
movq 0x28(%rbx), %rcx
cmpq 0x8(%r14), %rcx
jne 0x1a200
cmpq %rax, 0x30(%rbx)
je 0x1a371
movabsq $-0x8000000000000000, %r12 # imm = 0x8000000000000000
xorps %xmm0, %xmm0
movq %rsp, %r15
movups %xmm0, 0x8(%r15)
movq $0x0, 0x18(%r15)
movups (%r14), %xmm0
movups %xmm0, 0x20(%r15)
movq 0x10(%r14), %rax
movq %rax, 0x30(%r15)
movq %r15, %rdi
callq 0x203ce
movq %r15, %rdi
callq 0x2048c
movq 0x20(%rbx), %rsi
movq (%r14), %rcx
movq 0x8(%r14), %rax
cmpq %rsi, %rcx
movq %rsi, %rdi
cmovgq %rcx, %rdi
addq %rcx, %rax
decq %rax
movq 0x28(%rbx), %rdx
addq %rsi, %rdx
decq %rdx
cmpq %rax, %rdx
cmovlq %rdx, %rax
movq 0x18(%rbx), %r9
subq %rdi, %rax
movq 0x18(%r15), %r8
testq %r9, %r9
setne %dl
testq %r8, %r8
setne %r10b
testb %dl, %r10b
je 0x1a2e5
movq 0x10(%r14), %rdx
movq %rdi, %r10
subq %rcx, %r10
imulq %rdx, %r10
leaq (%r8,%r10,4), %rcx
movq 0x30(%rbx), %r8
subq %rsi, %rdi
imulq %r8, %rdi
leaq (%r9,%rdi,4), %rsi
movq %r8, %r10
xorq $0x1, %r10
movq %rdx, %r11
xorq $0x1, %r11
orq %r10, %r11
jne 0x1a30e
leaq -0x1(%r12), %rdx
cmpq %rdx, %rax
jae 0x1a332
leaq (%rsi,%rax,4), %rax
leaq (%r9,%rdi,4), %rdx
addq $-0x4, %rdx
movl 0x4(%rdx), %esi
addq $0x4, %rdx
movl %esi, (%rcx)
addq $0x4, %rcx
cmpq %rax, %rdx
jb 0x1a2d1
jmp 0x1a332
leaq -0x2(%r12), %rcx
cmpq %rcx, %rax
ja 0x1a332
leaq 0x88fe5(%rip), %rdi     # 0xa32db
leaq 0x88e20(%rip), %rsi     # 0xa311d
leaq 0x8d5cd(%rip), %rcx     # 0xa78d1
movl $0x6b8, %edx            # imm = 0x6B8
callq 0x2100
leaq -0x1(%r12), %rdi
cmpq %rdi, %rax
jae 0x1a332
shlq $0x2, %rdx
shlq $0x2, %r8
incq %rax
movl (%rsi), %edi
movl %edi, (%rcx)
addq %rdx, %rcx
addq %r8, %rsi
decq %rax
jne 0x1a323
leaq 0x18(%rsp), %r14
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x20610
cmpq $0x0, 0x18(%rsp)
je 0x1a371
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq %r12, 0x30(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
cmpq $0x0, 0x18(%rsp)
je 0x1a3af
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq %r12, 0x30(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
nop