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

```asm
<LinearADR_Sine_r>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %r8,%rbp
  push   %rbx
  movslq %edx,%rbx
  mov    %ebx,%edx
  sub    $0xd8,%rsp
  movsd  0x38(%rsi),%xmm1
  movsd  (%rsi),%xmm7
  movsd  0x8(%rsi),%xmm3
  movsd  0x10(%rsi),%xmm4
  mov    %r9,0x38(%rsp)
  movsd  0x50(%rsi),%xmm2
  mov    0x20(%rsi),%r14
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  movsd  %xmm7,(%rsp)
  movsd  0x18(%rsi),%xmm7
  movsd  %xmm1,0x80(%rsp)
  movsd  0x40(%rsi),%xmm1
  movsd  %xmm3,0x8(%rsp)
  movsd  0x30(%rsi),%xmm3
  movsd  %xmm4,0x10(%rsp)
  movsd  0x28(%rsi),%xmm4
  movsd  %xmm1,0x88(%rsp)
  movsd  0x48(%rsi),%xmm1
  movsd  %xmm2,0x98(%rsp)
  movsd  0x58(%rsi),%xmm2
  movsd  %xmm4,0x48(%rsp)
  movsd  %xmm1,0x28(%rsp)
  movsd  %xmm7,0x20(%rsp)
  movsd  %xmm3,0x30(%rsp)
  movsd  %xmm2,0xa0(%rsp)
  movsd  0x60(%rsi),%xmm2
  movsd  0x80(%rsi),%xmm3
  movsd  %xmm2,0xa8(%rsp)
  movsd  0x68(%rsi),%xmm2
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm2,0xb0(%rsp)
  movsd  0x70(%rsi),%xmm2
  movsd  %xmm2,0xb8(%rsp)
  movsd  0x78(%rsi),%xmm2
  movsd  %xmm2,0xc0(%rsp)
  call   <LinearADR_Sine@plt>
  movsd  0x48(%rsp),%xmm4
  movsd  0x30(%rsp),%xmm3
  lea    0x60(%rsp),%rdx
  movsd  0x28(%rsp),%xmm1
  mov    %eax,0x44(%rsp)
  lea    0xc8(%rsp),%rcx
  lea    0x80(%rsp),%rax
L46:
  movsd  (%rsp),%xmm0
  mulsd  (%rax),%xmm0
  add    $0x18,%rax
  add    $0x8,%rdx
  movsd  0x8(%rsp),%xmm2
  mulsd  -0x10(%rax),%xmm2
  mulsd  0x10(%rsp),%xmm1
  addsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rdx)
  cmp    %rax,%rcx
  je     L39
  movsd  0x10(%rax),%xmm1
  jmp    L46
L39:
  movsd  (%rsp),%xmm7
  movsd  0x8(%rsp),%xmm6
  movsd  0x60(%rsp),%xmm0
  movsd  0x68(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm5
  movq   D3(%rip),%xmm2
  mulsd  %xmm6,%xmm4
  mulsd  %xmm6,%xmm1
  mulsd  %xmm7,%xmm0
  mulsd  %xmm5,%xmm3
  addsd  %xmm1,%xmm0
  movsd  0x70(%rsp),%xmm1
  mulsd  %xmm5,%xmm1
  addsd  %xmm1,%xmm0
  xorpd  %xmm2,%xmm0
  subsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x28(%rsp)
  movq   %r14,%xmm0
  mulsd  %xmm7,%xmm0
  addsd  %xmm4,%xmm0
  addsd  %xmm3,%xmm0
  xorpd  %xmm2,%xmm0
  movsd  %xmm0,0x30(%rsp)
  test   %ebx,%ebx
  jle    L15
  xor    %r15d,%r15d
  lea    0x58(%rsp),%r14
  lea    0x50(%rsp),%r13
  nopw   0x0(%rax,%rax,1)
L19:
  movsd  (%rsp),%xmm0
  mov    %r13,%rsi
  mov    %r14,%rdi
  add    $0x18,%r12
  mulsd  -0x18(%r12),%xmm0
  movsd  0x8(%rsp),%xmm1
  mulsd  -0x10(%r12),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x10(%rsp),%xmm1
  mulsd  -0x8(%r12),%xmm1
  addsd  %xmm1,%xmm0
  addsd  0x20(%rsp),%xmm0
  call   <sincos@plt>
  movsd  0x18(%rsp),%xmm0
  movsd  0x30(%rsp),%xmm1
  mulsd  0x0(%rbp,%r15,8),%xmm0
  mov    0x38(%rsp),%rax
  mulsd  0x50(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x28(%rsp),%xmm1
  mulsd  0x58(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax,%r15,8)
  add    $0x1,%r15
  cmp    %r15,%rbx
  jne    L19
L15:
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  mov    0x44(%rsp),%eax
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D3
type: byte[8]

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

assistant: ```c
int LinearADR_Sine_r(int *iwork, double *rwork, int nPoints, double t, double *x, double *u, double *r) {
  int i, j, iret;
  double omega[3] = {rwork[0], rwork[1], rwork[2]};
  double omega0 = rwork[3];
  double b[3] = {rwork[4], rwork[5], rwork[6]};
  double a[3][3] = {{rwork[7], rwork[8], rwork[9]}, {rwork[10], rwork[11], rwork[12]}, {rwork[13], rwork[14], rwork[15]}};
  double c = rwork[16];
  double Y, D, E;
  double MM[3];
  iret = LinearADR_Sine(iwork, rwork, nPoints, t, x, u);
  for (j = 0; j < 3; j++) {
    MM[j] = a[j][0] * omega[0] + a[j][1] * omega[1] + a[j][2] * omega[2];
  }
  E = -(MM[0] * omega[0] + MM[1] * omega[1] + MM[2] * omega[2]) - c;
  D = -(b[0] * omega[0] + b[1] * omega[1] + b[2] * omega[2]);
  for (i = 0; i < nPoints; i++) {
    Y = omega[0] * x[i * 3 + 0] + omega[1] * x[i * 3 + 1] + omega[2] * x[i * 3 + 2] + omega0;
    r[i] = c * u[i] + D * cos(Y) + E * sin(Y);
  }
  return iret;
}
```