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

```asm
<rotate>:
  endbr64
  mov    %edx,%eax
  movslq %esi,%r8
  cltd
  idiv   %r8d
  test   %edx,%edx
  je     L182
  lea    -0x1(%r8),%eax
  push   %r12
  mov    %rdi,%rcx
  mov    %edx,%r10d
  push   %rbp
  push   %rbx
  test   %eax,%eax
  jle    L55
  lea    -0x2(%r8),%edi
  movslq %r8d,%r9
  mov    %edi,%ebp
  shl    $0x2,%r9
  shr    %ebp
  mov    %r9,%r11
  lea    0x1(%rbp),%esi
  mov    %rsi,%rbx
  shl    $0x2,%rsi
  sub    %rsi,%r11
  cmp    %r11,%rsi
  setle  %sil
  test   %r9,%r9
  setle  %r11b
  or     %r11b,%sil
  je     L211
  cmp    $0x1,%edi
  jbe    L211
  cmp    $0x5,%edi
  jbe    L90
  mov    %ebx,%r11d
  mov    %rcx,%rsi
  lea    -0x10(%rcx,%r9,1),%rdi
  shr    $0x2,%r11d
  sub    $0x1,%r11d
  shl    $0x4,%r11
  lea    0x10(%rcx,%r11,1),%r11
  nop
L260:
  movdqu (%rdi),%xmm2
  movdqu (%rsi),%xmm0
  add    $0x10,%rsi
  sub    $0x10,%rdi
  pshufd $0x1b,%xmm2,%xmm1
  pshufd $0x1b,%xmm0,%xmm0
  movups %xmm1,-0x10(%rsi)
  movups %xmm0,0x10(%rdi)
  cmp    %r11,%rsi
  jne    L260
  mov    %ebx,%r11d
  mov    %eax,%esi
  and    $0xfffffffc,%r11d
  mov    %r11d,%edi
  sub    %r11d,%esi
  cmp    %r11d,%ebx
  je     L55
L331:
  sub    %r11d,%ebx
  cmp    %r11d,%ebp
  je     L108
  shl    $0x2,%r11
  sub    $0x8,%r9
  sub    %r11,%r9
  lea    (%rcx,%r11,1),%rbp
  add    %rcx,%r9
  movq   0x0(%rbp),%xmm0
  movq   (%r9),%xmm1
  pshufd $0xe1,%xmm0,%xmm0
  pshufd $0xe1,%xmm1,%xmm1
  movq   %xmm1,0x0(%rbp)
  movq   %xmm0,(%r9)
  mov    %ebx,%r9d
  and    $0xfffffffe,%r9d
  add    %r9d,%edi
  sub    %r9d,%esi
  cmp    %r9d,%ebx
  je     L55
L108:
  movslq %edi,%rdi
  movslq %esi,%rsi
  lea    (%rcx,%rdi,4),%rdi
  lea    (%rcx,%rsi,4),%rsi
  mov    (%rdi),%r9d
  mov    (%rsi),%r11d
  mov    %r11d,(%rdi)
  mov    %r9d,(%rsi)
L55:
  lea    -0x1(%rdx),%esi
  test   %esi,%esi
  jle    L68
  lea    -0x2(%rdx),%r9d
  movslq %edx,%r11
  mov    %r9d,%r12d
  shl    $0x2,%r11
  shr    %r12d
  mov    %r11,%rbp
  lea    0x1(%r12),%edi
  mov    %rdi,%rbx
  shl    $0x2,%rdi
  sub    %rdi,%rbp
  cmp    %rbp,%rdi
  setle  %dil
  test   %r11,%r11
  setle  %bpl
  or     %bpl,%dil
  je     L333
  cmp    $0x1,%r9d
  jbe    L333
  cmp    $0x5,%r9d
  jbe    L126
  mov    %ebx,%ebp
  mov    %rcx,%rdi
  lea    -0x10(%rcx,%r11,1),%r9
  shr    $0x2,%ebp
  sub    $0x1,%ebp
  shl    $0x4,%rbp
  lea    0x10(%rcx,%rbp,1),%rbp
  nopl   0x0(%rax)
L89:
  movdqu (%r9),%xmm3
  movdqu (%rdi),%xmm0
  add    $0x10,%rdi
  sub    $0x10,%r9
  pshufd $0x1b,%xmm3,%xmm1
  pshufd $0x1b,%xmm0,%xmm0
  movups %xmm1,-0x10(%rdi)
  movups %xmm0,0x10(%r9)
  cmp    %rbp,%rdi
  jne    L89
  mov    %ebx,%r9d
  and    $0xfffffffc,%r9d
  mov    %r9d,%edi
  sub    %r9d,%esi
  cmp    %r9d,%ebx
  je     L68
L26:
  sub    %r9d,%ebx
  cmp    %r9d,%r12d
  je     L210
  shl    $0x2,%r9
  sub    $0x8,%r11
  sub    %r9,%r11
  lea    (%rcx,%r9,1),%rbp
  mov    %ebx,%r9d
  add    %rcx,%r11
  movq   0x0(%rbp),%xmm0
  and    $0xfffffffe,%r9d
  movq   (%r11),%xmm1
  add    %r9d,%edi
  sub    %r9d,%esi
  pshufd $0xe1,%xmm0,%xmm0
  pshufd $0xe1,%xmm1,%xmm1
  movq   %xmm1,0x0(%rbp)
  movq   %xmm0,(%r11)
  cmp    %r9d,%ebx
  je     L68
L210:
  movslq %edi,%rdi
  movslq %esi,%rsi
  lea    (%rcx,%rdi,4),%rdi
  lea    (%rcx,%rsi,4),%rsi
  mov    (%rdi),%r9d
  mov    (%rsi),%r11d
  mov    %r11d,(%rdi)
  mov    %r9d,(%rsi)
L68:
  cmp    %eax,%edx
  jge    L227
  lea    -0x2(%r8),%edi
  movslq %edx,%r11
  shl    $0x2,%r8
  sub    %edx,%edi
  lea    0x0(,%r11,4),%r9
  mov    %edi,%ebp
  shr    %ebp
  lea    0x1(%rbp),%esi
  mov    %rsi,%r12
  mov    %rsi,%rbx
  add    %r11,%rsi
  neg    %r12
  shl    $0x2,%rsi
  lea    (%r8,%r12,4),%r12
  cmp    %rsi,%r12
  setge  %sil
  cmp    %r8,%r9
  setge  %r12b
  or     %r12b,%sil
  je     L48
  cmp    $0x1,%edi
  jbe    L48
  cmp    $0x5,%edi
  jbe    L113
  mov    %ebx,%edi
  add    %rcx,%r9
  lea    -0x10(%rcx,%r8,1),%rsi
  shr    $0x2,%edi
  lea    -0x1(%rdi),%r10d
  lea    0x10(%r9),%rdi
  shl    $0x4,%r10
  add    %rdi,%r10
  jmp    L33
  cs nopw 0x0(%rax,%rax,1)
L184:
  add    $0x10,%rdi
L33:
  movdqu (%r9),%xmm0
  movdqu (%rsi),%xmm4
  sub    $0x10,%rsi
  pshufd $0x1b,%xmm4,%xmm1
  pshufd $0x1b,%xmm0,%xmm0
  movups %xmm1,(%r9)
  mov    %rdi,%r9
  movups %xmm0,0x10(%rsi)
  cmp    %r10,%rdi
  jne    L184
  mov    %ebx,%esi
  and    $0xfffffffc,%esi
  lea    (%rdx,%rsi,1),%r10d
  sub    %esi,%eax
  cmp    %esi,%ebx
  je     L227
L69:
  sub    %esi,%ebx
  cmp    %esi,%ebp
  je     L199
  add    %rsi,%r11
  neg    %rsi
  lea    -0x8(%r8,%rsi,4),%rdx
  lea    (%rcx,%r11,4),%rdi
  add    %rcx,%rdx
  movq   (%rdi),%xmm0
  movq   (%rdx),%xmm1
  pshufd $0xe1,%xmm0,%xmm0
  pshufd $0xe1,%xmm1,%xmm1
  movq   %xmm1,(%rdi)
  movq   %xmm0,(%rdx)
  mov    %ebx,%edx
  and    $0xfffffffe,%edx
  add    %edx,%r10d
  sub    %edx,%eax
  cmp    %edx,%ebx
  je     L227
L199:
  movslq %r10d,%r10
  cltq
  lea    (%rcx,%r10,4),%rdx
  lea    (%rcx,%rax,4),%rax
  mov    (%rdx),%esi
  mov    (%rax),%ecx
  mov    %ecx,(%rdx)
  mov    %esi,(%rax)
L227:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L182:
  ret
  nopl   0x0(%rax)
L48:
  cltq
  nopw   0x0(%rax,%rax,1)
L152:
  mov    (%rcx,%r11,4),%edx
  mov    (%rcx,%rax,4),%esi
  mov    %esi,(%rcx,%r11,4)
  add    $0x1,%r11
  mov    %edx,(%rcx,%rax,4)
  sub    $0x1,%rax
  cmp    %eax,%r11d
  jl     L152
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L211:
  movslq %eax,%rdi
  xor    %esi,%esi
  nopl   (%rax)
L208:
  mov    (%rcx,%rsi,4),%r9d
  mov    (%rcx,%rdi,4),%r11d
  mov    %r11d,(%rcx,%rsi,4)
  add    $0x1,%rsi
  mov    %r9d,(%rcx,%rdi,4)
  sub    $0x1,%rdi
  cmp    %edi,%esi
  jl     L208
  jmp    L55
  nopl   0x0(%rax)
L333:
  movslq %esi,%rsi
  xor    %edi,%edi
  nopl   (%rax)
L263:
  mov    (%rcx,%rdi,4),%r9d
  mov    (%rcx,%rsi,4),%r11d
  mov    %r11d,(%rcx,%rdi,4)
  add    $0x1,%rdi
  mov    %r9d,(%rcx,%rsi,4)
  sub    $0x1,%rsi
  cmp    %esi,%edi
  jl     L263
  jmp    L68
L90:
  mov    %eax,%esi
  xor    %r11d,%r11d
  xor    %edi,%edi
  jmp    L331
L113:
  xor    %esi,%esi
  jmp    L69
L126:
  xor    %r9d,%r9d
  xor    %edi,%edi
  jmp    L26
```

assistant: ```c
void rotate(int *nums, int numsSize, int k) {
  int begin = 0;
  int end = numsSize - 1;
  int tmp;
  if (k % numsSize == 0) {
    return;
  }
  k = k % numsSize;
  while (begin < end) {
    tmp = nums[begin];
    nums[begin] = nums[end];
    nums[end] = tmp;
    begin++;
    end--;
  }
  begin = 0;
  end = k - 1;
  while (begin < end) {
    tmp = nums[begin];
    nums[begin] = nums[end];
    nums[end] = tmp;
    begin++;
    end--;
  }
  begin = k;
  end = numsSize - 1;
  while (begin < end) {
    tmp = nums[begin];
    nums[begin] = nums[end];
    nums[end] = tmp;
    begin++;
    end--;
  }
}
```