// File: shirat74[P]resample/Resampler.cc
// Function: Resampler::resampleX(Image&, Image const&) const
void
Resampler::resampleX (Image& dst, const Image& src) const
{
  for (int32_t k = 0; k < dst.getHeight(); k++) {
    for (int32_t i = 0; i < dst.getWidth(); 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(contributor[i].p[j].pixel, k).v[c] *
                                        contributor[i].p[j].weight;
        }
        pixel.v[c] = (uint16_t) MAP_IN_RANGE(weight, 0, 65535u);
      }
      dst.putPixel(i, k, 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 0x56c0
movl %eax, %ecx
movl -0x84(%rbp), %eax
cmpl %ecx, %eax
jge 0x7499
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x56b0
movl %eax, %ecx
movl -0x88(%rbp), %eax
cmpl %ecx, %eax
jge 0x7489
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 0x7448
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 0x73cd
movq -0x80(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0xa0(%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 (%rax), %esi
movl -0x1c(%rbp), %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 0x72e5
xorps %xmm0, %xmm0
ucomiss -0x34(%rbp), %xmm0
jb 0x73e3
xorps %xmm0, %xmm0
movss %xmm0, -0xa4(%rbp)
jmp 0x7422
movss 0x5d95(%rip), %xmm0     # 0xd180
ucomiss -0x34(%rbp), %xmm0
jb 0x7400
movss -0x34(%rbp), %xmm0
movss %xmm0, -0xa8(%rbp)
jmp 0x7412
movss 0x5d78(%rip), %xmm0     # 0xd180
movss %xmm0, -0xa8(%rbp)
jmp 0x7412
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 0x72b1
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x1c(%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 0x727f
jmp 0x748b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7256
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)