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

```asm
<CriticalValueChooser>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  movsd  %xmm0,-0x48(%rbp)
  movsd  %xmm1,-0x50(%rbp)
  movsd  %xmm2,-0x58(%rbp)
  movsd  %xmm3,-0x60(%rbp)
  movsd  %xmm4,-0x68(%rbp)
  movsd  %xmm5,-0x70(%rbp)
  movsd  %xmm6,-0x78(%rbp)
  movsd  %xmm7,-0x80(%rbp)
  movsd  D41(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x48(%rbp),%xmm0
  ucomisd -0x48(%rbp),%xmm0
  jp     L37
  movsd  -0x48(%rbp),%xmm0
  comisd D18(%rip),%xmm0
  jb     L37
  movsd  D32(%rip),%xmm0
  comisd -0x48(%rbp),%xmm0
  jb     L37
  mov    $0x1,%eax
  jmp    L26
L37:
  mov    $0x0,%eax
L26:
  mov    %eax,%edi
  call   <assert@plt>
  movsd  -0x60(%rbp),%xmm0
  ucomisd -0x60(%rbp),%xmm0
  jp     L99
  movsd  -0x60(%rbp),%xmm0
  comisd D47(%rip),%xmm0
  jb     L99
  movsd  D35(%rip),%xmm0
  comisd -0x60(%rbp),%xmm0
  jb     L99
  mov    $0x1,%eax
  jmp    L55
L99:
  mov    $0x0,%eax
L55:
  mov    %eax,%edi
  call   <assert@plt>
  movsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  -0x68(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm3
  movsd  -0x78(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <gbs_call@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  movsd  -0x70(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm3
  movsd  -0x78(%rbp),%xmm2
  movsd  -0x58(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <gbs_put@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movsd  -0x68(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm3
  movsd  -0x78(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <delta_call@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  movsd  -0x70(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm3
  movsd  -0x78(%rbp),%xmm2
  movsd  -0x58(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <delta_put@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x20(%rbp),%xmm0
  subsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x10(%rbp),%xmm0
  subsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  jmp    L21
L80:
  movsd  -0x38(%rbp),%xmm0
  movapd %xmm0,%xmm1
  divsd  -0x30(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  -0x68(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm3
  movsd  -0x78(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <gbs_call@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  movsd  -0x70(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm3
  movsd  -0x78(%rbp),%xmm2
  movsd  -0x58(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <gbs_put@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movsd  -0x68(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm3
  movsd  -0x78(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <delta_call@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  movsd  -0x70(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x60(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm3
  movsd  -0x78(%rbp),%xmm2
  movsd  -0x58(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <delta_put@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x20(%rbp),%xmm0
  subsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x10(%rbp),%xmm0
  subsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
L21:
  movsd  -0x38(%rbp),%xmm0
  movq   D30(%rip),%xmm1
  andpd  %xmm1,%xmm0
  comisd -0x28(%rbp),%xmm0
  ja     L80
  movsd  -0x40(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D41
datatype: f64
name: read_data
arguments: data_label: D18
datatype: f64[2]
name: read_data
arguments: data_label: D32
datatype: f64
name: read_data
arguments: data_label: D47
datatype: byte[16]
name: read_data
arguments: data_label: D35
datatype: f64
name: read_data
arguments: data_label: D30
datatype: qword

tool: D41: 0.001

tool: {"D18": [1e-6,1000000000000.0]}

tool: D32: 1000000000000

tool: {"D47": [0xce,0xd2,0x29,0x9c,0x17,0x96,0x25,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x40]}

tool: D35: 20

tool: D30: 9223372036854775807

assistant: ```c
double CriticalValueChooser(double S, double Xc, double Xp, double T, double Tc, double Tp, double r, double b, double v) {
  double Sv, ci, Pi, dc, dp, yi, di;
  const double epsilon = 0.001;
  assert(((S) == (S)) && (S) >= 0.000001 && (S) <= 1000000000000.0);
  assert(((T) == (T)) && (T) >= (1.0 / (253.0 * 24.0)) && (T) <= (20.0));
  Sv = S;
  ci = gbs_call(Sv, Xc, Tc - T, r, b, v);
  Pi = gbs_put(Sv, Xp, Tp - T, r, b, v);
  dc = delta_call(Sv, Xc, Tc - T, r, b, v);
  dp = delta_put(Sv, Xp, Tp - T, r, b, v);
  yi = ci - Pi;
  di = dc - dp;
  while (fabs(yi) > epsilon) {
    Sv = Sv - (yi) / di;
    ci = gbs_call(Sv, Xc, Tc - T, r, b, v);
    Pi = gbs_put(Sv, Xp, Tp - T, r, b, v);
    dc = delta_call(Sv, Xc, Tc - T, r, b, v);
    dp = delta_put(Sv, Xp, Tp - T, r, b, v);
    yi = ci - Pi;
    di = dc - dp;
  }
  return Sv;
}
```