// File: /workspace/github_cpp_makefile_star2_O2/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>>, signed char const*, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>>, signed char*, void (&)(signed char const&, signed char&), 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&, signed char const*, nda::shape<nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>, nda::dim<-9l, -9l, -9l>> const&, signed char*, void (&)(signed char const&, signed char&))
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 $0x98, %rsp
movq %rcx, %rbp
movq %rdi, %r12
testq %rdx, %rdx
setne %al
testq %r8, %r8
setne %cl
testb %cl, %al
je 0x4dfcf
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %r15
movq 0x30(%r12), %rax
movq (%r12), %rcx
movq 0x18(%r12), %rdx
leaq 0x80(%rsp), %r13
movq %rcx, (%r13)
movq %rdx, 0x8(%r13)
movq %rax, 0x10(%r13)
movq %rsi, %rdi
movq %rsi, 0x10(%rsp)
movq %r13, %rsi
callq 0x127e0
addq %rax, %r15
movq %r15, 0x18(%rsp)
movq 0x30(%r12), %rax
movq (%r12), %rcx
movq 0x18(%r12), %rdx
movq %rcx, (%r13)
movq %rdx, 0x8(%r13)
movq %rax, 0x10(%r13)
leaq 0x80(%rsp), %rsi
movq %rbp, %rdi
callq 0x127e0
addq %rax, %r14
movq %r14, 0x20(%rsp)
movq %rbp, %rcx
movq 0x10(%rsp), %rdx
movq 0x40(%rdx), %rbp
movq 0x10(%rdx), %rax
movq %rax, 0x38(%rsp)
movq 0x28(%rdx), %rax
movq %rax, 0x68(%rsp)
movq 0x40(%rcx), %r15
movq 0x10(%rcx), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rcx), %rax
movq %rax, 0x60(%rsp)
movq 0x38(%r12), %rdx
movq 0x8(%r12), %rax
movq 0x20(%r12), %rcx
xorl %esi, %esi
testq %rax, %rax
cmovleq %rsi, %rax
movq %rax, 0x40(%rsp)
testq %rcx, %rcx
cmovleq %rsi, %rcx
movq %rcx, 0x70(%rsp)
movq %rbp, %rax
xorq $0x1, %rax
movq %r15, %rcx
xorq $0x1, %rcx
orq %rax, %rcx
sete 0xf(%rsp)
testq %rdx, %rdx
movl $0x0, %ecx
movq %rdx, 0x50(%rsp)
movl $0x0, %eax
cmovgq %rdx, %rcx
movq %rcx, 0x58(%rsp)
cmpq 0x40(%rsp), %rax
je 0x4dfe5
movq %rax, 0x48(%rsp)
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %r13
xorl %eax, %eax
cmpq 0x70(%rsp), %rax
je 0x4dfae
movq %rax, 0x78(%rsp)
movq 0x58(%rsp), %r14
movq %r12, 0x10(%rsp)
movq %r13, 0x28(%rsp)
cmpb $0x0, 0xf(%rsp)
je 0x4df7a
movq 0x50(%rsp), %rax
movq 0x10(%rsp), %rdi
leaq (%rdi,%rax), %r14
movq 0x28(%rsp), %rsi
cmpq %r14, %rdi
jae 0x4df90
leaq 0x1(%rdi), %r12
leaq 0x1(%rsi), %r13
callq *%rbx
movq %r13, %rsi
movq %r12, %rdi
jmp 0x4df63
subq $0x1, %r14
jb 0x4df90
movq %r12, %rdi
movq %r13, %rsi
callq *%rbx
addq %rbp, %r12
addq %r15, %r13
jmp 0x4df7a
movq 0x10(%rsp), %r12
addq 0x68(%rsp), %r12
movq 0x28(%rsp), %r13
addq 0x60(%rsp), %r13
movq 0x78(%rsp), %rax
incq %rax
jmp 0x4df2e
movq 0x38(%rsp), %rax
addq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
addq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
incq %rax
jmp 0x4df12
movq 0x20(%r12), %rax
imulq 0x38(%r12), %rax
imulq 0x8(%r12), %rax
testq %rax, %rax
jg 0x4dff7
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3f291(%rip), %rdi     # 0x8d28f
leaq 0x3f0cc(%rip), %rsi     # 0x8d0d1
leaq 0x52154(%rip), %rcx     # 0xa0160
movl $0x6b8, %edx            # imm = 0x6B8
callq 0x20e0