user: 请从给定的汇编指令推导出C源代码:

```asm
<get_dc_pred>:
  endbr64
  mov    %edx,%r10d
  mov    %ecx,%r11d
  test   %esi,%esi
  setg   %al
  test   %edx,%edx
  setg   %dl
  test   %al,%al
  je     L115
  test   %dl,%dl
  je     L115
  test   %r8d,%r8d
  jle    L162
  lea    -0x1(%rsi),%ecx
  imul   %r11d,%ecx
  lea    (%rcx,%r10,1),%eax
  cltq
  lea    (%rdi,%rax,4),%rdx
  lea    -0x1(%r8),%esi
  add    %rsi,%rax
  lea    0x4(%rdi,%rax,4),%rsi
  mov    $0x0,%eax
L1:
  add    (%rdx),%eax
  add    $0x4,%rdx
  cmp    %rsi,%rdx
  jne    L1
  movslq %r11d,%rsi
  shl    $0x2,%rsi
  lea    (%rcx,%r11,1),%edx
  movslq %edx,%rdx
  movslq %r10d,%r10
  add    %r10,%rdx
  lea    (%rdi,%rdx,4),%rcx
  mov    $0x0,%edx
L28:
  add    -0x4(%rcx),%eax
  add    $0x1,%edx
  add    %rsi,%rcx
  cmp    %edx,%r8d
  jne    L28
L10:
  add    %r8d,%eax
  lea    (%r8,%r8,1),%ecx
  cltd
  idiv   %ecx
L167:
  test   %r8d,%r8d
  jle    L124
  movslq %r8d,%r10
  shl    $0x2,%r10
  lea    -0x1(%r8),%edx
  lea    0x4(%r9,%rdx,4),%rcx
  mov    $0x0,%esi
  mov    %r8d,%edi
  neg    %rdi
  shl    $0x2,%rdi
L25:
  lea    (%rdi,%rcx,1),%rdx
L127:
  mov    %eax,(%rdx)
  add    $0x4,%rdx
  cmp    %rcx,%rdx
  jne    L127
  add    $0x1,%esi
  add    %r10,%rcx
  cmp    %esi,%r8d
  jne    L25
L124:
  ret
L162:
  mov    $0x0,%eax
  jmp    L10
L115:
  test   %r10d,%r10d
  jne    L180
  test   %al,%al
  je     L180
  test   %r8d,%r8d
  jle    L166
  lea    -0x1(%rsi),%edx
  imul   %r11d,%edx
  movslq %edx,%rdx
  lea    (%rdi,%rdx,4),%rax
  lea    -0x1(%r8),%ecx
  add    %rcx,%rdx
  lea    0x4(%rdi,%rdx,4),%rcx
  mov    $0x0,%edx
L85:
  add    (%rax),%edx
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L85
L163:
  mov    %r8d,%eax
  shr    $0x1f,%eax
  add    %r8d,%eax
  sar    %eax
  add    %edx,%eax
  cltd
  idiv   %r8d
  jmp    L167
L166:
  mov    $0x0,%edx
  jmp    L163
L180:
  test   %esi,%esi
  jne    L120
  test   %dl,%dl
  je     L120
  test   %r8d,%r8d
  jle    L51
  movslq %r11d,%rax
  shl    $0x2,%rax
  movslq %r10d,%r10
  lea    (%rdi,%r10,4),%rcx
  mov    $0x0,%edx
L95:
  add    -0x4(%rcx),%esi
  add    $0x1,%edx
  add    %rax,%rcx
  cmp    %edx,%r8d
  jne    L95
L91:
  mov    %r8d,%eax
  shr    $0x1f,%eax
  add    %r8d,%eax
  sar    %eax
  add    %esi,%eax
  cltd
  idiv   %r8d
  jmp    L167
L51:
  mov    $0x0,%esi
  jmp    L91
L120:
  mov    $0x80,%eax
  jmp    L167
```

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;
    }
  }
}
```