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

```asm
<rstage>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r14d
  mov    %esi,%r15d
  mov    %edx,0xc(%rsp)
  mov    %rcx,%rbx
  mov    %r8,%rbp
  mov    %r9,%r12
  mov    0x60(%rsp),%r13
  lea    (%rsi,%rsi,1),%eax
  mov    %eax,0x4(%rsp)
  mov    %eax,%ecx
  mov    $0x0,%eax
L46:
  add    $0x1,%eax
  cmp    %r14d,%eax
  jg     L82
  movslq %ecx,%rdx
  cltq
L57:
  movsd  0x0(%r13,%rax,8),%xmm1
  movsd  (%r12,%rax,8),%xmm2
  movapd %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x0(%r13,%rax,8)
  movsd  (%rbx,%rax,8),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%r12,%rax,8)
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    %rdx,%rax
  cmp    %eax,%r14d
  jge    L57
L82:
  lea    (%rcx,%rcx,1),%eax
  sub    %r15d,%eax
  shl    $0x2,%ecx
  cmp    %eax,%r14d
  jg     L46
  cmpl   $0x1,0xc(%rsp)
  jle    L92
  lea    0x7(%r15),%eax
  test   %r15d,%r15d
  cmovns %r15d,%eax
  sar    $0x3,%eax
  mov    %eax,%esi
  mov    %eax,0x8(%rsp)
  mov    0x4(%rsp),%ecx
  mov    $0x0,%eax
  movsd  D4(%rip),%xmm3
  movq   D11(%rip),%xmm4
L49:
  lea    0x1(%rax,%rsi,1),%eax
  cmp    %eax,%r14d
  jl     L55
  movslq %ecx,%rdx
  cltq
L115:
  movsd  (%r12,%rax,8),%xmm0
  movsd  0x0(%r13,%rax,8),%xmm1
  movapd %xmm0,%xmm2
  addsd  %xmm1,%xmm2
  mulsd  %xmm3,%xmm2
  subsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  movsd  0x0(%rbp,%rax,8),%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x0(%r13,%rax,8)
  movsd  0x0(%rbp,%rax,8),%xmm1
  xorpd  %xmm4,%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm1,(%r12,%rax,8)
  movsd  (%rbx,%rax,8),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp,%rax,8)
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    %rdx,%rax
  cmp    %eax,%r14d
  jge    L115
L55:
  lea    (%rcx,%rcx,1),%eax
  sub    %r15d,%eax
  shl    $0x2,%ecx
  cmp    %eax,%r14d
  jg     L49
  cmp    $0xf,%r15d
  jle    L92
  lea    0x18(%rsp),%rdi
  lea    0x10(%rsp),%rsi
  pxor   %xmm1,%xmm1
  cvtsi2sd %r15d,%xmm1
  movsd  D50(%rip),%xmm0
  divsd  %xmm1,%xmm0
  call   <sincos@plt>
  movsd  0x10(%rsp),%xmm11
  movsd  0x18(%rsp),%xmm10
  movsd  D32(%rip),%xmm1
  movapd %xmm10,%xmm12
  mulsd  %xmm1,%xmm12
  movapd %xmm10,%xmm0
  mulsd  %xmm10,%xmm0
  mulsd  %xmm10,%xmm0
  movsd  D0(%rip),%xmm2
  mulsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm12
  movapd %xmm11,%xmm0
  mulsd  %xmm11,%xmm0
  mulsd  %xmm11,%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  %xmm11,%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm0,%xmm9
  mov    0xc(%rsp),%r11d
  sub    $0x2,%r11d
  movapd %xmm0,%xmm7
  movapd %xmm11,%xmm6
  movapd %xmm12,%xmm5
  movapd %xmm10,%xmm4
  mov    $0x2,%r8d
  mov    $0x0,%r10d
  movq   D11(%rip),%xmm8
  jmp    L16
L40:
  movapd %xmm0,%xmm7
  movapd %xmm1,%xmm6
L16:
  mov    0x4(%rsp),%edi
  mov    %r10d,%eax
  movslq %r11d,%r9
L87:
  add    %r8d,%eax
  cmp    %eax,%r14d
  jl     L6
  movslq %edi,%rcx
  cltq
  lea    0x0(,%rcx,8),%rsi
  lea    (%r9,%rax,1),%rdx
  shl    $0x3,%rdx
L122:
  movsd  (%r12,%rax,8),%xmm1
  movsd  (%r12,%rdx,1),%xmm0
  movapd %xmm1,%xmm2
  mulsd  %xmm6,%xmm2
  movapd %xmm0,%xmm3
  mulsd  %xmm4,%xmm3
  addsd  %xmm3,%xmm2
  mulsd  %xmm6,%xmm0
  mulsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm0
  movsd  0x0(%r13,%rax,8),%xmm3
  movsd  0x0(%r13,%rdx,1),%xmm1
  movapd %xmm3,%xmm13
  mulsd  %xmm7,%xmm13
  movapd %xmm1,%xmm14
  mulsd  %xmm5,%xmm14
  addsd  %xmm14,%xmm13
  mulsd  %xmm7,%xmm1
  mulsd  %xmm5,%xmm3
  subsd  %xmm3,%xmm1
  movapd %xmm2,%xmm3
  addsd  %xmm13,%xmm3
  subsd  %xmm13,%xmm2
  movapd %xmm0,%xmm13
  addsd  %xmm1,%xmm13
  subsd  %xmm1,%xmm0
  movapd %xmm13,%xmm1
  subsd  0x0(%rbp,%rdx,1),%xmm1
  movsd  %xmm1,(%r12,%rax,8)
  addsd  0x0(%rbp,%rdx,1),%xmm13
  movsd  %xmm13,0x0(%r13,%rdx,1)
  movsd  0x0(%rbp,%rax,8),%xmm1
  xorpd  %xmm8,%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm1,(%r12,%rdx,1)
  movsd  0x0(%rbp,%rax,8),%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x0(%r13,%rax,8)
  movsd  (%rbx,%rax,8),%xmm1
  subsd  %xmm3,%xmm1
  movsd  %xmm1,0x0(%rbp,%rdx,1)
  addsd  (%rbx,%rax,8),%xmm3
  movsd  %xmm3,(%rbx,%rax,8)
  movapd %xmm0,%xmm1
  addsd  (%rbx,%rdx,1),%xmm1
  movsd  %xmm1,0x0(%rbp,%rax,8)
  movsd  (%rbx,%rdx,1),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx,%rdx,1)
  add    %rcx,%rax
  add    %rsi,%rdx
  cmp    %eax,%r14d
  jge    L122
L6:
  lea    (%rdi,%rdi,1),%eax
  sub    %r15d,%eax
  shl    $0x2,%edi
  cmp    %eax,%r14d
  jg     L87
  movapd %xmm11,%xmm1
  mulsd  %xmm6,%xmm1
  movapd %xmm10,%xmm2
  mulsd  %xmm4,%xmm2
  subsd  %xmm2,%xmm1
  mulsd  %xmm10,%xmm6
  mulsd  %xmm11,%xmm4
  addsd  %xmm6,%xmm4
  movapd %xmm9,%xmm0
  mulsd  %xmm7,%xmm0
  movapd %xmm12,%xmm2
  mulsd  %xmm5,%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm9,%xmm5
  mulsd  %xmm12,%xmm7
  addsd  %xmm7,%xmm5
  add    $0x1,%r8d
  sub    $0x2,%r11d
  cmp    %r8d,0x8(%rsp)
  jge    L40
L92:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D4
data_type: byte[8]
name: extract_symbolic_data
arguments: tag: D11
data_type: byte[8]
name: extract_symbolic_data
arguments: tag: D50
data_type: byte[8]
name: extract_symbolic_data
arguments: tag: D32
data_type: f64
name: extract_symbolic_data
arguments: tag: D0
data_type: byte[8]

tool: {"D4": [0xcc,0x3b,0x7f,0x66,0x9e,0xa0,0xe6,0x3f]}

tool: {"D11": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

tool: {"D50": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40]}

tool: D32: 3

tool: {"D0": [0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40]}

assistant: ```c
void rstage(n, n2, n4, x1, x2, x3, x4) int n, n2, n4;
double *x1, *x2, *x3, *x4;
{
  int n8, is, id, i1, i2, j, jn;
  double t1, t2, e, t3, t4, t5;
  double ss1, sd1, ss3, sd3;
  double cc1, cd1, cc3, cd3;
  n8 = n2 / 8;
  is = 0;
  id = n2 * 2;
  do {
    for (i1 = is + 1; i1 <= n; i1 += id) {
      t1 = x4[i1] + x3[i1];
      x4[i1] = x4[i1] - x3[i1];
      x3[i1] = x1[i1] - t1;
      x1[i1] = x1[i1] + t1;
    }
    is = 2 * id - n2;
    id = 4 * id;
  } while (is < n);
  if (n4 - 1 <= 0)
    return;
  is = 0;
  id = n2 * 2;
  do {
    for (i2 = is + 1 + n8; i2 <= n; i2 += id) {
      t1 = (x3[i2] + x4[i2]) * .7071067811865475;
      t2 = (x3[i2] - x4[i2]) * .7071067811865475;
      x4[i2] = x2[i2] - t1;
      x3[i2] = -x2[i2] - t1;
      x2[i2] = x1[i2] - t2;
      x1[i2] = x1[i2] + t2;
    }
    is = 2 * id - n2;
    id = 4 * id;
  } while (is < n);
  if (n8 - 1 <= 0)
    return;
  e = 2 * 3.14159265358979323 / n2;
  ss1 = sin(e);
  sd1 = ss1;
  sd3 = 3 * sd1 - 4 * (sd1 * sd1 * sd1);
  ss3 = sd3;
  cc1 = cos(e);
  cd1 = cc1;
  cd3 = 4 * (cd1 * cd1 * cd1) - 3. * cd1;
  cc3 = cd3;
  for (j = 2; j <= n8; j++) {
    is = 0;
    id = 2 * n2;
    jn = n4 - 2 * j + 2;
    do {
      for (i1 = is + j; i1 <= n; i1 += id) {
        i2 = i1 + jn;
        t1 = x3[i1] * cc1 + x3[i2] * ss1;
        t2 = x3[i2] * cc1 - x3[i1] * ss1;
        t3 = x4[i1] * cc3 + x4[i2] * ss3;
        t4 = x4[i2] * cc3 - x4[i1] * ss3;
        t5 = t1 + t3;
        t3 = t1 - t3;
        t1 = t2 + t4;
        t4 = t2 - t4;
        x3[i1] = t1 - x2[i2];
        x4[i2] = t1 + x2[i2];
        x3[i2] = -x2[i1] - t3;
        x4[i1] = x2[i1] - t3;
        x2[i2] = x1[i1] - t5;
        x1[i1] = x1[i1] + t5;
        x2[i1] = x1[i2] + t4;
        x1[i2] = x1[i2] - t4;
      }
      is = 2 * id - n2;
      id = 4 * id;
    } while (is < n);
    t1 = cc1 * cd1 - ss1 * sd1;
    ss1 = cc1 * sd1 + ss1 * cd1;
    cc1 = t1;
    t3 = cc3 * cd3 - ss3 * sd3;
    ss3 = cc3 * sd3 + ss3 * cd3;
    cc3 = t3;
  }
  return;
}
```