// File: dsharlet[P]array/include/array/image.h
// Function: void nda::for_each_image_index<nda::shape<nda::dim<-9l, -9l, 3l>, nda::dim<-9l, -9l, -9l>, nda::dim<0l, 3l, 1l>>, void nda::transform_index<int, nda::shape<nda::dim<-9l, -9l, 3l>, nda::dim<-9l, -9l, -9l>, nda::dim<0l, 3l, 1l>>, void nda::fill_pattern<int, nda::shape<nda::dim<-9l, -9l, 3l>, nda::dim<-9l, -9l, -9l>, nda::dim<0l, 3l, 1l>>>(nda::array_ref<int, nda::shape<nda::dim<-9l, -9l, 3l>, nda::dim<-9l, -9l, -9l>, nda::dim<0l, 3l, 1l>>> const&, int)::'lambda'(std::tuple<long, long, long> const&)>(nda::array_ref<int, nda::shape<nda::dim<-9l, -9l, 3l>, nda::dim<-9l, -9l, -9l>, nda::dim<0l, 3l, 1l>>> const&, void nda::fill_pattern<int, nda::shape<nda::dim<-9l, -9l, 3l>, nda::dim<-9l, -9l, -9l>, nda::dim<0l, 3l, 1l>>>(nda::array_ref<int, nda::shape<nda::dim<-9l, -9l, 3l>, nda::dim<-9l, -9l, -9l>, nda::dim<0l, 3l, 1l>>> const&, int)::'lambda'(std::tuple<long, long, long> const&)&&)::'lambda'(std::tuple<long, long, long> const&)&>(int const&, nda::shape<nda::dim<-9l, -9l, 3l>, nda::dim<-9l, -9l, -9l>, nda::dim<0l, 3l, 1l>>&&)
void for_each_image_index(const Shape& s, Fn&& fn) {
  // Images should always be iterated with c as the innermost loop. Even when
  // the image is planar, the number of channels is generally small, and many
  // operations use all of the channels at the same time (all-to-all
  // communication in the c dimension).
  for (index_t y : s.y()) {
    for (index_t x : s.x()) {
      for (index_t c : s.c()) {
        fn(std::tuple<index_t, index_t, index_t>(x, y, c));
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x68(%rbp)
movq %rsi, -0x70(%rbp)
movq -0x68(%rbp), %rdi
callq 0x10dbc0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0x366c0
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
callq 0x366f0
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
cmpq (%rcx), %rax
je 0x10dbb2
leaq -0x80(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x68(%rbp), %rdi
callq 0x10dbe0
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0x366c0
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
callq 0x366f0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0xa8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
cmpq (%rcx), %rax
je 0x10db95
leaq -0xa0(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x68(%rbp), %rdi
callq 0x10dc00
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x10dc20
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x10dc50
movq %rax, -0xc8(%rbp)
leaq -0xc0(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0xc8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x60(%rbp), %rcx
cmpq (%rcx), %rax
je 0x10db75
leaq -0xc0(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0x90(%rbp), %rdx
leaq -0xd0(%rbp), %rcx
callq 0xdf870
movq -0xf0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x10dca0
leaq -0xc0(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x10dad9
jmp 0x10db77
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x10da60
jmp 0x10db97
leaq -0x80(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x10d9ed
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax,%rax)