user: What would the C source look like for the assembly code provided here?

```asm
<lgndr>:
  endbr64
  movapd %xmm0,%xmm6
  push   %r15
  mulsd  %xmm0,%xmm6
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x48,%rsp
  mov    (%rcx),%eax
  mov    %edi,0x34(%rsp)
  movsd  %xmm0,0x18(%rsp)
  movsd  %xmm6,0x10(%rsp)
  test   %eax,%eax
  jne    L39
  mov    0x34(%rsp),%eax
  movl   $0x1,(%rcx)
  add    %eax,%eax
  js     L39
  mov    %eax,%eax
  mov    $0x1,%ebp
  lea    0x2(%rax),%r12
  nop
L31:
  mov    %ebp,%edi
  call   <sqrt@plt>
  movsd  %xmm0,0x0(%r13,%rbp,8)
  add    $0x1,%rbp
  cmp    %rbp,%r12
  jne    L31
L39:
  mov    D5(%rip),%rax
  movsd  0x18(%rsp),%xmm0
  mov    %rax,(%rbx)
  mulsd  0x18(%r13),%xmm0
  movsd  %xmm0,0x8(%rbx)
  movsd  0x18(%r13),%xmm6
  movsd  %xmm6,0x8(%rsp)
  movq   %rax,%xmm6
  subsd  0x10(%rsp),%xmm6
  cvttsd2si %xmm6,%edi
  movsd  %xmm6,0x38(%rsp)
  call   <sqrt@plt>
  mulsd  0x8(%rsp),%xmm0
  cmpl   $0x1,0x34(%rsp)
  movsd  %xmm0,0x10(%rbx)
  jle    L43
  lea    0x10(%r13),%rax
  lea    0x8(%r13),%r15
  mov    $0x1,%ebp
  mov    %rax,0x28(%rsp)
L29:
  mov    %ebp,%r10d
  add    $0x1,%ebp
  mov    0x28(%rsp),%r13
  xor    %r14d,%r14d
  lea    0x0(%rbp,%rbp,1),%eax
  mov    %eax,0x30(%rsp)
  lea    -0x1(%r10),%eax
  mov    %r13,%r12
  mov    %eax,0x24(%rsp)
  nopl   0x0(%rax)
L47:
  movsd  0x10(%r15),%xmm0
  mov    %r10d,%edi
  mov    %r14d,%esi
  sub    $0x8,%r13
  divsd  0x8(%r13),%xmm0
  movsd  0x20(%r15),%xmm1
  divsd  (%r12),%xmm1
  mulsd  %xmm1,%xmm0
  mulsd  0x18(%rsp),%xmm0
  mov    %r10d,0x20(%rsp)
  add    $0x8,%r12
  movsd  %xmm0,0x8(%rsp)
  call   <indx@plt>
  movsd  -0x10(%r12),%xmm2
  mov    0x24(%rsp),%edi
  mov    %r14d,%esi
  divsd  -0x8(%r12),%xmm2
  movsd  0x20(%r15),%xmm1
  divsd  (%r15),%xmm1
  mulsd  %xmm2,%xmm1
  movsd  0x8(%rsp),%xmm0
  movsd  0x0(%r13),%xmm2
  divsd  0x8(%r13),%xmm2
  mulsd  (%rbx,%rax,8),%xmm0
  mulsd  %xmm2,%xmm1
  movsd  %xmm0,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <indx@plt>
  movsd  0x8(%rsp),%xmm1
  mov    %r14d,%esi
  mov    %ebp,%edi
  mulsd  (%rbx,%rax,8),%xmm1
  add    $0x1,%r14d
  movsd  %xmm1,0x8(%rsp)
  call   <indx@plt>
  movsd  0x10(%rsp),%xmm0
  mov    0x20(%rsp),%r10d
  subsd  0x8(%rsp),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  cmp    %r10d,%r14d
  jne    L47
  movsd  0x18(%rsp),%xmm0
  mov    %r14d,%esi
  mov    %r14d,%edi
  add    $0x10,%r15
  mulsd  0x10(%r15),%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <indx@plt>
  mov    %r14d,%esi
  mov    %ebp,%edi
  movsd  (%rbx,%rax,8),%xmm5
  movsd  %xmm5,0x10(%rsp)
  call   <indx@plt>
  movsd  0x8(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  mulsd  0x10(%rsp),%xmm0
  cvtsi2sdl 0x30(%rsp),%xmm1
  movsd  %xmm0,(%rbx,%rax,8)
  movsd  D5(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  0x38(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  mov    %r14d,%esi
  mov    %r14d,%edi
  movsd  %xmm0,0x8(%rsp)
  call   <indx@plt>
  mov    %ebp,%esi
  mov    %ebp,%edi
  movsd  (%rbx,%rax,8),%xmm7
  movsd  %xmm7,0x10(%rsp)
  call   <indx@plt>
  movsd  0x8(%rsp),%xmm0
  mulsd  0x10(%rsp),%xmm0
  lea    0x2(%r14),%edx
  addq   $0x8,0x28(%rsp)
  movsd  %xmm0,(%rbx,%rax,8)
  cmp    %edx,0x34(%rsp)
  jge    L29
L43:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D5
type_guessed: f64

tool: D5: 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)];
  }
}
```