user: Translate the below assembly code into C programming language:

```asm
<calc_limb_darkening>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  movsd  %xmm0,0x18(%rsp)
  movsd  %xmm1,0x38(%rsp)
  test   %edx,%edx
  jle    L79
  mov    %r8,%r12
  mov    %rsi,%rbp
  mov    %rdi,%r13
  lea    -0x1(%rdx),%eax
  lea    0x8(%rsi,%rax,8),%r15
  jmp    L67
L63:
  movq   %rbx,%xmm6
  comisd D97(%rip),%xmm6
  jb     L92
  mov    D97(%rip),%rax
  mov    %rax,0x0(%r13)
L61:
  add    $0x8,%rbp
  add    $0x8,%r13
  cmp    %r15,%rbp
  je     L79
L67:
  mov    0x0(%rbp),%r14
  movq   %r14,%xmm4
  movsd  0x18(%rsp),%xmm5
  subsd  %xmm5,%xmm4
  movq   %xmm4,%rbx
  movapd %xmm4,%xmm2
  pxor   %xmm4,%xmm4
  comisd %xmm4,%xmm2
  jbe    L125
  movq   %r14,%xmm6
  addsd  %xmm5,%xmm6
  movsd  %xmm6,0x8(%rsp)
  movsd  D97(%rip),%xmm0
  comisd %xmm6,%xmm0
  ja     L63
  movsd  %xmm0,0x8(%rsp)
  jmp    L63
L128:
  movq   %rbx,%xmm0
  call   <acos@plt>
  movapd %xmm0,%xmm2
  mulsd  0x38(%rsp),%xmm2
  movsd  %xmm2,0x28(%rsp)
  movq   %rbx,%xmm7
  addsd  %xmm2,%xmm7
  movsd  %xmm7,0x10(%rsp)
  mov    D62(%rip),%rbx
  mov    %rbx,0x20(%rsp)
  movsd  0x8(%rsp),%xmm5
  comisd %xmm7,%xmm5
  jbe    L103
L29:
  mov    %rbx,0x30(%rsp)
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  movq   %r14,%xmm0
  call   <area@plt>
  movq   %xmm0,%rbx
  movsd  0x28(%rsp),%xmm3
  mulsd  D10(%rip),%xmm3
  movsd  0x10(%rsp),%xmm0
  subsd  %xmm3,%xmm0
  mov    %r12,%rdi
  call   <intensity@plt>
  movapd %xmm0,%xmm1
  movq   %rbx,%xmm7
  subsd  0x30(%rsp),%xmm7
  movapd %xmm7,%xmm0
  mulsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  addsd  0x20(%rsp),%xmm1
  movsd  %xmm1,0x20(%rsp)
  movsd  0x10(%rsp),%xmm0
  call   <acos@plt>
  movapd %xmm0,%xmm7
  mulsd  0x38(%rsp),%xmm7
  movsd  %xmm7,0x28(%rsp)
  movsd  0x10(%rsp),%xmm3
  addsd  %xmm7,%xmm3
  movsd  %xmm3,0x10(%rsp)
  movsd  0x8(%rsp),%xmm1
  comisd %xmm3,%xmm1
  ja     L29
L19:
  movsd  0x8(%rsp),%xmm1
  movapd %xmm1,%xmm0
  subsd  0x10(%rsp),%xmm0
  addsd  0x28(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  movsd  0x18(%rsp),%xmm2
  movq   %r14,%xmm0
  call   <area@plt>
  movq   %xmm0,%r14
  movsd  0x10(%rsp),%xmm0
  mulsd  D10(%rip),%xmm0
  movsd  0x8(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  mov    %r12,%rdi
  movapd %xmm1,%xmm0
  call   <intensity@plt>
  movapd %xmm0,%xmm1
  movq   %r14,%xmm0
  movq   %rbx,%xmm5
  subsd  %xmm5,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x20(%rsp),%xmm0
  movsd  D97(%rip),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%r13)
  jmp    L61
L103:
  mov    D62(%rip),%rbx
  mov    %rbx,0x20(%rsp)
  jmp    L19
L125:
  movq   %r14,%xmm2
  addsd  0x18(%rsp),%xmm2
  movsd  %xmm2,0x8(%rsp)
  mov    D62(%rip),%rbx
  movsd  D97(%rip),%xmm4
  comisd %xmm2,%xmm4
  ja     L92
  movsd  D97(%rip),%xmm3
  movsd  %xmm3,0x8(%rsp)
  mov    D62(%rip),%rbx
L92:
  movsd  D102(%rip),%xmm1
  movsd  0x8(%rsp),%xmm0
  movq   %rbx,%xmm3
  subsd  %xmm3,%xmm0
  comisd %xmm0,%xmm1
  jbe    L128
  mov    D97(%rip),%rax
  mov    %rax,0x0(%r13)
  jmp    L61
L79:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D97
type: f64[2]
name: retrieve_data
arguments: data_tag: D62
type: f64
name: retrieve_data
arguments: data_tag: D10
type: byte[8]
name: retrieve_data
arguments: data_tag: D102
type: byte[8]

tool: {"D97": [1.0,0.0]}

tool: D62: 0

tool: {"D10": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

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