// File: 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
movq %rsp, %rbp
subq $0xae0, %rsp            # imm = 0xAE0
leaq -0x50(%rbp), %rdi
movl $0xa, %esi
callq 0x34210
movl $0x3, -0x54(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x54(%rbp), %rdx
callq 0x34cc0
movl $0x0, -0x58(%rbp)
cmpl $0xa, -0x58(%rbp)
jge 0x22142
movl -0x58(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x342e0
movq %rax, -0x960(%rbp)
jmp 0x21f17
movq -0x960(%rbp), %rax
movl (%rax), %eax
subl $0x3, %eax
sete %al
movb %al, -0x969(%rbp)
leaq -0x219(%rbp), %rdi
movq %rdi, -0x968(%rbp)
callq 0x33b0
movq -0x968(%rbp), %rdx
leaq 0x1bc413(%rip), %rsi    # 0x1de360
leaq -0x218(%rbp), %rdi
callq 0x10a90
jmp 0x21f5b
movb -0x969(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x1e8(%rbp), %rdi
leaq -0x218(%rbp), %rdx
callq 0x10f80
jmp 0x21f7c
leaq 0x1ba862(%rip), %rsi    # 0x1dc7e5
leaq -0x1e8(%rbp), %rdi
callq 0x34320
movq %rax, -0x978(%rbp)
jmp 0x21f98
movq -0x978(%rbp), %rdi
leaq 0x1bc113(%rip), %rsi    # 0x1de0b9
callq 0x34360
movq %rax, -0x980(%rbp)
jmp 0x21fb4
movq -0x980(%rbp), %rdi
leaq 0x1be7ea(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x988(%rbp)
jmp 0x21fd0
movl -0x58(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x342e0
movq %rax, -0x990(%rbp)
jmp 0x21fe5
movq -0x990(%rbp), %rsi
movq -0x988(%rbp), %rdi
callq 0x343a0
movq %rax, -0x998(%rbp)
jmp 0x22001
movq -0x998(%rbp), %rdi
leaq 0x1ba7d6(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0x9a0(%rbp)
jmp 0x2201d
movq -0x9a0(%rbp), %rdi
leaq 0x1c522f(%rip), %rsi    # 0x1e725a
callq 0x34320
movq %rax, -0x9a8(%rbp)
jmp 0x22039
movq -0x9a8(%rbp), %rdi
leaq 0x1be765(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x9b0(%rbp)
jmp 0x22055
movq -0x9b0(%rbp), %rdi
movl $0x3, -0x220(%rbp)
leaq -0x220(%rbp), %rsi
callq 0x343a0
movq %rax, -0x9b8(%rbp)
jmp 0x2207b
movq -0x9b8(%rbp), %rdi
leaq 0x1d43f2(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x22090
leaq -0x1e8(%rbp), %rdi
callq 0x10ff0
jmp 0x2209e
leaq -0x218(%rbp), %rdi
callq 0x3100
leaq -0x219(%rbp), %rdi
callq 0x3290
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x21ef8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x22ab7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x22131
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x22125
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x10ff0
jmp 0x22123
jmp 0x22125
leaq -0x218(%rbp), %rdi
callq 0x3100
leaq -0x219(%rbp), %rdi
callq 0x3290
jmp 0x22ab7
leaq -0x2a0(%rbp), %rdi
movl $0x7, %esi
movl $0x3, %edx
callq 0x343e0
jmp 0x2215a
movl $0x5, -0x2a4(%rbp)
leaq -0x270(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
leaq -0x2a4(%rbp), %rdx
callq 0x34d30
jmp 0x22180
movl $0x0, -0x2a8(%rbp)
cmpl $0x3, -0x2a8(%rbp)
jge 0x22422
movl $0x0, -0x2ac(%rbp)
cmpl $0x7, -0x2ac(%rbp)
jge 0x2240c
movl -0x2ac(%rbp), %esi
movl -0x2a8(%rbp), %edx
leaq -0x270(%rbp), %rdi
callq 0x345b0
movq %rax, -0x9c0(%rbp)
jmp 0x221cf
movq -0x9c0(%rbp), %rax
movl (%rax), %eax
subl $0x5, %eax
sete %al
movb %al, -0x9c9(%rbp)
leaq -0x461(%rbp), %rdi
movq %rdi, -0x9c8(%rbp)
callq 0x33b0
movq -0x9c8(%rbp), %rdx
leaq 0x1bc165(%rip), %rsi    # 0x1de36a
leaq -0x460(%rbp), %rdi
callq 0x10a90
jmp 0x22213
movb -0x9c9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x440(%rbp), %rdi
leaq -0x460(%rbp), %rdx
callq 0x10f80
jmp 0x22234
leaq 0x1ba5aa(%rip), %rsi    # 0x1dc7e5
leaq -0x440(%rbp), %rdi
callq 0x34320
movq %rax, -0x9d8(%rbp)
jmp 0x22250
movq -0x9d8(%rbp), %rdi
leaq 0x1bbea1(%rip), %rsi    # 0x1de0ff
callq 0x34600
movq %rax, -0x9e0(%rbp)
jmp 0x2226c
movq -0x9e0(%rbp), %rdi
leaq 0x1be532(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0x9e8(%rbp)
jmp 0x22288
movl -0x2ac(%rbp), %esi
movl -0x2a8(%rbp), %edx
leaq -0x270(%rbp), %rdi
callq 0x345b0
movq %rax, -0x9f0(%rbp)
jmp 0x222a9
movq -0x9f0(%rbp), %rsi
movq -0x9e8(%rbp), %rdi
callq 0x343a0
movq %rax, -0x9f8(%rbp)
jmp 0x222c5
movq -0x9f8(%rbp), %rdi
leaq 0x1ba512(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0xa00(%rbp)
jmp 0x222e1
movq -0xa00(%rbp), %rdi
leaq 0x1bc46e(%rip), %rsi    # 0x1de75d
callq 0x34320
movq %rax, -0xa08(%rbp)
jmp 0x222fd
movq -0xa08(%rbp), %rdi
leaq 0x1be4a1(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0xa10(%rbp)
jmp 0x22319
movq -0xa10(%rbp), %rdi
movl $0x5, -0x468(%rbp)
leaq -0x468(%rbp), %rsi
callq 0x343a0
movq %rax, -0xa18(%rbp)
jmp 0x2233f
movq -0xa18(%rbp), %rdi
leaq 0x1d412e(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x22354
leaq -0x440(%rbp), %rdi
callq 0x10ff0
jmp 0x22362
leaq -0x460(%rbp), %rdi
callq 0x3100
leaq -0x461(%rbp), %rdi
callq 0x3290
movl -0x2ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2ac(%rbp)
jmp 0x221a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x22aab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x223fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x223ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
leaq -0x440(%rbp), %rdi
callq 0x10ff0
jmp 0x223ed
jmp 0x223ef
leaq -0x460(%rbp), %rdi
callq 0x3100
leaq -0x461(%rbp), %rdi
callq 0x3290
jmp 0x22aab
jmp 0x2240e
movl -0x2a8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a8(%rbp)
jmp 0x2218a
leaq -0x518(%rbp), %rdi
movl $0x5, %esi
movl $0x9, %edx
movl $0x3, %ecx
callq 0x34640
jmp 0x2243f
movl $0x7, -0x51c(%rbp)
leaq -0x4d0(%rbp), %rdi
leaq -0x518(%rbp), %rsi
leaq -0x51c(%rbp), %rdx
callq 0x34db0
jmp 0x22465
movl $0x0, -0x520(%rbp)
cmpl $0x3, -0x520(%rbp)
jge 0x22740
movl $0x0, -0x524(%rbp)
cmpl $0x9, -0x524(%rbp)
jge 0x2272a
movl $0x0, -0x528(%rbp)
cmpl $0x5, -0x528(%rbp)
jge 0x22714
movl -0x528(%rbp), %esi
movl -0x524(%rbp), %edx
movl -0x520(%rbp), %ecx
leaq -0x4d0(%rbp), %rdi
callq 0x34730
movq %rax, -0xa20(%rbp)
jmp 0x224d1
movq -0xa20(%rbp), %rax
movl (%rax), %eax
subl $0x7, %eax
sete %al
movb %al, -0xa29(%rbp)
leaq -0x6d9(%rbp), %rdi
movq %rdi, -0xa28(%rbp)
callq 0x33b0
movq -0xa28(%rbp), %rdx
leaq 0x1bbe70(%rip), %rsi    # 0x1de377
leaq -0x6d8(%rbp), %rdi
callq 0x10a90
jmp 0x22515
movb -0xa29(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x6b8(%rbp), %rdi
leaq -0x6d8(%rbp), %rdx
callq 0x10f80
jmp 0x22536
leaq 0x1ba2a8(%rip), %rsi    # 0x1dc7e5
leaq -0x6b8(%rbp), %rdi
callq 0x34320
movq %rax, -0xa38(%rbp)
jmp 0x22552
movq -0xa38(%rbp), %rdi
leaq 0x1bbc0a(%rip), %rsi    # 0x1de16a
callq 0x34570
movq %rax, -0xa40(%rbp)
jmp 0x2256e
movq -0xa40(%rbp), %rdi
leaq 0x1be230(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0xa48(%rbp)
jmp 0x2258a
movl -0x528(%rbp), %esi
movl -0x524(%rbp), %edx
movl -0x520(%rbp), %ecx
leaq -0x4d0(%rbp), %rdi
callq 0x34730
movq %rax, -0xa50(%rbp)
jmp 0x225b1
movq -0xa50(%rbp), %rsi
movq -0xa48(%rbp), %rdi
callq 0x343a0
movq %rax, -0xa58(%rbp)
jmp 0x225cd
movq -0xa58(%rbp), %rdi
leaq 0x1ba20a(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0xa60(%rbp)
jmp 0x225e9
movq -0xa60(%rbp), %rdi
leaq 0x1bbad4(%rip), %rsi    # 0x1de0cb
callq 0x34320
movq %rax, -0xa68(%rbp)
jmp 0x22605
movq -0xa68(%rbp), %rdi
leaq 0x1be199(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0xa70(%rbp)
jmp 0x22621
movq -0xa70(%rbp), %rdi
movl $0x7, -0x6e0(%rbp)
leaq -0x6e0(%rbp), %rsi
callq 0x343a0
movq %rax, -0xa78(%rbp)
jmp 0x22647
movq -0xa78(%rbp), %rdi
leaq 0x1d3e26(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x2265c
leaq -0x6b8(%rbp), %rdi
callq 0x10ff0
jmp 0x2266a
leaq -0x6d8(%rbp), %rdi
callq 0x3100
leaq -0x6d9(%rbp), %rdi
callq 0x3290
movl -0x528(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x528(%rbp)
jmp 0x2249d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x22a9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x22703
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x226f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
leaq -0x6b8(%rbp), %rdi
callq 0x10ff0
jmp 0x226f5
jmp 0x226f7
leaq -0x6d8(%rbp), %rdi
callq 0x3100
leaq -0x6d9(%rbp), %rdi
callq 0x3290
jmp 0x22a9f
jmp 0x22716
movl -0x524(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x524(%rbp)
jmp 0x22486
jmp 0x2272c
movl -0x520(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x520(%rbp)
jmp 0x2246f
leaq -0x778(%rbp), %rdi
movq $-0x2, %rsi
movl $0x5, %edx
movl $0x2, %ecx
callq 0x10c60
jmp 0x2275f
leaq -0x790(%rbp), %rdi
movl $0x4, %esi
movl $0xa, %edx
movl $0x14, %ecx
callq 0x10c60
jmp 0x2277c
leaq -0x760(%rbp), %rdi
leaq -0x778(%rbp), %rsi
leaq -0x790(%rbp), %rdx
callq 0x11310
jmp 0x22798
movl $0xd, -0x794(%rbp)
leaq -0x730(%rbp), %rdi
leaq -0x760(%rbp), %rsi
leaq -0x794(%rbp), %rdx
callq 0x34e40
jmp 0x227be
movl $0x4, -0x798(%rbp)
cmpl $0xe, -0x798(%rbp)
jge 0x22a5d
movl $0xfffffffe, -0x79c(%rbp) # imm = 0xFFFFFFFE
cmpl $0x3, -0x79c(%rbp)
jge 0x22a47
movl -0x79c(%rbp), %esi
movl -0x798(%rbp), %edx
leaq -0x730(%rbp), %rdi
callq 0x34880
movq %rax, -0xa80(%rbp)
jmp 0x2280d
movq -0xa80(%rbp), %rax
movl (%rax), %eax
subl $0xd, %eax
sete %al
movb %al, -0xa89(%rbp)
leaq -0x951(%rbp), %rdi
movq %rdi, -0xa88(%rbp)
callq 0x33b0
movq -0xa88(%rbp), %rdx
leaq 0x1bbb44(%rip), %rsi    # 0x1de387
leaq -0x950(%rbp), %rdi
callq 0x10a90
jmp 0x22851
movb -0xa89(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x930(%rbp), %rdi
leaq -0x950(%rbp), %rdx
callq 0x10f80
jmp 0x22872
leaq 0x1b9f6c(%rip), %rsi    # 0x1dc7e5
leaq -0x930(%rbp), %rdi
callq 0x34320
movq %rax, -0xa98(%rbp)
jmp 0x2288e
movq -0xa98(%rbp), %rdi
leaq 0x1bb934(%rip), %rsi    # 0x1de1d0
callq 0x346f0
movq %rax, -0xaa0(%rbp)
jmp 0x228aa
movq -0xaa0(%rbp), %rdi
leaq 0x1bdef4(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0xaa8(%rbp)
jmp 0x228c6
movl -0x79c(%rbp), %esi
movl -0x798(%rbp), %edx
leaq -0x730(%rbp), %rdi
callq 0x34880
movq %rax, -0xab0(%rbp)
jmp 0x228e7
movq -0xab0(%rbp), %rsi
movq -0xaa8(%rbp), %rdi
callq 0x343a0
movq %rax, -0xab8(%rbp)
jmp 0x22903
movq -0xab8(%rbp), %rdi
leaq 0x1b9ed4(%rip), %rsi    # 0x1dc7e5
callq 0x34320
movq %rax, -0xac0(%rbp)
jmp 0x2291f
movq -0xac0(%rbp), %rdi
leaq 0x1bba6a(%rip), %rsi    # 0x1de397
callq 0x34840
movq %rax, -0xac8(%rbp)
jmp 0x2293b
movq -0xac8(%rbp), %rdi
leaq 0x1bde63(%rip), %rsi    # 0x1e07ac
callq 0x34320
movq %rax, -0xad0(%rbp)
jmp 0x22957
movq -0xad0(%rbp), %rdi
movl $0xd, -0x958(%rbp)
leaq -0x958(%rbp), %rsi
callq 0x343a0
movq %rax, -0xad8(%rbp)
jmp 0x2297d
movq -0xad8(%rbp), %rdi
leaq 0x1d3af0(%rip), %rsi    # 0x1f647b
callq 0x34320
jmp 0x22992
leaq -0x930(%rbp), %rdi
callq 0x10ff0
jmp 0x229a0
leaq -0x950(%rbp), %rdi
callq 0x3100
leaq -0x951(%rbp), %rdi
callq 0x3290
movl -0x79c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x79c(%rbp)
jmp 0x227df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x22a93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x22a39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0x22a2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
leaq -0x930(%rbp), %rdi
callq 0x10ff0
jmp 0x22a2b
jmp 0x22a2d
leaq -0x950(%rbp), %rdi
callq 0x3100
leaq -0x951(%rbp), %rdi
callq 0x3290
jmp 0x22a93
jmp 0x22a49
movl -0x798(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x798(%rbp)
jmp 0x227c8
leaq -0x730(%rbp), %rdi
callq 0x114a0
leaq -0x4d0(%rbp), %rdi
callq 0x11110
leaq -0x270(%rbp), %rdi
callq 0x34950
leaq -0x38(%rbp), %rdi
callq 0x34990
addq $0xae0, %rsp            # imm = 0xAE0
popq %rbp
retq
leaq -0x730(%rbp), %rdi
callq 0x114a0
leaq -0x4d0(%rbp), %rdi
callq 0x11110
leaq -0x270(%rbp), %rdi
callq 0x34950
leaq -0x38(%rbp), %rdi
callq 0x34990
movq -0x1f0(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw %cs:(%rax,%rax)