user: 请将以下的汇编代码转换成C语言代码：

```asm
<rotate_right>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    -0x34(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%rcx
  mov    $0x0,%ebx
  movl   $0x0,-0x30(%rbp)
  jmp    L12
L33:
  mov    -0x30(%rbp),%edx
  mov    %edx,-0x28(%rbp)
  mov    -0x34(%rbp),%edx
  sub    $0x1,%edx
  sub    -0x30(%rbp),%edx
  mov    %edx,-0x24(%rbp)
  mov    -0x28(%rbp),%edx
  mov    %edx,-0x2c(%rbp)
  jmp    L9
L39:
  mov    -0x2c(%rbp),%edx
  sub    -0x28(%rbp),%edx
  mov    %edx,-0x20(%rbp)
  mov    -0x28(%rbp),%edx
  movslq %edx,%rcx
  movslq %eax,%rdx
  imul   %rcx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x40(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rcx,%rdx,4),%edx
  mov    %edx,-0x1c(%rbp)
  mov    -0x24(%rbp),%edx
  sub    -0x20(%rbp),%edx
  movslq %edx,%rcx
  movslq %eax,%rdx
  imul   %rcx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x40(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x28(%rbp),%edx
  movslq %edx,%rsi
  movslq %eax,%rdx
  imul   %rsi,%rdx
  lea    0x0(,%rdx,4),%rsi
  mov    -0x40(%rbp),%rdx
  add    %rdx,%rsi
  mov    -0x28(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rcx,%rdx,4),%ecx
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rsi,%rdx,4)
  mov    -0x24(%rbp),%edx
  movslq %edx,%rcx
  movslq %eax,%rdx
  imul   %rcx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x40(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x24(%rbp),%edx
  mov    %edx,%edi
  sub    -0x20(%rbp),%edi
  mov    -0x24(%rbp),%edx
  sub    -0x20(%rbp),%edx
  movslq %edx,%rsi
  movslq %eax,%rdx
  imul   %rsi,%rdx
  lea    0x0(,%rdx,4),%rsi
  mov    -0x40(%rbp),%rdx
  add    %rdx,%rsi
  movslq %edi,%rdx
  mov    (%rcx,%rdx,4),%ecx
  mov    -0x28(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rsi,%rdx,4)
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rcx
  movslq %eax,%rdx
  imul   %rcx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x40(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x24(%rbp),%edx
  movslq %edx,%rsi
  movslq %eax,%rdx
  imul   %rsi,%rdx
  lea    0x0(,%rdx,4),%rsi
  mov    -0x40(%rbp),%rdx
  add    %rdx,%rsi
  mov    -0x24(%rbp),%edx
  mov    %edx,%edi
  sub    -0x20(%rbp),%edi
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  mov    (%rcx,%rdx,4),%ecx
  movslq %edi,%rdx
  mov    %ecx,(%rsi,%rdx,4)
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rcx
  movslq %eax,%rdx
  imul   %rcx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x40(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rsi
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  mov    -0x1c(%rbp),%ecx
  mov    %ecx,(%rsi,%rdx,4)
  addl   $0x1,-0x2c(%rbp)
L9:
  mov    -0x2c(%rbp),%edx
  cmp    -0x24(%rbp),%edx
  jl     L39
  addl   $0x1,-0x30(%rbp)
L12:
  mov    -0x34(%rbp),%edx
  mov    %edx,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%edx
  sar    %edx
  cmp    %edx,-0x30(%rbp)
  jl     L33
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void rotate_right(int n, int matrix[n][n]) {
  int layer, first, last, offset, top, i;
  for (layer = 0; layer < (n / 2); layer++) {
    first = layer;
    last = n - 1 - layer;
    for (i = first; i < last; i++) {
      offset = i - first;
      top = matrix[first][i];
      matrix[first][i] = matrix[last - offset][first];
      matrix[last - offset][first] = matrix[last][last - offset];
      matrix[last][last - offset] = matrix[i][last];
      matrix[i][last] = top;
    }
  }
}
```