// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/libraries/libwebp/src/dsp/lossless.c
// Function: PredictorInverseTransform_C
static void PredictorInverseTransform_C(const VP8LTransform* const transform,
                                        int y_start, int y_end,
                                        const uint32_t* in, uint32_t* out) {
  const int width = transform->xsize_;
  if (y_start == 0) {  // First Row follows the L (mode=1) mode.
    PredictorAdd0_C(in, NULL, 1, out);
    PredictorAdd1_C(in + 1, NULL, width - 1, out + 1);
    in += width;
    out += width;
    ++y_start;
  }

  {
    int y = y_start;
    const int tile_width = 1 << transform->bits_;
    const int mask = tile_width - 1;
    const int tiles_per_row = VP8LSubSampleSize(width, transform->bits_);
    const uint32_t* pred_mode_base =
        transform->data_ + (y >> transform->bits_) * tiles_per_row;

    while (y < y_end) {
      const uint32_t* pred_mode_src = pred_mode_base;
      int x = 1;
      // First pixel follows the T (mode=2) mode.
      PredictorAdd2_C(in, out - width, 1, out);
      // .. the rest:
      while (x < width) {
        const VP8LPredictorAddSubFunc pred_func =
            VP8LPredictorsAdd[((*pred_mode_src++) >> 8) & 0xf];
        int x_end = (x & ~mask) + tile_width;
        if (x_end > width) x_end = width;
        pred_func(in + x, out + x - width, x_end - x, out + x);
        x = x_end;
      }
      in += width;
      out += width;
      ++y;
      if ((y & mask) == 0) {   // Use the same mask, since tiles are squares.
        pred_mode_base += tiles_per_row;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x14ec52
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x14fd20
movq -0x18(%rbp), %rdi
addq $0x4, %rdi
movl -0x24(%rbp), %edx
subl $0x1, %edx
movq -0x20(%rbp), %rcx
addq $0x4, %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x14fd80
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x24(%rbp), %edi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x14eff0
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %edx
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
sarl %cl, %edx
movl %edx, %ecx
imull -0x34(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x14edee
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x1, -0x4c(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movslq -0x24(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x2, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rcx
movl $0x1, %edx
callq 0x14fdf0
movl -0x4c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x14ed96
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x48(%rbp)
movl (%rax), %eax
shrl $0x8, %eax
andl $0xf, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0xca385(%rip), %rax     # 0x2190a0
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
movl -0x4c(%rbp), %eax
movl -0x30(%rbp), %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x14ed42
movl -0x24(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x58(%rbp), %rax
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rdi
movq -0x20(%rbp), %rsi
movslq -0x4c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rsi
movslq -0x24(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rsi
movl -0x5c(%rbp), %edx
subl -0x4c(%rbp), %edx
movq -0x20(%rbp), %rcx
movslq -0x4c(%rbp), %r8
shlq $0x2, %r8
addq %r8, %rcx
callq *%rax
movl -0x5c(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x14eced
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl -0x30(%rbp), %eax
cmpl $0x0, %eax
jne 0x14ede9
movl -0x34(%rbp), %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0x14ecac
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)