user: Converte this assembly snippet into its equivalent C code:

```asm
<vp8_dc_only_idct_add_c>:
  endbr64
  movslq %r8d,%r8
  movswl %di,%eax
  movslq %edx,%r11
  push   %rbp
  add    $0x4,%eax
  lea    (%r8,%r8,2),%rdx
  mov    $0x3,%ebp
  mov    %rsi,%r9
  lea    0x3(%rdx),%rdi
  sar    $0x3,%eax
  test   %r8,%r8
  mov    %rcx,%rsi
  cmovs  %rbp,%rdi
  lea    0x3(%r11,%r11,2),%rcx
  push   %rbx
  xor    %ebx,%ebx
  test   %r11,%r11
  lea    (%rsi,%rdi,1),%r10
  lea    -0x3(%rcx),%rdi
  cmovns %rbx,%rdi
  add    %r9,%rdi
  cmp    %rdi,%r10
  setb   %dil
  test   %r11,%r11
  cmovs  %rbp,%rcx
  add    %r9,%rcx
  test   %r8,%r8
  cmovns %rbx,%rdx
  add    %rsi,%rdx
  cmp    %rdx,%rcx
  setb   %dl
  or     %dl,%dil
  je     L19
  lea    0x3(%r8),%rdx
  cmp    $0x6,%rdx
  jbe    L19
  movd   %eax,%xmm2
  lea    (%r9,%r11,1),%rax
  movd   (%r9),%xmm1
  pxor   %xmm5,%xmm5
  lea    (%rax,%r11,1),%rdx
  mov    (%rax),%eax
  punpcklwd %xmm2,%xmm2
  pxor   %xmm4,%xmm4
  mov    (%rdx,%r11,1),%ecx
  movd   (%rdx),%xmm0
  pshufd $0x0,%xmm2,%xmm2
  movd   %eax,%xmm7
  movdqa D6(%rip),%xmm3
  lea    (%rsi,%r8,2),%rax
  movd   %ecx,%xmm6
  punpckldq %xmm7,%xmm1
  punpckldq %xmm6,%xmm0
  punpcklqdq %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  punpckhbw %xmm5,%xmm1
  punpcklbw %xmm5,%xmm0
  paddw  %xmm2,%xmm1
  paddw  %xmm2,%xmm0
  pminsw %xmm3,%xmm1
  pminsw %xmm3,%xmm0
  pmaxsw %xmm4,%xmm1
  pmaxsw %xmm4,%xmm0
  pand   %xmm3,%xmm0
  pand   %xmm1,%xmm3
  packuswb %xmm3,%xmm0
  pshufd $0x55,%xmm0,%xmm1
  movd   %xmm0,(%rsi)
  movd   %xmm1,(%rsi,%r8,1)
  movdqa %xmm0,%xmm1
  punpckhdq %xmm0,%xmm1
  pshufd $0xff,%xmm0,%xmm0
  movd   %xmm1,(%rsi,%r8,2)
  movd   %xmm0,(%rax,%r8,1)
  pop    %rbx
  pop    %rbp
  ret
L19:
  movzbl (%r9),%edx
  mov    $0xff,%ecx
  mov    $0xff,%edi
  add    %eax,%edx
  cmp    %ecx,%edx
  cmovg  %ecx,%edx
  xor    %ecx,%ecx
  test   %edx,%edx
  cmovs  %ecx,%edx
  mov    $0xff,%ecx
  mov    %dl,(%rsi)
  movzbl 0x1(%r9),%edx
  add    %eax,%edx
  cmp    %ecx,%edx
  cmovg  %ecx,%edx
  xor    %ecx,%ecx
  test   %edx,%edx
  cmovs  %ecx,%edx
  mov    $0xff,%ecx
  mov    %dl,0x1(%rsi)
  movzbl 0x2(%r9),%edx
  add    %eax,%edx
  cmp    %ecx,%edx
  cmovg  %ecx,%edx
  xor    %ecx,%ecx
  test   %edx,%edx
  cmovs  %ecx,%edx
  mov    $0xff,%ecx
  mov    %dl,0x2(%rsi)
  movzbl 0x3(%r9),%edx
  add    %eax,%edx
  cmp    %ecx,%edx
  cmovg  %ecx,%edx
  xor    %ecx,%ecx
  test   %edx,%edx
  cmovs  %ecx,%edx
  mov    %dl,0x3(%rsi)
  lea    (%r9,%r11,1),%rdx
  add    %r8,%rsi
  movzbl (%rdx),%ecx
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    $0xff,%edi
  mov    %cl,(%rsi)
  movzbl 0x1(%rdx),%ecx
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    $0xff,%edi
  mov    %cl,0x1(%rsi)
  movzbl 0x2(%rdx),%ecx
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    $0xff,%edi
  mov    %cl,0x2(%rsi)
  movzbl 0x3(%rdx),%ecx
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  add    %r11,%rdx
  mov    $0xff,%edi
  mov    %cl,0x3(%rsi)
  movzbl (%rdx),%ecx
  add    %r8,%rsi
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    $0xff,%edi
  mov    %cl,(%rsi)
  movzbl 0x1(%rdx),%ecx
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    $0xff,%edi
  mov    %cl,0x1(%rsi)
  movzbl 0x2(%rdx),%ecx
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    $0xff,%edi
  mov    %cl,0x2(%rsi)
  movzbl 0x3(%rdx),%ecx
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  add    %r11,%rdx
  mov    $0xff,%edi
  mov    %cl,0x3(%rsi)
  movzbl (%rdx),%ecx
  add    %r8,%rsi
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    $0xff,%edi
  mov    %cl,(%rsi)
  movzbl 0x1(%rdx),%ecx
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    $0xff,%edi
  mov    %cl,0x1(%rsi)
  movzbl 0x2(%rdx),%ecx
  add    %eax,%ecx
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    %cl,0x2(%rsi)
  movzbl 0x3(%rdx),%edx
  add    %edx,%eax
  mov    $0xff,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  xor    %edx,%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  mov    %al,0x3(%rsi)
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: tag: D6
data_type: byte[16]

tool: {"D6": [0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00]}

assistant: ```c
void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, int pred_stride, unsigned char *dst_ptr, int dst_stride) {
  int a1 = ((input_dc + 4) >> 3);
  int r, c;
  for (r = 0; r < 4; r++) {
    for (c = 0; c < 4; c++) {
      int a = a1 + pred_ptr[c];
      if (a < 0)
        a = 0;
      if (a > 255)
        a = 255;
      dst_ptr[c] = (unsigned char)a;
    }
    dst_ptr += dst_stride;
    pred_ptr += pred_stride;
  }
}
```