// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/filters.c
// Function: DoGradientFilter_C
static WEBP_INLINE void DoGradientFilter_C(const uint8_t* in,
                                           int width, int height, int stride,
                                           int row, int num_rows,
                                           int inverse, uint8_t* out) {
  const uint8_t* preds;
  const size_t start_offset = row * stride;
  const int last_row = row + num_rows;
  DCHECK(in, out);
  in += start_offset;
  out += start_offset;
  preds = inverse ? out : in;

  // left prediction for top scan-line
  if (row == 0) {
    out[0] = in[0];
    PredictLine_C(in + 1, preds, out + 1, width - 1, inverse);
    row = 1;
    preds += stride;
    in += stride;
    out += stride;
  }

  // Filter line-by-line.
  while (row < last_row) {
    int w;
    // leftmost pixel: predict from above.
    PredictLine_C(in, preds - stride, out, 1, inverse);
    for (w = 1; w < width; ++w) {
      const int pred = GradientPredictor_C(preds[w - 1],
                                           preds[w - stride],
                                           preds[w - stride - 1]);
      out[w] = (uint8_t)(in[w] + (inverse ? pred : -pred));
    }
    ++row;
    preds += stride;
    in += stride;
    out += stride;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl %r9d, -0x1c(%rbp)
movl -0x18(%rbp), %eax
imull -0x14(%rbp), %eax
cltq
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x14de23
jmp 0x14de42
leaq 0x718b4(%rip), %rdi     # 0x1bf6de
leaq 0x71776(%rip), %rsi     # 0x1bf5a7
movl $0x88, %edx
leaq 0x719bc(%rip), %rcx     # 0x1bf7f9
callq 0x598a0
cmpq $0x0, 0x18(%rbp)
je 0x14de4b
jmp 0x14de6a
leaq 0x718ed(%rip), %rdi     # 0x1bf73f
leaq 0x7174e(%rip), %rsi     # 0x1bf5a7
movl $0x88, %edx
leaq 0x71994(%rip), %rcx     # 0x1bf7f9
callq 0x598a0
cmpl $0x0, -0xc(%rbp)
jle 0x14de72
jmp 0x14de91
leaq 0x718d4(%rip), %rdi     # 0x1bf74d
leaq 0x71727(%rip), %rsi     # 0x1bf5a7
movl $0x88, %edx
leaq 0x7196d(%rip), %rcx     # 0x1bf7f9
callq 0x598a0
cmpl $0x0, -0x10(%rbp)
jle 0x14de99
jmp 0x14deb8
leaq 0x718b7(%rip), %rdi     # 0x1bf757
leaq 0x71700(%rip), %rsi     # 0x1bf5a7
movl $0x88, %edx
leaq 0x71946(%rip), %rcx     # 0x1bf7f9
callq 0x598a0
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jl 0x14dec2
jmp 0x14dee1
leaq 0x71899(%rip), %rdi     # 0x1bf762
leaq 0x716d7(%rip), %rsi     # 0x1bf5a7
movl $0x88, %edx
leaq 0x7191d(%rip), %rcx     # 0x1bf7f9
callq 0x598a0
cmpl $0x0, -0x18(%rbp)
jl 0x14defa
cmpl $0x0, -0x1c(%rbp)
jle 0x14defa
movl -0x18(%rbp), %eax
addl -0x1c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jg 0x14defa
jmp 0x14df19
leaq 0x71871(%rip), %rdi     # 0x1bf772
leaq 0x7169f(%rip), %rsi     # 0x1bf5a7
movl $0x88, %edx
leaq 0x718e5(%rip), %rcx     # 0x1bf7f9
callq 0x598a0
movq -0x30(%rbp), %rax
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x30(%rbp), %rax
addq 0x18(%rbp), %rax
movq %rax, 0x18(%rbp)
cmpl $0x0, 0x10(%rbp)
je 0x14df41
movq 0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x14df49
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x14dfc0
movq -0x8(%rbp), %rax
movb (%rax), %cl
movq 0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rdi
addq $0x1, %rdi
movq -0x28(%rbp), %rsi
movq 0x18(%rbp), %rdx
addq $0x1, %rdx
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movl 0x10(%rbp), %r8d
callq 0x14dae0
movl $0x1, -0x18(%rbp)
movl -0x14(%rbp), %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x14(%rbp), %ecx
movq 0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rbp)
jmp 0x14dfc2
movl -0x18(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x14e0d4
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movslq -0x14(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
addq %rax, %rsi
movq 0x18(%rbp), %rdx
movl 0x10(%rbp), %r8d
movl $0x1, %ecx
callq 0x14dae0
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x14e093
movq -0x28(%rbp), %rax
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %sil
movq -0x28(%rbp), %rax
movl -0x38(%rbp), %ecx
subl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x28(%rbp), %rax
movl -0x38(%rbp), %ecx
subl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl %sil, %edi
movzbl %dl, %esi
movzbl (%rax,%rcx), %edx
callq 0x14d800
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, 0x10(%rbp)
je 0x14e068
movl -0x3c(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x14e070
xorl %eax, %eax
subl -0x3c(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
movl -0x50(%rbp), %ecx
addl %ecx, %eax
movb %al, %dl
movq 0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x14dffb
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x14(%rbp), %ecx
movq 0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rbp)
jmp 0x14dfc2
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)