// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/shape.cpp
// Function: nda::test_for_each_index_1d_body()
TEST(for_each_index_1d) {
  dense_shape<1> s(20);
  int expected_flat_offset = 0;
  for_each_index(s, [&](auto i) {
    ASSERT_EQ(s[i], expected_flat_offset);
    expected_flat_offset++;
  });
  // Ensure the for_each_index 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 0x1bb52(%rip), %r13     # 0xa3684
leaq 0x1f71d(%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 0x385d0(%rip), %xmm0    # 0xc013f
movups %xmm0, 0xc(%rax)
movups 0x385b9(%rip), %xmm0    # 0xc0133
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 0x37c3c(%rip), %rsi     # 0xbf7eb
callq 0x18ff2
movq %rax, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x87bda
movq %rbp, %rdi
addq $0x10, %rdi
movq %r14, %rsi
callq 0x21b0
movq %rbp, %rdi
movq %r13, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x38589(%rip), %rsi     # 0xc0178
callq 0x4ace2
movq %rax, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x87c1a
movq %rbp, %rdi
addq $0x10, %rdi
movl %r14d, %esi
callq 0x22f0
movq %rbp, %rdi
leaq 0x32675(%rip), %rsi     # 0xba299
callq 0x18fba
movq %rbx, %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x87c4c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %r14
cmpq $0x14, %r14
jne 0x87b39
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x37240(%rip), %rsi     # 0xbeeab
leaq 0x37253(%rip), %rdx     # 0xbeec5
callq 0xd14c
leaq 0x28(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf80
leaq 0x1b9f4(%rip), %rsi     # 0xa3684
leaq 0x28(%rsp), %rdi
callq 0x18fba
leaq 0x384d7(%rip), %rsi     # 0xc0178
movq %rax, %rdi
callq 0x4ace2
leaq 0x1f5a6(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x87cd5
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x14, %esi
callq 0x22f0
leaq 0x1b9a8(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x1d588(%rip), %rsi     # 0xa5273
movq %rax, %rdi
callq 0x1917a
leaq 0x1f55c(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x87d1f
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x14, %esi
callq 0x22f0
leaq 0x32573(%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 0x87d53
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 0x87dae
jmp 0x87d6e
jmp 0x87d7f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbfd8
jmp 0x87d93
jmp 0x87db6
movq %rax, %rbx
jmp 0x87d93
jmp 0x87d86
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x87dae
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9