// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/z_order.cpp
// Function: nda::test_split_z_order_3d_body()
TEST(split_z_order_3d) {
  for (index_t w : {2, 3, 4, 5, 12, 16, 20}) {
    for (index_t h : {1, 2, 3, 4, 5, 12, 16, 20}) {
      for (index_t d : {4, 5, 12, 16, 20}) {
        dense_array<int, 3> a({w, h, d});
        size_t total_size = 0;
        auto xs = split<2>(a.x());
        auto ys = split(a.y(), 3);
        auto zs = split<4>(a.z());
        for_all_in_z_order(std::make_tuple(xs, ys, zs), [&](const auto& xo, const auto& yo, const auto& zo) {
          auto a_inner = a(xo, 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_LE(a.size(), total_size);
        check_pattern(a);
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
xorl %ebp, %ebp
leaq 0x118(%rsp), %r15
leaq 0x20(%rsp), %r12
xorl %eax, %eax
movq %rax, %rcx
leaq 0x1fea2(%rip), %rax     # 0xc0ee4
movq %rcx, 0x60(%rsp)
movslq (%rcx,%rax), %rax
movq %rax, 0x70(%rsp)
xorl %ecx, %ecx
leaq 0x1fedb(%rip), %rax     # 0xc0f34
movq %rcx, 0x68(%rsp)
movslq (%rcx,%rax), %rax
movq %rax, 0x78(%rsp)
xorl %ecx, %ecx
leaq 0x1fe90(%rip), %rax     # 0xc0f00
movq %rcx, 0x80(%rsp)
movslq (%rcx,%rax), %rbx
movq %rbp, 0x118(%rsp)
movq 0x70(%rsp), %r13
movq %r13, 0x120(%rsp)
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
movq %r14, 0x128(%rsp)
xorl %edi, %edi
movq %r15, %rsi
callq 0xd133
leaq 0x90(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rbx, 0xb0(%rsp)
movq %r14, 0xb8(%rsp)
movq %rbp, 0xc0(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq %r14, 0xd0(%rsp)
movq %rbp, 0xd8(%rsp)
movq %r13, 0xe0(%rsp)
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0xc30a
movq %rbx, %rdi
callq 0xc412
movq %rbp, 0x18(%rsp)
movq 0xe0(%rsp), %rsi
cmpq $0x1, %rsi
jle 0xa14ff
movq 0xb0(%rsp), %rcx
cmpq $0x3, %rcx
jle 0xa1516
movq 0xd8(%rsp), %r9
movq 0xc0(%rsp), %rax
movq 0xa8(%rsp), %r8
movq 0xc8(%rsp), %rdi
leaq (%rdi,%rax), %rdx
leaq (%rcx,%r8), %r10
movq %r8, 0x118(%rsp)
leaq -0x1(%rcx,%r8), %r8
movq %r8, 0x128(%rsp)
movq %r10, 0x130(%rsp)
leaq (%rdi,%rax), %r10
decq %r10
cmpq $0x3, %rdi
movq %r8, 0x140(%rsp)
movl $0x3, %r8d
cmovlq %rdi, %r8
movq %rax, 0x148(%rsp)
movq %r8, 0x150(%rsp)
movq %r10, 0x158(%rsp)
movq %rdx, 0x160(%rsp)
movq $0x0, 0x168(%rsp)
movq %r10, 0x170(%rsp)
leaq (%rsi,%r9), %r10
movq %r9, 0x178(%rsp)
leaq -0x1(%rsi,%r9), %r9
movq %r9, 0x188(%rsp)
movq %r10, 0x190(%rsp)
movq %r9, 0x1a0(%rsp)
leaq 0x88(%rsp), %r9
movq %r9, 0xf8(%rsp)
leaq 0x18(%rsp), %r9
movq %r9, 0x100(%rsp)
leaq 0xf8(%rsp), %r9
movq %r9, 0xf0(%rsp)
testq %rdi, %rdi
jle 0xa123e
notq %rax
addq %rdx, %rax
addq %r8, %rax
cqto
idivq %r8
jmp 0xa1240
xorl %eax, %eax
leaq 0x1(%rsi), %rdx
shrq $0x3f, %rdx
addq %rsi, %rdx
incq %rdx
sarq %rdx
leaq 0x3(%rcx), %rsi
addq $0x6, %rcx
testq %rsi, %rsi
cmovnsq %rsi, %rcx
sarq $0x2, %rcx
leaq 0xf0(%rsp), %rsi
movq %rsi, 0x108(%rsp)
movq %r15, 0x110(%rsp)
movq %rdx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq %rcx, 0x30(%rsp)
xorl %esi, %esi
cmpq %rax, %rdx
setl %sil
cmovleq %rax, %rdx
shll $0x3, %esi
cmpq %rcx, %rdx
movl $0x10, %eax
cmovlq %rax, %rsi
movq 0x20(%rsp,%rsi), %rax
movl $0x1, %ecx
movq %rcx, %rdx
addq %rcx, %rcx
cmpq %rax, %rdx
jl 0xa12b1
sarq %rdx
cmpq $0x2, %rdx
movl $0x1, %eax
cmovlq %rax, %rdx
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
movl $0x2, %esi
movq %r12, %rdi
leaq 0x108(%rsp), %rcx
callq 0xa1bba
movq 0xe0(%rsp), %rbp
movq 0xb0(%rsp), %rbx
movq 0xc8(%rsp), %r14
movq 0x18(%rsp), %r13
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r12, %rdi
leaq 0x1f8e8(%rip), %rsi     # 0xc0c1e
leaq 0x1f8f7(%rip), %rdx     # 0xc0c34
callq 0xd14c
imulq %rbp, %r14
imulq %rbx, %r14
testq %r14, %r14
movl $0x0, %ebp
cmovleq %rbp, %r14
xorl %esi, %esi
cmpq %r13, %r14
setbe %sil
movq %r15, %rdi
movq %r12, %r13
movq %r12, %rdx
callq 0xbf80
leaq 0x2310(%rip), %rbx      # 0xa3684
leaq 0x5edb(%rip), %r12      # 0xa7256
movq %r15, %rdi
movq %rbx, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x1f513(%rip), %rsi     # 0xc08a3
callq 0x1a146
movq %rax, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0xa13d9
movq 0xe0(%rsp), %rsi
imulq 0xc8(%rsp), %rsi
imulq 0xb0(%rsp), %rsi
testq %rsi, %rsi
cmovleq %rbp, %rsi
movq %r14, %rdi
addq $0x10, %rdi
callq 0x2110
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x1f83c(%rip), %rsi     # 0xc0c2a
callq 0x19062
movq %rax, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0xa141b
movq %r14, %rdi
addq $0x10, %rdi
movq 0x18(%rsp), %rsi
callq 0x2110
movq %r14, %rdi
leaq 0x18e74(%rip), %rsi     # 0xba299
callq 0x18fba
movq %r15, %rdi
callq 0xbfd8
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xa144e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x118(%rsp)
movl $0x9, %ecx
leaq 0x120(%rsp), %rax
movq %rax, %rdi
leaq 0xa8(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, 0x40(%rsp)
movq %r13, %r12
movq %r13, 0x48(%rsp)
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x1f012
leaq 0x88(%rsp), %rdi
callq 0xd206
movq 0x80(%rsp), %rcx
addq $0x4, %rcx
cmpq $0x14, %rcx
jne 0xa1069
movq 0x68(%rsp), %rcx
addq $0x4, %rcx
cmpq $0x20, %rcx
jne 0xa1052
movq 0x60(%rsp), %rax
addq $0x4, %rax
cmpq $0x1c, %rax
jne 0xa1038
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1bb15(%rip), %rdi     # 0xbd01b
leaq 0x1c10(%rip), %rsi      # 0xa311d
leaq 0x1f546(%rip), %rcx     # 0xc0a5a
jmp 0xa152b
leaq 0x1bafe(%rip), %rdi     # 0xbd01b
leaq 0x1bf9(%rip), %rsi      # 0xa311d
leaq 0x1f5a9(%rip), %rcx     # 0xc0ad4
movl $0x269, %edx            # imm = 0x269
callq 0x2100
jmp 0xa158a
jmp 0xa153b
jmp 0xa153b
movq %rax, %rbx
jmp 0xa1573
movq %rax, %rbx
jmp 0xa1557
jmp 0xa1547
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0xbfd8
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xa1573
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x88(%rsp), %rdi
callq 0xd206
movq %rbx, %rdi
callq 0x2300
jmp 0xa158a
movq %rax, %rdi
callq 0xc0a9