// File: dsharlet[P]array/test/array_lifetime.cpp
// Function: void nda::test_lifetime_leaks<std::allocator<nda::lifetime_counter>>()
void test_lifetime_leaks() {
  lifetime_counter::reset();
  {
    lifetime_array<Alloc> empty;
    lifetime_array<Alloc> default_init(lifetime_shape);
    lifetime_array<Alloc> default_init2({4, 9});
    lifetime_array<Alloc> default_init3({5, 12});
    lifetime_array<Alloc> default_init4({3, 8});
    lifetime_array<Alloc> copy(default_init);
    lifetime_array<Alloc> copy2(default_init2);
    lifetime_array<Alloc> copy3(copy2);
    lifetime_array<Alloc> copy_empty(empty);
    lifetime_array<Alloc> assign_init = default_init;
    lifetime_array<Alloc> assign_init_empty = empty;
    lifetime_array<Alloc> assign;
    assign = default_init;
    assign = default_init2;
    assign = default_init2;
    assign = default_init;
    assign = default_init;
    assign = default_init2;
    assign = default_init;
    assign = default_init2;
    assign = std::move(default_init);
    assign = std::move(default_init2);
    assign = std::move(copy2);
    assign = copy3;
    assign = copy;
    assign = copy;
    copy.clear();
    assign = copy;
    lifetime_array<Alloc> assign2;
    assign2.assign(default_init3);
    assign2.assign(default_init4);
    assign2.assign(default_init4);
    assign2.assign(default_init3);
    assign2.assign(default_init4);
    assign2.assign(lifetime_shape, lifetime_counter());
    assign2.assign(std::move(default_init3));
    assign2.assign(default_init4);
    assign2.assign(std::move(default_init4));
  }
  ASSERT_EQ(lifetime_counter::destructs, lifetime_counter::constructs());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x700, %rsp            # imm = 0x700
callq 0x7f630
leaq -0x50(%rbp), %rdi
callq 0x89f10
leaq 0x215508(%rip), %rsi    # 0x292258
leaq -0xa0(%rbp), %rdi
callq 0x7f7e0
jmp 0x7cd5e
leaq -0x130(%rbp), %rdi
movl $0x4, %esi
movl $0x9, %edx
callq 0x11150
jmp 0x7cd76
leaq -0x100(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x7f7e0
jmp 0x7cd8b
leaq -0x1b0(%rbp), %rdi
movl $0x5, %esi
movl $0xc, %edx
callq 0x11150
jmp 0x7cda3
leaq -0x180(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x7f7e0
jmp 0x7cdb8
leaq -0x230(%rbp), %rdi
movl $0x3, %esi
movl $0x8, %edx
callq 0x11150
jmp 0x7cdd0
leaq -0x200(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x7f7e0
jmp 0x7cde5
leaq -0x280(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x86350
jmp 0x7cdfa
leaq -0x2d0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x86350
jmp 0x7ce0f
leaq -0x320(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x86350
jmp 0x7ce24
leaq -0x370(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x86350
jmp 0x7ce36
leaq -0x3c0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x86350
jmp 0x7ce4b
leaq -0x410(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x86350
jmp 0x7ce5d
leaq -0x460(%rbp), %rdi
callq 0x89f10
jmp 0x7ce6b
leaq -0x460(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x89f40
jmp 0x7ce80
leaq -0x460(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x89f40
jmp 0x7ce95
leaq -0x460(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x89f40
jmp 0x7ceaa
leaq -0x460(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x89f40
jmp 0x7cebf
leaq -0x460(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x89f40
jmp 0x7ced4
leaq -0x460(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x89f40
jmp 0x7cee9
leaq -0x460(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x89f40
jmp 0x7cefe
leaq -0x460(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x89f40
jmp 0x7cf13
leaq -0x460(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x8a510
jmp 0x7cf28
leaq -0x460(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x8a510
jmp 0x7cf3d
leaq -0x460(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x8a510
jmp 0x7cf52
leaq -0x460(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x89f40
jmp 0x7cf67
leaq -0x460(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x89f40
jmp 0x7cf7c
leaq -0x460(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x89f40
jmp 0x7cf91
leaq -0x280(%rbp), %rdi
callq 0x8aec0
jmp 0x7cf9f
leaq -0x460(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x89f40
jmp 0x7cfb4
leaq -0x4b0(%rbp), %rdi
callq 0x89f10
jmp 0x7cfc2
leaq -0x4b0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x864b0
jmp 0x7cfd7
leaq -0x4b0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x864b0
jmp 0x7cfec
leaq -0x4b0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x864b0
jmp 0x7d001
leaq -0x4b0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x864b0
jmp 0x7d016
leaq -0x4b0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x864b0
jmp 0x7d02b
movups 0x215246(%rip), %xmm0   # 0x292278
movaps %xmm0, -0x4c0(%rbp)
movups 0x215228(%rip), %xmm0   # 0x292268
movaps %xmm0, -0x4d0(%rbp)
movups 0x21520a(%rip), %xmm0   # 0x292258
movaps %xmm0, -0x4e0(%rbp)
leaq -0x4e1(%rbp), %rdi
callq 0x7fd00
jmp 0x7d063
leaq -0x4b0(%rbp), %rdi
leaq -0x4e0(%rbp), %rsi
leaq -0x4e1(%rbp), %rdx
callq 0x856b0
jmp 0x7d07f
leaq -0x4e1(%rbp), %rdi
callq 0x7ff40
leaq -0x4b0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x8c010
jmp 0x7d0a0
leaq -0x4b0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x864b0
jmp 0x7d0b5
leaq -0x4b0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x8c010
jmp 0x7d0ca
leaq -0x4b0(%rbp), %rdi
callq 0x7f870
leaq -0x460(%rbp), %rdi
callq 0x7f870
leaq -0x410(%rbp), %rdi
callq 0x7f870
leaq -0x3c0(%rbp), %rdi
callq 0x7f870
leaq -0x370(%rbp), %rdi
callq 0x7f870
leaq -0x320(%rbp), %rdi
callq 0x7f870
leaq -0x2d0(%rbp), %rdi
callq 0x7f870
leaq -0x280(%rbp), %rdi
callq 0x7f870
leaq -0x200(%rbp), %rdi
callq 0x7f870
leaq -0x180(%rbp), %rdi
callq 0x7f870
leaq -0x100(%rbp), %rdi
callq 0x7f870
leaq -0xa0(%rbp), %rdi
callq 0x7f870
leaq -0x50(%rbp), %rdi
callq 0x7f870
leaq 0x2151ee(%rip), %rax    # 0x292358
movq (%rax), %rax
movq %rax, -0x6c0(%rbp)
callq 0x7f730
movq %rax, %rcx
movq -0x6c0(%rbp), %rax
subq %rcx, %rax
sete %al
movb %al, -0x6b1(%rbp)
leaq -0x699(%rbp), %rdi
movq %rdi, -0x6b0(%rbp)
callq 0x33b0
movq -0x6b0(%rbp), %rdx
leaq 0x16a0ac(%rip), %rsi    # 0x1e725c
leaq -0x698(%rbp), %rdi
callq 0x10a90
jmp 0x7d1be
movb -0x6b1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x678(%rbp), %rdi
leaq -0x698(%rbp), %rdx
callq 0x10f80
jmp 0x7d1df
leaq 0x15f5ff(%rip), %rsi    # 0x1dc7e5
leaq -0x678(%rbp), %rdi
callq 0x34320
movq %rax, -0x6c8(%rbp)
jmp 0x7d1fb
movq -0x6c8(%rbp), %rdi
leaq 0x1646d5(%rip), %rsi    # 0x1e18de
callq 0x7f8f0
movq %rax, -0x6d0(%rbp)
jmp 0x7d217
movq -0x6d0(%rbp), %rdi
leaq 0x163587(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x6d8(%rbp)
jmp 0x7d233
movq -0x6d8(%rbp), %rdi
leaq 0x215117(%rip), %rsi    # 0x292358
callq 0x355c0
movq %rax, -0x6e0(%rbp)
jmp 0x7d24f
movq -0x6e0(%rbp), %rdi
leaq 0x15f588(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x6e8(%rbp)
jmp 0x7d26b
movq -0x6e8(%rbp), %rdi
leaq 0x16a002(%rip), %rsi    # 0x1e727b
callq 0x7f760
movq %rax, -0x6f0(%rbp)
jmp 0x7d287
movq -0x6f0(%rbp), %rdi
leaq 0x163517(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x6f8(%rbp)
jmp 0x7d2a3
callq 0x7f730
movq -0x6f8(%rbp), %rdi
movq %rax, -0x6a8(%rbp)
leaq -0x6a8(%rbp), %rsi
callq 0x355c0
movq %rax, -0x700(%rbp)
jmp 0x7d2cb
movq -0x700(%rbp), %rdi
leaq 0x1791a2(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x7d2e0
leaq -0x678(%rbp), %rdi
callq 0x10ff0
jmp 0x7d2ee
leaq -0x698(%rbp), %rdi
callq 0x3100
leaq -0x699(%rbp), %rdi
callq 0x3290
addq $0x700, %rsp            # imm = 0x700
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d4dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d4d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d4c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d4b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d4ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d4a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d494
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d488
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d47c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d470
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d464
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d458
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d44c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x4e1(%rbp), %rdi
callq 0x7ff40
leaq -0x4b0(%rbp), %rdi
callq 0x7f870
leaq -0x460(%rbp), %rdi
callq 0x7f870
leaq -0x410(%rbp), %rdi
callq 0x7f870
leaq -0x3c0(%rbp), %rdi
callq 0x7f870
leaq -0x370(%rbp), %rdi
callq 0x7f870
leaq -0x320(%rbp), %rdi
callq 0x7f870
leaq -0x2d0(%rbp), %rdi
callq 0x7f870
leaq -0x280(%rbp), %rdi
callq 0x7f870
leaq -0x200(%rbp), %rdi
callq 0x7f870
leaq -0x180(%rbp), %rdi
callq 0x7f870
leaq -0x100(%rbp), %rdi
callq 0x7f870
leaq -0xa0(%rbp), %rdi
callq 0x7f870
leaq -0x50(%rbp), %rdi
callq 0x7f870
jmp 0x7d549
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d53d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7d531
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x678(%rbp), %rdi
callq 0x10ff0
jmp 0x7d52f
jmp 0x7d531
leaq -0x698(%rbp), %rdi
callq 0x3100
leaq -0x699(%rbp), %rdi
callq 0x3290
movq -0xa8(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopl (%rax)