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

```asm
<cg_scale>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movsd  %xmm0,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    -0x30(%rbp),%rcx
  movabs $0x6666666666666667,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    %rax
  mov    %rcx,%rsi
  sar    $0x3f,%rsi
  sub    %rsi,%rax
  mov    %rax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jne    L33
  movq   $0x0,-0x10(%rbp)
  jmp    L21
L37:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
L21:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jl     L37
  jmp    L89
L12:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
L89:
  mov    -0x10(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jl     L12
  jmp    L52
L33:
  movq   $0x0,-0x10(%rbp)
  jmp    L6
L17:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
L6:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jl     L17
  jmp    L64
L96:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x10(%rbp)
L64:
  mov    -0x10(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jl     L96
  nop
L52:
  pop    %rbp
  ret
```

assistant: ```c
void cg_scale(double *y, double *x, double s, long int n) {
  long int i, n5;
  n5 = n % 5;
  if (y == x) {
    for (i = 0; i < n5; i++)
      y[i] *= s;
    for (; i < n;) {
      y[i] *= s;
      i++;
      y[i] *= s;
      i++;
      y[i] *= s;
      i++;
      y[i] *= s;
      i++;
      y[i] *= s;
      i++;
    }
  } else {
    for (i = 0; i < n5; i++)
      y[i] = s * x[i];
    for (; i < n;) {
      y[i] = s * x[i];
      i++;
      y[i] = s * x[i];
      i++;
      y[i] = s * x[i];
      i++;
      y[i] = s * x[i];
      i++;
      y[i] = s * x[i];
      i++;
    }
  }
  return;
}
```