// File: dsharlet[P]array/test/array_lifetime.cpp
// Function: nda::test_array_move_lifetime_body()
TEST(array_move_lifetime) {
  movable_custom_alloc::reset_lifetime_counters();
  immovable_custom_alloc::reset_lifetime_counters();
  test_move_lifetime(std_alloc());
  test_move_lifetime(movable_custom_alloc());
  test_move_lifetime(immovable_custom_alloc());
  test_move_lifetime(movable_custom_alloc(1));
  test_move_lifetime(auto_alloc_big(), false);
  test_move_lifetime(auto_alloc_small());
  ASSERT_EQ(movable_custom_alloc::constructs, 2 * 4);  // We run tests with movable_custom_alloc twice.
  ASSERT_EQ(immovable_custom_alloc::constructs, 5);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x590, %rsp            # imm = 0x590
callq 0x580d0
callq 0x580f0
leaq -0x1(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x60d60
movq -0x4c0(%rbp), %rdi
movl $0x1, %esi
callq 0x5f890
jmp 0x4bee8
leaq -0x1(%rbp), %rdi
callq 0x60d80
leaq -0x18(%rbp), %rdi
movq %rdi, -0x4c8(%rbp)
xorl %esi, %esi
callq 0x62250
movq -0x4c8(%rbp), %rdi
movl $0x1, %esi
callq 0x60da0
jmp 0x4bf16
leaq -0x18(%rbp), %rdi
callq 0x62280
leaq -0x1c(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
xorl %esi, %esi
callq 0x63750
movq -0x4d0(%rbp), %rdi
movl $0x1, %esi
callq 0x622a0
jmp 0x4bf44
leaq -0x1c(%rbp), %rdi
callq 0x63780
leaq -0x20(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
movl $0x1, %esi
movl %esi, -0x4d4(%rbp)
callq 0x62250
movq -0x4e0(%rbp), %rdi
movl -0x4d4(%rbp), %esi
callq 0x60da0
jmp 0x4bf7c
leaq -0x20(%rbp), %rdi
callq 0x62280
leaq -0x122(%rbp), %rdi
movq %rdi, -0x4e8(%rbp)
callq 0x64c60
movq -0x4e8(%rbp), %rdi
xorl %esi, %esi
callq 0x637a0
jmp 0x4bfa8
leaq -0x122(%rbp), %rdi
callq 0x64c90
leaq -0x144(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0x66170
movq -0x4f0(%rbp), %rdi
movl $0x1, %esi
callq 0x64cc0
jmp 0x4bfda
leaq -0x144(%rbp), %rdi
callq 0x661a0
movq 0x2462db(%rip), %rax    # 0x2922c8
subq $0x8, %rax
sete %al
movb %al, -0x4f9(%rbp)
leaq -0x2f9(%rbp), %rdi
movq %rdi, -0x4f8(%rbp)
callq 0x33b0
movq -0x4f8(%rbp), %rdx
leaq 0x1956a2(%rip), %rsi    # 0x1e16bd
leaq -0x2f8(%rbp), %rdi
callq 0x10a90
jmp 0x4c029
movb -0x4f9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x2d8(%rbp), %rdi
leaq -0x2f8(%rbp), %rdx
callq 0x10f80
jmp 0x4c04a
leaq 0x190794(%rip), %rsi    # 0x1dc7e5
leaq -0x2d8(%rbp), %rdi
callq 0x34320
movq %rax, -0x508(%rbp)
jmp 0x4c066
movq -0x508(%rbp), %rdi
leaq 0x19559a(%rip), %rsi    # 0x1e160e
callq 0x59840
movq %rax, -0x510(%rbp)
jmp 0x4c082
movq -0x510(%rbp), %rdi
leaq 0x19471c(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x518(%rbp)
jmp 0x4c09e
movq -0x518(%rbp), %rdi
leaq 0x24621c(%rip), %rsi    # 0x2922c8
callq 0x355c0
movq %rax, -0x520(%rbp)
jmp 0x4c0ba
movq -0x520(%rbp), %rdi
leaq 0x19071d(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x528(%rbp)
jmp 0x4c0d6
movq -0x528(%rbp), %rdi
leaq 0x1955fd(%rip), %rsi    # 0x1e16e1
callq 0x661c0
movq %rax, -0x530(%rbp)
jmp 0x4c0f2
movq -0x530(%rbp), %rdi
leaq 0x1946ac(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x538(%rbp)
jmp 0x4c10e
movq -0x538(%rbp), %rdi
movl $0x8, -0x300(%rbp)
leaq -0x300(%rbp), %rsi
callq 0x343a0
movq %rax, -0x540(%rbp)
jmp 0x4c134
movq -0x540(%rbp), %rdi
leaq 0x1aa339(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x4c149
leaq -0x2d8(%rbp), %rdi
callq 0x10ff0
jmp 0x4c157
leaq -0x2f8(%rbp), %rdi
callq 0x3100
leaq -0x2f9(%rbp), %rdi
callq 0x3290
movq 0x24615a(%rip), %rax    # 0x2922d0
subq $0x5, %rax
sete %al
movb %al, -0x549(%rbp)
leaq -0x4b1(%rbp), %rdi
movq %rdi, -0x548(%rbp)
callq 0x33b0
movq -0x548(%rbp), %rdx
leaq 0x195543(%rip), %rsi    # 0x1e16e7
leaq -0x4b0(%rbp), %rdi
callq 0x10a90
jmp 0x4c1b2
movb -0x549(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x490(%rbp), %rdi
leaq -0x4b0(%rbp), %rdx
callq 0x10f80
jmp 0x4c1d3
leaq 0x19060b(%rip), %rsi    # 0x1dc7e5
leaq -0x490(%rbp), %rdi
callq 0x34320
movq %rax, -0x558(%rbp)
jmp 0x4c1ef
movq -0x558(%rbp), %rdi
leaq 0x19540f(%rip), %rsi    # 0x1e160c
callq 0x59880
movq %rax, -0x560(%rbp)
jmp 0x4c20b
movq -0x560(%rbp), %rdi
leaq 0x194593(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x568(%rbp)
jmp 0x4c227
movq -0x568(%rbp), %rdi
leaq 0x24609b(%rip), %rsi    # 0x2922d0
callq 0x355c0
movq %rax, -0x570(%rbp)
jmp 0x4c243
movq -0x570(%rbp), %rdi
leaq 0x190594(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x578(%rbp)
jmp 0x4c25f
movq -0x578(%rbp), %rdi
leaq 0x1924f0(%rip), %rsi    # 0x1de75d
callq 0x34320
movq %rax, -0x580(%rbp)
jmp 0x4c27b
movq -0x580(%rbp), %rdi
leaq 0x194523(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x588(%rbp)
jmp 0x4c297
movq -0x588(%rbp), %rdi
movl $0x5, -0x4b8(%rbp)
leaq -0x4b8(%rbp), %rsi
callq 0x343a0
movq %rax, -0x590(%rbp)
jmp 0x4c2bd
movq -0x590(%rbp), %rdi
leaq 0x1aa1b0(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x4c2d2
leaq -0x490(%rbp), %rdi
callq 0x10ff0
jmp 0x4c2e0
leaq -0x4b0(%rbp), %rdi
callq 0x3100
leaq -0x4b1(%rbp), %rdi
callq 0x3290
addq $0x590, %rsp            # imm = 0x590
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x1(%rbp), %rdi
callq 0x60d80
jmp 0x4c445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x62280
jmp 0x4c445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x1c(%rbp), %rdi
callq 0x63780
jmp 0x4c445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x62280
jmp 0x4c445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x122(%rbp), %rdi
callq 0x64c90
jmp 0x4c445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x144(%rbp), %rdi
callq 0x661a0
jmp 0x4c445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
jmp 0x4c3e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
jmp 0x4c3db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x10ff0
jmp 0x4c3d9
jmp 0x4c3db
leaq -0x2f8(%rbp), %rdi
callq 0x3100
leaq -0x2f9(%rbp), %rdi
callq 0x3290
jmp 0x4c445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
jmp 0x4c439
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
jmp 0x4c42d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x490(%rbp), %rdi
callq 0x10ff0
jmp 0x4c42b
jmp 0x4c42d
leaq -0x4b0(%rbp), %rdi
callq 0x3100
leaq -0x4b1(%rbp), %rdi
callq 0x3290
movq -0x10(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw %cs:(%rax,%rax)