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

```asm
<rec4>:
  endbr64
  movslq %edx,%rdx
  lea    (%rdi,%rdx,4),%rdx
  test   %r8d,%r8d
  jle    L3
  push   %rbx
  movslq %ecx,%rcx
  mov    %rdi,%rax
  xor    %r10d,%r10d
  lea    0x0(,%rcx,4),%r9
  cs nopw 0x0(%rax,%rax,1)
L15:
  mov    0x4(%rax),%ecx
  mov    (%rax),%edi
  mov    0x4(%rdx),%ebx
  add    %ecx,%edi
  add    (%rdx),%edi
  lea    0x2(%rbx,%rdi,1),%edi
  sar    $0x2,%edi
  mov    %edi,(%rsi)
  mov    0x8(%rax),%edi
  mov    0x8(%rdx),%r11d
  add    %edi,%ecx
  add    %ebx,%ecx
  lea    0x2(%r11,%rcx,1),%ecx
  sar    $0x2,%ecx
  mov    %ecx,0x4(%rsi)
  mov    0xc(%rax),%ecx
  mov    0xc(%rdx),%ebx
  add    %ecx,%edi
  add    %r11d,%edi
  lea    0x2(%rbx,%rdi,1),%edi
  sar    $0x2,%edi
  mov    %edi,0x8(%rsi)
  mov    0x10(%rax),%edi
  mov    0x10(%rdx),%r11d
  add    %edi,%ecx
  add    %ebx,%ecx
  lea    0x2(%r11,%rcx,1),%ecx
  sar    $0x2,%ecx
  mov    %ecx,0xc(%rsi)
  mov    0x14(%rax),%ecx
  mov    0x14(%rdx),%ebx
  add    %ecx,%edi
  add    %r11d,%edi
  lea    0x2(%rbx,%rdi,1),%edi
  sar    $0x2,%edi
  mov    %edi,0x10(%rsi)
  mov    0x18(%rax),%edi
  mov    0x18(%rdx),%r11d
  add    %edi,%ecx
  add    %ebx,%ecx
  lea    0x2(%r11,%rcx,1),%ecx
  sar    $0x2,%ecx
  mov    %ecx,0x14(%rsi)
  mov    0x1c(%rax),%ecx
  mov    0x1c(%rdx),%ebx
  add    %ecx,%edi
  add    %r11d,%edi
  lea    0x2(%rbx,%rdi,1),%edi
  sar    $0x2,%edi
  mov    %edi,0x18(%rsi)
  mov    0x20(%rax),%edi
  mov    0x20(%rdx),%r11d
  add    %edi,%ecx
  add    %ebx,%ecx
  lea    0x2(%r11,%rcx,1),%ecx
  sar    $0x2,%ecx
  mov    %ecx,0x1c(%rsi)
  mov    0x24(%rax),%ecx
  mov    0x24(%rdx),%ebx
  add    %ecx,%edi
  add    %r11d,%edi
  lea    0x2(%rbx,%rdi,1),%edi
  sar    $0x2,%edi
  mov    %edi,0x20(%rsi)
  mov    0x28(%rax),%edi
  mov    0x28(%rdx),%r11d
  add    %edi,%ecx
  add    %ebx,%ecx
  lea    0x2(%r11,%rcx,1),%ecx
  sar    $0x2,%ecx
  mov    %ecx,0x24(%rsi)
  mov    0x2c(%rax),%ecx
  mov    0x2c(%rdx),%ebx
  add    %ecx,%edi
  add    %r11d,%edi
  lea    0x2(%rbx,%rdi,1),%edi
  sar    $0x2,%edi
  add    $0x1,%r10d
  mov    %edi,0x28(%rsi)
  mov    0x30(%rax),%edi
  mov    0x30(%rdx),%r11d
  add    %edi,%ecx
  add    %ebx,%ecx
  lea    0x2(%r11,%rcx,1),%ecx
  sar    $0x2,%ecx
  mov    %ecx,0x2c(%rsi)
  mov    0x34(%rax),%ecx
  mov    0x34(%rdx),%ebx
  add    %ecx,%edi
  add    %r11d,%edi
  lea    0x2(%rbx,%rdi,1),%edi
  sar    $0x2,%edi
  mov    %edi,0x30(%rsi)
  mov    0x38(%rax),%edi
  mov    0x38(%rdx),%r11d
  add    %edi,%ecx
  add    %ebx,%ecx
  lea    0x2(%r11,%rcx,1),%ecx
  sar    $0x2,%ecx
  mov    %ecx,0x34(%rsi)
  mov    0x3c(%rax),%ecx
  mov    0x3c(%rdx),%ebx
  add    %ecx,%edi
  add    %r11d,%edi
  lea    0x2(%rbx,%rdi,1),%edi
  sar    $0x2,%edi
  mov    %edi,0x38(%rsi)
  add    0x40(%rax),%ecx
  add    %r9,%rax
  add    %ebx,%ecx
  add    0x40(%rdx),%ecx
  add    %r9,%rdx
  add    $0x2,%ecx
  sar    $0x2,%ecx
  mov    %ecx,0x3c(%rsi)
  add    %r9,%rsi
  cmp    %r10d,%r8d
  jne    L15
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  ret
```

