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

```asm
<lgndr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  movsd  %xmm0,0x20(%rsp)
  mov    %edi,0x54(%rsp)
  mov    %rsi,%r15
  mov    %rdx,0x40(%rsp)
  movapd %xmm0,%xmm7
  mulsd  %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  cmpl   $0x0,(%rcx)
  jne    L38
  movl   $0x1,(%rcx)
  mov    %edi,%eax
  add    %eax,%eax
  js     L38
  mov    %eax,%eax
  lea    0x2(%rax),%rbp
  mov    $0x1,%ebx
  mov    %rdx,%r12
L51:
  mov    %ebx,%edi
  call   <sqrt@plt>
  movsd  %xmm0,(%r12,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L51
L38:
  movsd  D14(%rip),%xmm0
  movsd  %xmm0,(%r15)
  mov    0x40(%rsp),%r14
  movsd  0x20(%rsp),%xmm1
  mulsd  0x18(%r14),%xmm1
  movsd  %xmm1,0x8(%r15)
  mov    0x18(%r14),%rbx
  subsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x58(%rsp)
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  movq   %rbx,%xmm7
  mulsd  %xmm0,%xmm7
  movsd  %xmm7,0x10(%r15)
  cmpl   $0x1,0x54(%rsp)
  jle    L37
  lea    0x10(%r14),%rax
  mov    %rax,0x48(%rsp)
  movl   $0x1,0x50(%rsp)
  movq   $0x0,0x38(%rsp)
  movl   $0x2,0x30(%rsp)
  jmp    L66
L15:
  mov    0x30(%rsp),%eax
  add    %eax,%eax
  cltq
  shl    $0x3,%rax
  mov    0x40(%rsp),%rcx
  lea    -0x8(%rcx,%rax,1),%rdx
  lea    0x8(%rcx,%rax,1),%r14
  lea    -0x18(%rcx,%rax,1),%rax
  mov    %rax,0x28(%rsp)
  mov    0x48(%rsp),%r12
  mov    %r12,%r13
  mov    $0x0,%ebx
  mov    0x38(%rsp),%eax
  mov    %eax,0x34(%rsp)
  mov    %ebp,0x8(%rsp)
  mov    %rdx,%rbp
L84:
  movsd  0x0(%rbp),%xmm0
  divsd  (%r12),%xmm0
  movsd  (%r14),%xmm1
  divsd  0x0(%r13),%xmm1
  mulsd  %xmm1,%xmm0
  mulsd  0x20(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  mov    %ebx,%esi
  mov    0x8(%rsp),%edi
  call   <indx@plt>
  movsd  0x10(%rsp),%xmm0
  mulsd  (%r15,%rax,8),%xmm0
  movsd  %xmm0,0x10(%rsp)
  movsd  (%r14),%xmm0
  mov    0x28(%rsp),%rdx
  divsd  (%rdx),%xmm0
  movsd  -0x8(%r13),%xmm1
  divsd  0x0(%r13),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  -0x8(%r12),%xmm1
  divsd  (%r12),%xmm1
  movapd %xmm0,%xmm2
  mulsd  %xmm1,%xmm2
  movsd  %xmm2,0x18(%rsp)
  mov    %ebx,%esi
  mov    0x34(%rsp),%edi
  call   <indx@plt>
  movsd  0x18(%rsp),%xmm2
  mulsd  (%r15,%rax,8),%xmm2
  movsd  %xmm2,0x18(%rsp)
  mov    %ebx,%esi
  mov    0x30(%rsp),%edi
  call   <indx@plt>
  movsd  0x10(%rsp),%xmm0
  subsd  0x18(%rsp),%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  add    $0x1,%ebx
  sub    $0x8,%r12
  add    $0x8,%r13
  cmp    0x8(%rsp),%ebx
  jne    L84
  mov    0x8(%rsp),%ebp
L48:
  mov    0x38(%rsp),%r13
  mov    %r13,%rax
  shl    $0x4,%rax
  mov    0x40(%rsp),%rcx
  movsd  0x20(%rsp),%xmm4
  mulsd  0x28(%rcx,%rax,1),%xmm4
  movsd  %xmm4,0x8(%rsp)
  mov    %ebp,%esi
  mov    %ebp,%edi
  call   <indx@plt>
  mov    (%r15,%rax,8),%rbx
  mov    %ebp,%esi
  mov    0x30(%rsp),%r14d
  mov    %r14d,%edi
  call   <indx@plt>
  movq   %rbx,%xmm0
  mulsd  0x8(%rsp),%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  lea    (%r14,%r14,1),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D14(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  0x58(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  movq   %xmm0,%r12
  mov    %ebp,%esi
  mov    %ebp,%edi
  call   <indx@plt>
  mov    (%r15,%rax,8),%rbx
  mov    %r14d,%esi
  mov    %r14d,%edi
  call   <indx@plt>
  movq   %r12,%xmm0
  movq   %rbx,%xmm6
  mulsd  %xmm6,%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  add    $0x1,%r14d
  mov    %r14d,0x30(%rsp)
  add    $0x1,%r13
  mov    %r13,0x38(%rsp)
  addl   $0x1,0x50(%rsp)
  addq   $0x8,0x48(%rsp)
  cmp    %r14d,0x54(%rsp)
  jl     L37
L66:
  mov    0x50(%rsp),%eax
  mov    %eax,%ebp
  test   %eax,%eax
  jg     L15
  jmp    L48
L37:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: tag: D14
type_infered: f64

tool: D14: 1

assistant: ```c
void lgndr(double t, int NMAX, double *P_bar_nm, double *SQT, int *IX) {
  int n, m;
  double t2 = t * t;
  if (*IX == 0) {
    *IX = 1;
    int NSQRTS = NMAX + NMAX + 1;
#pragma omp parallel for
    for (m = 1; m <= NSQRTS; m++)
      SQT[m] = sqrt(m);
  }
  P_bar_nm[0] = 1.0;
  P_bar_nm[1] = SQT[3] * t;
  P_bar_nm[2] = SQT[3] * sqrt(1.0 - t2);
  if (NMAX == 1)
    return;
  for (n = 2; n <= NMAX; n++) {
    for (m = 0; m < n - 1; m++) {
      P_bar_nm[indx(n, m)] = ((SQT[2 * n - 1] / SQT[n - m]) * (SQT[2 * n + 1] / SQT[n + m])) * t * P_bar_nm[indx(n - 1, m)] - ((SQT[2 * n + 1] / SQT[2 * n - 3]) * (SQT[n + m - 1] / SQT[n + m]) * (SQT[n - m - 1] / SQT[n - m])) * P_bar_nm[indx(n - 2, m)];
    }
    P_bar_nm[indx(n, n - 1)] = SQT[2 * n + 1] * t * P_bar_nm[indx(n - 1, n - 1)];
    P_bar_nm[indx(n, n)] = sqrt((2 * n + 1.0) * (1 - t2) / (2 * n)) * P_bar_nm[indx(n - 1, n - 1)];
  }
}
```