// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/z_order.cpp
// Function: nda::test_for_each_in_z_order_3d_body()
TEST(for_each_in_z_order_3d) {
  for (index_t w : {1, 2, 3, 4, 5, 12, 16, 20}) {
    for (index_t h : {1, 2, 3, 4, 5, 12, 16, 20}) {
      for (index_t d : {1, 2, 3, 4, 5, 12, 16, 20}) {
        dense_array<int, 3> a({w, h, d});
        size_t total_size = 0;
        for_all_indices_in_z_order(a.shape().extent(), [&](index_t x, index_t y, index_t z) {
          total_size++;
          a(x, y, z) = pattern<int>(std::make_tuple(x, y, z));
        });
        // 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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
xorl %ebp, %ebp
leaq 0x20(%rsp), %r15
xorl %ecx, %ecx
leaq 0x20781(%rip), %rax     # 0xc0f34
movq %rcx, 0x50(%rsp)
movslq (%rcx,%rax), %rax
movq %rax, 0x60(%rsp)
xorl %ecx, %ecx
leaq 0x2076a(%rip), %rax     # 0xc0f34
movq %rcx, 0x58(%rsp)
movslq (%rcx,%rax), %rax
movq %rax, 0x68(%rsp)
xorl %ecx, %ecx
leaq 0x20753(%rip), %rax     # 0xc0f34
movq %rcx, 0x70(%rsp)
movslq (%rcx,%rax), %r14
movq %rbp, 0xe8(%rsp)
movq 0x60(%rsp), %rbx
movq %rbx, 0xf0(%rsp)
movabsq $-0x8000000000000000, %r12 # imm = 0x8000000000000000
movq %r12, 0xf8(%rsp)
xorl %edi, %edi
leaq 0xe8(%rsp), %rsi
callq 0xd133
leaq 0x88(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r14, 0xa8(%rsp)
movq %r12, 0xb0(%rsp)
movq %rbp, 0xb8(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq %r12, 0xc8(%rsp)
movq %rbp, 0xd0(%rsp)
movq %rbx, 0xd8(%rsp)
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0xc30a
movq %r14, %rdi
callq 0xc412
movq %rbp, 0x18(%rsp)
movq 0xd8(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0xc0(%rsp), %rdx
leaq 0x18(%rsp), %rsi
movq %rsi, 0x40(%rsp)
movq %r14, 0x48(%rsp)
leaq 0x40(%rsp), %rsi
movq %rsi, 0x78(%rsp)
movq %rax, 0xe8(%rsp)
movq %rdx, 0xf0(%rsp)
movq %rcx, 0xf8(%rsp)
xorl %esi, %esi
cmpq %rdx, %rax
setl %sil
cmovgq %rax, %rdx
shll $0x3, %esi
cmpq %rcx, %rdx
movl $0x10, %eax
cmovlq %rax, %rsi
movq 0xe8(%rsp,%rsi), %rax
movl $0x1, %ecx
movq %rcx, %rdx
addq %rcx, %rcx
cmpq %rax, %rdx
jl 0xa08fe
sarq %rdx
cmpq $0x2, %rdx
movl $0x1, %eax
cmovlq %rax, %rdx
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups %xmm0, (%rsp)
movl $0x2, %esi
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x78(%rsp), %rcx
callq 0xa172f
movq 0x18(%rsp), %r13
movq 0xd8(%rsp), %r14
movq 0xa8(%rsp), %rbp
movq 0xc0(%rsp), %r12
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r15, %rdi
leaq 0x1ff12(%rip), %rsi     # 0xc0895
leaq 0x1ff21(%rip), %rdx     # 0xc08ab
callq 0xd14c
imulq %r14, %r12
imulq %rbp, %r12
testq %r12, %r12
movl $0x0, %ebp
cmovleq %rbp, %r12
xorl %esi, %esi
cmpq %r12, %r13
sete %sil
movq %rbx, %rdi
movq %r15, %rdx
callq 0xbf80
movq %rbx, %r14
leaq 0x2cc3(%rip), %rbx      # 0xa3684
leaq 0x688e(%rip), %r12      # 0xa7256
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x2024d(%rip), %rsi     # 0xc0c2a
callq 0x19062
movq %rax, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %r13
cmpb $0x1, 0x188(%rax)
jne 0xa0a0a
movq %r13, %rdi
addq $0x10, %rdi
movq 0x18(%rsp), %rsi
callq 0x2110
movq %r13, %rdi
movq %rbx, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x1fe84(%rip), %rsi     # 0xc08a3
callq 0x1a146
movq %rax, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %r13
cmpb $0x1, 0x188(%rax)
jne 0xa0a68
movq 0xd8(%rsp), %rsi
imulq 0xc0(%rsp), %rsi
imulq 0xa8(%rsp), %rsi
testq %rsi, %rsi
cmovleq %rbp, %rsi
movq %r13, %rdi
addq $0x10, %rdi
callq 0x2110
movq %r13, %rdi
leaq 0x19827(%rip), %rsi     # 0xba299
callq 0x18fba
movq %r14, %rdi
callq 0xbfd8
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xa0a9b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0xe8(%rsp)
movl $0x9, %ecx
leaq 0xf0(%rsp), %rax
movq %rax, %rdi
leaq 0xa0(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, 0x40(%rsp)
movq %r15, 0x48(%rsp)
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x1f012
leaq 0x80(%rsp), %rdi
callq 0xd206
movq 0x70(%rsp), %rcx
addq $0x4, %rcx
cmpq $0x20, %rcx
jne 0xa07da
movq 0x58(%rsp), %rcx
addq $0x4, %rcx
cmpq $0x20, %rcx
jne 0xa07c3
movq 0x50(%rsp), %rcx
addq $0x4, %rcx
cmpq $0x20, %rcx
jne 0xa07ac
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa0b4a
jmp 0xa0b99
movq %rax, %rbx
jmp 0xa0b82
jmp 0xa0b56
movq %rax, %rbx
jmp 0xa0b66
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0xbfd8
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xa0b82
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x80(%rsp), %rdi
callq 0xd206
movq %rbx, %rdi
callq 0x2300
jmp 0xa0b99
movq %rax, %rdi
callq 0xc0a9