user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_dc_pred>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8d,-0x28(%rbp)
  mov    %r9,-0x30(%rbp)
  movl   $0x80,-0x8(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jle    L217
  cmpl   $0x0,-0x20(%rbp)
  jle    L217
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L163
L71:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x4(%rbp)
  addl   $0x1,-0xc(%rbp)
L163:
  mov    -0xc(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L71
  movl   $0x0,-0x10(%rbp)
  jmp    L150
L113:
  mov    -0x1c(%rbp),%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x4(%rbp)
  addl   $0x1,-0x10(%rbp)
L150:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L113
  mov    -0x4(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  mov    -0x28(%rbp),%edx
  lea    (%rdx,%rdx,1),%ecx
  cltd
  idiv   %ecx
  mov    %eax,-0x8(%rbp)
  jmp    L109
L217:
  cmpl   $0x0,-0x1c(%rbp)
  jle    L91
  cmpl   $0x0,-0x20(%rbp)
  jne    L91
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L153
L137:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x4(%rbp)
  addl   $0x1,-0xc(%rbp)
L153:
  mov    -0xc(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L137
  mov    -0x28(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x28(%rbp)
  mov    %eax,-0x8(%rbp)
  jmp    L109
L91:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L33
  cmpl   $0x0,-0x20(%rbp)
  jle    L33
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L209
L28:
  mov    -0x1c(%rbp),%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x4(%rbp)
  addl   $0x1,-0x10(%rbp)
L209:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L28
  mov    -0x28(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x28(%rbp)
  mov    %eax,-0x8(%rbp)
  jmp    L109
L33:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L109
  cmpl   $0x0,-0x20(%rbp)
  jne    L109
  movl   $0x80,-0x8(%rbp)
L109:
  movl   $0x0,-0x10(%rbp)
  jmp    L47
L196:
  movl   $0x0,-0xc(%rbp)
  jmp    L125
L103:
  mov    -0x10(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0xc(%rbp)
L125:
  mov    -0xc(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L103
  addl   $0x1,-0x10(%rbp)
L47:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L196
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void get_dc_pred(uint8_t *rec, int ypos, int xpos, int stride, int size, uint8_t *pblock) {
  int i, j, dc = 128, sum;
  if (ypos > 0 && xpos > 0) {
    sum = 0;
    for (j = 0; j < size; j++)
      sum += rec[(ypos - 1) * stride + xpos + j];
    for (i = 0; i < size; i++)
      sum += rec[(ypos + i) * stride + xpos - 1];
    dc = (sum + size) / (2 * size);
  } else if (ypos > 0 && xpos == 0) {
    sum = 0;
    for (j = 0; j < size; j++)
      sum += rec[(ypos - 1) * stride + xpos + j];
    dc = (sum + size / 2) / size;
  } else if (ypos == 0 && xpos > 0) {
    sum = 0;
    for (i = 0; i < size; i++)
      sum += rec[(ypos + i) * stride + xpos - 1];
    dc = (sum + size / 2) / size;
  } else if (ypos == 0 && xpos == 0) {
    dc = 128;
  }
  for (i = 0; i < size; i++) {
    for (j = 0; j < size; j++) {
      pblock[i * size + j] = dc;
    }
  }
}
```