// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/utils/quant_levels_dec_utils.c
// Function: HFilter
static void HFilter(SmoothParams* const p) {
  const uint16_t* const in = p->end_;
  uint16_t* const out = p->average_;
  const uint32_t scale = p->scale_;
  const int w = p->width_;
  const int r = p->radius_;

  int x;
  for (x = 0; x <= r; ++x) {   // left mirroring
    const uint16_t delta = in[x + r - 1] + in[r - x];
    out[x] = (delta * scale) >> FIX;
  }
  for (; x < w - r; ++x) {     // bulk middle run
    const uint16_t delta = in[x + r] - in[x - r - 1];
    out[x] = (delta * scale) >> FIX;
  }
  for (; x < w; ++x) {         // right mirroring
    const uint16_t delta =
        2 * in[w - 1] - in[2 * w - 2 - r - x] - in[x - r - 1];
    out[x] = (delta * scale) >> FIX;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x18614c
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x24(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
movq -0x10(%rbp), %rcx
movl -0x24(%rbp), %edx
subl -0x28(%rbp), %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
addl %ecx, %eax
movw %ax, -0x2a(%rbp)
movzwl -0x2a(%rbp), %eax
imull -0x1c(%rbp), %eax
shrl $0x10, %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1860f4
jmp 0x18614e
movl -0x28(%rbp), %eax
movl -0x20(%rbp), %ecx
subl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1861ab
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %edx
subl -0x24(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
subl %ecx, %eax
movw %ax, -0x2c(%rbp)
movzwl -0x2c(%rbp), %eax
imull -0x1c(%rbp), %eax
shrl $0x10, %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x18614e
jmp 0x1861ad
movl -0x28(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x186222
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
shll %eax
movq -0x10(%rbp), %rcx
movl -0x20(%rbp), %edx
shll %edx
subl $0x2, %edx
subl -0x24(%rbp), %edx
subl -0x28(%rbp), %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
subl %ecx, %eax
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %edx
subl -0x24(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
subl %ecx, %eax
movw %ax, -0x2e(%rbp)
movzwl -0x2e(%rbp), %eax
imull -0x1c(%rbp), %eax
shrl $0x10, %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1861ad
popq %rbp
retq
nopw %cs:(%rax,%rax)