// File: /workspace/github_cpp_makefile_star2_O2/dsharlet[P]array/test/algorithm.cpp
// Function: nda::test_algorithm_move_body()
TEST(algorithm_move) {
  array_of_rank<int, 2> a({10, 20});
  generate(a, rand);

  for (int crop_min : {0, 1}) {
    for (int crop_max : {0, 1}) {
      int x_min = a.shape().x().min() + crop_min;
      int x_max = a.shape().x().max() - crop_max;
      int y_min = a.shape().y().min() + crop_min;
      int y_max = a.shape().y().max() - crop_max;
      shape_of_rank<2> b_shape({{x_min, x_max - x_min + 1}, {y_min, y_max - y_min + 1}});
      array_of_rank<int, 2> b(b_shape);

      move(a, b);
      // The lifetime of moved elements is tested in array_lifetime.cpp.
      ASSERT(equal(a(b.x(), b.y()), b));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
leaq 0xd0(%rsp), %rsi
andq $0x0, (%rsi)
movq $0x14, 0x8(%rsi)
movq %rax, 0x10(%rsi)
andq $0x0, 0x18(%rsi)
movq $0xa, 0x20(%rsi)
movq %rax, 0x28(%rsi)
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x69d2
movq 0xdbd83(%rip), %rsi     # 0xe1fa8
movq %rbx, %rdi
callq 0x6a07
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x18(%rsp)
xorl %eax, %eax
leaq 0xd0(%rsp), %r14
leaq 0xa0(%rsp), %rbp
leaq 0x158(%rsp), %r15
cmpq $0x8, %rax
je 0x63b0
movq %rax, 0x8(%rsp)
movl 0x18(%rsp,%rax), %r13d
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
cmpq $0x8, %r12
je 0x63a2
movl 0x10(%rsp,%r12), %eax
movl 0x70(%rsp), %ecx
movl 0x88(%rsp), %edx
leal (%rdx,%r13), %esi
addl 0x90(%rsp), %edx
leal (%rcx,%r13), %edi
addl 0x78(%rsp), %ecx
movslq %esi, %rsi
subl %esi, %edx
subl %eax, %edx
movslq %edx, %rdx
movslq %edi, %rdi
addl %edi, %eax
subl %eax, %ecx
movslq %ecx, %rax
movq %rdi, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x30(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
callq 0x69d2
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x6ada
leaq 0x108(%rsp), %rdx
movq 0x10(%rdx), %rax
leaq 0xb8(%rsp), %rcx
movq %rax, 0x10(%rcx)
movups (%rdx), %xmm0
movups %xmm0, (%rcx)
movq -0x8(%rdx), %rax
movq %rax, 0xb0(%rsp)
movups -0x18(%rdx), %xmm0
movaps %xmm0, 0xa0(%rsp)
movq 0x68(%rsp), %rsi
leaq 0x120(%rsp), %rbx
movq %rbx, %rdi
leaq 0x70(%rsp), %rdx
movq %rbp, %rcx
callq 0x7d3a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6a96
movl %eax, %ebx
movq %rbp, %rdi
leaq 0x86cdf(%rip), %rsi     # 0x8d048
leaq 0x7(%rsp), %rdx
callq 0x66a0
movzbl %bl, %esi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x6894
movq %r15, %rdi
callq 0x68d4
movq %rbp, %rdi
callq 0x2090
movq %r14, %rdi
callq 0x6aca
addq $0x4, %r12
jmp 0x627c
movq 0x8(%rsp), %rax
addq $0x4, %rax
jmp 0x6256
leaq 0x50(%rsp), %rdi
callq 0x6aca
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x63d0
jmp 0x63e9
movq %rax, %rbx
jmp 0x63f9
jmp 0x63e9
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x2090
jmp 0x63ec
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x6aca
leaq 0x50(%rsp), %rdi
callq 0x6aca
movq %rbx, %rdi
callq 0x22f0