// File: dsharlet[P]array/test/split.cpp
// Function: nda::test_split_even_nonconstant_body()
TEST(split_even_nonconstant) {
  dense_array<int, 3> a({4, 8, 9});
  size_t total_size = 0;
  for (auto zo : split(a.z(), 3)) {
    for (auto yo : split(a.y(), 4)) {
      auto a_inner = a(_, yo, zo);
      total_size += a_inner.size();
      fill_pattern(a_inner);
    }
  }
  // The total number of items in the inner splits should be equal to the size
  // of the array (no overlap among inner splits).
  ASSERT_EQ(total_size, a.size());
  check_pattern(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4d0, %rsp            # imm = 0x4D0
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x420(%rbp)
movl $0x4, %esi
movl $0x8, %edx
movl $0x9, %ecx
callq 0x34640
movq -0x420(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x418(%rbp)
callq 0x10d10
movq -0x418(%rbp), %rdi
movq $0x0, -0xb8(%rbp)
callq 0x1cc8c0
movq %rax, -0x410(%rbp)
jmp 0x1c9344
movq -0x410(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
movl $0x3, %edx
callq 0x162910
jmp 0x1c935e
leaq -0xf0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x162980
jmp 0x1c9381
movq -0xc0(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x1629b0
jmp 0x1c9396
jmp 0x1c9398
leaq -0x118(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x1629e0
movb %al, -0x421(%rbp)
jmp 0x1c93b3
movb -0x421(%rbp), %al
testb $0x1, %al
jne 0x1c93c2
jmp 0x1c9598
leaq -0x118(%rbp), %rdi
callq 0x162a30
movq %rdx, -0x438(%rbp)
movq %rax, -0x430(%rbp)
jmp 0x1c93de
movq -0x438(%rbp), %rax
movq -0x430(%rbp), %rcx
movq %rcx, -0x140(%rbp)
movq %rax, -0x138(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x1cc340
movq %rax, -0x440(%rbp)
jmp 0x1c940c
movq -0x440(%rbp), %rsi
leaq -0x178(%rbp), %rdi
movl $0x4, %edx
callq 0x162910
jmp 0x1c9426
leaq -0x178(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x162980
jmp 0x1c9449
movq -0x148(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x1629b0
jmp 0x1c945e
jmp 0x1c9460
leaq -0x190(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x1629e0
movb %al, -0x441(%rbp)
jmp 0x1c947b
movb -0x441(%rbp), %al
testb $0x1, %al
jne 0x1c948a
jmp 0x1c9583
leaq -0x190(%rbp), %rdi
callq 0x162a30
movq %rdx, -0x458(%rbp)
movq %rax, -0x450(%rbp)
jmp 0x1c94a6
movq -0x458(%rbp), %rax
movq -0x450(%rbp), %rcx
movq %rcx, -0x1b8(%rbp)
movq %rax, -0x1b0(%rbp)
movw 0xc8fd9(%rip), %ax      # 0x2924a2
movw %ax, -0x20a(%rbp)
movups -0x1b8(%rbp), %xmm0
movaps %xmm0, -0x220(%rbp)
movups -0x140(%rbp), %xmm0
movaps %xmm0, -0x230(%rbp)
movq -0x220(%rbp), %rdx
movq -0x218(%rbp), %rcx
movq -0x230(%rbp), %r8
movq -0x228(%rbp), %r9
leaq -0x208(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1cc8e0
jmp 0x1c951a
leaq -0x208(%rbp), %rdi
callq 0x1cc960
movq %rax, -0x460(%rbp)
jmp 0x1c952f
movq -0x460(%rbp), %rcx
movq -0xb8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
leaq -0x208(%rbp), %rdi
xorl %esi, %esi
callq 0x10c390
jmp 0x1c9557
jmp 0x1c9559
leaq -0x190(%rbp), %rdi
callq 0x162cb0
jmp 0x1c9567
jmp 0x1c9460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x1c97f6
jmp 0x1c9585
leaq -0x118(%rbp), %rdi
callq 0x162cb0
jmp 0x1c9593
jmp 0x1c9398
movq -0xb8(%rbp), %rax
movq %rax, -0x470(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x1cc980
movq %rax, -0x468(%rbp)
jmp 0x1c95b8
movq -0x468(%rbp), %rcx
movq -0x470(%rbp), %rax
subq %rcx, %rax
sete %al
movb %al, -0x479(%rbp)
leaq -0x3e1(%rbp), %rdi
movq %rdi, -0x478(%rbp)
callq 0x33b0
movq -0x478(%rbp), %rdx
leaq 0x33e6f(%rip), %rsi     # 0x1fd462
leaq -0x3e0(%rbp), %rdi
callq 0x10a90
jmp 0x1c9601
movb -0x479(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x3c0(%rbp), %rdi
leaq -0x3e0(%rbp), %rdx
callq 0x10f80
jmp 0x1c9622
leaq 0x131bc(%rip), %rsi     # 0x1dc7e5
leaq -0x3c0(%rbp), %rdi
callq 0x34320
movq %rax, -0x488(%rbp)
jmp 0x1c963e
movq -0x488(%rbp), %rdi
leaq 0x34275(%rip), %rsi     # 0x1fd8c1
callq 0x34570
movq %rax, -0x490(%rbp)
jmp 0x1c965a
movq -0x490(%rbp), %rdi
leaq 0x17144(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x498(%rbp)
jmp 0x1c9676
movq -0x498(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x355c0
movq %rax, -0x4a0(%rbp)
jmp 0x1c9692
movq -0x4a0(%rbp), %rdi
leaq 0x13145(%rip), %rsi     # 0x1dc7e5
callq 0x34320
movq %rax, -0x4a8(%rbp)
jmp 0x1c96ae
movq -0x4a8(%rbp), %rdi
leaq 0x33db4(%rip), %rsi     # 0x1fd470
callq 0x36600
movq %rax, -0x4b0(%rbp)
jmp 0x1c96ca
movq -0x4b0(%rbp), %rdi
leaq 0x170d4(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x4b8(%rbp)
jmp 0x1c96e6
leaq -0x68(%rbp), %rdi
callq 0x1cc980
movq %rax, -0x4c0(%rbp)
jmp 0x1c96f8
movq -0x4b8(%rbp), %rdi
movq -0x4c0(%rbp), %rax
movq %rax, -0x3f0(%rbp)
leaq -0x3f0(%rbp), %rsi
callq 0x355c0
movq %rax, -0x4c8(%rbp)
jmp 0x1c9722
movq -0x4c8(%rbp), %rdi
leaq 0x2cd4b(%rip), %rsi     # 0x1f647b
callq 0x34320
jmp 0x1c9737
leaq -0x3c0(%rbp), %rdi
callq 0x10ff0
jmp 0x1c9745
leaq -0x3e0(%rbp), %rdi
callq 0x3100
leaq -0x3e1(%rbp), %rdi
callq 0x3290
leaq -0x408(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x35c10
movq -0x4d0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x35be0
jmp 0x1c9782
leaq -0x68(%rbp), %rdi
callq 0x11110
addq $0x4d0, %rsp            # imm = 0x4D0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x1c97ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x1c97de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x3c0(%rbp), %rdi
callq 0x10ff0
jmp 0x1c97dc
jmp 0x1c97de
leaq -0x3e0(%rbp), %rdi
callq 0x3100
leaq -0x3e1(%rbp), %rdi
callq 0x3290
leaq -0x68(%rbp), %rdi
callq 0x11110
movq -0xf8(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0
nopw %cs:(%rax,%rax)