// File: /workspace/github_cpp_makefile_star2_O2/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 $0x318, %rsp            # imm = 0x318
leaq 0x180(%rsp), %r12
leaq 0x28(%rsp), %r14
leaq 0x88(%rsp), %r13
xorl %eax, %eax
cmpq $0x1c, %rax
je 0x8b5dc
movq %rax, 0x20(%rsp)
leaq 0x21450(%rip), %rax     # 0xac65c
movq 0x20(%rsp), %rcx
movslq (%rcx,%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x20(%rsp), %rax
xorl %ebx, %ebx
cmpq $0x20, %rbx
je 0x8b5d3
leaq 0x2147a(%rip), %rax     # 0xac6ac
movslq (%rbx,%rax), %rax
movq %rax, 0x60(%rsp)
xorl %r15d, %r15d
movq %rbx, 0x58(%rsp)
cmpq $0x14, %r15
je 0x8b5c5
leaq 0x21424(%rip), %rax     # 0xac678
movslq (%r15,%rax), %rcx
movq %r12, %rdi
movq 0x50(%rsp), %rsi
movq 0x60(%rsp), %rdx
callq 0x5cb2a
leaq 0xb8(%rsp), %rdi
movq %r12, %rsi
callq 0x6750
andq $0x0, 0x28(%rsp)
leaq 0x150(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x8bcc2
movq %r15, 0x68(%rsp)
movq 0xf0(%rsp), %r15
movq 0xf8(%rsp), %rbx
leaq 0x120(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x897dc
leaq (%rbx,%r15), %rax
leaq (%rbx,%r15), %rdx
decq %rdx
cmpq $0x3, %rbx
pushq $0x3
popq %rcx
cmovlq %rbx, %rcx
movups 0x120(%rsp), %xmm0
movups 0x130(%rsp), %xmm1
movups 0x140(%rsp), %xmm2
movaps %xmm2, 0x1a0(%rsp)
movaps %xmm1, 0x190(%rsp)
movaps %xmm0, 0x180(%rsp)
movq %r15, 0x1b0(%rsp)
movq %rcx, 0x1b8(%rsp)
movq %rdx, 0x1c0(%rsp)
movq %rax, 0x1c8(%rsp)
andq $0x0, 0x1d0(%rsp)
movq %rdx, 0x1d8(%rsp)
movups 0x150(%rsp), %xmm0
movups 0x160(%rsp), %xmm1
movups 0x170(%rsp), %xmm2
leaq 0x1e0(%rsp), %rdx
movups %xmm2, 0x20(%rdx)
movups %xmm1, 0x10(%rdx)
movups %xmm0, (%rdx)
leaq 0xb8(%rsp), %rdx
movq %rdx, 0xa8(%rsp)
movq %r14, 0xb0(%rsp)
leaq 0xa8(%rsp), %rdx
movq %rdx, 0x70(%rsp)
movq 0x1e0(%rsp), %rdi
movq 0x1f8(%rsp), %rsi
testq %rbx, %rbx
jle 0x8b3b1
notq %r15
addq %rax, %r15
addq %rcx, %r15
movq %r15, %rax
cqto
idivq %rcx
movq %rax, %rcx
jmp 0x8b3b3
xorl %ecx, %ecx
pushq $0x2
popq %rbx
leaq 0x78(%rsp), %r14
subq %rdi, %rsi
incq %rsi
movq %rsi, %rax
cqto
idivq %rbx
movq %rax, %rsi
movq 0x198(%rsp), %rax
subq 0x180(%rsp), %rax
addq $0x3, %rax
cqto
pushq $0x4
popq %rdi
idivq %rdi
leaq 0x70(%rsp), %rdx
movq %rdx, 0x78(%rsp)
movq %r12, 0x80(%rsp)
movq %rsi, 0x88(%rsp)
movq %rcx, 0x90(%rsp)
movq %rax, 0x98(%rsp)
movq %r13, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x8bcf0
movq (%rax), %rdi
callq 0x8bce1
sarq %rax
cmpq $0x2, %rax
pushq $0x1
popq %rcx
cmovlq %rcx, %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r14, %rcx
callq 0x8ba72
movq 0x110(%rsp), %rbp
movq %r14, %rdx
movq 0xe0(%rsp), %r14
movq 0xf8(%rsp), %rbx
movq 0x28(%rsp), %r15
movq %r13, %rdi
leaq 0x21039(%rip), %rsi     # 0xac4cd
callq 0x66a0
imulq %rbp, %rbx
imulq %r14, %rbx
testq %rbx, %rbx
movl $0x0, %ebp
cmovleq %rbp, %rbx
xorl %esi, %esi
cmpq %r15, %rbx
setbe %sil
movq %r12, %rdi
movq %r13, %r15
movq %r13, %rdx
callq 0x6894
leaq 0x28(%rsp), %r14
leaq 0x2177(%rip), %rbx      # 0x8d647
movq %r12, %rdi
movq %rbx, %rsi
callq 0x106fe
leaq 0x6110(%rip), %r13      # 0x915f2
movq %rax, %rdi
leaq 0x20b9c(%rip), %rsi     # 0xac088
callq 0x118ac
movq %rax, %rdi
movq %r13, %rsi
callq 0x106fe
movq 0xf8(%rsp), %rcx
imulq 0x110(%rsp), %rcx
imulq 0xe0(%rsp), %rcx
testq %rcx, %rcx
cmovleq %rbp, %rcx
movq %rcx, 0x30(%rsp)
movq %rax, %rdi
leaq 0x30(%rsp), %rsi
callq 0x11052
movq %rax, %rdi
movq %rbx, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x20f95(%rip), %rsi     # 0xac4d9
callq 0x107d8
movq %rax, %rdi
movq %r13, %rsi
callq 0x106fe
movq %rax, %rdi
movq %r14, %rsi
callq 0x11052
movq %rax, %rdi
leaq 0x19d39(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r12, %rdi
callq 0x68d4
movq %r15, %r13
movq %r15, %rdi
callq 0x2090
xorps %xmm0, %xmm0
movaps %xmm0, 0x180(%rsp)
andq $0x0, 0x190(%rsp)
leaq 0xb8(%rsp), %rdi
movq %r12, %rsi
callq 0x1132f
leaq 0xb8(%rsp), %rdi
callq 0x69c2
movq 0x68(%rsp), %r15
addq $0x4, %r15
movq 0x58(%rsp), %rbx
jmp 0x8b243
addq $0x4, %rbx
movq 0x20(%rsp), %rax
jmp 0x8b221
addq $0x4, %rax
jmp 0x8b1f6
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8b5fb
jmp 0x8b5fb
jmp 0x8b5fb
jmp 0x8b5fb
movq %rax, %rbx
jmp 0x8b612
movq %rax, %rbx
jmp 0x8b61f
jmp 0x8b602
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x68d4
leaq 0x88(%rsp), %rdi
callq 0x2090
leaq 0xb8(%rsp), %rdi
callq 0x69c2
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba