// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/shape.cpp
// Function: nda::test_for_all_indices_1d_body()
TEST(for_all_indices_1d) {
  dense_shape<1> s(20);
  int expected_flat_offset = 0;
  for_all_indices(s, [&](int x) {
    ASSERT_EQ(s(x), expected_flat_offset);
    expected_flat_offset++;
  });
  // Ensure the for_all_indices loop above actually ran.
  ASSERT_EQ(expected_flat_offset, 20);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
leaq 0x28(%rsp), %rbx
movq $0x0, (%rbx)
movq $0x14, 0x8(%rbx)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x10(%rbx)
xorl %r14d, %r14d
xorl %edi, %edi
movq %rbx, %rsi
callq 0xd133
movq %rsp, %r15
leaq 0x1d0db(%rip), %r13     # 0xa3684
leaq 0x20ca6(%rip), %r12     # 0xa7256
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x1c, 0x20(%rsp)
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0x2310
movq %rax, (%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x39ab3(%rip), %xmm0    # 0xc0099
movups %xmm0, 0xc(%rax)
movups 0x39a9c(%rip), %xmm0    # 0xc008d
movups %xmm0, (%rax)
movq %rcx, 0x8(%rsp)
movq (%rsp), %rax
movb $0x0, (%rax,%rcx)
movq %rbx, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0xbf80
movq %rbx, %rdi
movq %r13, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x39a84(%rip), %rsi     # 0xc00aa
callq 0x18ff2
movq %rax, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x86651
movq %rbp, %rdi
addq $0x10, %rdi
movq %r14, %rsi
callq 0x21b0
movq %rbp, %rdi
movq %r13, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x39b12(%rip), %rsi     # 0xc0178
callq 0x4ace2
movq %rax, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x86691
movq %rbp, %rdi
addq $0x10, %rdi
movl %r14d, %esi
callq 0x22f0
movq %rbp, %rdi
leaq 0x33bfe(%rip), %rsi     # 0xba299
callq 0x18fba
movq %rbx, %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x866c3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %r14
cmpq $0x14, %r14
jne 0x865b0
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x387c9(%rip), %rsi     # 0xbeeab
leaq 0x387dc(%rip), %rdx     # 0xbeec5
callq 0xd14c
leaq 0x28(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x1cf7d(%rip), %rsi     # 0xa3684
leaq 0x28(%rsp), %rdi
callq 0x18fba
leaq 0x39a60(%rip), %rsi     # 0xc0178
movq %rax, %rdi
callq 0x4ace2
leaq 0x20b2f(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x8674c
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x14, %esi
callq 0x22f0
leaq 0x1cf31(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x1eb11(%rip), %rsi     # 0xa5273
movq %rax, %rdi
callq 0x1917a
leaq 0x20ae5(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x86796
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x14, %esi
callq 0x22f0
leaq 0x33afc(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0x28(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x867ca
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x86825
jmp 0x867e5
jmp 0x867f6
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbfd8
jmp 0x8680a
jmp 0x8682d
movq %rax, %rbx
jmp 0x8680a
jmp 0x867fd
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x86825
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9