// File: /workspace/github_cpp_makefile_star2_O1/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 $0x2b8, %rsp            # imm = 0x2B8
xorl %r13d, %r13d
leaq 0x128(%rsp), %r15
leaq 0x20(%rsp), %r12
xorl %eax, %eax
movq %rax, %rcx
leaq 0x20039(%rip), %rax     # 0xbf384
movq %rcx, 0x70(%rsp)
movslq (%rcx,%rax), %rax
movq %rax, 0x80(%rsp)
xorl %ecx, %ecx
leaq 0x2006f(%rip), %rax     # 0xbf3d4
movq %rcx, 0x78(%rsp)
movslq (%rcx,%rax), %rax
movq %rax, 0x88(%rsp)
xorl %ecx, %ecx
leaq 0x20021(%rip), %rax     # 0xbf3a0
movq %rcx, 0x90(%rsp)
movslq (%rcx,%rax), %rbx
movq %r13, 0x128(%rsp)
movq 0x80(%rsp), %rbp
movq %rbp, 0x130(%rsp)
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
movq %r14, 0x138(%rsp)
xorl %edi, %edi
movq %r15, %rsi
callq 0xd09f
leaq 0xa0(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %rbx, 0xc0(%rsp)
movq %r14, 0xc8(%rsp)
movq %r13, 0xd0(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq %r14, 0xe0(%rsp)
movq %r13, 0xe8(%rsp)
movq %rbp, 0xf0(%rsp)
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
callq 0xc2a2
movq %rbx, %rdi
callq 0xc38a
movq %r13, 0x48(%rsp)
movq 0xf0(%rsp), %rsi
cmpq $0x1, %rsi
jle 0x9f820
movq 0xc0(%rsp), %rcx
cmpq $0x3, %rcx
jle 0x9f837
movq 0xd0(%rsp), %rax
movq 0xb8(%rsp), %rdx
movq 0xd8(%rsp), %rdi
leaq (%rcx,%rdx), %r8
movq %rdx, 0x128(%rsp)
leaq -0x1(%rcx,%rdx), %rdx
movq %rdx, 0x138(%rsp)
movq %r8, 0x140(%rsp)
leaq (%rdi,%rax), %r8
movq %rdx, 0x150(%rsp)
leaq (%rdi,%rax), %rdx
decq %rdx
cmpq $0x3, %rdi
movl $0x3, %r9d
cmovgeq %r9, %rdi
movq %rax, 0x158(%rsp)
movq %rdi, 0x160(%rsp)
movq %rdx, 0x168(%rsp)
movq %r8, 0x170(%rsp)
movq 0xe8(%rsp), %r8
movq $0x0, 0x178(%rsp)
movq %rdx, 0x180(%rsp)
leaq (%rsi,%r8), %rdx
movq %r8, 0x188(%rsp)
leaq -0x1(%rsi,%r8), %r8
movq %r8, 0x198(%rsp)
movq %rdx, 0x1a0(%rsp)
movq %r8, 0x1b0(%rsp)
leaq 0x98(%rsp), %rdx
movq %rdx, 0x108(%rsp)
leaq 0x48(%rsp), %rdx
movq %rdx, 0x110(%rsp)
leaq 0x108(%rsp), %rdx
movq %rdx, 0x100(%rsp)
testq %rdi, %rdi
jle 0x9f558
notq %rax
addq %rdi, %rax
addq 0x170(%rsp), %rax
cqto
idivq %rdi
jmp 0x9f55a
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 0x100(%rsp), %rsi
movq %rsi, 0x118(%rsp)
movq %r15, 0x120(%rsp)
movq %rdx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq %rcx, 0x30(%rsp)
movl $0x8, %eax
movq %r12, %rcx
movq (%rcx), %rdx
cmpq 0x20(%rsp,%rax), %rdx
jge 0x9f5bf
leaq (%rsp,%rax), %rcx
addq $0x20, %rcx
addq $0x8, %rax
cmpq $0x18, %rax
jne 0x9f5ad
movq (%rcx), %rax
movl $0x1, %ecx
movq %rcx, %rdx
addq %rcx, %rcx
cmpq %rax, %rdx
jl 0x9f5d1
sarq %rdx
cmpq $0x2, %rdx
movl $0x1, %eax
cmovlq %rax, %rdx
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
movl $0x2, %esi
movq %r12, %rdi
leaq 0x118(%rsp), %rcx
callq 0x9ff58
movq 0xf0(%rsp), %rbp
movq 0xc0(%rsp), %r13
movq 0xd8(%rsp), %r14
movq 0x48(%rsp), %rbx
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r12, %rdi
leaq 0x1fa68(%rip), %rsi     # 0xbf0be
leaq 0x1fa77(%rip), %rdx     # 0xbf0d4
callq 0xd0b8
imulq %rbp, %r14
imulq %r13, %r14
testq %r14, %r14
movl $0x0, %r13d
cmovleq %r13, %r14
xorl %esi, %esi
cmpq %rbx, %r14
setbe %sil
movq %r15, %rdi
movq %r12, %rbp
movq %r12, %rdx
callq 0xbf0a
leaq 0x1fbf(%rip), %rbx      # 0xa1654
leaq 0x5c8e(%rip), %r12      # 0xa532a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x1f692(%rip), %rsi     # 0xbed43
callq 0x19c24
movq %rax, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x9f6fa
movq 0xf0(%rsp), %rsi
imulq 0xd8(%rsp), %rsi
imulq 0xc0(%rsp), %rsi
testq %rsi, %rsi
cmovleq %r13, %rsi
movq %r14, %rdi
addq $0x10, %rdi
callq 0x2110
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x1f9bb(%rip), %rsi     # 0xbf0ca
callq 0x18abe
movq %rax, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x9f73c
movq %r14, %rdi
addq $0x10, %rdi
movq 0x48(%rsp), %rsi
callq 0x2110
movq %r14, %rdi
leaq 0x18c23(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %r15, %rdi
callq 0xbf62
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x9f76f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x128(%rsp)
movl $0x9, %ecx
leaq 0x130(%rsp), %rax
movq %rax, %rdi
leaq 0xb8(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, 0x50(%rsp)
movq %rbp, %r12
movq %rbp, 0x58(%rsp)
movq %rax, %rdi
leaq 0x50(%rsp), %rsi
callq 0x1e56e
leaq 0x98(%rsp), %rdi
callq 0xd16c
movq 0x90(%rsp), %rcx
addq $0x4, %rcx
cmpq $0x14, %rcx
jne 0x9f378
movq 0x78(%rsp), %rcx
addq $0x4, %rcx
cmpq $0x20, %rcx
jne 0x9f35e
movq 0x70(%rsp), %rax
addq $0x4, %rax
cmpq $0x1c, %rax
jne 0x9f341
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ba9b(%rip), %rdi     # 0xbb2c2
leaq 0x18bf(%rip), %rsi      # 0xa10ed
leaq 0x1f6c5(%rip), %rcx     # 0xbeefa
jmp 0x9f84c
leaq 0x1ba84(%rip), %rdi     # 0xbb2c2
leaq 0x18a8(%rip), %rsi      # 0xa10ed
leaq 0x1f728(%rip), %rcx     # 0xbef74
movl $0x269, %edx            # imm = 0x269
callq 0x2100
jmp 0x9f8ab
jmp 0x9f85c
jmp 0x9f85c
movq %rax, %rbx
jmp 0x9f894
movq %rax, %rbx
jmp 0x9f878
jmp 0x9f868
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0xbf62
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x9f894
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x98(%rsp), %rdi
callq 0xd16c
movq %rbx, %rdi
callq 0x2300
jmp 0x9f8ab
movq %rax, %rdi
callq 0xc036