// File: /workspace/github_cpp_makefile_star2_O1/dsharlet[P]array/test/array.cpp
// Function: nda::test_array_fill_constructor_body()
TEST(array_fill_constructor) {
  dense_array<int, 1> a({10}, 3);
  for (int x = 0; x < 10; x++) {
    ASSERT_EQ(a(x), 3);
  }

  dense_array<int, 2> b({7, 3}, 5);
  for (int y = 0; y < 3; y++) {
    for (int x = 0; x < 7; x++) {
      ASSERT_EQ(b(x, y), 5);
    }
  }

  dense_array<int, 3> c({5, 9, 3}, 7);
  for (int z = 0; z < 3; z++) {
    for (int y = 0; y < 9; y++) {
      for (int x = 0; x < 5; x++) {
        ASSERT_EQ(c(x, y, z), 7);
      }
    }
  }

  array<int, shape<dim<>, dim<>>> sparse({{-2, 5, 2}, {4, 10, 20}}, 13);
  for (int y = 4; y < 14; y++) {
    for (int x = -2; x < 3; x++) {
      ASSERT_EQ(sparse(x, y), 13);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
xorl %ebp, %ebp
leaq 0x178(%rsp), %rbx
movq %rbp, (%rbx)
movl $0xa, %r14d
movq %r14, 0x8(%rbx)
movq %rax, 0x10(%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0xd09f
movq %rbp, (%rbx)
movq %r14, 0x8(%rbx)
leaq 0x18(%rsp), %r14
movl $0x3, (%r14)
leaq 0x140(%rsp), %rdi
leaq 0x178(%rsp), %rsi
movq %r14, %rdx
callq 0x18cb6
leaq 0x9097d(%rip), %r13     # 0xa1654
leaq 0x9464c(%rip), %r15     # 0xa532a
movq 0x158(%rsp), %rax
movq 0x160(%rsp), %rcx
shlq $0x2, %rcx
subq %rcx, %rax
movl (%rax,%rbp,4), %r12d
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r14, %rdi
leaq 0x920f6(%rip), %rsi     # 0xa2e03
leaq 0x920f8(%rip), %rdx     # 0xa2e0c
callq 0xd0b8
xorl %esi, %esi
cmpl $0x3, %r12d
sete %sil
movq %rbx, %rdi
movq %r14, %rdx
callq 0xbf0a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x91e19(%rip), %rsi     # 0xa2b5c
callq 0x18a4e
movq %rax, %rdi
movq %r15, %rsi
callq 0x18a16
movq %rax, %r12
cmpb $0x1, 0x188(%rax)
jne 0x10d85
movq 0x158(%rsp), %rax
movq 0x160(%rsp), %rcx
shlq $0x2, %rcx
subq %rcx, %rax
movq %r12, %rdi
addq $0x10, %rdi
movl (%rax,%rbp,4), %esi
callq 0x22f0
movq %r12, %rdi
movq %r13, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x9adaf(%rip), %rsi     # 0xabb49
callq 0x18a16
movq %rax, %rdi
movq %r15, %rsi
callq 0x18a16
movq %rax, %r12
cmpb $0x1, 0x188(%rax)
jne 0x10dc7
movq %r12, %rdi
addq $0x10, %rdi
movl $0x3, %esi
callq 0x22f0
movq %r12, %rdi
leaq 0xa7598(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %rbx, %rdi
callq 0xbf62
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x10dfa
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %rbp
cmpq $0xa, %rbp
jne 0x10cde
leaq 0x18(%rsp), %rsi
movq $0x0, (%rsi)
movq $0x7, 0x8(%rsi)
movabsq $-0x8000000000000000, %rbx # imm = 0x8000000000000000
movq %rbx, 0x10(%rsi)
xorl %edi, %edi
callq 0xd09f
xorl %eax, %eax
leaq 0x178(%rsp), %rsi
movq %rax, (%rsi)
movq $0x3, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
movq %rax, 0x18(%rsi)
movq $0x7, 0x20(%rsi)
leaq 0x18(%rsp), %rdx
movl $0x5, (%rdx)
leaq 0xf0(%rsp), %rdi
callq 0x18d2a
movq $0x0, (%rsp)
leaq 0x18(%rsp), %rbx
leaq 0x178(%rsp), %r12
leaq 0x907cb(%rip), %r13     # 0xa1654
leaq 0x9449a(%rip), %r15     # 0xa532a
xorl %edx, %edx
movq %r13, %rbp
movq (%rsp), %rax
subq 0x110(%rsp), %rax
imulq 0x120(%rsp), %rax
movq 0x128(%rsp), %rcx
shlq $0x2, %rax
shlq $0x2, %rcx
subq %rcx, %rax
addq 0x108(%rsp), %rax
movq %rdx, 0x8(%rsp)
movl (%rax,%rdx,4), %r14d
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %r13
movq %rbx, %rdi
leaq 0x91f28(%rip), %rsi     # 0xa2e0d
leaq 0x91f2d(%rip), %rdx     # 0xa2e19
callq 0xd0b8
xorl %esi, %esi
cmpl $0x5, %r14d
sete %sil
movq %r12, %rdi
movq %r13, %rbx
movq %r13, %rdx
callq 0xbf0a
movq %rbp, %r13
movq %r12, %rdi
movq %rbp, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x91c81(%rip), %rsi     # 0xa2ba2
callq 0x18af6
movq %rax, %rdi
movq %r15, %rsi
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x10f81
movq (%rsp), %rax
subq 0x110(%rsp), %rax
movq 0x128(%rsp), %rcx
imulq 0x120(%rsp), %rax
shlq $0x2, %rax
shlq $0x2, %rcx
subq %rcx, %rax
addq 0x108(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x22f0
movq %r14, %rdi
movq %r13, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x9226a(%rip), %rsi     # 0xa3200
callq 0x18a16
movq %rax, %rdi
movq %r15, %rsi
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x10fc3
movq %r14, %rdi
addq $0x10, %rdi
movl $0x5, %esi
callq 0x22f0
movq %r14, %rdi
leaq 0xa739c(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %r12, %rdi
callq 0xbf62
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x10ff6
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x8(%rsp), %rdx
incq %rdx
cmpq $0x7, %rdx
jne 0x10e92
movq (%rsp), %rcx
incq %rcx
movq %rcx, (%rsp)
cmpq $0x3, %rcx
jne 0x10e90
leaq 0xa0(%rsp), %rsi
movq $0x0, (%rsi)
movq $0x5, 0x8(%rsi)
movabsq $-0x8000000000000000, %rbx # imm = 0x8000000000000000
movq %rbx, 0x10(%rsi)
xorl %edi, %edi
callq 0xd09f
xorl %eax, %eax
leaq 0x178(%rsp), %rsi
movq %rax, (%rsi)
movq $0x3, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
movq %rax, 0x18(%rsi)
movq $0x9, 0x20(%rsi)
movq %rbx, 0x28(%rsi)
movq %rax, 0x30(%rsi)
movq $0x5, 0x38(%rsi)
leaq 0xa0(%rsp), %rdx
movl $0x7, (%rdx)
leaq 0x18(%rsp), %rdi
callq 0x18dba
movq $0x0, 0x10(%rsp)
leaq 0xa0(%rsp), %rbp
leaq 0x178(%rsp), %r12
leaq 0x9059e(%rip), %rbx     # 0xa1654
leaq 0x9426d(%rip), %r13     # 0xa532a
movq $0x0, (%rsp)
xorl %esi, %esi
movq %rbx, %r15
movq 0x10(%rsp), %rax
subq 0x38(%rsp), %rax
movq 0x68(%rsp), %rcx
imulq 0x48(%rsp), %rax
movq (%rsp), %rdx
subq 0x50(%rsp), %rdx
imulq 0x60(%rsp), %rdx
shlq $0x2, %rdx
leaq (%rdx,%rax,4), %rax
shlq $0x2, %rcx
subq %rcx, %rax
addq 0x30(%rsp), %rax
movq %rsi, 0x8(%rsp)
movl (%rax,%rsi,4), %r14d
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %rbp, %rbx
movq %rbp, %rdi
leaq 0x91cf2(%rip), %rsi     # 0xa2e1a
leaq 0x91cfa(%rip), %rdx     # 0xa2e29
callq 0xd0b8
xorl %esi, %esi
cmpl $0x7, %r14d
sete %sil
movq %r12, %rdi
movq %rbx, %rbp
movq %rbx, %rdx
callq 0xbf0a
movq %r15, %rbx
movq %r12, %rdi
movq %r15, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x91aa9(%rip), %rsi     # 0xa2c0d
callq 0x18abe
movq %rax, %rdi
movq %r13, %rsi
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x111cc
movq 0x10(%rsp), %rax
subq 0x38(%rsp), %rax
imulq 0x48(%rsp), %rax
movq 0x68(%rsp), %rcx
movq (%rsp), %rdx
subq 0x50(%rsp), %rdx
imulq 0x60(%rsp), %rdx
shlq $0x2, %rdx
leaq (%rdx,%rax,4), %rax
shlq $0x2, %rcx
subq %rcx, %rax
addq 0x30(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x22f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x9198d(%rip), %rsi     # 0xa2b6e
callq 0x18a16
movq %rax, %rdi
movq %r13, %rsi
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x1120e
movq %r14, %rdi
addq $0x10, %rdi
movl $0x7, %esi
callq 0x22f0
movq %r14, %rdi
leaq 0xa7151(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %r12, %rdi
callq 0xbf62
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x1124a
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x8(%rsp), %rsi
incq %rsi
cmpq $0x5, %rsi
jne 0x110c7
movq (%rsp), %rcx
incq %rcx
movq %rcx, (%rsp)
cmpq $0x9, %rcx
jne 0x110c5
movq 0x10(%rsp), %rcx
incq %rcx
movq %rcx, 0x10(%rsp)
cmpq $0x3, %rcx
jne 0x110bd
leaq 0x178(%rsp), %rsi
movq $0x4, (%rsi)
movq $0xa, 0x8(%rsi)
movq $0x14, 0x10(%rsi)
movq $-0x2, 0x18(%rsi)
movq $0x5, 0x20(%rsi)
movq $0x2, 0x28(%rsi)
leaq 0x80(%rsp), %rdx
movl $0xd, (%rdx)
leaq 0xa0(%rsp), %rdi
callq 0x18e4c
movl $0x4, %eax
movq %rax, (%rsp)
leaq 0x80(%rsp), %rbx
leaq 0x178(%rsp), %r12
leaq 0x9035a(%rip), %r13     # 0xa1654
leaq 0x94029(%rip), %r15     # 0xa532a
movq $-0x2, %rax
movq %r13, %rbp
movq %rax, 0x8(%rsp)
subq 0xd8(%rsp), %rax
imulq 0xe8(%rsp), %rax
movq (%rsp), %rcx
subq 0xc0(%rsp), %rcx
imulq 0xd0(%rsp), %rcx
shlq $0x2, %rcx
addq 0xb8(%rsp), %rcx
movl (%rcx,%rax,4), %r14d
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq %rbx, %r13
movq %rbx, %rdi
leaq 0x91ac7(%rip), %rsi     # 0xa2e2a
leaq 0x91ad2(%rip), %rdx     # 0xa2e3c
callq 0xd0b8
xorl %esi, %esi
cmpl $0xd, %r14d
sete %sil
movq %r12, %rdi
movq %r13, %rbx
movq %r13, %rdx
callq 0xbf0a
movq %rbp, %r13
movq %r12, %rdi
movq %rbp, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x918d4(%rip), %rsi     # 0xa2c73
callq 0x18b2e
movq %rax, %rdi
movq %r15, %rsi
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x11401
movq (%rsp), %rax
subq 0xc0(%rsp), %rax
imulq 0xd0(%rsp), %rax
shlq $0x2, %rax
addq 0xb8(%rsp), %rax
movq 0x8(%rsp), %rcx
subq 0xd8(%rsp), %rcx
imulq 0xe8(%rsp), %rcx
movq %r14, %rdi
addq $0x10, %rdi
movl (%rax,%rcx,4), %esi
callq 0x22f0
movq %r14, %rdi
movq %r13, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x91a24(%rip), %rsi     # 0xa2e3a
callq 0x18bd6
movq %rax, %rdi
movq %r15, %rsi
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x11443
movq %r14, %rdi
addq $0x10, %rdi
movl $0xd, %esi
callq 0x22f0
movq %r14, %rdi
leaq 0xa6f1c(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %r12, %rdi
callq 0xbf62
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x1147f
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x8(%rsp), %rax
incq %rax
cmpq $0x3, %rax
jne 0x11308
movq (%rsp), %rax
incq %rax
movq %rax, (%rsp)
cmpq $0xe, %rax
jne 0x11301
leaq 0xa0(%rsp), %rdi
callq 0xe542
leaq 0x18(%rsp), %rdi
callq 0xd16c
leaq 0xf0(%rsp), %rdi
callq 0x1cd2c
leaq 0x140(%rsp), %rdi
callq 0x1cc90
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11653
jmp 0x11653
jmp 0x11653
jmp 0x11653
jmp 0x115e0
jmp 0x11553
jmp 0x11553
jmp 0x1150a
jmp 0x1150a
movq %rax, %rbx
jmp 0x11638
jmp 0x11519
movq %rax, %rbx
jmp 0x11529
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0xbf62
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x11638
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x11638
movq %rax, %rbx
jmp 0x1159e
movq %rax, %rbx
jmp 0x1162b
jmp 0x11569
movq %rax, %rbx
jmp 0x11579
jmp 0x115b2
movq %rax, %rbx
jmp 0x115c2
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0xbf62
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x1159e
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0xa0(%rsp), %rdi
callq 0xe542
jmp 0x11621
jmp 0x11653
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0xbf62
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x1162b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x1162b
movq %rax, %rbx
jmp 0x11621
jmp 0x115ec
movq %rax, %rbx
jmp 0x115fc
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0xbf62
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x11621
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x18(%rsp), %rdi
callq 0xd16c
leaq 0xf0(%rsp), %rdi
callq 0x1cd2c
leaq 0x140(%rsp), %rdi
callq 0x1cc90
movq %rbx, %rdi
callq 0x2300
jmp 0x11653
jmp 0x11653
jmp 0x11653
movq %rax, %rdi
callq 0xc036