user: What is the c source code of the assembly code below:

```asm
<calc_limb_darkening>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  movsd  %xmm1,0x40(%rsp)
  test   %edx,%edx
  jle    L117
  lea    -0x1(%rdx),%eax
  movapd %xmm0,%xmm2
  mov    %r8,%r12
  mov    %rsi,%rbx
  movsd  D28(%rip),%xmm6
  mov    %rdi,%rbp
  lea    0x8(%rsi,%rax,8),%r13
  jmp    L42
  nopl   0x0(%rax,%rax,1)
L71:
  comisd %xmm6,%xmm1
  minsd  %xmm6,%xmm4
  jb     L68
L85:
  add    $0x8,%rbx
  movsd  %xmm6,0x0(%rbp)
  add    $0x8,%rbp
  cmp    %r13,%rbx
  je     L117
L42:
  movsd  (%rbx),%xmm5
  pxor   %xmm7,%xmm7
  movapd %xmm5,%xmm1
  movapd %xmm5,%xmm4
  subsd  %xmm2,%xmm1
  addsd  %xmm2,%xmm4
  comisd %xmm7,%xmm1
  ja     L71
  comisd %xmm4,%xmm6
  ja     L102
  movapd %xmm6,%xmm4
  pxor   %xmm1,%xmm1
L119:
  movapd %xmm1,%xmm0
  movsd  %xmm2,0x20(%rsp)
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm1,(%rsp)
  call   <acos@plt>
  movsd  0x40(%rsp),%xmm3
  movsd  (%rsp),%xmm1
  movq   $0x0,0x8(%rsp)
  movsd  0x10(%rsp),%xmm4
  mov    D43(%rip),%rax
  movq   $0x0,(%rsp)
  mulsd  %xmm0,%xmm3
  movsd  0x18(%rsp),%xmm5
  movsd  0x20(%rsp),%xmm2
  mov    %rax,0x48(%rsp)
  addsd  %xmm3,%xmm1
  comisd %xmm1,%xmm4
  jbe    L26
L18:
  movsd  (%rsp),%xmm7
  movapd %xmm5,%xmm0
  movsd  %xmm4,0x30(%rsp)
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm5,0x20(%rsp)
  movsd  %xmm3,0x38(%rsp)
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm1,0x18(%rsp)
  call   <area@plt>
  movsd  0x38(%rsp),%xmm3
  mulsd  D43(%rip),%xmm3
  mov    %r12,%rdi
  movsd  0x18(%rsp),%xmm1
  movsd  %xmm0,(%rsp)
  movapd %xmm1,%xmm7
  subsd  %xmm3,%xmm7
  movapd %xmm7,%xmm0
  call   <intensity@plt>
  movsd  0x18(%rsp),%xmm1
  movapd %xmm0,%xmm3
  movsd  (%rsp),%xmm0
  subsd  0x10(%rsp),%xmm0
  movsd  %xmm1,0x10(%rsp)
  mulsd  %xmm3,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm1,%xmm0
  call   <acos@plt>
  movsd  0x40(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm1
  movsd  0x30(%rsp),%xmm4
  movsd  0x20(%rsp),%xmm5
  mulsd  %xmm0,%xmm3
  movsd  0x28(%rsp),%xmm2
  addsd  %xmm3,%xmm1
  comisd %xmm1,%xmm4
  ja     L18
L13:
  movapd %xmm4,%xmm0
  movsd  %xmm2,0x28(%rsp)
  add    $0x8,%rbx
  add    $0x8,%rbp
  subsd  %xmm1,%xmm0
  movapd %xmm4,%xmm1
  movsd  %xmm4,0x20(%rsp)
  addsd  %xmm3,%xmm0
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm5,%xmm0
  call   <area@plt>
  movsd  0x20(%rsp),%xmm4
  mov    %r12,%rdi
  movsd  %xmm0,0x18(%rsp)
  movsd  0x10(%rsp),%xmm0
  mulsd  0x48(%rsp),%xmm0
  subsd  %xmm0,%xmm4
  movapd %xmm4,%xmm0
  call   <intensity@plt>
  movsd  0x18(%rsp),%xmm1
  subsd  (%rsp),%xmm1
  movapd %xmm0,%xmm3
  mov    D28(%rip),%rax
  movsd  0x28(%rsp),%xmm2
  movapd %xmm1,%xmm0
  movq   %rax,%xmm1
  movq   %rax,%xmm6
  mulsd  %xmm3,%xmm0
  addsd  0x8(%rsp),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rbp)
  cmp    %r13,%rbx
  jne    L42
L117:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nop
L102:
  movapd %xmm4,%xmm0
  pxor   %xmm1,%xmm1
L74:
  movsd  D34(%rip),%xmm7
  comisd %xmm0,%xmm7
  ja     L85
  jmp    L119
  nop
L26:
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  mov    %rax,0x48(%rsp)
  jmp    L13
L68:
  movapd %xmm4,%xmm0
  subsd  %xmm1,%xmm0
  jmp    L74
```

tool_calls: name: unpack_data
arguments: tag: D28
datatype: f64
name: unpack_data
arguments: tag: D43
datatype: f32[2]
name: unpack_data
arguments: tag: D34
datatype: byte[8]

tool: D28: 1

tool: {"D43": [0.0,1.75]}

tool: {"D34": [0x48,0xaf,0xbc,0x9a,0xf2,0xd7,0x7a,0x3e]}

assistant: ```c
void calc_limb_darkening(double *f_array, double *d_array, int N, double rprs, double fac, int nthreads, double *intensity_args) {
  for (int i = 0; i < N; i++) {
    double d = d_array[i];
    double x_in = (((d - rprs) > (0.)) ? (d - rprs) : (0.));
    double x_out = (((d + rprs) < (1.0)) ? (d + rprs) : (1.0));
    if (x_in >= 1.)
      f_array[i] = 1.0;
    else if (x_out - x_in < 1.e-7)
      f_array[i] = 1.0;
    else {
      double delta = 0.;
      double x = x_in;
      double dx = fac * acos(x);
      x += dx;
      double A_i = 0.;
      while (x < x_out) {
        double A_f = area(d, x, rprs);
        double I = intensity(x - dx / 2., intensity_args);
        delta += (A_f - A_i) * I;
        dx = fac * acos(x);
        x = x + dx;
        A_i = A_f;
      }
      dx = x_out - x + dx;
      x = x_out;
      double A_f = area(d, x, rprs);
      double I = intensity(x - dx / 2., intensity_args);
      delta += (A_f - A_i) * I;
      f_array[i] = 1.0 - delta;
    }
  }
}
```