assistant: ```c
void rec4(uint8_t *s, uint8_t *d, int lx, int lx2, int h) {
  uint8_t *dp = d, *sp = s, *sp2 = s + lx;
  uint32_t s1, s2, s3, s4;
  int j;
  for (j = 0; j < h; ++j) {
    s1 = sp[0];
    s3 = sp2[0];
    dp[0] = (uint32_t)(s1 + (s2 = sp[1]) + s3 + (s4 = sp2[1]) + 2) >> 2;
    dp[1] = (uint32_t)(s2 + (s1 = sp[2]) + s4 + (s3 = sp2[2]) + 2) >> 2;
    dp[2] = (uint32_t)(s1 + (s2 = sp[3]) + s3 + (s4 = sp2[3]) + 2) >> 2;
    dp[3] = (uint32_t)(s2 + (s1 = sp[4]) + s4 + (s3 = sp2[4]) + 2) >> 2;
    dp[4] = (uint32_t)(s1 + (s2 = sp[5]) + s3 + (s4 = sp2[5]) + 2) >> 2;
    dp[5] = (uint32_t)(s2 + (s1 = sp[6]) + s4 + (s3 = sp2[6]) + 2) >> 2;
    dp[6] = (uint32_t)(s1 + (s2 = sp[7]) + s3 + (s4 = sp2[7]) + 2) >> 2;
    dp[7] = (uint32_t)(s2 + (s1 = sp[8]) + s4 + (s3 = sp2[8]) + 2) >> 2;
    dp[8] = (uint32_t)(s1 + (s2 = sp[9]) + s3 + (s4 = sp2[9]) + 2) >> 2;
    dp[9] = (uint32_t)(s2 + (s1 = sp[10]) + s4 + (s3 = sp2[10]) + 2) >> 2;
    dp[10] = (uint32_t)(s1 + (s2 = sp[11]) + s3 + (s4 = sp2[11]) + 2) >> 2;
    dp[11] = (uint32_t)(s2 + (s1 = sp[12]) + s4 + (s3 = sp2[12]) + 2) >> 2;
    dp[12] = (uint32_t)(s1 + (s2 = sp[13]) + s3 + (s4 = sp2[13]) + 2) >> 2;
    dp[13] = (uint32_t)(s2 + (s1 = sp[14]) + s4 + (s3 = sp2[14]) + 2) >> 2;
    dp[14] = (uint32_t)(s1 + (s2 = sp[15]) + s3 + (s4 = sp2[15]) + 2) >> 2;
    dp[15] = (uint32_t)(s2 + sp[16] + s4 + sp2[16] + 2) >> 2;
    sp += lx2;
    sp2 += lx2;
    dp += lx2;
  }
}
```