user: Converte this assembly snippet into its equivalent C code:

```asm
<pumas_elastic_dcs>:
  endbr64
  sub    $0xd8,%rsp
  movsd  D35(%rip),%xmm6
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  movsd  %xmm0,0x8(%rsp)
  comisd %xmm0,%xmm6
  ja     L58
  comisd %xmm1,%xmm6
  movsd  %xmm1,0x10(%rsp)
  ja     L58
  pxor   %xmm7,%xmm7
  movsd  %xmm2,0x18(%rsp)
  comisd %xmm2,%xmm7
  movapd %xmm7,%xmm0
  jae    L26
  comisd %xmm3,%xmm7
  movsd  %xmm3,0x20(%rsp)
  jae    L26
  movapd %xmm4,%xmm0
  lea    0x58(%rsp),%rdi
  lea    0x50(%rsp),%rsi
  call   <sincos@plt>
  movsd  0x8(%rsp),%xmm5
  lea    0x70(%rsp),%rsi
  movsd  0x50(%rsp),%xmm9
  movsd  0x58(%rsp),%xmm8
  movsd  0x20(%rsp),%xmm3
  lea    0x68(%rsp),%rdi
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  movapd %xmm5,%xmm0
  movsd  %xmm9,0x40(%rsp)
  movsd  %xmm8,0x38(%rsp)
  movsd  %xmm3,0x30(%rsp)
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm5,0x18(%rsp)
  call   <coulomb_frame_parameters@plt>
  movsd  0x18(%rsp),%xmm5
  lea    0x64(%rsp),%rdi
  movsd  0x68(%rsp),%xmm4
  movsd  0x30(%rsp),%xmm3
  movsd  0x28(%rsp),%xmm2
  lea    0xa0(%rsp),%rdx
  lea    0x80(%rsp),%rsi
  movsd  0x20(%rsp),%xmm1
  movapd %xmm5,%xmm0
  movsd  %xmm5,0x20(%rsp)
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <coulomb_screening_parameters@plt>
  movsd  0x10(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm2
  movapd %xmm3,%xmm1
  movapd %xmm2,%xmm0
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  call   <coulomb_spin_factor@plt>
  movsd  0x70(%rsp),%xmm11
  pxor   %xmm7,%xmm7
  movsd  0x38(%rsp),%xmm8
  movsd  0x78(%rsp),%xmm1
  mov    D35(%rip),%rax
  movsd  %xmm0,0x8(%rsp)
  mulsd  %xmm11,%xmm8
  movsd  0x40(%rsp),%xmm9
  movsd  0x10(%rsp),%xmm2
  movapd %xmm1,%xmm4
  movq   %rax,%xmm0
  movq   %rax,%xmm6
  movsd  0x18(%rsp),%xmm3
  mulsd  %xmm1,%xmm4
  movapd %xmm9,%xmm10
  movsd  0x20(%rsp),%xmm5
  mulsd  %xmm9,%xmm10
  mulsd  %xmm8,%xmm8
  subsd  %xmm4,%xmm0
  mulsd  %xmm8,%xmm0
  addsd  %xmm10,%xmm0
  ucomisd %xmm0,%xmm7
  ja     L134
  sqrtsd %xmm0,%xmm0
L24:
  movapd %xmm1,%xmm4
  addsd  %xmm8,%xmm10
  mov    0x64(%rsp),%eax
  addsd  %xmm6,%xmm4
  mulsd  %xmm9,%xmm1
  lea    -0x1(%rax),%edx
  mulsd  %xmm8,%xmm4
  movapd %xmm9,%xmm8
  subsd  %xmm0,%xmm8
  addsd  %xmm0,%xmm1
  mulsd  %xmm9,%xmm8
  mulsd  %xmm11,%xmm1
  addsd  %xmm8,%xmm4
  mulsd  D58(%rip),%xmm4
  movapd %xmm7,%xmm8
  mulsd  %xmm1,%xmm1
  divsd  %xmm10,%xmm4
  mulsd  %xmm10,%xmm10
  mulsd  %xmm0,%xmm10
  divsd  %xmm10,%xmm1
  movsd  %xmm1,0x10(%rsp)
  test   %edx,%edx
  jle    L67
  cmp    $0x2,%eax
  je     L141
  movapd 0x80(%rsp),%xmm0
  movapd %xmm4,%xmm1
  mov    %edx,%eax
  unpcklpd %xmm1,%xmm1
  and    $0xfffffffe,%eax
  addpd  0xa0(%rsp),%xmm1
  divpd  %xmm1,%xmm0
  movapd %xmm0,%xmm8
  unpckhpd %xmm0,%xmm0
  addsd  %xmm7,%xmm8
  addsd  %xmm0,%xmm8
  test   $0x1,%dl
  je     L67
L79:
  cltq
  movsd  0xa0(%rsp,%rax,8),%xmm1
  movsd  0x80(%rsp,%rax,8),%xmm0
  addsd  %xmm4,%xmm1
  divsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm8
L67:
  movslq %edx,%rdx
  movapd %xmm4,%xmm0
  movsd  %xmm3,0x38(%rsp)
  movsd  0xa0(%rsp,%rdx,8),%xmm1
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm5,0x28(%rsp)
  movsd  %xmm8,0x20(%rsp)
  movsd  %xmm4,0x18(%rsp)
  call   <coulomb_nuclear_form_factor@plt>
  movsd  0x30(%rsp),%xmm2
  pxor   %xmm7,%xmm7
  movsd  0x20(%rsp),%xmm8
  mov    D35(%rip),%rax
  movsd  0x18(%rsp),%xmm4
  movapd %xmm2,%xmm1
  movsd  0x28(%rsp),%xmm5
  movsd  0x38(%rsp),%xmm3
  addsd  %xmm2,%xmm1
  mulsd  %xmm0,%xmm8
  movsd  0x68(%rsp),%xmm0
  movq   %rax,%xmm6
  movapd %xmm1,%xmm9
  addsd  %xmm0,%xmm9
  mulsd  %xmm8,%xmm8
  mulsd  %xmm0,%xmm9
  ucomisd %xmm9,%xmm7
  ja     L8
  sqrtsd %xmm9,%xmm9
L138:
  addsd  %xmm3,%xmm1
  movapd %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  ucomisd %xmm0,%xmm7
  ja     L3
  sqrtsd %xmm0,%xmm0
L105:
  mulsd  D61(%rip),%xmm5
  addsd  %xmm3,%xmm2
  mulsd  %xmm0,%xmm9
  movsd  0x8(%rsp),%xmm0
  mulsd  %xmm4,%xmm0
  mulsd  %xmm2,%xmm5
  mulsd  D82(%rip),%xmm5
  subsd  %xmm0,%xmm6
  divsd  %xmm9,%xmm5
  mulsd  %xmm5,%xmm5
  mulsd  %xmm8,%xmm5
  mulsd  0x10(%rsp),%xmm5
  mulsd  %xmm6,%xmm5
  movapd %xmm5,%xmm0
L26:
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L143
  add    $0xd8,%rsp
  ret
  nopl   0x0(%rax,%rax,1)
L58:
  pxor   %xmm0,%xmm0
  jmp    L26
  cs nopw 0x0(%rax,%rax,1)
L141:
  xor    %eax,%eax
  jmp    L79
L143:
  call   <__stack_chk_fail@plt>
L134:
  movsd  %xmm3,0x48(%rsp)
  movsd  %xmm2,0x40(%rsp)
  movsd  %xmm5,0x38(%rsp)
  movsd  %xmm9,0x30(%rsp)
  movsd  %xmm1,0x28(%rsp)
  movsd  %xmm8,0x20(%rsp)
  movsd  %xmm10,0x18(%rsp)
  movsd  %xmm11,0x10(%rsp)
  call   <sqrt@plt>
  mov    D35(%rip),%rax
  pxor   %xmm7,%xmm7
  movsd  0x48(%rsp),%xmm3
  movsd  0x40(%rsp),%xmm2
  movsd  0x38(%rsp),%xmm5
  movsd  0x30(%rsp),%xmm9
  movsd  0x28(%rsp),%xmm1
  movq   %rax,%xmm6
  movsd  0x20(%rsp),%xmm8
  movsd  0x18(%rsp),%xmm10
  movsd  0x10(%rsp),%xmm11
  jmp    L24
L8:
  movapd %xmm9,%xmm0
  movsd  %xmm3,0x40(%rsp)
  movsd  %xmm2,0x38(%rsp)
  movsd  %xmm5,0x30(%rsp)
  movsd  %xmm8,0x28(%rsp)
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm1,0x18(%rsp)
  call   <sqrt@plt>
  mov    D35(%rip),%rax
  pxor   %xmm7,%xmm7
  movsd  0x40(%rsp),%xmm3
  movsd  0x38(%rsp),%xmm2
  movsd  0x30(%rsp),%xmm5
  movapd %xmm0,%xmm9
  movsd  0x28(%rsp),%xmm8
  movsd  0x20(%rsp),%xmm4
  movq   %rax,%xmm6
  movsd  0x18(%rsp),%xmm1
  jmp    L138
L3:
  movsd  %xmm3,0x40(%rsp)
  movsd  %xmm2,0x38(%rsp)
  movsd  %xmm5,0x30(%rsp)
  movsd  %xmm9,0x28(%rsp)
  movsd  %xmm8,0x20(%rsp)
  movsd  %xmm4,0x18(%rsp)
  call   <sqrt@plt>
  mov    D35(%rip),%rax
  movsd  0x40(%rsp),%xmm3
  movsd  0x38(%rsp),%xmm2
  movsd  0x30(%rsp),%xmm5
  movsd  0x28(%rsp),%xmm9
  movsd  0x18(%rsp),%xmm4
  movq   %rax,%xmm6
  movsd  0x20(%rsp),%xmm8
  jmp    L105
```

