// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/z_order.cpp
// Function: nda::test_for_each_in_z_order_1d_body()
TEST(for_each_in_z_order_1d) {
  // A 1-d z order traversal is useless, but it should work.
  dense_array<int, 1> a({12}, 0);
  size_t total_size = 0;
  for_all_indices_in_z_order(a.shape().extent(), [&](index_t x) {
    total_size++;
    a(x) = pattern<int>(std::make_tuple(x));
  });
  // 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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
xorl %r12d, %r12d
leaq 0x68(%rsp), %rbx
movq %r12, (%rbx)
movl $0xc, %r14d
movq %r14, 0x8(%rbx)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x10(%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0xd133
movq %r12, (%rbx)
movq %r14, 0x8(%rbx)
leaq 0x8(%rsp), %rbx
movl $0x0, (%rbx)
leaq 0x30(%rsp), %r14
leaq 0x68(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1925a
movq %rsp, %rcx
movq %r12, (%rcx)
movq 0x28(%r14), %rax
movq %rcx, (%r15)
movq %r14, 0x8(%r15)
movq %r15, 0x28(%rsp)
movq %rax, (%rbx)
movl $0x1, %edx
movq %rdx, %rcx
addq %rdx, %rdx
cmpq %rax, %rcx
jl 0xa0233
sarq %rcx
cmpq $0x2, %rcx
movl $0x1, %edx
cmovgeq %rcx, %rdx
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rcx
xorl %esi, %esi
callq 0xa1592
movq (%rsp), %rbx
movq 0x58(%rsp), %r15
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2061d(%rip), %rsi     # 0xc0895
leaq 0x2062c(%rip), %rdx     # 0xc08ab
leaq 0x8(%rsp), %rdi
callq 0xd14c
xorl %eax, %eax
testq %r15, %r15
cmovgq %r15, %rax
xorl %esi, %esi
cmpq %rax, %rbx
sete %sil
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xbf80
leaq 0x33d3(%rip), %rsi      # 0xa3684
leaq 0x68(%rsp), %rdi
callq 0x18fba
leaq 0x20968(%rip), %rsi     # 0xc0c2a
movq %rax, %rdi
callq 0x19062
leaq 0x6f85(%rip), %rsi      # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0xa02f5
movq %rbx, %rdi
addq $0x10, %rdi
movq (%rsp), %rsi
callq 0x2110
leaq 0x3388(%rip), %rsi      # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x20598(%rip), %rsi     # 0xc08a3
movq %rax, %rdi
callq 0x1a146
leaq 0x6f3c(%rip), %rsi      # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0xa0348
movq 0x58(%rsp), %rax
xorl %esi, %esi
testq %rax, %rax
cmovgq %rax, %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x2110
leaq 0x19f4a(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0x68(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xa0378
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x68(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x30(%rsp), %rdi
callq 0xa1df3
cmpq $0x0, 0x48(%rsp)
je 0xa03ba
leaq 0x48(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq -0x10(%rax), %rdi
movq -0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x21f0
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xa03cb
movq %rax, %rbx
jmp 0xa03fb
jmp 0xa03d7
movq %rax, %rbx
jmp 0xa03e4
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xbfd8
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xa03fb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
cmpq $0x0, 0x48(%rsp)
je 0xa0427
leaq 0x48(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq -0x10(%rax), %rdi
movq -0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9