// File: /workspace/github_cpp_makefile_star2_O1/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 0xd09f
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 0x18cb6
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 0x9e577
sarq %rcx
cmpq $0x2, %rcx
movl $0x1, %edx
cmovgeq %rcx, %rdx
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rcx
xorl %esi, %esi
callq 0x9f8b3
movq (%rsp), %rbx
movq 0x58(%rsp), %r15
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x20779(%rip), %rsi     # 0xbed35
leaq 0x20788(%rip), %rdx     # 0xbed4b
leaq 0x8(%rsp), %rdi
callq 0xd0b8
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 0xbf0a
leaq 0x305f(%rip), %rsi      # 0xa1654
leaq 0x68(%rsp), %rdi
callq 0x18a16
leaq 0x20ac4(%rip), %rsi     # 0xbf0ca
movq %rax, %rdi
callq 0x18abe
leaq 0x6d15(%rip), %rsi      # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x9e639
movq %rbx, %rdi
addq $0x10, %rdi
movq (%rsp), %rsi
callq 0x2110
leaq 0x3014(%rip), %rsi      # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x206f4(%rip), %rsi     # 0xbed43
movq %rax, %rdi
callq 0x19c24
leaq 0x6ccc(%rip), %rsi      # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x9e68c
movq 0x58(%rsp), %rax
xorl %esi, %esi
testq %rax, %rax
cmovgq %rax, %rsi
movq %rbx, %rdi
addq $0x10, %rdi
callq 0x2110
leaq 0x19cd6(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0x68(%rsp), %rdi
callq 0xbf62
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9e6bc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x68(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x30(%rsp), %rdi
callq 0xa01b2
leaq 0x30(%rsp), %rdi
callq 0x1cc90
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x9e733
jmp 0x9e6ef
movq %rax, %rbx
jmp 0x9e71f
jmp 0x9e6fb
movq %rax, %rbx
jmp 0x9e708
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xbf62
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9e71f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x30(%rsp), %rdi
callq 0x1cc90
movq %rbx, %rdi
callq 0x2300
jmp 0x9e733
movq %rax, %rdi
callq 0xc036