user: Translate the below assembly code into C programming language:

```asm
<__imlib_RotateSample>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    0x70(%rsp),%eax
  mov    0x78(%rsp),%ebx
  mov    %rsi,0x10(%rsp)
  mov    %r9d,0x18(%rsp)
  mov    0x80(%rsp),%edi
  mov    %edx,0xc(%rsp)
  mov    0x88(%rsp),%esi
  mov    %eax,(%rsp)
  mov    0x90(%rsp),%r12d
  mov    0x98(%rsp),%ebp
  mov    0xa0(%rsp),%r8d
  mov    0xa8(%rsp),%r9d
  test   %eax,%eax
  jle    L163
  test   %ebx,%ebx
  jle    L163
  push   %r13
  mov    %ecx,%r14d
  mov    %r12d,%edx
  push   %rcx
  mov    %ebp,%ecx
  push   %rbx
  push   %rax
  mov    %r9d,0x4c(%rsp)
  mov    %r8d,0x48(%rsp)
  mov    %esi,0x40(%rsp)
  mov    %edi,0x3c(%rsp)
  call   <__check_inside_coords@plt>
  add    $0x20,%rsp
  mov    0x1c(%rsp),%edi
  mov    0x20(%rsp),%esi
  test   %rax,%rax
  mov    0x28(%rsp),%r8d
  mov    0x2c(%rsp),%r9d
  mov    0x18(%rsp),%r10d
  mov    0x10(%rsp),%r11
  jne    L115
  mov    (%rsp),%edx
  shl    $0xc,%r14d
  mov    %r9d,%ecx
  shl    $0xc,%r13d
  mov    %edx,%eax
  sub    %edx,%r10d
  imul   %r12d,%eax
  sub    %eax,%r8d
  mov    %edx,%eax
  imul   %ebp,%eax
  sub    %eax,%ecx
  movslq %r10d,%rax
  cmpl   $0x1,0xc(%rsp)
  lea    0x0(,%rax,4),%r10
  lea    -0x1(%rdx),%eax
  jne    L95
  mov    (%rsp),%r9d
  add    %r12d,%r8d
  shl    $0x2,%r9
  lea    (%r10,%r9,1),%rdx
  add    %r11,%r9
  mov    %rdx,(%rsp)
  mov    %r12d,%edx
  imul   %eax,%edx
  add    %r8d,%edx
  mov    %edx,0x18(%rsp)
  lea    0x0(%rbp,%rcx,1),%edx
  mov    %ebp,%ecx
  imul   %eax,%ecx
  lea    0x4(%r10,%rax,4),%rax
  mov    %rax,0x10(%rsp)
  add    %edx,%ecx
  mov    %ecx,0xc(%rsp)
  nopl   0x0(%rax)
L96:
  mov    %esi,%edx
  mov    %edi,%ecx
  mov    %r11,%rax
  jmp    L161
  nopl   0x0(%rax)
L47:
  mov    %ecx,%r8d
  mov    %edx,%r10d
  add    $0x4,%rax
  add    %r12d,%ecx
  sar    $0xc,%r8d
  sar    $0xc,%r10d
  add    %ebp,%edx
  add    %r10d,%r8d
  movslq %r8d,%r8
  mov    (%r15,%r8,4),%r8d
  mov    %r8d,-0x4(%rax)
  cmp    %r9,%rax
  je     L89
L161:
  cmp    %edx,%r13d
  jbe    L16
  cmp    %ecx,%r14d
  ja     L47
L16:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  add    %r12d,%ecx
  add    %ebp,%edx
  cmp    %r9,%rax
  jne    L161
L89:
  add    (%rsp),%r9
  sub    $0x1,%ebx
  je     L163
  add    0x18(%rsp),%edi
  add    0xc(%rsp),%esi
  add    0x10(%rsp),%r11
  jmp    L96
  nopl   0x0(%rax,%rax,1)
L163:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L115:
  mov    %r9d,0x98(%rsp)
  mov    0xc(%rsp),%edx
  mov    %ebx,%r9d
  mov    %r10d,%ecx
  mov    %r8d,0x90(%rsp)
  mov    (%rsp),%r8d
  mov    %ebp,0x88(%rsp)
  mov    %r12d,0x80(%rsp)
  mov    %esi,0x78(%rsp)
  mov    %r11,%rsi
  mov    %edi,0x70(%rsp)
  add    $0x38,%rsp
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <__imlib_RotateSampleInside@plt>
L95:
  mov    %edx,%r9d
  add    %r12d,%r8d
  add    %ebp,%ecx
  mov    %ebx,0x18(%rsp)
  shl    $0x2,%r9
  mov    0xc(%rsp),%ebx
  lea    (%r10,%r9,1),%rdx
  add    %r11,%r9
  mov    %rdx,(%rsp)
  mov    %r12d,%edx
  imul   %eax,%edx
  add    %r8d,%edx
  mov    %edx,0x10(%rsp)
  mov    %ebp,%edx
  imul   %eax,%edx
  lea    0x4(%r10,%rax,4),%rax
  mov    %rax,0x20(%rsp)
  add    %edx,%ecx
  mov    %ecx,0x1c(%rsp)
  xchg   %ax,%ax
L24:
  mov    %esi,%r8d
  mov    %edi,%ecx
  mov    %r11,%rax
  jmp    L157
  nopw   0x0(%rax,%rax,1)
L79:
  cmp    %r8d,%r13d
  jbe    L146
  mov    %r8d,%edx
  mov    %ecx,%r10d
  add    $0x4,%rax
  add    %r12d,%ecx
  sar    $0xc,%edx
  sar    $0xc,%r10d
  add    %ebp,%r8d
  imul   %ebx,%edx
  add    %r10d,%edx
  movslq %edx,%rdx
  mov    (%r15,%rdx,4),%edx
  mov    %edx,-0x4(%rax)
  cmp    %r9,%rax
  je     L49
L157:
  cmp    %ecx,%r14d
  ja     L79
L146:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  add    %r12d,%ecx
  add    %ebp,%r8d
  cmp    %r9,%rax
  jne    L157
L49:
  add    (%rsp),%r9
  subl   $0x1,0x18(%rsp)
  je     L163
  add    0x10(%rsp),%edi
  add    0x1c(%rsp),%esi
  add    0x20(%rsp),%r11
  jmp    L24
```

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