user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<distort_vec_expl>:
  endbr64
  push   %r15
  mov    %r8,%r15
  mov    %r9d,%r8d
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %r9d,%ebx
  sub    $0x28,%rsp
  mov    0x60(%rsp),%r14d
  mov    %rdi,0x10(%rsp)
  imul   %r14d,%r8d
  test   %r8d,%r8d
  jle    L118
  movslq %r8d,%r9
  xor    %esi,%esi
  mov    %r15,%rdi
  mov    %r8d,0x1c(%rsp)
  lea    0x0(,%r9,4),%rdx
  mov    %r9,0x8(%rsp)
  call   <memset@plt>
  mov    0x8(%rsp),%rdx
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  test   %r14d,%r14d
  mov    0x1c(%rsp),%r8d
  jle    L138
L61:
  movslq %ebx,%r10
  mov    0x10(%rsp),%r11
  xor    %r9d,%r9d
  lea    0x0(,%r10,4),%rax
  mov    %rax,0x8(%rsp)
L42:
  test   %ebx,%ebx
  jle    L97
  xor    %edx,%edx
  jmp    L137
  nopw   0x0(%rax,%rax,1)
L148:
  add    $0x1,%rdx
  cmp    %r10,%rdx
  je     L97
L137:
  cvttss2si 0x0(%rbp,%rdx,4),%ecx
  cvttss2si (%r12,%rdx,4),%eax
  add    %edx,%ecx
  add    %r9d,%eax
  mov    %ecx,%esi
  or     %eax,%esi
  shr    $0x1f,%esi
  cmp    %ecx,%ebx
  setle  %dil
  or     %sil,%dil
  jne    L148
  cmp    %eax,%r14d
  jle    L148
  imul   %ebx,%eax
  add    %ecx,%eax
  cmp    %r8d,%eax
  jge    L121
  movzbl (%r11,%rdx,1),%ecx
  cltq
  add    $0x1,%rdx
  add    %ecx,(%r15,%rax,4)
  addb   $0x1,0x0(%r13,%rax,1)
  cmp    %r10,%rdx
  jne    L137
L97:
  mov    0x8(%rsp),%rax
  add    $0x1,%r9d
  add    %r10,%r11
  add    %rax,%rbp
  add    %rax,%r12
  cmp    %r9d,%r14d
  jg     L42
  test   %r8d,%r8d
  jle    L121
L138:
  mov    0x10(%rsp),%rdi
  xor    %ecx,%ecx
  nopl   0x0(%rax,%rax,1)
L15:
  movzbl 0x0(%r13,%rcx,1),%eax
  test   %al,%al
  jne    L19
  movzbl (%rdi,%rcx,1),%eax
  mov    %al,0x0(%r13,%rcx,1)
  add    $0x1,%rcx
  cmp    %ecx,%r8d
  jg     L15
L121:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L19:
  movzbl %al,%esi
  mov    (%r15,%rcx,4),%eax
  cltd
  idiv   %esi
  mov    %al,0x0(%r13,%rcx,1)
  add    $0x1,%rcx
  cmp    %ecx,%r8d
  jg     L15
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L118:
  test   %r14d,%r14d
  jg     L61
  jmp    L121
```

assistant: ```c
void distort_vec_expl(unsigned char *in, unsigned char *out, float *vecx, float *vecy, int *acc, int width, int height) {
  int i, j;
  unsigned char *ino;
  float *vecxo, *vecyo;
  int destidx;
  int vecxi, vecyi;
  for (i = 0; i < width * height; i++)
    acc[i] = 0;
  for (i = 0; i < width * height; i++)
    out[i] = 0;
  for (j = 0; j < height; j++) {
    ino = in + j * width;
    vecxo = vecx + j * width;
    vecyo = vecy + j * width;
    for (i = 0; i < width; i++) {
      vecxi = i + (int)(vecxo[i]);
      vecyi = j + (int)(vecyo[i]);
      if (vecxi < 0)
        continue;
      if (vecyi < 0)
        continue;
      if (vecxi >= width)
        continue;
      if (vecyi >= height)
        continue;
      if ((vecxi + width * vecyi) < 0)
        return;
      if ((vecxi + width * vecyi) >= width * height)
        return;
      destidx = vecxi + width * vecyi;
      acc[destidx] += ino[i];
      out[destidx]++;
    }
  }
  for (i = 0; i < width * height; i++) {
    if (out[i] == 0) {
      out[i] = in[i];
    } else {
      out[i] = acc[i] / out[i];
    }
  }
}
```