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

```asm
<calc_L1>:
  endbr64
  sub    $0x18,%rsp
  movsd  D44(%rip),%xmm1
  movsd  D44(%rip),%xmm6
  xor    %eax,%eax
  movq   D29(%rip),%xmm9
  pxor   %xmm7,%xmm7
  movsd  D12(%rip),%xmm8
  addsd  %xmm0,%xmm1
  movapd %xmm7,%xmm3
  movq   D13(%rip),%xmm10
  divsd  %xmm1,%xmm0
  divsd  %xmm1,%xmm6
  movapd %xmm0,%xmm11
  movapd %xmm0,%xmm5
  addsd  %xmm0,%xmm11
  mulsd  %xmm6,%xmm8
  movapd %xmm6,%xmm4
  xorpd  %xmm9,%xmm4
  jmp    L20
  nopw   0x0(%rax,%rax,1)
L8:
  comisd %xmm5,%xmm2
  jae    L43
  movapd %xmm2,%xmm3
L26:
  add    $0x1,%eax
  andpd  %xmm10,%xmm1
  comisd D25(%rip),%xmm1
  jbe    L11
  cmp    $0x64,%eax
  je     L11
L20:
  movapd %xmm3,%xmm2
  movapd %xmm6,%xmm12
  movapd %xmm6,%xmm1
  addsd  %xmm3,%xmm12
  subsd  %xmm0,%xmm2
  movapd %xmm0,%xmm15
  movapd %xmm2,%xmm14
  movapd %xmm12,%xmm13
  mulsd  %xmm2,%xmm14
  mulsd  %xmm12,%xmm13
  divsd  %xmm14,%xmm1
  mulsd  %xmm14,%xmm2
  movapd %xmm8,%xmm14
  divsd  %xmm13,%xmm15
  mulsd  %xmm12,%xmm13
  movapd %xmm7,%xmm12
  divsd  %xmm2,%xmm14
  movapd %xmm11,%xmm2
  subsd  %xmm15,%xmm1
  addsd  %xmm3,%xmm1
  cmpnltsd %xmm1,%xmm12
  andpd  %xmm12,%xmm5
  andnpd %xmm3,%xmm12
  orpd   %xmm12,%xmm5
  movapd %xmm1,%xmm12
  xorpd  %xmm9,%xmm1
  cmpnltsd %xmm7,%xmm12
  divsd  %xmm13,%xmm2
  andpd  %xmm12,%xmm4
  andnpd %xmm3,%xmm12
  orpd   %xmm12,%xmm4
  addsd  %xmm14,%xmm2
  addsd  D44(%rip),%xmm2
  divsd  %xmm2,%xmm1
  movapd %xmm1,%xmm2
  addsd  %xmm3,%xmm2
  comisd %xmm2,%xmm4
  jb     L8
L43:
  movapd %xmm4,%xmm2
  addsd  %xmm5,%xmm2
  mulsd  D14(%rip),%xmm2
  movapd %xmm2,%xmm1
  subsd  %xmm3,%xmm1
  movapd %xmm2,%xmm3
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L11:
  movapd %xmm3,%xmm1
  movapd %xmm6,%xmm0
  lea    D35(%rip),%rdi
  movsd  %xmm3,0x8(%rsp)
  addsd  %xmm6,%xmm1
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm3
  add    $0x18,%rsp
  movapd %xmm3,%xmm0
  ret
```

tool_calls: name: parse_data
arguments: data_label: D44
datatype: f64
name: parse_data
arguments: data_label: D29
datatype: f32[2]
name: parse_data
arguments: data_label: D12
datatype: f32[2]
name: parse_data
arguments: data_label: D13
datatype: qword
name: parse_data
arguments: data_label: D25
datatype: byte[16]
name: parse_data
arguments: data_label: D14
datatype: f64
name: parse_data
arguments: data_label: D35
datatype: string

tool: D44: 1

tool: {"D29": [0.0,-0.0]}

tool: {"D12": [0.0,-2.0]}

tool: D13: 9223372036854775807

tool: {"D25": [0x11,0xea,0x2d,0x81,0x99,0x97,0x71,0x3d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

tool: D14: 0.5

tool: D35: From M2: CM=%.6lf L1=%.6lf


assistant: ```c
double calc_L1(double Q) {
  double x = 0.0;
  double M1 = 1.0 / (1 + Q);
  double M2 = Q / (1 + Q);
  double a1 = Q / (1 + Q);
  double a2 = 1.0 / (1 + Q);
  double xa = -a2;
  double xb = a1;
  double dx = 10.0;
  double f, df;
  int i = 0;
  while (fabs(dx) > 1.0e-12 && i < 100) {
    double d1 = x - a1;
    double d2 = x + a2;
    f = M1 / (d1 * d1) - M2 / (d2 * d2) + x;
    df = -2 * M1 / (d1 * d1 * d1) + 2 * M2 / (d2 * d2 * d2) + 1;
    if (f > 0.0)
      xb = x;
    if (f < 0.0)
      xa = x;
    dx = -f / df;
    if (x + dx <= xa || x + dx >= xb) {
      dx = 0.5 * (xa + xb) - x;
      x = 0.5 * (xa + xb);
    } else
      x += dx;
    i += 1;
  }
  printf("From M2: CM=%.6lf L1=%.6lf\n", a2, a2 + x);
  return x;
}
```