// File: dsharlet[P]array/test/array_lifetime.cpp
// Function: nda::test_array_swap_lifetime_body()
TEST(array_swap_lifetime) {
  movable_custom_alloc::reset_lifetime_counters();
  immovable_custom_alloc::reset_lifetime_counters();
  test_swap_lifetime<std_alloc>();
  test_swap_lifetime<movable_custom_alloc>();
  test_swap_lifetime<immovable_custom_alloc>();
  test_swap_lifetime<auto_alloc_big>(false);
  test_swap_lifetime<auto_alloc_small>();
  ASSERT_EQ(movable_custom_alloc::constructs, 2);
  ASSERT_EQ(immovable_custom_alloc::constructs, 3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
callq 0x580d0
callq 0x580f0
movl $0x1, %edi
movl %edi, -0x390(%rbp)
callq 0x78140
movl -0x390(%rbp), %edi
callq 0x790a0
movl -0x390(%rbp), %edi
callq 0x79fc0
xorl %edi, %edi
callq 0x7aee0
movl -0x390(%rbp), %edi
callq 0x7be10
movq 0x2448c4(%rip), %rax    # 0x2922c8
subq $0x2, %rax
sete %al
movb %al, -0x389(%rbp)
leaq -0x1b1(%rbp), %rdi
movq %rdi, -0x388(%rbp)
callq 0x33b0
movq -0x388(%rbp), %rdx
leaq 0x193d14(%rip), %rsi    # 0x1e1746
leaq -0x1b0(%rbp), %rdi
callq 0x10a90
jmp 0x4da40
movb -0x389(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x190(%rbp), %rdi
leaq -0x1b0(%rbp), %rdx
callq 0x10f80
jmp 0x4da61
leaq 0x18ed7d(%rip), %rsi    # 0x1dc7e5
leaq -0x190(%rbp), %rdi
callq 0x34320
movq %rax, -0x398(%rbp)
jmp 0x4da7d
movq -0x398(%rbp), %rdi
leaq 0x193b83(%rip), %rsi    # 0x1e160e
callq 0x59840
movq %rax, -0x3a0(%rbp)
jmp 0x4da99
movq -0x3a0(%rbp), %rdi
leaq 0x192d05(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x3a8(%rbp)
jmp 0x4dab5
movq -0x3a8(%rbp), %rdi
leaq 0x244805(%rip), %rsi    # 0x2922c8
callq 0x355c0
movq %rax, -0x3b0(%rbp)
jmp 0x4dad1
movq -0x3b0(%rbp), %rdi
leaq 0x18ed06(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x3b8(%rbp)
jmp 0x4daed
movq -0x3b8(%rbp), %rdi
leaq 0x197bf6(%rip), %rsi    # 0x1e56f1
callq 0x34320
movq %rax, -0x3c0(%rbp)
jmp 0x4db09
movq -0x3c0(%rbp), %rdi
leaq 0x192c95(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x3c8(%rbp)
jmp 0x4db25
movq -0x3c8(%rbp), %rdi
movl $0x2, -0x1c8(%rbp)
leaq -0x1c8(%rbp), %rsi
callq 0x343a0
movq %rax, -0x3d0(%rbp)
jmp 0x4db4b
movq -0x3d0(%rbp), %rdi
leaq 0x1a8922(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x4db60
leaq -0x190(%rbp), %rdi
callq 0x10ff0
jmp 0x4db6e
leaq -0x1b0(%rbp), %rdi
callq 0x3100
leaq -0x1b1(%rbp), %rdi
callq 0x3290
movq 0x244743(%rip), %rax    # 0x2922d0
subq $0x3, %rax
sete %al
movb %al, -0x3d9(%rbp)
leaq -0x379(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
callq 0x33b0
movq -0x3d8(%rbp), %rdx
leaq 0x193ac6(%rip), %rsi    # 0x1e1681
leaq -0x378(%rbp), %rdi
callq 0x10a90
jmp 0x4dbc9
movb -0x3d9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x358(%rbp), %rdi
leaq -0x378(%rbp), %rdx
callq 0x10f80
jmp 0x4dbea
leaq 0x18ebf4(%rip), %rsi    # 0x1dc7e5
leaq -0x358(%rbp), %rdi
callq 0x34320
movq %rax, -0x3e8(%rbp)
jmp 0x4dc06
movq -0x3e8(%rbp), %rdi
leaq 0x1939f8(%rip), %rsi    # 0x1e160c
callq 0x59880
movq %rax, -0x3f0(%rbp)
jmp 0x4dc22
movq -0x3f0(%rbp), %rdi
leaq 0x192b7c(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x3f8(%rbp)
jmp 0x4dc3e
movq -0x3f8(%rbp), %rdi
leaq 0x244684(%rip), %rsi    # 0x2922d0
callq 0x355c0
movq %rax, -0x400(%rbp)
jmp 0x4dc5a
movq -0x400(%rbp), %rdi
leaq 0x18eb7d(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x408(%rbp)
jmp 0x4dc76
movq -0x408(%rbp), %rdi
leaq 0x1995d6(%rip), %rsi    # 0x1e725a
callq 0x34320
movq %rax, -0x410(%rbp)
jmp 0x4dc92
movq -0x410(%rbp), %rdi
leaq 0x192b0c(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x418(%rbp)
jmp 0x4dcae
movq -0x418(%rbp), %rdi
movl $0x3, -0x380(%rbp)
leaq -0x380(%rbp), %rsi
callq 0x343a0
movq %rax, -0x420(%rbp)
jmp 0x4dcd4
movq -0x420(%rbp), %rdi
leaq 0x1a8799(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x4dce9
leaq -0x358(%rbp), %rdi
callq 0x10ff0
jmp 0x4dcf7
leaq -0x378(%rbp), %rdi
callq 0x3100
leaq -0x379(%rbp), %rdi
callq 0x3290
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c0(%rbp)
movl %eax, -0x1c4(%rbp)
jmp 0x4dd6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c0(%rbp)
movl %eax, -0x1c4(%rbp)
jmp 0x4dd62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c0(%rbp)
movl %eax, -0x1c4(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x10ff0
jmp 0x4dd60
jmp 0x4dd62
leaq -0x1b0(%rbp), %rdi
callq 0x3100
leaq -0x1b1(%rbp), %rdi
callq 0x3290
jmp 0x4ddde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c0(%rbp)
movl %eax, -0x1c4(%rbp)
jmp 0x4ddd2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c0(%rbp)
movl %eax, -0x1c4(%rbp)
jmp 0x4ddc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c0(%rbp)
movl %eax, -0x1c4(%rbp)
leaq -0x358(%rbp), %rdi
callq 0x10ff0
jmp 0x4ddc4
jmp 0x4ddc6
leaq -0x378(%rbp), %rdi
callq 0x3100
leaq -0x379(%rbp), %rdi
callq 0x3290
movq -0x1c0(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw %cs:(%rax,%rax)