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

```asm
<__imlib_RotateSample>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    0x78(%rsp),%eax
  mov    0x70(%rsp),%r10d
  mov    %r9d,0x8(%rsp)
  mov    0xa8(%rsp),%r9d
  mov    %rsi,0x10(%rsp)
  mov    %eax,0x4(%rsp)
  mov    0x80(%rsp),%edi
  mov    %r9d,0x20(%rsp)
  mov    0x88(%rsp),%esi
  mov    0x90(%rsp),%r12d
  mov    0x98(%rsp),%ebp
  mov    0xa0(%rsp),%r8d
  test   %r10d,%r10d
  jle    L86
  test   %eax,%eax
  jle    L86
  push   %r13
  mov    %edx,%r15d
  mov    %ecx,%ebx
  mov    %r12d,%edx
  push   %rcx
  mov    %ebp,%ecx
  push   %rax
  push   %r10
  mov    %r10d,0x4c(%rsp)
  mov    %r8d,0x48(%rsp)
  mov    %esi,0x44(%rsp)
  mov    %edi,0x38(%rsp)
  call   <__check_inside_coords@plt>
  add    $0x20,%rsp
  mov    0x18(%rsp),%edi
  mov    0x24(%rsp),%esi
  test   %rax,%rax
  mov    0x28(%rsp),%r8d
  mov    0x2c(%rsp),%r10d
  mov    0x10(%rsp),%r11
  jne    L23
  mov    0x8(%rsp),%eax
  mov    %r10d,%r9d
  lea    -0x1(%r10),%ecx
  shl    $0xc,%ebx
  shl    $0x2,%r9
  shl    $0xc,%r13d
  sub    %r10d,%eax
  cltq
  shl    $0x2,%rax
  lea    (%rax,%r9,1),%rdx
  mov    %rax,0x18(%rsp)
  add    %r11,%r9
  mov    %rdx,0x8(%rsp)
  mov    %r10d,%edx
  imul   %ebp,%r10d
  imul   %r12d,%edx
  sub    %edx,%r8d
  mov    %r12d,%edx
  imul   %ecx,%edx
  lea    (%r8,%r12,1),%eax
  add    %eax,%edx
  mov    %edx,0x10(%rsp)
  mov    0x20(%rsp),%edx
  sub    %r10d,%edx
  mov    %edx,%eax
  mov    %ebp,%edx
  imul   %ecx,%edx
  add    %ebp,%eax
  add    %eax,%edx
  mov    0x18(%rsp),%rax
  mov    %edx,0x20(%rsp)
  lea    0x4(%rax,%rcx,4),%rax
  mov    %rax,0x18(%rsp)
L36:
  mov    %esi,%r8d
  mov    %edi,%ecx
  mov    %r11,%rax
  jmp    L59
  nopw   0x0(%rax,%rax,1)
L24:
  mov    %r8d,%edx
  mov    %ecx,%r10d
  sar    $0xc,%edx
  sar    $0xc,%r10d
  imul   %r15d,%edx
  add    %r10d,%edx
  movslq %edx,%rdx
  mov    (%r14,%rdx,4),%edx
L37:
  mov    %edx,(%rax)
  add    $0x4,%rax
  add    %r12d,%ecx
  add    %ebp,%r8d
  cmp    %r9,%rax
  je     L8
L59:
  cmp    %ebx,%ecx
  jae    L55
  cmp    %r13d,%r8d
  jb     L24
L55:
  xor    %edx,%edx
  jmp    L37
  nopl   0x0(%rax)
L86:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L8:
  add    0x8(%rsp),%r9
  subl   $0x1,0x4(%rsp)
  je     L86
  add    0x10(%rsp),%edi
  add    0x20(%rsp),%esi
  add    0x18(%rsp),%r11
  jmp    L36
L23:
  mov    0x20(%rsp),%eax
  mov    %esi,0x78(%rsp)
  mov    %r15d,%edx
  mov    %r11,%rsi
  mov    %r8d,0x90(%rsp)
  mov    0x4(%rsp),%r9d
  mov    %r10d,%r8d
  mov    %ebp,0x88(%rsp)
  mov    0x8(%rsp),%ecx
  mov    %r12d,0x80(%rsp)
  mov    %edi,0x70(%rsp)
  mov    %r14,%rdi
  mov    %eax,0x98(%rsp)
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <__imlib_RotateSampleInside@plt>
```

assistant: ```c
void __imlib_RotateSample(unsigned int *src, unsigned int *dest, int sow, int sw, int sh, int dow, int dw, int dh, int x, int y, int dxh, int dyh, int dxv, int dyv) {
  int i;
  if ((dw < 1) || (dh < 1))
    return;
  if (__check_inside_coords(x, y, dxh, dyh, dxv, dyv, dw, dh, sw, sh)) {
    __imlib_RotateSampleInside(src, dest, sow, dow, dw, dh, x, y, dxh, dyh, dxv, dyv);
    return;
  }
  sw <<= 12;
  sh <<= 12;
  while (1) {
    i = dw - 1;
    do {
      if (((unsigned)x < sw) && ((unsigned)y < sh))
        *dest = src[(x >> 12) + ((y >> 12) * sow)];
      else
        *dest = 0;
      x += dxh;
      y += dyh;
      dest++;
    } while (--i >= 0);
    if (--dh <= 0)
      break;
    x += dxv - dw * dxh;
    y += dyv - dw * dyh;
    dest += (dow - dw);
  }
}
```