tool_calls: name: read_data
arguments: label: D35
type_infered: f64
name: read_data
arguments: label: D58
type_infered: f64
name: read_data
arguments: label: D61
type_infered: byte[8]
name: read_data
arguments: label: D82
type_infered: byte[8]

tool: D35: 1

tool: D58: 0.5

tool: {"D61": [0x9d,0xd2,0x1e,0x2a,0xd4,0xe3,0x6d,0x3f]}

tool: {"D82": [0x82,0x38,0x06,0xa3,0x14,0x70,0xac,0x3c]}

assistant: ```c
double pumas_elastic_dcs(double Z, double A, double m, double K, double theta) {
  if ((Z < 1.) || (A < 1.) || (m <= 0.) || (K <= 0.))
    return 0.;
  int n_parameters;
  double kinetic0, amplitude[3], screening[5], fCM[2];
  coulomb_frame_parameters(Z, A, m, K, &kinetic0, fCM);
  coulomb_screening_parameters(Z, A, m, K, kinetic0, &n_parameters, amplitude, screening);
  const double fspin = coulomb_spin_factor(m, K);
  const double c = cos(theta);
  const double s = sin(theta);
  const double gs = fCM[0] * s;
  const double sd = sqrt(c * c + gs * gs * (1. - fCM[1] * fCM[1]));
  const double cgs = c * c + gs * gs;
  const double mu0 = 0.5 * (gs * gs * (1. + fCM[1]) + c * (c - sd)) / cgs;
  const double num = fCM[0] * (c * fCM[1] + sd);
  const double jac = num * num / (cgs * cgs * sd);
  const int n = n_parameters - 1;
  double dcs = 0.;
  int i;
  for (i = 0; i < n; i++) {
    dcs += amplitude[i] / (screening[i] + mu0);
  }
  dcs *= coulomb_nuclear_form_factor(mu0, screening[n]);
  dcs *= dcs;
  const double p0 = sqrt(kinetic0 * (kinetic0 + 2. * m));
  const double p = sqrt(K * (K + 2. * m));
  const double factor = 0.5 * 7.2973525693E-03 * Z * (K + m) * 1.973269804E-16 / (p0 * p);
  return factor * factor * dcs * jac * (1. - fspin * mu0);
}
```