// File: dsharlet[P]array/test/array.cpp
// Function: nda::test_array_move_body()
TEST(array_move) {
  array_of_rank<int, 3> a({4, 5, 6});
  fill_pattern(a);

  dense_array<int, 3> b({4, 5, 6});
  move(a, b);
  check_pattern(b);

  array_of_rank<int, 3> c({dim<>(0, 4, 2), 5, 6});
  move(b, c);
  check_pattern(c);

  array_of_rank<int, 3> d = make_move(a, c.shape());
  ASSERT_EQ(c.shape(), d.shape());
  check_pattern(d);

  dense_array<int, 3> e = make_move(a, b.shape());
  ASSERT_EQ(b.shape(), e.shape());
  check_pattern(e);

  dense_array<int, 3> g({4, {1, 2}, 5});
  move(a, g);
  check_pattern(g);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x950, %rsp            # imm = 0x950
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x808(%rbp)
movl $0x4, %esi
movl $0x5, %edx
movl $0x6, %ecx
callq 0x34ec0
movq -0x808(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x800(%rbp)
callq 0x34f10
movq -0x800(%rbp), %rdi
xorl %esi, %esi
callq 0x34fb0
jmp 0x26da4
leaq -0x170(%rbp), %rdi
movl $0x4, %esi
movl $0x5, %edx
movl $0x6, %ecx
callq 0x34640
jmp 0x26dc1
leaq -0x128(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x10d10
jmp 0x26dd6
leaq -0x68(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x36310
jmp 0x26de8
leaq -0x188(%rbp), %rdi
movq %rdi, -0x810(%rbp)
callq 0x35c10
movq -0x810(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0x35be0
jmp 0x26e10
xorl %eax, %eax
movl %eax, %esi
leaq -0x250(%rbp), %rdi
movl $0x4, %edx
movl $0x2, %ecx
callq 0x10c60
jmp 0x26e2c
movq -0x240(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x250(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x238(%rbp), %rdi
movl $0x5, %esi
movl $0x6, %edx
callq 0x35aa0
jmp 0x26e5c
leaq -0x1f0(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x34f10
jmp 0x26e71
leaq -0x128(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x36360
jmp 0x26e86
leaq -0x268(%rbp), %rdi
movq %rdi, -0x818(%rbp)
callq 0x35c10
movq -0x818(%rbp), %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x35c90
jmp 0x26eae
leaq -0x1f0(%rbp), %rdi
callq 0x35d20
movq %rax, -0x820(%rbp)
jmp 0x26ec3
leaq -0x2d1(%rbp), %rdi
movq %rdi, -0x828(%rbp)
callq 0x10e30
movq -0x820(%rbp), %rdx
movq -0x828(%rbp), %rcx
leaq -0x2d0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x363b0
jmp 0x26ef6
leaq -0x2d1(%rbp), %rdi
callq 0x10e50
leaq -0x1f0(%rbp), %rdi
callq 0x35d20
movq %rax, -0x830(%rbp)
jmp 0x26f17
leaq -0x2d0(%rbp), %rdi
callq 0x35d20
movq %rax, -0x838(%rbp)
jmp 0x26f2c
movq -0x838(%rbp), %rsi
movq -0x830(%rbp), %rdi
callq 0x35d40
movb %al, -0x839(%rbp)
jmp 0x26f47
leaq -0x489(%rbp), %rdi
movq %rdi, -0x848(%rbp)
callq 0x33b0
movq -0x848(%rbp), %rdx
leaq 0x1b75bf(%rip), %rsi    # 0x1de527
leaq -0x488(%rbp), %rdi
callq 0x10a90
jmp 0x26f76
movb -0x839(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x468(%rbp), %rdi
leaq -0x488(%rbp), %rdx
callq 0x10f80
jmp 0x26f97
leaq 0x1b5847(%rip), %rsi    # 0x1dc7e5
leaq -0x468(%rbp), %rdi
callq 0x34320
movq %rax, -0x850(%rbp)
jmp 0x26fb3
movq -0x850(%rbp), %rdi
leaq 0x1b757d(%rip), %rsi    # 0x1de53e
callq 0x344d0
movq %rax, -0x858(%rbp)
jmp 0x26fcf
movq -0x858(%rbp), %rdi
leaq 0x1b97cf(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x860(%rbp)
jmp 0x26feb
leaq -0x1f0(%rbp), %rdi
callq 0x35d20
movq %rax, -0x868(%rbp)
jmp 0x27000
movq -0x868(%rbp), %rsi
movq -0x860(%rbp), %rdi
callq 0x35d80
movq %rax, -0x870(%rbp)
jmp 0x2701c
movq -0x870(%rbp), %rdi
leaq 0x1b57bb(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x878(%rbp)
jmp 0x27038
movq -0x878(%rbp), %rdi
leaq 0x1b74ee(%rip), %rsi    # 0x1de534
callq 0x344d0
movq %rax, -0x880(%rbp)
jmp 0x27054
movq -0x880(%rbp), %rdi
leaq 0x1b974a(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x888(%rbp)
jmp 0x27070
leaq -0x2d0(%rbp), %rdi
callq 0x35d20
movq %rax, -0x890(%rbp)
jmp 0x27085
movq -0x890(%rbp), %rsi
movq -0x888(%rbp), %rdi
callq 0x35d80
movq %rax, -0x898(%rbp)
jmp 0x270a1
movq -0x898(%rbp), %rdi
leaq 0x1cf3cc(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x270b6
leaq -0x468(%rbp), %rdi
callq 0x10ff0
jmp 0x270c4
leaq -0x488(%rbp), %rdi
callq 0x3100
leaq -0x489(%rbp), %rdi
callq 0x3290
leaq -0x4a8(%rbp), %rdi
movq %rdi, -0x8a0(%rbp)
callq 0x35c10
movq -0x8a0(%rbp), %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x35c90
jmp 0x27104
leaq -0x128(%rbp), %rdi
callq 0x35e20
movq %rax, -0x8a8(%rbp)
jmp 0x27119
leaq -0x511(%rbp), %rdi
movq %rdi, -0x8b0(%rbp)
callq 0x10e30
movq -0x8a8(%rbp), %rdx
movq -0x8b0(%rbp), %rcx
leaq -0x510(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x36410
jmp 0x2714c
leaq -0x511(%rbp), %rdi
callq 0x10e50
leaq -0x128(%rbp), %rdi
callq 0x35e20
movq %rax, -0x8b8(%rbp)
jmp 0x2716d
leaq -0x510(%rbp), %rdi
callq 0x35e20
movq %rax, -0x8c0(%rbp)
jmp 0x27182
movq -0x8c0(%rbp), %rsi
movq -0x8b8(%rbp), %rdi
callq 0x18f50
movb %al, -0x8c1(%rbp)
jmp 0x2719d
leaq -0x6c9(%rbp), %rdi
movq %rdi, -0x8d0(%rbp)
callq 0x33b0
movq -0x8d0(%rbp), %rdx
leaq 0x1b738a(%rip), %rsi    # 0x1de548
leaq -0x6c8(%rbp), %rdi
callq 0x10a90
jmp 0x271cc
movb -0x8c1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x6a8(%rbp), %rdi
leaq -0x6c8(%rbp), %rdx
callq 0x10f80
jmp 0x271ed
leaq 0x1b55f1(%rip), %rsi    # 0x1dc7e5
leaq -0x6a8(%rbp), %rdi
callq 0x34320
movq %rax, -0x8d8(%rbp)
jmp 0x27209
movq -0x8d8(%rbp), %rdi
leaq 0x1b7348(%rip), %rsi    # 0x1de55f
callq 0x344d0
movq %rax, -0x8e0(%rbp)
jmp 0x27225
movq -0x8e0(%rbp), %rdi
leaq 0x1b9579(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x8e8(%rbp)
jmp 0x27241
leaq -0x128(%rbp), %rdi
callq 0x35e20
movq %rax, -0x8f0(%rbp)
jmp 0x27256
movq -0x8f0(%rbp), %rsi
movq -0x8e8(%rbp), %rdi
callq 0x35e40
movq %rax, -0x8f8(%rbp)
jmp 0x27272
movq -0x8f8(%rbp), %rdi
leaq 0x1b5565(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x900(%rbp)
jmp 0x2728e
movq -0x900(%rbp), %rdi
leaq 0x1b72b9(%rip), %rsi    # 0x1de555
callq 0x344d0
movq %rax, -0x908(%rbp)
jmp 0x272aa
movq -0x908(%rbp), %rdi
leaq 0x1b94f4(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x910(%rbp)
jmp 0x272c6
leaq -0x510(%rbp), %rdi
callq 0x35e20
movq %rax, -0x918(%rbp)
jmp 0x272db
movq -0x918(%rbp), %rsi
movq -0x910(%rbp), %rdi
callq 0x35e40
movq %rax, -0x920(%rbp)
jmp 0x272f7
movq -0x920(%rbp), %rdi
leaq 0x1cf176(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x2730c
leaq -0x6a8(%rbp), %rdi
callq 0x10ff0
jmp 0x2731a
leaq -0x6c8(%rbp), %rdi
callq 0x3100
leaq -0x6c9(%rbp), %rdi
callq 0x3290
leaq -0x6e8(%rbp), %rdi
movq %rdi, -0x928(%rbp)
callq 0x35c10
movq -0x928(%rbp), %rsi
leaq -0x510(%rbp), %rdi
callq 0x35be0
jmp 0x2735a
leaq -0x7b0(%rbp), %rdi
movl $0x4, %esi
callq 0x10bf0
jmp 0x2736d
leaq -0x7c8(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
callq 0x10c60
jmp 0x2738f
leaq -0x7e0(%rbp), %rdi
movl $0x5, %esi
callq 0x10c20
jmp 0x273a2
leaq -0x798(%rbp), %rdi
leaq -0x7b0(%rbp), %rsi
leaq -0x7c8(%rbp), %rdx
leaq -0x7e0(%rbp), %rcx
callq 0x10cb0
jmp 0x273c5
leaq -0x750(%rbp), %rdi
leaq -0x798(%rbp), %rsi
callq 0x10d10
jmp 0x273da
leaq -0x68(%rbp), %rdi
leaq -0x750(%rbp), %rsi
callq 0x36310
jmp 0x273ec
leaq -0x7f8(%rbp), %rdi
movq %rdi, -0x930(%rbp)
callq 0x35c10
movq -0x930(%rbp), %rsi
leaq -0x750(%rbp), %rdi
callq 0x35be0
jmp 0x27414
leaq -0x750(%rbp), %rdi
callq 0x11110
leaq -0x510(%rbp), %rdi
callq 0x11110
leaq -0x2d0(%rbp), %rdi
callq 0x35160
leaq -0x1f0(%rbp), %rdi
callq 0x35160
leaq -0x128(%rbp), %rdi
callq 0x11110
leaq -0x68(%rbp), %rdi
callq 0x35160
addq $0x950, %rsp            # imm = 0x950
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x27634
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x27628
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x2761c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x2d1(%rbp), %rdi
callq 0x10e50
jmp 0x2761c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x27610
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x27537
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x2752b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x468(%rbp), %rdi
callq 0x10ff0
jmp 0x27529
jmp 0x2752b
leaq -0x488(%rbp), %rdi
callq 0x3100
leaq -0x489(%rbp), %rdi
callq 0x3290
jmp 0x27610
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x511(%rbp), %rdi
callq 0x10e50
jmp 0x27610
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x27604
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x275d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x275cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x6a8(%rbp), %rdi
callq 0x10ff0
jmp 0x275ca
jmp 0x275cc
leaq -0x6c8(%rbp), %rdi
callq 0x3100
leaq -0x6c9(%rbp), %rdi
callq 0x3290
jmp 0x27604
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x750(%rbp), %rdi
callq 0x11110
leaq -0x510(%rbp), %rdi
callq 0x11110
leaq -0x2d0(%rbp), %rdi
callq 0x35160
leaq -0x1f0(%rbp), %rdi
callq 0x35160
leaq -0x128(%rbp), %rdi
callq 0x11110
leaq -0x68(%rbp), %rdi
callq 0x35160
movq -0xb8(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw %cs:(%rax,%rax)