user: 请从给定的汇编指令推导出C源代码：

```asm
<rstage>:
  endbr64
  push   %r15
  lea    (%rsi,%rsi,1),%eax
  mov    %edx,%r15d
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  mov    %eax,%ecx
  sub    $0x38,%rsp
  mov    0x70(%rsp),%rbp
  mov    %eax,0xc(%rsp)
  xor    %eax,%eax
  xchg   %ax,%ax
L51:
  lea    0x1(%rax),%esi
  movslq %ecx,%rdx
  movslq %esi,%rax
  cmp    %r12d,%esi
  jg     L88
  xchg   %ax,%ax
L85:
  movsd  0x0(%rbp,%rax,8),%xmm1
  movsd  (%r9,%rax,8),%xmm2
  movapd %xmm1,%xmm0
  subsd  %xmm2,%xmm1
  addsd  %xmm2,%xmm0
  movsd  %xmm1,0x0(%rbp,%rax,8)
  movsd  (%rbx,%rax,8),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%r9,%rax,8)
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    %rdx,%rax
  cmp    %eax,%r12d
  jge    L85
L88:
  lea    (%rcx,%rcx,1),%eax
  shl    $0x2,%ecx
  sub    %r13d,%eax
  cmp    %eax,%r12d
  jg     L51
  cmp    $0x1,%r15d
  jle    L57
  test   %r13d,%r13d
  lea    0x7(%r13),%r14d
  mov    0xc(%rsp),%ecx
  movsd  D25(%rip),%xmm3
  cmovns %r13d,%r14d
  movq   D53(%rip),%xmm4
  xor    %eax,%eax
  sar    $0x3,%r14d
  nopl   0x0(%rax)
L9:
  lea    0x1(%rax,%r14,1),%esi
  movslq %ecx,%rdx
  movslq %esi,%rax
  cmp    %esi,%r12d
  jl     L61
L90:
  movsd  (%r9,%rax,8),%xmm0
  movsd  0x0(%rbp,%rax,8),%xmm1
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm0
  addsd  %xmm1,%xmm2
  movsd  (%r8,%rax,8),%xmm1
  mulsd  %xmm3,%xmm0
  mulsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x0(%rbp,%rax,8)
  movsd  (%r8,%rax,8),%xmm1
  xorpd  %xmm4,%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm1,(%r9,%rax,8)
  movsd  (%rbx,%rax,8),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%r8,%rax,8)
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    %rdx,%rax
  cmp    %eax,%r12d
  jge    L90
L61:
  lea    (%rcx,%rcx,1),%eax
  shl    $0x2,%ecx
  sub    %r13d,%eax
  cmp    %eax,%r12d
  jg     L9
  mov    %r9,0x18(%rsp)
  mov    %r8,0x10(%rsp)
  cmp    $0xf,%r13d
  jle    L57
  pxor   %xmm1,%xmm1
  lea    0x28(%rsp),%rdi
  lea    0x20(%rsp),%rsi
  movsd  D40(%rip),%xmm0
  cvtsi2sd %r13d,%xmm1
  sub    $0x2,%r15d
  divsd  %xmm1,%xmm0
  call   <sincos@plt>
  movsd  0x28(%rsp),%xmm10
  movsd  D56(%rip),%xmm1
  mov    $0x2,%r10d
  movsd  D8(%rip),%xmm2
  movsd  0x20(%rsp),%xmm11
  movapd %xmm10,%xmm0
  movapd %xmm10,%xmm12
  mov    0x10(%rsp),%r8
  movq   D53(%rip),%xmm8
  mulsd  %xmm10,%xmm0
  mov    0x18(%rsp),%r9
  movapd %xmm11,%xmm6
  movapd %xmm10,%xmm4
  mulsd  %xmm1,%xmm12
  mulsd  %xmm11,%xmm1
  mulsd  %xmm10,%xmm0
  mulsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm12
  movapd %xmm11,%xmm0
  mulsd  %xmm11,%xmm0
  movapd %xmm12,%xmm5
  mulsd  %xmm11,%xmm0
  mulsd  %xmm2,%xmm0
  subsd  %xmm1,%xmm0
  movapd %xmm0,%xmm9
  movapd %xmm0,%xmm7
L104:
  mov    0xc(%rsp),%edi
  xor    %eax,%eax
  movslq %r15d,%r11
  nopl   0x0(%rax)
L120:
  add    %r10d,%eax
  cmp    %eax,%r12d
  jl     L43
  cltq
  movslq %edi,%rcx
  lea    (%r11,%rax,1),%rdx
  lea    0x0(,%rcx,8),%rsi
  shl    $0x3,%rdx
  nopl   0x0(%rax)
L24:
  movsd  (%r9,%rax,8),%xmm1
  movsd  (%r9,%rdx,1),%xmm0
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm3
  mulsd  %xmm4,%xmm3
  mulsd  %xmm4,%xmm1
  mulsd  %xmm6,%xmm2
  mulsd  %xmm6,%xmm0
  addsd  %xmm3,%xmm2
  movsd  0x0(%rbp,%rax,8),%xmm3
  subsd  %xmm1,%xmm0
  movsd  0x0(%rbp,%rdx,1),%xmm1
  movapd %xmm3,%xmm13
  mulsd  %xmm7,%xmm13
  movapd %xmm1,%xmm14
  mulsd  %xmm5,%xmm14
  mulsd  %xmm5,%xmm3
  mulsd  %xmm7,%xmm1
  addsd  %xmm14,%xmm13
  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  (%r8,%rdx,1),%xmm1
  movsd  %xmm1,(%r9,%rax,8)
  addsd  (%r8,%rdx,1),%xmm13
  movsd  %xmm13,0x0(%rbp,%rdx,1)
  movsd  (%r8,%rax,8),%xmm1
  xorpd  %xmm8,%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm1,(%r9,%rdx,1)
  movsd  (%r8,%rax,8),%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm1,0x0(%rbp,%rax,8)
  movsd  (%rbx,%rax,8),%xmm1
  subsd  %xmm3,%xmm1
  movsd  %xmm1,(%r8,%rdx,1)
  addsd  (%rbx,%rax,8),%xmm3
  movsd  %xmm3,(%rbx,%rax,8)
  movsd  (%rbx,%rdx,1),%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%r8,%rax,8)
  movsd  (%rbx,%rdx,1),%xmm1
  add    %rcx,%rax
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx,%rdx,1)
  add    %rsi,%rdx
  cmp    %eax,%r12d
  jge    L24
L43:
  lea    (%rdi,%rdi,1),%eax
  shl    $0x2,%edi
  sub    %r13d,%eax
  cmp    %eax,%r12d
  jg     L120
  movapd %xmm11,%xmm1
  movapd %xmm10,%xmm2
  add    $0x1,%r10d
  sub    $0x2,%r15d
  mulsd  %xmm4,%xmm2
  movapd %xmm9,%xmm0
  mulsd  %xmm6,%xmm1
  mulsd  %xmm7,%xmm0
  mulsd  %xmm10,%xmm6
  mulsd  %xmm11,%xmm4
  mulsd  %xmm12,%xmm7
  subsd  %xmm2,%xmm1
  movapd %xmm12,%xmm2
  mulsd  %xmm5,%xmm2
  mulsd  %xmm9,%xmm5
  addsd  %xmm6,%xmm4
  subsd  %xmm2,%xmm0
  addsd  %xmm7,%xmm5
  cmp    %r10d,%r14d
  jl     L57
  movapd %xmm0,%xmm7
  movapd %xmm1,%xmm6
  jmp    L104
L57:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: tag: D25
type_infered: byte[8]
name: read_data
arguments: tag: D53
type_infered: byte[8]
name: read_data
arguments: tag: D40
type_infered: byte[8]
name: read_data
arguments: tag: D56
type_infered: f64
name: read_data
arguments: tag: D8
type_infered: byte[8]

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

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

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

tool: D56: 3

tool: {"D8": [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;
}
```