user: Please show me the C implementation that matches the assembly code listed below:

```asm
<CriticalPart3>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x34(%rbp)
  movsd  %xmm0,-0x40(%rbp)
  movsd  %xmm1,-0x48(%rbp)
  movsd  %xmm2,-0x50(%rbp)
  movsd  %xmm3,-0x58(%rbp)
  movsd  -0x50(%rbp),%xmm0
  subsd  -0x48(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movsd  -0x58(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x58(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x40(%rbp),%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  cmpl   $0x1,-0x34(%rbp)
  jne    L35
  movsd  -0x20(%rbp),%xmm0
  movsd  D35(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x50(%rbp),%xmm0
  subsd  -0x48(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  -0x18(%rbp),%xmm0
  divsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x20(%rbp),%xmm0
  movsd  D35(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x50(%rbp),%xmm0
  subsd  -0x48(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x18(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  divsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <cnd@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x60(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <cnd@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  -0x60(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  jmp    L37
L35:
  cmpl   $0x2,-0x34(%rbp)
  jne    L33
  movsd  -0x58(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  D35(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x50(%rbp),%xmm0
  subsd  -0x48(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  subsd  -0x18(%rbp),%xmm0
  divsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movq   D40(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  movsd  -0x58(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  D35(%rip),%xmm3
  movapd %xmm0,%xmm2
  divsd  %xmm3,%xmm2
  movsd  -0x50(%rbp),%xmm0
  subsd  -0x48(%rbp),%xmm0
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  divsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <cnd@plt>
  pxor   %xmm4,%xmm4
  cvtsi2sd %eax,%xmm4
  movsd  %xmm4,-0x60(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <cnd@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x40(%rbp),%xmm1
  movsd  -0x60(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  jmp    L37
L33:
  call   <abort@plt>
L37:
  movsd  -0x30(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D35
datatype: f64
name: parse_data
arguments: data_label: D40
datatype: byte[8]

tool: D35: 2

tool: {"D40": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
double CriticalPart3(int id, double I, double t1, double T2, double v) {
  double result;
  double z1, z2;
  const double vT2_t1 = v * sqrt(T2 - t1);
  const double p2v = ((v) * (v));
  const double logI = log(I);
  if (id == 1) {
    z1 = (logI + p2v / 2.0 * (T2 - t1)) / vT2_t1;
    z2 = (logI - p2v / 2.0 * (T2 - t1)) / vT2_t1;
    result = I * cnd(z1) - cnd(z2);
  } else if (id == 2) {
    z1 = (-logI + ((v) * (v)) / 2.0 * (T2 - t1)) / vT2_t1;
    z2 = (-logI - ((v) * (v)) / 2.0 * (T2 - t1)) / vT2_t1;
    result = cnd(z1) - I * cnd(z2);
  } else
    abort();
  return result;
}
```