// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/include/array/array.h
// Function: void nda::for_each_value_in_order<nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, int const*, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, int*, void (&)(int const&, int&), void>(nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>> const&, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>> const&, int const*, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>> const&, int*, void (&)(int const&, int&))
NDARRAY_UNIQUE NDARRAY_HOST_DEVICE void for_each_value_in_order(const Shape& shape,
    const ShapeA& shape_a, PtrA base_a, const ShapeB& shape_b, PtrB base_b, Fn&& fn) {
  if (!base_a || !base_b) {
    assert(shape.empty());
    return;
  }
  base_a += shape_a[shape.min()];
  base_b += shape_b[shape.min()];
  // TODO: This is losing compile-time constant extents and strides info
  // (https://github.com/dsharlet/array/issues/1).
  auto a = std::make_pair(base_a, shape_a.stride());
  auto b = std::make_pair(base_b, shape_b.stride());
  internal::for_each_value_in_order<Shape::rank() - 1>(shape.extent(), fn, a, b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r9, %rbx
testq %rdx, %rdx
setne %al
testq %r8, %r8
setne %r9b
testb %r9b, %al
je 0x18c5a
movq 0x8(%rdi), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
jle 0x18c6d
movq %r8, %rbp
movq 0x40(%rsi), %r13
movq 0x10(%rsi), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsi), %rax
movq %rax, 0x28(%rsp)
movq (%rdi), %r14
movq 0x18(%rdi), %r11
movq %r11, %r8
movq 0x30(%rdi), %r15
movq %r15, %r9
movq %r14, %r10
subq 0x18(%rsi), %r11
subq 0x30(%rsi), %r15
subq (%rsi), %r14
movq 0x40(%rcx), %rax
movq 0x10(%rcx), %rsi
movq %rsi, 0x48(%rsp)
subq 0x18(%rcx), %r8
subq 0x30(%rcx), %r9
subq (%rcx), %r10
movq 0x28(%rcx), %r12
imulq %r12, %r8
imulq %rax, %r9
imulq %rsi, %r10
imulq 0x28(%rsp), %r11
imulq %r13, %r15
imulq 0x10(%rsp), %r14
movq %r13, %rcx
xorq $0x1, %rcx
movq %rax, %rsi
xorq $0x1, %rsi
orq %rcx, %rsi
leaq (%rdx,%r11,4), %rcx
leaq (%rcx,%r15,4), %rcx
leaq (%rcx,%r14,4), %rcx
movq %rcx, 0x20(%rsp)
sete 0xf(%rsp)
shlq $0x2, %r15
leaq (%r15,%r14,4), %rcx
leaq (%rcx,%r11,4), %rcx
addq %rdx, %rcx
movq %rcx, 0x58(%rsp)
leaq (,%r8,4), %rcx
addq %rbp, %rcx
leaq (%rcx,%r9,4), %rcx
leaq (%rcx,%r10,4), %rcx
movq %rcx, 0x18(%rsp)
shlq $0x2, %r9
leaq (%r9,%r10,4), %rcx
movq 0x38(%rdi), %rdx
movq %rdx, 0x30(%rsp)
movq 0x20(%rdi), %rdx
movq %rdx, 0x60(%rsp)
leaq (%rcx,%r8,4), %rcx
movq 0x10(%rsp), %rdx
leaq (,%rdx,4), %rdx
movq %rdx, 0x70(%rsp)
addq %rbp, %rcx
movq %rcx, 0x50(%rsp)
movq 0x28(%rsp), %rcx
leaq (,%rcx,4), %rcx
movq %rcx, 0x90(%rsp)
shlq $0x2, %r13
movq %r13, 0xb0(%rsp)
shlq $0x2, %rax
movq %rax, %rbp
movq 0x48(%rsp), %rax
leaq (,%rax,4), %rax
movq %rax, 0x68(%rsp)
movq %r12, 0x98(%rsp)
leaq (,%r12,4), %rax
movq %rax, 0x88(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x80(%rsp)
cmpq $0x0, 0x60(%rsp)
jle 0x18c08
movq 0x50(%rsp), %r14
movq 0x58(%rsp), %r15
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
xorl %r12d, %r12d
cmpb $0x0, 0xf(%rsp)
movq %r14, 0xa8(%rsp)
movq %r15, 0xa0(%rsp)
je 0x18b8c
cmpq $0x0, 0x30(%rsp)
jle 0x18bb1
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rdi
leaq (%rdi,%rax,4), %r14
movq 0x38(%rsp), %rsi
leaq 0x4(%rdi), %r15
leaq 0x4(%rsi), %r13
callq *%rbx
movq %r15, %rdi
movq %r13, %rsi
cmpq %r14, %r15
jb 0x18b75
jmp 0x18bb1
movq 0x30(%rsp), %rax
movq %rax, %r13
testq %rax, %rax
jle 0x18bb1
movq %r15, %rdi
movq %r14, %rsi
callq *%rbx
addq 0xb0(%rsp), %r15
addq %rbp, %r14
decq %r13
jne 0x18b99
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,4), %rcx
movq %rcx, 0x40(%rsp)
movq 0x98(%rsp), %rax
movq 0x38(%rsp), %rcx
leaq (%rcx,%rax,4), %rcx
movq %rcx, 0x38(%rsp)
incq %r12
movq 0xa0(%rsp), %r15
addq 0x90(%rsp), %r15
movq 0xa8(%rsp), %r14
addq 0x88(%rsp), %r14
cmpq 0x60(%rsp), %r12
jne 0x18b43
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax,4), %rcx
movq %rcx, 0x20(%rsp)
movq 0x48(%rsp), %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,4), %rcx
movq %rcx, 0x18(%rsp)
movq 0x80(%rsp), %rcx
incq %rcx
movq 0x70(%rsp), %rax
addq %rax, 0x58(%rsp)
movq 0x68(%rsp), %rax
addq %rax, 0x50(%rsp)
cmpq 0x78(%rsp), %rcx
jne 0x18b0e
jmp 0x18c6d
movq 0x20(%rdi), %rax
imulq 0x38(%rdi), %rax
imulq 0x8(%rdi), %rax
testq %rax, %rax
jg 0x18c7f
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8a655(%rip), %rdi     # 0xa32db
leaq 0x8a490(%rip), %rsi     # 0xa311d
leaq 0x8a85f(%rip), %rcx     # 0xa34f3
movl $0x6b8, %edx            # imm = 0x6B8
callq 0x2100