// File: /workspace/github_cpp_makefile_star2_O2/dsharlet[P]array/test/ein_reduce.cpp
// Function: nda::test_ein_sum_sum_3d_body()
TEST(ein_sum_sum_3d) {
  array_of_rank<int, 3> T({4, 5, 8});
  fill_pattern(T);

  // Fully reduce T.
  int sum_ijk = 0;
  ein_reduce(ein(sum_ijk) -= ein<i, j, k>(T));

  int sum_ijk_ref = 0;
  T.for_each_value([&](int i) { sum_ijk_ref -= i; });
  ASSERT_EQ(sum_ijk, sum_ijk_ref);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
leaq 0x100(%rsp), %rbx
pushq $0x4
popq %rsi
pushq $0x5
popq %rdx
pushq $0x8
popq %rcx
movq %rbx, %rdi
callq 0x10b74
leaq 0x78(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10b92
movq %r14, %rdi
xorl %esi, %esi
callq 0x10bbd
leaq 0x4(%rsp), %rax
andl $0x0, (%rax)
movq 0x90(%rsp), %rcx
movups 0x98(%rsp), %xmm0
movups %xmm0, 0x118(%rsp)
movq 0xa8(%rsp), %rdx
movq %rdx, 0x128(%rsp)
movups 0xb0(%rsp), %xmm0
movups %xmm0, 0x130(%rsp)
movq 0xc0(%rsp), %rdx
movq %rdx, 0x140(%rsp)
movups 0xc8(%rsp), %xmm0
movups %xmm0, 0x148(%rsp)
movq 0xd8(%rsp), %rdx
movq %rdx, 0x158(%rsp)
movq %rax, 0x100(%rsp)
movq %rcx, 0x110(%rsp)
movups 0x118(%rsp), %xmm0
leaq 0x10(%rsp), %rcx
movaps %xmm0, (%rcx)
movups 0x130(%rsp), %xmm0
leaq 0xe0(%rsp), %rdx
movaps %xmm0, (%rdx)
movups 0x148(%rsp), %xmm0
leaq 0x290(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x30(%rsp), %rdi
callq 0x49bb2
leaq 0x110(%rsp), %r14
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %rax
addq %r15, %rax
movq %rax, 0x8(%rsp)
cmpq 0x8(%rsp), %r15
je 0x45372
movq 0x48(%rsp), %r12
movq 0x50(%rsp), %rbx
addq %r12, %rbx
cmpq %rbx, %r12
je 0x4536d
movq 0x60(%rsp), %r13
movq 0x68(%rsp), %rbp
subq $0x1, %rbp
jb 0x45368
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x49cae
movl (%rax), %eax
movq 0x100(%rsp), %rcx
subl %eax, (%rcx)
incq %r13
jmp 0x45340
incq %r12
jmp 0x45331
incq %r15
jmp 0x4531d
andl $0x0, 0x10(%rsp)
movq 0x90(%rsp), %r14
leaq 0x100(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x12237
testq %r14, %r14
je 0x45454
movq 0x140(%rsp), %rax
movq 0x128(%rsp), %rcx
movq 0x108(%rsp), %rdx
movq 0x110(%rsp), %rsi
movq 0x120(%rsp), %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
cmovleq %rbx, %rdi
movq 0x138(%rsp), %r8
testq %rdx, %rdx
cmovleq %rbx, %rdx
testq %r8, %r8
movl $0x0, %r9d
cmovgq %r8, %r9
shlq $0x2, %rsi
shlq $0x2, %rcx
leaq (,%rax,4), %r10
xorl %r11d, %r11d
cmpq %rdx, %r11
je 0x45479
movq %r14, %r15
xorl %r12d, %r12d
cmpq %rdi, %r12
je 0x4544c
cmpq $0x1, %rax
jne 0x4542c
leaq (%r15,%r8,4), %r13
movq %r15, %rbp
cmpq %r13, %rbp
jae 0x45444
subl (%rbp), %ebx
addq $0x4, %rbp
movl %ebx, 0x10(%rsp)
jmp 0x4541a
movq %r9, %r13
movq %r15, %rbp
subq $0x1, %r13
jb 0x45444
subl (%rbp), %ebx
movl %ebx, 0x10(%rsp)
addq %r10, %rbp
jmp 0x45432
addq %rcx, %r15
incq %r12
jmp 0x45408
incq %r11
addq %rsi, %r14
jmp 0x453fd
movq 0x120(%rsp), %rax
imulq 0x138(%rsp), %rax
imulq 0x108(%rsp), %rax
xorl %ebx, %ebx
testq %rax, %rax
jg 0x4556b
movl 0x4(%rsp), %ebp
leaq 0x55343(%rip), %rsi     # 0x9a7c7
leaq 0x30(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpl %ebx, %ebp
sete %sil
leaq 0x100(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x6894
leaq 0x48190(%rip), %rsi     # 0x8d647
leaq 0x100(%rsp), %rdi
callq 0x106fe
leaq 0x55313(%rip), %rsi     # 0x9a7de
movq %rax, %rdi
callq 0x107f4
leaq 0x4c118(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x4(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
leaq 0x48151(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x552cd(%rip), %rsi     # 0x9a7d2
movq %rax, %rdi
callq 0x46c4c
leaq 0x4c0de(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
leaq 0x5fd72(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x100(%rsp), %rdi
callq 0x68d4
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0x78(%rsp), %rdi
callq 0x10d02
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x47d1d(%rip), %rdi     # 0x8d28f
leaq 0x47b58(%rip), %rsi     # 0x8d0d1
leaq 0x58b03(%rip), %rcx     # 0x9e083
movl $0x6a1, %edx            # imm = 0x6A1
callq 0x20e0
jmp 0x455bb
jmp 0x455bb
jmp 0x455bb
jmp 0x455bb
movq %rax, %rbx
jmp 0x455a7
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x68d4
leaq 0x30(%rsp), %rdi
callq 0x2090
jmp 0x455be
movq %rax, %rdi
callq 0x6bba
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x10d02
movq %rbx, %rdi
callq 0x22f0