// File: shirat74[P]resample/Resampler.cc
// Function: Resampler::resampleY(Image&, Image const&) const
void
Resampler::resampleY (Image& dst, const Image& src) const
{
  for (int32_t k = 0; k < dst.getWidth(); k++) {
    for (int32_t i = 0; i < dst.getHeight(); i++) {
      Color pixel;
      for (int c = 0; c < src.getNComps(); c++) {
        float weight = 0.0;
        for (int j = 0; j < contributor[i].n; j++) {
          weight +=
            src.getPixel(k, contributor[i].p[j].pixel).v[c] *
                                           contributor[i].p[j].weight;
        }
        pixel.v[c] = (uint16_t) MAP_IN_RANGE(weight, 0, 65535u);
      }
      dst.putPixel(k, i, pixel);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rdi
callq 0x56b0
movl %eax, %ecx
movl -0x84(%rbp), %eax
cmpl %ecx, %eax
jge 0x7725
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x56c0
movl %eax, %ecx
movl -0x88(%rbp), %eax
cmpl %ecx, %eax
jge 0x7715
leaq -0x2c(%rbp), %rdi
callq 0x42d0
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x8c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5690
movb %al, %cl
movl -0x8c(%rbp), %eax
movsbl %cl, %ecx
cmpl %ecx, %eax
jge 0x76d4
xorps %xmm0, %xmm0
movss %xmm0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x80(%rbp), %rdi
movl -0x38(%rbp), %eax
movl %eax, -0x90(%rbp)
addq $0x10, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8050
movq %rax, %rcx
movl -0x90(%rbp), %eax
cmpl (%rcx), %eax
jge 0x7659
movq -0x80(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x98(%rbp)
addq $0x10, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8050
movq %rax, %rdi
addq $0x8, %rdi
movslq -0x38(%rbp), %rsi
callq 0x8070
movq -0xa0(%rbp), %rdi
movl -0x98(%rbp), %esi
movl (%rax), %edx
callq 0x3e30
movq -0x80(%rbp), %rdi
movl %edx, -0x50(%rbp)
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x44(%rbp)
movw -0x50(%rbp), %ax
movw %ax, -0x3c(%rbp)
movb -0x4e(%rbp), %al
movb %al, -0x3a(%rbp)
movslq -0x30(%rbp), %rax
movzwl -0x44(%rbp,%rax,2), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x94(%rbp)
addq $0x10, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8050
movq %rax, %rdi
addq $0x8, %rdi
movslq -0x38(%rbp), %rsi
callq 0x8070
movss -0x94(%rbp), %xmm0
movss 0x4(%rax), %xmm2
movss -0x34(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x34(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x7565
xorps %xmm0, %xmm0
ucomiss -0x34(%rbp), %xmm0
jb 0x766f
xorps %xmm0, %xmm0
movss %xmm0, -0xa4(%rbp)
jmp 0x76ae
movss 0x5b09(%rip), %xmm0     # 0xd180
ucomiss -0x34(%rbp), %xmm0
jb 0x768c
movss -0x34(%rbp), %xmm0
movss %xmm0, -0xa8(%rbp)
jmp 0x769e
movss 0x5aec(%rip), %xmm0     # 0xd180
movss %xmm0, -0xa8(%rbp)
jmp 0x769e
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
movss -0xa4(%rbp), %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movslq -0x30(%rbp), %rax
movw %cx, -0x2c(%rbp,%rax,2)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x7531
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movq -0x2c(%rbp), %rax
movq %rax, -0x64(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x64(%rbp), %rax
movq %rax, -0x74(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x74(%rbp), %rcx
movl -0x6c(%rbp), %r8d
callq 0x3f20
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x74ff
jmp 0x7717
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x74d6
addq $0xb0, %rsp
popq %rbp
retq
nop