LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: dsharlet[P]array/test/array.cpp
// Function: nda::test_array_move_reinterpret_shape_body()
TEST(array_move_reinterpret_shape) {
  array_of_rank<int, 3> a({9, {0, 5, 10}, 1});
  fill_pattern(a);

  auto b = move_reinterpret_shape<shape_of_rank<2>>(std::move(a));
  check_pattern(b);

  a = move_reinterpret_shape<shape_of_rank<3>>(std::move(b));
  check_pattern(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x218(%rbp)
movl $0x9, %esi
callq 0x10c20
xorl %eax, %eax
movl %eax, -0x1ec(%rbp)
movl %eax, %esi
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x210(%rbp)
movl $0x5, %edx
movl $0xa, %ecx
callq 0x10c60
leaq -0xf8(%rbp), %rdi
movq %rdi, -0x208(%rbp)
movl $0x1, %esi
callq 0x10c20
movq -0x218(%rbp), %rsi
movq -0x210(%rbp), %rdx
movq -0x208(%rbp), %rcx
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x36640
movq -0x200(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x34f10
movq -0x1f8(%rbp), %rdi
movl -0x1ec(%rbp), %esi
callq 0x34fb0
jmp 0x2a6c5
xorl %eax, %eax
movl %eax, %edx
leaq -0x158(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x370b0
jmp 0x2a6db
leaq -0x168(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x365d0
movq -0x220(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x365a0
jmp 0x2a703
xorl %eax, %eax
movl %eax, %edx
leaq -0x1d0(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x37110
jmp 0x2a71c
leaq -0x68(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x35060
jmp 0x2a72e
leaq -0x1d0(%rbp), %rdi
callq 0x35160
leaq -0x1e8(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x35c10
movq -0x228(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x35c90
jmp 0x2a75f
leaq -0x158(%rbp), %rdi
callq 0x114a0
leaq -0x68(%rbp), %rdi
callq 0x35160
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x2a7cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x2a7c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x35160
leaq -0x158(%rbp), %rdi
callq 0x114a0
leaq -0x68(%rbp), %rdi
callq 0x35160
movq -0x100(%rbp), %rdi
callq 0x33a0
nopw %cs:(%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array<int, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, std::allocator<int>>::clear()
void clear() {
    deallocate();
    shape_ = Shape();
    allocate();
    construct();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x1b5e0
leaq -0x38(%rbp), %rdi
callq 0x1b6d0
movq -0x40(%rbp), %rdi
addq $0x20, %rdi
leaq -0x38(%rbp), %rsi
callq 0x1b6f0
movq -0x40(%rbp), %rdi
callq 0x1a060
movq -0x40(%rbp), %rdi
callq 0x1a120
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, false>>>::operator=(nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, false>>>&&)
array& operator=(array&& other) {
    using std::swap;
    if (base_ == other.base_) {
      if (base_) {
        assert(shape_ == other.shape_);
      } else {
        swap(shape_, other.shape_);
        assert(shape_.empty());
      }
      return *this;
    }

    if (std::allocator_traits<allocator_type>::propagate_on_container_move_assignment::value) {
      swap(alloc_, other.alloc_);
      swap_except_allocator(other);
    } else if (alloc_ == other.get_allocator()) {
      swap_except_allocator(other);
    } else {
      assign(std::move(other));
    }
    return *this;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x8a858
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8a803
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
callq 0x44150
testb $0x1, %al
jne 0x8a7e0
jmp 0x8a7e2
jmp 0x8a801
leaq 0x15235b(%rip), %rdi    # 0x1dcb44
leaq 0x1518f1(%rip), %rsi    # 0x1dc0e1
movl $0x9a0, %edx            # imm = 0x9A0
leaq 0x15c176(%rip), %rcx    # 0x1e6972
callq 0x3130
jmp 0x8a84e
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
callq 0x882a0
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
callq 0x1a8a0
testb $0x1, %al
jne 0x8a82b
jmp 0x8a82d
jmp 0x8a84c
leaq 0x151a18(%rip), %rdi    # 0x1dc24c
leaq 0x1518a6(%rip), %rsi    # 0x1dc0e1
movl $0x9a3, %edx            # imm = 0x9A3
leaq 0x15c12b(%rip), %rcx    # 0x1e6972
callq 0x3130
jmp 0x8a84e
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8a897
movq -0x18(%rbp), %rdi
callq 0x87200
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x88960
testb $0x1, %al
jne 0x8a873
jmp 0x8a882
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x88980
jmp 0x8a88f
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8a8b0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, true>>>::operator=(nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, true>>> const&)
array& operator=(const array& other) {
    if (base_ == other.base_) {
      if (base_) {
        assert(shape_ == other.shape_);
      } else {
        shape_ = other.shape_;
        assert(shape_.empty());
      }
      return *this;
    }

    if (alloc_traits::propagate_on_container_copy_assignment::value) {
      if (alloc_ != other.get_allocator()) { deallocate(); }
      alloc_ = other.get_allocator();
    }

    assign(other);
    return *this;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x8a128
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8a0d3
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
callq 0x44150
testb $0x1, %al
jne 0x8a0b0
jmp 0x8a0b2
jmp 0x8a0d1
leaq 0x152a8b(%rip), %rdi    # 0x1dcb44
leaq 0x152021(%rip), %rsi    # 0x1dc0e1
movl $0x987, %edx            # imm = 0x987
leaq 0x15c165(%rip), %rcx    # 0x1e6231
callq 0x3130
jmp 0x8a11e
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
addq $0x20, %rdi
callq 0x44190
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
callq 0x1a8a0
testb $0x1, %al
jne 0x8a0fb
jmp 0x8a0fd
jmp 0x8a11c
leaq 0x152148(%rip), %rdi    # 0x1dc24c
leaq 0x151fd6(%rip), %rsi    # 0x1dc0e1
movl $0x98a, %edx            # imm = 0x98A
leaq 0x15c11a(%rip), %rcx    # 0x1e6231
callq 0x3130
jmp 0x8a11e
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8a16e
movq -0x18(%rbp), %rdi
callq 0x86d40
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x8a180
testb $0x1, %al
jne 0x8a143
jmp 0x8a14c
movq -0x20(%rbp), %rdi
callq 0x80310
movq -0x18(%rbp), %rdi
callq 0x86d40
movq -0x20(%rbp), %rdi
movl (%rax), %eax
movl %eax, (%rdi)
movq -0x18(%rbp), %rsi
callq 0x86d50
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array<int, nda::shape<nda::dim<-9l, -9l, 1l>>, std::allocator<int>>::assign(nda::shape<nda::dim<-9l, -9l, 1l>>, int const&)
void assign(Shape shape, const T& value) {
    shape.resolve();
    if (shape_ == shape) {
      destroy();
    } else {
      deallocate();
      shape_ = shape;
      allocate();
    }
    construct(value);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, %rax
movq -0x30(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x3f4f0
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x20, %rdi
callq 0x439a0
testb $0x1, %al
jne 0x35357
jmp 0x35362
movq -0x28(%rbp), %rdi
callq 0x3fe70
jmp 0x35385
movq -0x28(%rbp), %rdi
callq 0x3fe00
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
callq 0x439e0
movq -0x28(%rbp), %rdi
callq 0x3f3b0
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x43a10
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rsi, -0x98(%rbp)
movq %rdi, %rax
movq -0x98(%rbp), %rdi
movq %rdi, -0x88(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
callq 0x47d10
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
addq $0x20, %rdi
callq 0x48860
testb $0x1, %al
jne 0x36938
jmp 0x3693d
jmp 0x36a24
movq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x36820
movq -0x88(%rbp), %rdi
callq 0x48920
movq %rax, -0xa0(%rbp)
jmp 0x36962
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
callq 0x48920
movq %rax, -0xa8(%rbp)
jmp 0x3697b
movq -0xa8(%rbp), %rdx
movq -0xa0(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x488a0
jmp 0x36994
movq -0x30(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x48930
jmp 0x369ae
movq -0x88(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3bb20
movq %rax, -0xb8(%rbp)
jmp 0x369c7
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdi
callq 0x17b00
movq %rax, %rcx
movq -0x90(%rbp), %rax
movq %rcx, -0x78(%rbp)
movq %rax, %rdi
addq $0x20, %rdi
movq 0x18(%rax), %rsi
movq -0x78(%rbp), %rcx
leaq -0x1968e(%rip), %r8     # 0x1d370
leaq -0x60(%rbp), %rdx
callq 0x48960
jmp 0x36a09
movq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x489d0
jmp 0x36a1b
leaq -0x48(%rbp), %rdi
callq 0x36c70
addq $0xc0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x36c70
movq -0x68(%rbp), %rdi
callq 0x33a0
nopl (%rax,%rax)
// File: dsharlet[P]array/test/test.h
// Function: std::ostream& nda::operator<<<long, long, long>(std::ostream&, std::tuple<long, long, long> const&)
std::ostream& operator<<(std::ostream& s, const std::tuple<Ts...>& t) {
  s << "{";
  ostream_tuple(s, t, std::make_index_sequence<sizeof...(Ts)>());
  s << "}";
  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x19b12d(%rip), %rsi    # 0x1e07b8
callq 0x3220
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x456c0
movq -0x8(%rbp), %rdi
leaq 0x19b112(%rip), %rsi    # 0x1e07ba
callq 0x3220
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: dsharlet[P]array/test/test.h
// Function: std::ostream& nda::operator<<<-9l, -9l, -9l>(std::ostream&, nda::dim<-9l, -9l, -9l> const&)
std::ostream& operator<<(std::ostream& s, const dim<Min, Extent, Stride>& d) {
  s << "dim<";
  if (internal::is_static(Stride)) {
    ostream_comma_separated_list(s, Min, Extent, Stride);
  } else if (internal::is_static(Extent)) {
    ostream_comma_separated_list(s, Min, Extent);
  } else if (internal::is_static(Min)) {
    s << Min;
  }
  s << ">(";
  ostream_comma_separated_list(s, d.min(), d.extent(), d.stride());
  s << ")";
  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq -0x38(%rbp), %rdi
leaq 0x199df4(%rip), %rsi    # 0x1e08af
callq 0x3220
movq -0x38(%rbp), %rdi
leaq 0x199de9(%rip), %rsi    # 0x1e08b4
callq 0x3220
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
callq 0x45720
movq -0x38(%rbp), %rdi
leaq 0x19583a(%rip), %rsi    # 0x1dc36b
callq 0x3220
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
// File: dsharlet[P]array/include/array/array.h
// Function: auto nda::internal::clamp_dims<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>(nda::dim<-9l, -9l, -9l> const&, nda::dim<-9l, -9l, -9l> const&)
NDARRAY_HOST_DEVICE auto clamp_dims(const DimA& a, const DimB& b) {
  constexpr index_t Min = static_max(DimA::Min, DimB::Min);
  constexpr index_t Max = static_min(DimA::Max, DimB::Max);
  constexpr index_t Extent = static_add(static_sub(Max, Min), 1);
  index_t min = internal::max(a.min(), b.min());
  index_t max = internal::min(a.max(), b.max());
  index_t extent = max - min + 1;
  return dim<Min, Extent, DimA::Stride>(min, extent, a.stride());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0xd0(%rbp)
movq %rdi, -0xc8(%rbp)
movq %rsi, -0x68(%rbp)
movq %rdx, -0x70(%rbp)
movq $-0x9, -0x78(%rbp)
movq $-0x9, -0x80(%rbp)
movq $-0x9, -0x88(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x12b00
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq %rcx, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movq -0x10(%rbp), %rcx
addq (%rcx), %rax
subq $0x1, %rax
movq %rax, -0xb0(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
addq $0x8, %rcx
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rcx
addq (%rcx), %rax
subq $0x1, %rax
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x124b0
movq -0xd0(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
subq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
movq -0x90(%rbp), %rsi
movq -0xc0(%rbp), %rdx
movq -0x68(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
callq 0x10c60
movq -0xc8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>> nda::convert_shape<nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, void>(nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>> const&)
NDARRAY_HOST_DEVICE ShapeDst convert_shape(const ShapeSrc& src) {
  assert(
      internal::is_trivial_slice<ShapeDst::rank()>(src.dims(), typename ShapeSrc::dim_indices()));
  return internal::convert_dims<typename ShapeDst::dims_type>(
      src.dims(), typename ShapeDst::dim_indices());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x60(%rbp)
movq %rdi, %rax
movq %rax, -0x58(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x38740
movq %rax, %rdi
callq 0x4a850
testb $0x1, %al
jne 0x4a682
jmp 0x4a684
jmp 0x4a6a3
leaq 0x196a65(%rip), %rdi    # 0x1e10f0
leaq 0x191a4f(%rip), %rsi    # 0x1dc0e1
movl $0x682, %edx            # imm = 0x682
leaq 0x196aad(%rip), %rcx    # 0x1e114b
callq 0x3130
movq -0x10(%rbp), %rdi
callq 0x38740
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x4a8a0
movq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x17de0
movq -0x58(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array<int, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, std::allocator<int>> nda::move_reinterpret_shape<nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, int, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, std::allocator<int>>(nda::array<int, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, std::allocator<int>>&&, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>> const&, long)
array<T, NewShape, Alloc> move_reinterpret_shape(
    array<T, OldShape, Alloc>&& from, const NewShape& new_shape, index_t offset = 0) {
  // TODO: Use enable_if to implement this check. It is difficult to do due to
  // the friend declaration.
  static_assert(
      std::is_trivial<T>::value, "move_reinterpret_shape is broken for non-trivial types.");
  using std::swap;

  assert(new_shape.is_subset_of(from.shape(), offset));
  array<T, NewShape, Alloc> result;
  // Consider this to be a move assignment.
  if (std::allocator_traits<Alloc>::propagate_on_container_move_assignment::value) {
    swap(result.alloc_, from.alloc_);
  } else {
    assert(result.alloc_ == from.get_allocator());
  }

  swap(result.buffer_, from.buffer_);
  swap(result.buffer_size_, from.buffer_size_);
  swap(result.base_, from.base_);
  result.shape_ = new_shape;
  from.shape_ = OldShape();
  result.base_ += offset;

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x35d20
movq -0x88(%rbp), %rdi
movq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x4a990
testb $0x1, %al
jne 0x4a729
jmp 0x4a72b
jmp 0x4a74a
leaq 0x196ab2(%rip), %rdi    # 0x1e11e4
leaq 0x1919a8(%rip), %rsi    # 0x1dc0e1
movl $0xbee, %edx            # imm = 0xBEE
leaq 0x196acc(%rip), %rcx    # 0x1e1211
callq 0x3130
movq -0x98(%rbp), %rdi
movb $0x0, -0x21(%rbp)
callq 0x35520
movq -0x98(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x435c0
movq -0x98(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x16660
movq -0x98(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0x166a0
movq -0x98(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
callq 0x16660
movq -0x98(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rdi
callq 0x44190
leaq -0x70(%rbp), %rdi
callq 0x398b0
jmp 0x4a7d1
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
leaq -0x70(%rbp), %rsi
callq 0x39a00
movq -0x98(%rbp), %rax
movq -0x20(%rbp), %rcx
shlq $0x2, %rcx
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movb $0x1, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
jne 0x4a82b
jmp 0x4a81f
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
callq 0x114a0
jmp 0x4a83b
movq -0x98(%rbp), %rdi
callq 0x114a0
movq -0x90(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x33a0
nopw %cs:(%rax,%rax)
nop
// File: dsharlet[P]array/test/array_lifetime.cpp
// Function: nda::test_array_lifetime_uninitialized_body()
TEST(array_lifetime_uninitialized) {
  lifetime_counter::reset();
  using uninitializer = uninitialized_allocator<std::allocator<lifetime_counter>>;
  array_of_rank<lifetime_counter, 3, uninitializer> uninit({100, 100, 100});
  ASSERT_EQ(lifetime_counter::constructs(), 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
callq 0x7f630
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x298(%rbp)
movl $0x64, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x34ec0
movq -0x298(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x7f690
callq 0x7f730
movq %rax, -0x290(%rbp)
jmp 0x4e27a
movq -0x290(%rbp), %rax
testq %rax, %rax
sete %al
movb %al, -0x2a1(%rbp)
leaq -0x271(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x33b0
movq -0x2a0(%rbp), %rdx
leaq 0x193574(%rip), %rsi    # 0x1e1822
leaq -0x270(%rbp), %rdi
callq 0x10a90
jmp 0x4e2bc
movb -0x2a1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x240(%rbp), %rdi
leaq -0x270(%rbp), %rdx
callq 0x10f80
jmp 0x4e2dd
leaq 0x18e501(%rip), %rsi    # 0x1dc7e5
leaq -0x240(%rbp), %rdi
callq 0x34320
movq %rax, -0x2b0(%rbp)
jmp 0x4e2f9
movq -0x2b0(%rbp), %rdi
leaq 0x198f74(%rip), %rsi    # 0x1e727b
callq 0x7f760
movq %rax, -0x2b8(%rbp)
jmp 0x4e315
movq -0x2b8(%rbp), %rdi
leaq 0x192489(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x2c0(%rbp)
jmp 0x4e331
callq 0x7f730
movq %rax, -0x2c8(%rbp)
jmp 0x4e33f
movq -0x2c0(%rbp), %rdi
movq -0x2c8(%rbp), %rax
movq %rax, -0x280(%rbp)
leaq -0x280(%rbp), %rsi
callq 0x355c0
movq %rax, -0x2d0(%rbp)
jmp 0x4e369
movq -0x2d0(%rbp), %rdi
leaq 0x18e46e(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x2d8(%rbp)
jmp 0x4e385
movq -0x2d8(%rbp), %rdi
leaq 0x1900a1(%rip), %rsi    # 0x1de434
callq 0x34320
movq %rax, -0x2e0(%rbp)
jmp 0x4e3a1
movq -0x2e0(%rbp), %rdi
leaq 0x1923fd(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x2e8(%rbp)
jmp 0x4e3bd
movq -0x2e8(%rbp), %rdi
movl $0x0, -0x284(%rbp)
leaq -0x284(%rbp), %rsi
callq 0x343a0
movq %rax, -0x2f0(%rbp)
jmp 0x4e3e3
movq -0x2f0(%rbp), %rdi
leaq 0x1a808a(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x4e3f8
leaq -0x240(%rbp), %rdi
callq 0x10ff0
jmp 0x4e406
leaq -0x270(%rbp), %rdi
callq 0x3100
leaq -0x271(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
callq 0x7f7a0
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x4e4a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x4e49a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x4e48e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x10ff0
jmp 0x4e48c
jmp 0x4e48e
leaq -0x270(%rbp), %rdi
callq 0x3100
leaq -0x271(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
callq 0x7f7a0
movq -0x248(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw %cs:(%rax,%rax)
// File: dsharlet[P]array/test/lifetime.h
// Function: nda::lifetime_counter::reset()
static void reset() {
    default_constructs = 0;
    copy_constructs = 0;
    move_constructs = 0;
    copy_assigns = 0;
    move_assigns = 0;
    destructs = 0;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x212cf5(%rip), %rax    # 0x292330
movq $0x0, (%rax)
leaq 0x212cef(%rip), %rax    # 0x292338
movq $0x0, (%rax)
leaq 0x212ce9(%rip), %rax    # 0x292340
movq $0x0, (%rax)
leaq 0x212ce3(%rip), %rax    # 0x292348
movq $0x0, (%rax)
leaq 0x212cdd(%rip), %rax    # 0x292350
movq $0x0, (%rax)
leaq 0x212cd7(%rip), %rax    # 0x292358
movq $0x0, (%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::auto_allocator<nda::lifetime_counter, 256ul, 1ul, std::allocator<nda::lifetime_counter>>::allocate(unsigned long)
value_type* allocate(size_t n) {
    if (!allocated && n <= N) {
      allocated = true;
      return reinterpret_cast<value_type*>(&buffer[0]);
    } else {
      return std::allocator_traits<BaseAlloc>::allocate(alloc, n);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
testb $0x1, 0x100(%rax)
jne 0x80dec
cmpq $0x100, -0x18(%rbp)     # imm = 0x100
ja 0x80dec
movq -0x20(%rbp), %rax
movb $0x1, 0x100(%rax)
movq %rax, -0x8(%rbp)
jmp 0x80e04
movq -0x20(%rbp), %rdi
addq $0x101, %rdi            # imm = 0x101
movq -0x18(%rbp), %rsi
callq 0x7fa70
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: dsharlet[P]array/include/array/array.h
// Function: nda::auto_allocator<nda::lifetime_counter, 256ul, 1ul, std::allocator<nda::lifetime_counter>>::deallocate(nda::lifetime_counter*, unsigned long)
void deallocate(value_type* ptr, size_t n) noexcept {
    if (ptr == reinterpret_cast<value_type*>(&buffer[0])) {
      assert(allocated);
      allocated = false;
    } else {
      std::allocator_traits<BaseAlloc>::deallocate(alloc, ptr, n);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq %rcx, %rax
jne 0x811a0
movq -0x20(%rbp), %rax
testb $0x1, 0x100(%rax)
je 0x81174
jmp 0x81193
leaq 0x1614fe(%rip), %rdi    # 0x1e2679
leaq 0x15af5f(%rip), %rsi    # 0x1dc0e1
movl $0xc57, %edx            # imm = 0xC57
leaq 0x1614f5(%rip), %rcx    # 0x1e2683
callq 0x3130
movq -0x20(%rbp), %rax
movb $0x0, 0x100(%rax)
jmp 0x811bc
movq -0x20(%rbp), %rdi
addq $0x101, %rdi            # imm = 0x101
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x7fe20
jmp 0x811ba
jmp 0x811bc
addq $0x20, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x116d0
nopw (%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, false>>>::array(nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, false>>>&&)
array(array&& other)
      : alloc_(get_allocator_for_move(other)), buffer_(nullptr), buffer_size_(0), base_(nullptr) {
    using std::swap;
    // If we already took other's allocator, it might be in an undefined state.
    // Just assume we can swap in that case.
    if (typename alloc_traits::propagate_on_container_move_assignment() ||
        alloc_ == other.get_allocator()) {
      swap_except_allocator(other);
    } else {
      shape_ = other.shape_;
      allocate();
      move_construct(other);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movq %rdi, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rsi
callq 0x88930
movq -0x28(%rbp), %rdi
movq $0x0, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
addq $0x20, %rdi
callq 0x1b6d0
jmp 0x8884f
movq -0x10(%rbp), %rdi
callq 0x87200
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x88960
movb %al, -0x31(%rbp)
jmp 0x88869
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x88872
jmp 0x8889a
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x88980
jmp 0x88881
jmp 0x888cb
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x63780
jmp 0x888d1
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
addq $0x20, %rdi
callq 0x44190
movq -0x30(%rbp), %rdi
callq 0x80660
jmp 0x888ba
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x889f0
jmp 0x888c9
jmp 0x888cb
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x33a0
nopw (%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, false>>>::move_construct(nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, false>>>&)
void move_construct(array& other) {
    assert(base_ || shape_.empty());
    assert(shape_ == other.shape_);
    copy_shape_traits_type::for_each_value(
        other.shape_, other.base_, shape_, base_, [&](reference src, reference dst) {
          alloc_traits::construct(alloc_, &dst, std::move(src));
        });
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movb $0x1, %al
cmpq $0x0, 0x18(%rcx)
movb %al, -0x19(%rbp)
jne 0x88a24
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
callq 0x1a8a0
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x88a2d
jmp 0x88a2f
jmp 0x88a4e
leaq 0x15380d(%rip), %rdi    # 0x1dc243
leaq 0x1536a4(%rip), %rsi    # 0x1dc0e1
movl $0x905, %edx            # imm = 0x905
leaq 0x15cfeb(%rip), %rcx    # 0x1e5a34
callq 0x3130
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x44150
testb $0x1, %al
jne 0x88a69
jmp 0x88a6b
jmp 0x88a8a
leaq 0x1540d2(%rip), %rdi    # 0x1dcb44
leaq 0x153668(%rip), %rsi    # 0x1dc0e1
movl $0x906, %edx            # imm = 0x906
leaq 0x15cfaf(%rip), %rcx    # 0x1e5a34
callq 0x3130
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rsi
movq %rax, %rdx
addq $0x20, %rdx
movq 0x18(%rax), %rcx
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %r8
callq 0x88af0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: bool nda::operator==<nda::lifetime_counter, 256ul, 1ul>(nda::auto_allocator<nda::lifetime_counter, 256ul, 1ul, std::allocator<nda::lifetime_counter>> const&, nda::auto_allocator<nda::lifetime_counter, 256ul, 1ul, std::allocator<nda::lifetime_counter>> const&)
bool operator==(const auto_allocator& a, const auto_allocator<U, U_N, U_A>& b) {
    if (a.allocated || b.allocated) {
      return &a.buffer[0] == &b.buffer[0];
    } else {
      return a.alloc == b.alloc;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x100(%rax)
jne 0x88e8a
movq -0x18(%rbp), %rax
testb $0x1, 0x100(%rax)
je 0x88e9f
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x88ebf
movq -0x10(%rbp), %rdi
addq $0x101, %rdi            # imm = 0x101
movq -0x18(%rbp), %rsi
addq $0x101, %rsi            # imm = 0x101
callq 0x89080
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, false>>>::assign(nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::custom_alloc<std::integral_constant<bool, false>>>&&)
void assign(array&& other) {
    if (base_ == other.base_) {
      if (base_) {
        assert(shape_ == other.shape_);
      } else {
        shape_ = other.shape_;
        assert(shape_.empty());
      }
      return;
    }
    if (base_ && shape_ == other.shape_) {
      destroy();
    } else {
      deallocate();
      shape_ = other.shape_;
      allocate();
    }
    move_construct(other);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x8a970
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8a923
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x44150
testb $0x1, %al
jne 0x8a900
jmp 0x8a902
jmp 0x8a921
leaq 0x15223b(%rip), %rdi    # 0x1dcb44
leaq 0x1517d1(%rip), %rsi    # 0x1dc0e1
movl $0x9cc, %edx            # imm = 0x9CC
leaq 0x15c19a(%rip), %rcx    # 0x1e6ab6
callq 0x3130
jmp 0x8a96e
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
addq $0x20, %rdi
callq 0x44190
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
callq 0x1a8a0
testb $0x1, %al
jne 0x8a94b
jmp 0x8a94d
jmp 0x8a96c
leaq 0x1518f8(%rip), %rdi    # 0x1dc24c
leaq 0x151786(%rip), %rsi    # 0x1dc0e1
movl $0x9cf, %edx            # imm = 0x9CF
leaq 0x15c14f(%rip), %rcx    # 0x1e6ab6
callq 0x3130
jmp 0x8a96e
jmp 0x8a9d5
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8a9a1
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x44150
testb $0x1, %al
jne 0x8a996
jmp 0x8a9a1
movq -0x18(%rbp), %rdi
callq 0x80960
jmp 0x8a9c8
movq -0x18(%rbp), %rdi
callq 0x808f0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
addq $0x20, %rdi
callq 0x44190
movq -0x18(%rbp), %rdi
callq 0x80660
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x889f0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, std::allocator<nda::lifetime_counter>>::swap(nda::array<nda::lifetime_counter, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, std::allocator<nda::lifetime_counter>>&)
void swap(array& other) {
    using std::swap;

    if (alloc_traits::propagate_on_container_swap::value) {
      swap(alloc_, other.alloc_);
      swap_except_allocator(other);
    } else {
      // TODO: If the shapes are equal, we could swap each element without the
      // temporary allocation.
      array temp(std::move(other));
      other = std::move(*this);
      *this = std::move(temp);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x88060
movq -0x78(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0x8a510
jmp 0x8bd17
movq -0x78(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x8a510
jmp 0x8bd26
leaq -0x60(%rbp), %rdi
callq 0x7f870
addq $0x80, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7f870
movq -0x68(%rbp), %rdi
callq 0x33a0
nopw %cs:(%rax,%rax)
// File: dsharlet[P]array/test/array_ref.cpp
// Function: nda::test_array_ref_incompatible_shape_body()
TEST(array_ref_incompatible_shape) {
  // Uncomment to see the errors.
  {
    array_ref<int, nda::shape_of_rank<1>> src(nullptr, {{0, 10, 2}});
    // Error converting dim 0: expected static stride 1, got 2
    // array_ref<int, nda::shape<nda::fixed_dim<nda::dynamic, 1>>> dst(src);
  }

  {
    array_ref<int, nda::shape<nda::fixed_dim<10, nda::dynamic>, nda::fixed_dim<2, nda::dynamic>>>
        dst;
    array_ref<int, nda::shape_of_rank<2>> src(nullptr, {{0, 10}, {0, 3}});
    // Error converting dim 1: expected static extent 2, got 3
    // dst = src;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
movl $0x2, %ecx
callq 0x10c60
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x367c0
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdx
callq 0x96d50
leaq -0xb8(%rbp), %rdi
callq 0x96ee0
leaq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0xb8(%rbp), %rdx
callq 0x96f00
leaq -0x138(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
callq 0x10c60
leaq -0x150(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x3, %edx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
callq 0x10c60
leaq -0x120(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x150(%rbp), %rdx
callq 0x11310
leaq -0xf0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x120(%rbp), %rdx
callq 0x96f50
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax,%rax)
// File: dsharlet[P]array/include/array/array.h
// Function: nda::array_ref<int, nda::shape<nda::dim<-9l, -9l, 1l>>>::set_shape(nda::shape<nda::dim<-9l, -9l, 1l>> const&, long)
NDARRAY_HOST_DEVICE void set_shape(const Shape& new_shape, index_t offset = 0) {
    assert(new_shape.is_resolved());
    assert(new_shape.is_subset_of(shape_, -offset));
    shape_ = new_shape;
    base_ = internal::pointer_add(base_, offset);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa0eb0
testb $0x1, %al
jne 0x9701b
jmp 0x9701d
jmp 0x9703c
leaq 0x151774(%rip), %rdi    # 0x1e8798
leaq 0x1450b6(%rip), %rsi    # 0x1dc0e1
movl $0x8a6, %edx            # imm = 0x8A6
leaq 0x151779(%rip), %rcx    # 0x1e87b0
callq 0x3130
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x8, %rsi
xorl %eax, %eax
movl %eax, %edx
subq -0x18(%rbp), %rdx
callq 0xa0ed0
testb $0x1, %al
jne 0x9705b
jmp 0x9705d
jmp 0x9707c
leaq 0x1517dc(%rip), %rdi    # 0x1e8840
leaq 0x145076(%rip), %rsi    # 0x1dc0e1
movl $0x8a7, %edx            # imm = 0x8A7
leaq 0x151739(%rip), %rcx    # 0x1e87b0
callq 0x3130
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rdi
callq 0x439e0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x17b00
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: dsharlet[P]array/test/test.h
// Function: bool nda::assert_dim_eq<-9l, -9l, -9l, -9l, -9l, -9l>(nda::dim<-9l, -9l, -9l> const&, nda::dim<-9l, -9l, -9l> const&)
bool assert_dim_eq(const dim<MinA, ExtentA, StrideA>& a, const dim<MinB, ExtentB, StrideB>& b) {
  static_assert(MinA == MinB, "");
  static_assert(ExtentA == ExtentB, "");
  static_assert(StrideA == StrideB, "");
  ASSERT_EQ(a, b);
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x19220
movb %al, -0x1e1(%rbp)
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x33b0
movq -0x1e0(%rbp), %rdx
leaq 0x144840(%rip), %rsi    # 0x1dc097
leaq -0x1c0(%rbp), %rdi
callq 0x10a90
jmp 0x97865
movb -0x1e1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rdx
callq 0x10f80
jmp 0x97886
leaq 0x144f58(%rip), %rsi    # 0x1dc7e5
leaq -0x1a0(%rbp), %rdi
callq 0x34320
movq %rax, -0x1f0(%rbp)
jmp 0x978a2
movq -0x1f0(%rbp), %rdi
leaq 0x15137a(%rip), %rsi    # 0x1e8c2a
callq 0x34320
movq %rax, -0x1f8(%rbp)
jmp 0x978be
movq -0x1f8(%rbp), %rdi
leaq 0x148ee0(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x200(%rbp)
jmp 0x978da
movq -0x200(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xa4680
movq %rax, -0x208(%rbp)
jmp 0x978f3
movq -0x208(%rbp), %rdi
leaq 0x144ee4(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x210(%rbp)
jmp 0x9790f
movq -0x210(%rbp), %rdi
leaq 0x146bf0(%rip), %rsi    # 0x1de50d
callq 0x34320
movq %rax, -0x218(%rbp)
jmp 0x9792b
movq -0x218(%rbp), %rdi
leaq 0x148e73(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x220(%rbp)
jmp 0x97947
movq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa4680
movq %rax, -0x228(%rbp)
jmp 0x97960
movq -0x228(%rbp), %rdi
leaq 0x15eb0d(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x97975
leaq -0x1a0(%rbp), %rdi
callq 0x10ff0
jmp 0x97983
leaq -0x1c0(%rbp), %rdi
callq 0x3100
leaq -0x1c1(%rbp), %rdi
callq 0x3290
movb $0x1, %al
andb $0x1, %al
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
jmp 0x979fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
jmp 0x979f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x10ff0
jmp 0x979f0
jmp 0x979f2
leaq -0x1c0(%rbp), %rdi
callq 0x3100
leaq -0x1c1(%rbp), %rdi
callq 0x3290
movq -0x1d0(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nop
// File: dsharlet[P]array/test/auto_allocator.cpp
// Function: bool nda::is_auto_allocation<nda::array<int, nda::shape<nda::dim<-9l, -9l, 1l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::auto_allocator<int, 32ul, 4ul, std::allocator<int>>>>(nda::array<int, nda::shape<nda::dim<-9l, -9l, 1l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::auto_allocator<int, 32ul, 4ul, std::allocator<int>>> const&)
bool is_auto_allocation(const T& a) {
  const uint8_t* a_begin = reinterpret_cast<const uint8_t*>(&a);
  const uint8_t* a_end = a_begin + sizeof(T);
  const uint8_t* a_data_begin = reinterpret_cast<const uint8_t*>(a.data());
  const uint8_t* a_data_end = reinterpret_cast<const uint8_t*>(a.data() + a.shape().flat_extent());
  return a_begin <= a_data_begin && a_data_end <= a_end;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0xe8, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0xaa5c0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0xaa5c0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa9b40
movq %rax, %rdi
callq 0x11c00
movq %rax, %rcx
movq -0x38(%rbp), %rax
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x29(%rbp)
ja 0xa9b2c
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
setbe %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: dsharlet[P]array/test/image.cpp
// Function: nda::test_image_chunky_copy_body()
TEST(image_chunky_copy) {
  test_copy_all_types<chunky_image_shape<1>, chunky_image_shape<1>>(1);
  test_copy_all_types<chunky_image_shape<2>, chunky_image_shape<2>>(2);
  test_copy_all_types<chunky_image_shape<3>, chunky_image_shape<3>>(3);
  test_copy_all_types<chunky_image_shape<4>, chunky_image_shape<4>>(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, %edi
callq 0x10b210
movl $0x2, %edi
callq 0x10b240
movl $0x3, %edi
callq 0x10b270
movl $0x4, %edi
callq 0x10b2a0
popq %rbp
retq
nop
// File: dsharlet[P]array/test/image.cpp
// Function: nda::test_image_interleave_body()
TEST(image_interleave) {
  test_copy_all_types<planar_image_shape, chunky_image_shape<1>>(1);
  test_copy_all_types<planar_image_shape, chunky_image_shape<2>>(2);
  test_copy_all_types<planar_image_shape, chunky_image_shape<3>>(3);
  test_copy_all_types<planar_image_shape, chunky_image_shape<4>>(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, %edi
callq 0x10b300
movl $0x2, %edi
callq 0x10b330
movl $0x3, %edi
callq 0x10b360
movl $0x4, %edi
callq 0x10b390
popq %rbp
retq
nop
// File: dsharlet[P]array/test/image.cpp
// Function: nda::test_image_deinterleave_body()
TEST(image_deinterleave) {
  test_copy_all_types<chunky_image_shape<1>, planar_image_shape>(1);
  test_copy_all_types<chunky_image_shape<2>, planar_image_shape>(2);
  test_copy_all_types<chunky_image_shape<3>, planar_image_shape>(3);
  test_copy_all_types<chunky_image_shape<4>, planar_image_shape>(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, %edi
callq 0x10b3c0
movl $0x2, %edi
callq 0x10b3f0
movl $0x3, %edi
callq 0x10b420
movl $0x4, %edi
callq 0x10b450
popq %rbp
retq
nop
// File: dsharlet[P]array/test/image.cpp
// Function: nda::test_image_overload_shape_body()
TEST(image_overload_shape) {
  planar_image<int> planar({10, 20, 3});
  chunky_image<int> chunky({10, 20, 3});

  overload_shape(planar);
  overload_shape(chunky);

  chunky_image<int, 3> chunky3({10, 20, {}});
  general_chunky(chunky3.cref());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp            # imm = 0x380
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x380(%rbp)
movl $0xa, %esi
movl %esi, -0x374(%rbp)
movl $0x14, %edx
movl %edx, -0x370(%rbp)
movl $0x3, %ecx
movl %ecx, -0x36c(%rbp)
callq 0x34640
movq -0x380(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x10d10
movl -0x374(%rbp), %esi
movl -0x370(%rbp), %edx
movl -0x36c(%rbp), %ecx
leaq -0x160(%rbp), %rdi
callq 0x10b9a0
jmp 0xf36af
leaq -0x118(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x10b9f0
jmp 0xf36c4
leaq -0x1c0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x10ba90
jmp 0xf36d6
leaq -0x1c0(%rbp), %rdi
callq 0xf3620
leaq -0x210(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x10bac0
jmp 0xf36f7
leaq -0x210(%rbp), %rdi
callq 0xf3630
leaq -0x2b8(%rbp), %rdi
movl $0xa, %esi
callq 0x10baf0
jmp 0xf3716
leaq -0x2d0(%rbp), %rdi
movl $0x14, %esi
callq 0x10c20
jmp 0xf3729
leaq -0x2d3(%rbp), %rdi
callq 0x10bb20
jmp 0xf3737
leaq -0x2a0(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
leaq -0x2d0(%rbp), %rdx
leaq -0x2d3(%rbp), %rcx
callq 0x10bb40
jmp 0xf375a
leaq -0x268(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x10bba0
jmp 0xf376f
leaq -0x368(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x10bc40
jmp 0xf3784
leaq -0x328(%rbp), %rdi
leaq -0x368(%rbp), %rsi
callq 0x10bc80
jmp 0xf3799
leaq -0x328(%rbp), %rdi
callq 0xf3610
leaq -0x268(%rbp), %rdi
callq 0x10bce0
leaq -0x118(%rbp), %rdi
callq 0x10bd20
leaq -0x68(%rbp), %rdi
callq 0x11110
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x168(%rbp)
movl %eax, -0x16c(%rbp)
jmp 0xf3821
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x168(%rbp)
movl %eax, -0x16c(%rbp)
jmp 0xf3815
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x168(%rbp)
movl %eax, -0x16c(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x10bce0
leaq -0x118(%rbp), %rdi
callq 0x10bd20
leaq -0x68(%rbp), %rdi
callq 0x11110
movq -0x168(%rbp), %rdi
callq 0x33a0
nopw %cs:(%rax,%rax)
// File: dsharlet[P]array/test/image.cpp
// Function: nda::test_image_overload_chunky_body()
TEST(image_overload_chunky) {
  chunky_image<int, 1> chunky1({10, 20, {}});
  chunky_image<int, 3> chunky3({10, 20, {}});

  overload_chunky(chunky1);
  overload_chunky(chunky3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x248(%rbp)
movl $0xa, %esi
movq %rsi, -0x228(%rbp)
callq 0x10bf0
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x240(%rbp)
movl $0x14, %esi
callq 0x10c20
leaq -0xc3(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x10bd60
movq -0x248(%rbp), %rsi
movq -0x240(%rbp), %rdx
movq -0x238(%rbp), %rcx
leaq -0x90(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x10bd80
movq -0x230(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x10bde0
movq -0x228(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x10baf0
jmp 0xf3902
leaq -0x198(%rbp), %rdi
movl $0x14, %esi
callq 0x10c20
jmp 0xf3915
leaq -0x19b(%rbp), %rdi
callq 0x10bb20
jmp 0xf3923
leaq -0x158(%rbp), %rdi
leaq -0x170(%rbp), %rsi
leaq -0x198(%rbp), %rdx
leaq -0x19b(%rbp), %rcx
callq 0x10bb40
jmp 0xf3946
leaq -0x120(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x10bba0
jmp 0xf395b
leaq -0x1e0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x10be80
jmp 0xf396d
leaq -0x1e0(%rbp), %rdi
callq 0xf3840
leaq -0x220(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x10beb0
jmp 0xf398e
leaq -0x220(%rbp), %rdi
callq 0xf3850
leaq -0x120(%rbp), %rdi
callq 0x10bce0
leaq -0x58(%rbp), %rdi
callq 0x10bee0
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x178(%rbp)
movl %eax, -0x17c(%rbp)
jmp 0xf39ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x178(%rbp)
movl %eax, -0x17c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x10bce0
leaq -0x58(%rbp), %rdi
callq 0x10bee0
movq -0x178(%rbp), %rdi
callq 0x33a0
nop